Miata Turbo Forum - Boost cars, acquire cats.

Miata Turbo Forum - Boost cars, acquire cats. (https://www.miataturbo.net/)
-   ECUs and Tuning (https://www.miataturbo.net/ecus-tuning-54/)
-   -   Arduino as ECU? (https://www.miataturbo.net/ecus-tuning-54/arduino-ecu-50695/)

Joe Perez 10-23-2011 01:36 PM

Propeller is a pretty cool chip. I've actually had a devboard sitting here for about a year, and haven't gotten around to doing anything with it.

JasonC SBB 10-23-2011 10:26 PM

MAP to MAF conversion.

Search for my post with the mathematical curve fit, for a 99 motor. MAF voltage is a fucntion of MAP and RPM.

Jeff_Ciesielski 10-23-2011 10:43 PM


Originally Posted by Joe Perez (Post 786908)
Propeller is a pretty cool chip. I've actually had a devboard sitting here for about a year, and haven't gotten around to doing anything with it.

I was hoping to get started playing with mine this weekend, but in trying to modify my ftdi breakout board to work with both 3 and 5 volt systems, I managed to rip the super tiny 3v smt pad right off the board :vash:. Looks like I'll start next weekend :(

downix 01-06-2012 08:44 PM


Originally Posted by ctxspy (Post 643954)
http://lmgtfy.com/?q=what+does+a+cas+do+on+a+miata

are you just trying to build up your post count??
having read your other posts (all on this thread) I can only imagine you're a non-miata guy and you joined this forum because of this thread. That said, please spend 5 minutes before posting questions to do basic research.

Egads, you just made me feel bad a year later for just joining these forums because of this thread. (building myself a Locost 7 using many Miata parts off of a wrecked non-turbo, a way to save a great car which served me well for many years)

But I do have an Arduino, three of them in fact (a Mega and two Uno) and am a hardware guy. I was reading this thread and got interested.

JustinHoMi 01-06-2012 08:49 PM


Originally Posted by blade8r (Post 745440)
the rpm enrichment is probably a mechanical design. the wind that is passes through the afm will kick back the plate initially further then the air that is passing through was suppose to be at. it's all inertia i would assume. because it levels out real quick

i'm mean we are talking about a small albeit minor flac that the afm

also a question for whoever had made this graph... did you swap into a full range tps? also can you get us a read out of what it looks like to be 3 k rpm 5th gear cruising down the freeway. i think that's the most important thing about our cars.

Sorry... 6 months later and I just noticed the response. No, that is the OEM 1.6 TPS. I modified the code so that it reads like a three-way switch: 0-50-100% (no throttle-partial throttle-full throttle). Do you still need data from cruising down the highway?

blade8r 01-28-2012 07:21 AM

woot sorry for the late response myself. i decided to give up on the arduino as an ecu subject. it seems the capability of the unit itself is limited. i also don't have the knowledge to write the code for it. i guess i was just brain storming to see if it's possible. i actually was more interested in it as afm eliminator.

but however i still have no experience in coding.

91luckymiata 03-20-2013 03:35 PM

Is this thread still alive?
 
I happened to stumble across this forum and post way too late in dev, I have a 91 miata I am trying to use an arduino to control or replace my ecu all together, I have roughly read all of the posts but got lost alittle here and there... so did bloodline loose all interest in using the arduino altogether

bloodline 03-20-2013 03:53 PM


Originally Posted by 91luckymiata (Post 991971)
I happened to stumble across this forum and post way too late in dev, I have a 91 miata I am trying to use an arduino to control or replace my ecu all together, I have roughly read all of the posts but got lost alittle here and there... so did bloodline loose all interest in using the arduino altogether

Like most unpaid complex projects, real life got in the way. My final code used the ATMega328's counter/timers to generate the spark timing, so left a lot of CPU time free for more complex stuff like interpolation between points in the timing and fuelling tables... I will have to dig the code out when I get some more free time and think more seriously about building some hardware for it :)

Leafy 03-20-2013 04:08 PM

Reading a good bit of this thread before I realized it was ancient got me thinking. Trying to use an arduino as a full ecu seems like a bit of a stretch and we're already got good affordable solutions for that already. If there was an arduino variant with 4 high current pwm drivers and 4 vr/hall inputs it would be interesting to try to make a motorsports abs/traction control system with it. Race logic traction control's price isnt too outrageous, but a motorsports abs system is around $10k.

AbeFM 03-20-2013 04:12 PM

As Jason said, check out DIYEFI - there's something with a lot of groundwork laid, a few running cars, and all very, very open source.

bloodline 03-20-2013 08:03 PM


Originally Posted by downix (Post 816196)
Egads, you just made me feel bad a year later for just joining these forums because of this thread. (building myself a Locost 7 using many Miata parts off of a wrecked non-turbo, a way to save a great car which served me well for many years)

But I do have an Arduino, three of them in fact (a Mega and two Uno) and am a hardware guy. I was reading this thread and got interested.

Hey Nate, it's been a long time since I've seen you, not since the Amiga.org days :)

Beghemas 05-14-2013 05:09 AM

Welcome
I'm new here, I read the whole topic and do not understand the arduino inputs and outputs: (maybe someone could write about?

bloodline 01-14-2014 10:10 AM

Latest 8bit Arduino code here:

https://sourceforge.net/projects/mia...ataBrain_v3.1/

Will post up 32bit ARM code at some point.

whizbang18T 02-25-2014 08:20 AM

Arduino Blog » Blog Archive » An electronic diesel engine controlled with Arduino Mega

mrhrholden 06-14-2014 07:48 AM

Hi Guys would just like to know how many crank angle sensor pulses to cam sensor like 4 crank pulses to 1 cam pulse? i am having trouble getting my prototype board running right leds arnt flashing right and d13 is flashing thanks my version of code is the lastest 3.1 thanks

JasonC SBB 06-14-2014 11:05 AM

NA and NB motors have different cam pulse patterns.
NA are like the old Mitsu motors that have 4 crank pulses per crank revolution.
Search this forum for my posts on the VVT setup. The NB non-VVT and VVT have the same cam pattern, just that the latter moves around.

mrhrholden 06-14-2014 08:47 PM

arduino crank and cam simulator
 
thanks mate just programing another arduino as the crank angle sensor to trigger the arduino efi
thanks will have a look


QUOTE=JasonC

SBB;1139942]NA and NB motors have different cam pulse patterns.
NA are like the old Mitsu motors that have 4 crank pulses per crank revolution.
Search this forum for my posts on the VVT setup. The NB non-VVT and VVT have the same cam pattern, just that the latter moves around.[/QUOTE]

mrhrholden 06-15-2014 07:31 AM

arduino crank simulator
 
Hi i have been playing around with a arduino simulating a crank and cam signals to drive this ecu and just cant seem to get the code right does anybody have a arduino code that cold help me out thanks

klax187bz 09-10-2014 02:50 PM

Hi, does anybody know what formula you can use for calculating the time injection using Arduino as an ECU?
Many thanks in advance.

TurboTim 09-10-2014 03:15 PM

y=mx+b

Leafy 09-10-2014 03:18 PM

Um, the standard speed density fuel calculation formula with dead time compensation added in?

klax187bz 09-10-2014 03:27 PM

I need the formula for calculating the time when the injector is on. Also the time injection when the injector is off.
On this topic at the 5th page, https://www.miataturbo.net/ecus-tuni...u-50695/page5/, Bloodline specified about an InjTime that calculates Injector Open Time.
Do you have any idea regarding the mathematical formula?

klax187bz 09-10-2014 03:30 PM

To be more specific, a formula using the Lambda sensor, the depression sensor, an acceleration would be perfect

Leafy 09-10-2014 04:11 PM

2 Attachment(s)
Fuck.

Kurak 10-22-2014 07:48 PM

Aye comrades, I are Kurak and I appear to have some arduino code that should run an engine.

Well, it did run lawnmower engine! Flooded it like hell, since it was a 250cc injector and 25cc engine, but worked almost well.
The code also sparks, multisparks. I havent tested that in a real world outside my lab walls, but there it was sparking be-a-utifylly.

Code works on an Arduino UNO (yeah, cheap atmegas ftw) and injects just the right amount of fuel to get into a specific AFR (with closed loop control, ofc, if you have a wideband) with around 16us resolution.
Its up to you how you'd define target afr (i think rpm/toa is most reasonable).

What Im not seeing in this thread is hardware design. Anyone working on that?
What about the PC side software, how'd you want to define the maps?

Kurak 10-22-2014 07:49 PM

Oh, and having an "Arduino" as an ECU is an absolutely terrible idea. We definitely should do that.

Leafy 10-23-2014 07:15 AM

Somewhere, I cant find it anymore, there is a presentation given at a linux convention where someone has a more advanced arduino ecu. The gist I got from it was really that the I/O capability of the normal arduino is just not there to do this properly, and the processor and mega marginal to run a 4 cylinder for fuel and spark even on the 2560. Something tells me the Due or Galileo would both be significantly better, but still pretty huge compromises.

Reverant 10-23-2014 08:07 AM

Yeap, the ATMEGAx series are just not up for the job.

Joe Perez 10-23-2014 08:32 AM


Originally Posted by Reverant (Post 1177851)
Yeap, the ATMEGAx series are just not up for the job.

You're just not trying hard enough. I'm working on a new product called the HyperSquirt Holy Grail ECU, which uses no microprocessor at all. I can't share any details yet (top secret) but it's going to be awesome.

Kurak 10-23-2014 08:45 AM

Well, the Atema 328 series is powerful enough. Calculation of injection time (without any optimisation) takes 580us, on Arduino libs, in proper C that would be faster. Thats fast enough.
You need 6 digital output pins for injectors and wasted spark. You've got that. 2 interrupts. Got that. Some analogs - use an eternal SPI ADC and sample it from time to time, not on every engine revolution. There is a large number of pins left.

Fan control? EGR valve? Other "slow" outputs? Shift register. Cheap and easy.

Write code as you should and this little microcontroller will do the job just fine.

About the hypersquirt... you can do that w/out an uC... but hell, why?

Arduino DUE and clones are based on ARM processors. These aren't that suitable for automotive thingies - you're better off using AVRs - they'll tolerate more and are in general more reliable.

Also, running on 5V will be cooler since it has more oomph to power the transistors (lower costs transistors).

Kurak 10-23-2014 09:04 AM

Heres a fun thing: list of terminals in OEM ECU.
  1. +12V bat
  2. Main relay (input, ign switch)
  3. Ignition switch (start)
  4. Self diagnosis
  5. CEL
  6. Self diagnosis 2
  7. Igniter
  8. Igniter
  9. A/C relay
  10. Diagnosis conn
  11. Throttle sensor (WOT, closed)
  12. Stoplight switch
  13. P/S pressure switch
  14. A/C switch
  15. Fan switch
  16. Blower control switch
  17. Headlight switch
  18. Clutch switch
  19. CAS (Ne)
  20. CAS (G)
  21. Igniter
  22. AFM
  23. o2 sensor
  24. AFM temperature
  25. Water temp
  26. Injector 1,3
  27. Injector 2,4
  28. ISC valve
  29. Solenoid valve


Out of those you need... well, fast:
  1. Injectors (1,2,3,4)
  2. Ignition 1,2 (wasted spark)
  3. o2 sensor
  4. AFM (well, MAP)
  5. Throttle sensor (TOA)
  6. CAS & CAS

Slow:
  1. +12
  2. GND
  3. Water temp
  4. AFM temp

(Alternator load info:)
  1. Fan switch
  2. Blower switch
  3. Headlight switch

And lets ditch A/C for now.

Stop, clutch, cranking are redundant, this info comes from RPM/TOA. ISC and purge valves? No idea what those are, lets ditch.
So this gives us 8 pins on the uC, including 2 interrupts, and 3 direct analogs. The rest is an 8bit DAC controller (8 load inputs) with, lets have some 8 bit (328p is 8 bit) DAC for a number of analog inputs (lets add EGT, for instance). Lets have as many as we want: spi connection takes only 3 pins.

Now the 328p does cope with that quite nicely, doesn't it? With room for extensions.
It might not be fast enough to do dataloggig, but these atmegas are dirt cheap so why don't throw in another one, that would do that?

Leafy 10-23-2014 09:14 AM

You're missing the IAC, that needs to run at ~32Hz with the driving frequency variable to tune out the noise of it.

Also for slow you're missing fuel pump.

Kurak 10-23-2014 09:17 AM

I am fairly convinced that the F/P might be ommited and is ommited in the oem NA ECU, but could be nice to have it to build fuel pressure before cranking, to get nicer start, as normally the pump starts when cranking and the first revs go quite dry (unlike in cyvilised cars, where the FP is turned on for some time after you put the key into drive).

What do we need IAC for?

Leafy 10-23-2014 09:22 AM

Stock ecu does control the fuel pump. I guess you could rewire it to just always run in the on position, but if you dies when a fire starts after you crash because the fuel pump kept cranking away after the engine shutoff, dont cry to me.

You need an iac so you dont have to constantly re-do idle adjustment as the weather changes.

Kurak 10-23-2014 09:29 AM

Nope - if the engine dies, the AFM flap goes down and activates circuit breaking relay (yellow thingy on drivers side, near steering column) which cuts the fuel pump.

Leafy 10-23-2014 09:30 AM

on the 1.6 maybe. The more civilized miatas dont do that and only a moran would keep the afm when going stand alone.

Kurak 10-23-2014 09:31 AM

Especially with ITBs which is my scenario. 1:0 for you, Leafy.

flyingchameleon 01-20-2015 02:44 AM

Hi, im Jon

saw the post because the ecu on my 90 mx-5 died recently and read through the thread

first I must say thank you to everyone who contributed

my question is has anyone put this work onto a miata yet? if not I volunteer mine. wonderful little tidbit about where I live is there are no restrictions about whats on the road. (blessing and a curse)

I have an arduino uno that has the same specs as bloodline was aiming for as well as a sheild and extra micro controller if we need more umph, along with limited electronics knowledge but plenty of soldering and nuts and bolts experience. I can code, but im probably more dangerous than helpful with my background in aerospace using fortran and matlab. Its been a few years since C++ but reading over the code was exciting and refreshing.

Ideally I want to turbo it down the line, but right now I wanted to just get it running so i could get back to working on it.

finished my degree and although i should be looking for a job, I feel a project like this would help land me one.

so, how can I help?

Schuyler 01-20-2015 04:24 AM


Originally Posted by flyingchameleon (Post 1198286)
Hi, im Jon

saw the post because the ecu on my 90 mx-5 died recently and read through the thread

first I must say thank you to everyone who contributed

my question is has anyone put this work onto a miata yet? if not I volunteer mine. wonderful little tidbit about where I live is there are no restrictions about whats on the road. (blessing and a curse)

I have an arduino uno that has the same specs as bloodline was aiming for as well as a sheild and extra micro controller if we need more umph, along with limited electronics knowledge but plenty of soldering and nuts and bolts experience. I can code, but im probably more dangerous than helpful with my background in aerospace using fortran and matlab. Its been a few years since C++ but reading over the code was exciting and refreshing.

Ideally I want to turbo it down the line, but right now I wanted to just get it running so i could get back to working on it.

finished my degree and although i should be looking for a job, I feel a project like this would help land me one.

so, how can I help?

You just got a degree in aerospace which gave you experience with Fortran? Did whatever school you were studying at also have a cryogenics lab you frequented?

*A bunch of mean text about how awful of an idea this is used to reside here. I decided better of it once I wrote the concluding sentence. *

This is not the kind of project that would land you a job. The ATMega chip is not powerful enough to handle this beyond a proof-of-concept standpoint, and the end product would likely do more to deter admiration towards your professional career than it would to dazzle prospective employers.

flyingchameleon 01-20-2015 06:23 AM

I was attempting to contribute to the thread and not be a flamer and show the world what little value that is. yea, you are right, it might not land me a job from one project. I have other things under my belt. Yes i do believe it would help, it wont be the final say, but it may be the difference by saying i can do more than the average book worm.

but im guessing you are 30+ years older than me in a dead end career and not very aware or even care of the current economic situations or job markets and probably dont care. The one generation that could have helped but was too busy smoking weed. also i could give 2 nickels in your shitter to what my peers think because most aerospace graduates have their heads so far up their but its a wonder planes dont crash more often and why people hate on the few who actually tried really hard in school.

there are employers out there who want people with skills, and if you can show them something they dont see everyday they will hire you

seriously if you are a "senior member" and all you like to do is greet people with a piss poor attitude just because its the internet and your "anonymous" than get a better day job, like yelling at hobos or Mexicans or something. who knows you might be both

and... probably permaban... but either way, it just reminds me how much i hate politics and forums. just a bunch of epenor measuring.

also thanks for being a grammar nazi. shows you care less for what is trying to be said than what you can measure yourself against... keep measuring, it only gets smaller

Schuyler 01-20-2015 10:51 AM


Originally Posted by flyingchameleon (Post 1198294)
I was attempting to contribute to the thread and not be a flamer and show the world what little value that is. yea, you are right, it might not land me a job from one project. I have other things under my belt. Yes i do believe it would help, it wont be the final say, but it may be the difference by saying i can do more than the average book worm.

but im guessing you are 30+ years older than me in a dead end career and not very aware or even care of the current economic situations or job markets and probably dont care. The one generation that could have helped but was too busy smoking weed. also i could give 2 nickels in your shitter to what my peers think because most aerospace graduates have their heads so far up their but its a wonder planes dont crash more often and why people hate on the few who actually tried really hard in school.

there are employers out there who want people with skills, and if you can show them something they dont see everyday they will hire you

seriously if you are a "senior member" and all you like to do is greet people with a piss poor attitude just because its the internet and your "anonymous" than get a better day job, like yelling at hobos or Mexicans or something. who knows you might be both

and... probably permaban... but either way, it just reminds me how much i hate politics and forums. just a bunch of epenor measuring.

also thanks for being a grammar nazi. shows you care less for what is trying to be said than what you can measure yourself against... keep measuring, it only gets smaller

lol.

My profile will answer most of your questions with regards to my anonymity and social status. I apologize my engineering school taught English. I said my piece on the matter, best of luck on your future endeavors.

bloodline 01-20-2015 07:16 PM

It's been a long time
 
Hi flyingchameleon,

The last code I posted is as far as I got with the Arduino. Using the on board timers and the timing/fuelling tables from the original ROM etc I was able to simulate engine Miata engine control at least as effectively as the original hardware. I then moved my code to the Teensy 3.1, which being ARM M4 based, gave far more had room for engine management. Unfortunately real life got in the way and I never managed to produce any actual hardware to interface with a real engine (which would have introduced some interesting problems). I'm currently restoring an Avro Vulcan, which you can imagine is more fun than a Miata.

ausmerican 01-21-2015 05:43 AM

Hey all,

I came across this today, looks like it's coming along: Speeduino Wiki

noisymime 06-14-2015 09:14 PM

Hey all... In case anyone was still interested in an Arduino based ECU, I'm the author of the above linked Speeduino project and am currently in the process of fitting it to a '91 NA6.

Given the testing that has occurred to date on other engines, the NA6 should be a nice simple candidate to get up and running. The usual things apply for this setup (Namely the requirement for a variable TPS and IAT sensor when the AFM is deleted), but on the whole it's a lovely straightforward engine to work with.

Happy to answer any questions or anything if people are interested in the project, otherwise I'll report back with updates.

cyotani 06-15-2015 03:02 PM

<p>Nice work on this project! It's very impressive integration with tuner studio and has some nice potential. I love the documentation work as well. Keep it up. I'll be following your progress.&nbsp;</p>

noisymime 08-23-2015 08:29 AM

Quick update on my project in case anyone is interested. I've got my na6 up and running on this now, though the tune needs some work and I need to sort out things like the fans etc, but it's all running.

Obligatory quick and dirty video at

A number of other people have working setups with this now too, so its starting to become viable. I'll post back once the pnp boards for the na6 are all done.

sparkybean 08-25-2015 10:30 AM

I had a stab at this last year.


The engine is a subaru/robin ex13, about 125ccc making about 4hp. I tore the carb, intake and ignition coil off and replaced the coil with an inductive sensor.

3D printed an intake manifold and used a huge ball valve as a throttle. DONT DO THIS. 3d prints are porus and dont hold vacuum, and are weak as hell.

Used a Lm1815 for input conditioning (should have used a max998)
Cheap 3 pin map sensor for load sensing.
Injector was some small motorbike injector, yamaha i think. Drove it with a Mosfet.
Coil was some 2 pin unit that i had laying around, which i drove with a V3040P IGBT.

Wiring it all together was pretty simple, connected the output of the LM1815 into an inturrupt pin on the uno.


Programming the whole thing was a nightmare, but i am the worlds most useless coder at the moment. I would have liked spark to interpolate/extrapolate based on engine speed and fuelling interpolate based off the map sensor, but my coding-fu wasnt up to the task. In the end i just set the fuel and spark at set values and the engine ran like crap. Doesnt rev as you can see in the vid.


Probably an easy project if you can code. Would still be a nightmare to do on a boosted miata though....

noisymime 09-30-2015 02:15 AM

If anyone is interested in what's capable using an arduino, I've just put together a video showing the current features of Speeduino. It's obviously not competing with the big name established commercial units, but it's starting to cover off most of the bases:

Girz0r 09-30-2015 10:12 AM


Originally Posted by noisymime (Post 1270771)

FTFY. :likecat:

noisymime 09-30-2015 04:19 PM


Originally Posted by Girz0r (Post 1270825)
FTFY. :likecat:

Well, don't I feel stupid. :doh:
Thanks!

noisymime 12-13-2015 07:32 AM

Nothing too exciting to report, lots of progress on the project but nothing too specific to the MX5 / Miata world. The only thing around that is that the first style of interface board has arrived for the 48-pin NA6 connector. Testing has revealed there are some improvements to be made, but it is working no worries and plugged straight into the stock loom. It has screw connector inputs for TPS and CLT (Was meant to be IAT, I cocked this up).

In case anyone is interested, there's a shot of it at the end of this video:

x_25 12-15-2015 12:43 PM

Watching with interest. You wouldn't happen to be in the eastern PA area? One of my friends mentioned a year or two ago, that he was helping someone get a miata running on an Arduino.

noisymime 12-15-2015 03:01 PM


Originally Posted by x_25 (Post 1292155)
Watching with interest. You wouldn't happen to be in the eastern PA area? One of my friends mentioned a year or two ago, that he was helping someone get a miata running on an Arduino.

Nope, over in Australia haha

noisymime 12-26-2015 07:14 AM

Out and about testing in the sun this evening. Wanted to see whether the gauges through Race Render would work from the log that is being produced.



The tune itself is still pretty terrible. Timing is very conservative and the fuel is a bit rubbish, but it's good for a drive and nicer than the stock ECU now.

noisymime 02-13-2016 10:05 PM

1 Attachment(s)
OK, so it's not the most professional looking thing, but all boxed up I don't think this comes out too badly:

https://www.miataturbo.net/attachmen...ine=1455419152

There's 2 MX5/Miatas running with this now and another 2-3 in the works (Including a turbo). Looking into various options for a more automated manufacture friendly board at the moment which will hopefully help bring the pricing down. With the ECU connector and things included I'm hoping the price will land somewhere around $150-200 USD

noisymime 03-31-2016 10:55 AM

1 Attachment(s)
Have finished up all the testing and now boxed the unit up for permanent mounting:
https://www.miataturbo.net/attachmen...ine=1459436128

Have been running this regularly without issue for about 6 weeks now. Used a 14point7 wideband to 'autotune' it in, which worked no worries.

Next board to be tested soon will be a surface mount design aimed at being easier/cheaper to produce in volume. Purely for my own simplicity, I'll probably do an initial run of these with a 48-pin connector on it, which will make it near plug and play (Normal TPS and fuel pump relay mods still needed). Will make these available if there's any interest.

cyotani 03-31-2016 11:02 AM

Nice Work! I didn't read through everything but this is an open source project?

noisymime 03-31-2016 11:10 AM


Originally Posted by cyotani (Post 1319847)
Nice Work! I didn't read through everything but this is an open source project?

Definitely! Code and hardware are both open source.

AbeFM 03-31-2016 12:51 PM

Super awesome. Seem a lot of folks start ECU projects, the hard part is getting them into people's hands. Pretty excited to see it working out!

noisymime 03-31-2016 04:53 PM


Originally Posted by AbeFM (Post 1319865)
Super awesome. Seem a lot of folks start ECU projects, the hard part is getting them into people's hands.

Yeah, this is certainly a challenge. Kits and DIY projects are great and there is definitely interest enough to move them (I think there's about 10 cars and multiple bikes/karts running this now), they are a lot of effort to prepare. What I am seeing is that people really want something that is more complete and can be sold as a largely ready to go solution. This is what I'm currently working on at the moment, but it all takes time.


All times are GMT -4. The time now is 01:09 AM.


© 2024 MH Sub I, LLC dba Internet Brands