ECUs and Tuning Discuss Engine Management, Tuning, & Programming

Arduino as ECU?

Thread Tools
 
Search this Thread
 
Old 06-24-2011, 08:35 AM
  #221  
Junior Member
 
bloodline's Avatar
 
Join Date: Sep 2010
Location: London, England
Posts: 91
Total Cats: 0
Default

Originally Posted by FieldEffectDave
It's only a 2 layer board which makes it very easy to follow tracks, but there are alot of components on the board which I cannot find datasheets for.

I started with the injector drivers, I can trace them back to the "MP493". I think this is an ASIC (a chip NipponDenso designed for themselves), so it might be very difficult to get a datasheet to understand what it is doing.

I could only guess that maybe there is some current sensing / diagnostic circuits which is why there is so much hardware between the uC port pin and the injector driver.

Maybe with a full bench setup running the ECU you could probe with an oscilloscope and intuitively try and figure out what this chip does and what the pinout is.

Definitely not as straightforward to reverse engineer as I was hoping.

Looks very similar to my unit, a few different transistors but all the major components the same.

Those Denso part numbers threw me off too, firstly trying to indetify the CPU... I'm guessing the Denso ICs are probably standard components but from special batches that meet the Automotive spec... As r26det has alluded to above, the ECU doesn't "bit bang" the signals... So these are probably just simple, counters, shifters and buffers etc... If you can detail a schematic, I reckon their function could be determined by logical deduction (if you excuse the pun)
bloodline is offline  
Old 06-25-2011, 10:15 AM
  #222  
Newb
iTrader: (1)
 
kakarot's Avatar
 
Join Date: Sep 2010
Posts: 27
Total Cats: 0
Default

make sure to figure out the alternator circuit, or car will never have any charging capability.
kakarot is offline  
Old 06-25-2011, 12:30 PM
  #223  
Elite Member
iTrader: (1)
 
richyvrlimited's Avatar
 
Join Date: Jun 2006
Location: Warrington/Birmingham
Posts: 2,642
Total Cats: 42
Default

Originally Posted by kakarot
make sure to figure out the alternator circuit, or car will never have any charging capability.
Only relevant on a MK2. MK1 alternators internally regulate.
richyvrlimited is offline  
Old 07-05-2011, 08:53 AM
  #224  
Newb
 
blade8r's Avatar
 
Join Date: Apr 2010
Posts: 10
Total Cats: 0
Default

just a question of simplicity and curiosity.

i was wondering if the audrino unit is outright limited with all of it's process function. maybe it would be a better idea to make it do a little bit less as well. the biggest and obvious reason why audrino is considered is simply it's price and adjust-ability.

everybody and their mother pray to the heavens for a way to upgrade their injectors and get rid of the afm with some kind of fuel control.

wouldn't it be easier to hook up a Map, IAT and an RPM Source to create and emulate the AFM signal source outright. in essence copying what the E-manage Ultimate can do.

the AFM Voltage reference has also been documented as well right?

couldn't we just create a voltage table graph based of the AFM to modulate our injectors? i mean just a suggestion as to keep the cost down and keep the coding simple.
blade8r is offline  
Old 07-05-2011, 03:20 PM
  #225  
Newb
 
FieldEffectDave's Avatar
 
Join Date: Aug 2009
Posts: 35
Total Cats: 0
Default

Just my perspective here:

But I think the point of the Arduino ECU is that it is a project in itself, not really intended to compete with the really well established existing solutions on a 1 to 1. More about the journey than the end.

It's like the "hello world" of engine ECU's the code will be an interesting and hopefully easy read for people who want to learn more about how an ECU works.

couldn't we just create a voltage table graph based of the AFM to modulate our injectors? i mean just a suggestion as to keep the cost down and keep the coding simple.
Maybe something that deserves its own thread, but I was shown an article in a magazine where the a MAP sensor and a simple inverting op amp circuit was used to substitute the AFM for a carburettor converted MX5. (so the standard ignition system would still work)

I didn't believe it could be that simple so I wired the OEM AFM to a spare ADC on the megasquirt, did some drives and used the collected data to make a curve. This is what it looks like: (I think with some averaging / smoothing applied. I need to search for the origional files.)





It is almost a simple curve to match, except for the hump.

I made it so long ago I can't remember the conditions which caused the hump at below idle MAP and zero air flow.

I think the issue was around 30kpa you could not tell the overrun condition from idle or similar. Maybe this could be fixed with an RPM input as well.

If there was interest and with some more research could be definitely worthy of a (seperate) project. A box which connects to the AFM plug, with a map and air temp sensor going in for a plug and play AFM deletion.

Last edited by FieldEffectDave; 07-05-2011 at 03:33 PM.
FieldEffectDave is offline  
Old 07-05-2011, 06:24 PM
  #226  
Newb
 
blade8r's Avatar
 
Join Date: Apr 2010
Posts: 10
Total Cats: 0
Default

i found a link where someone had previously attempted a conversion for Afm to map through this link

http://www.my-acoustic.com/Car/ECU/a...afm_to_map.htm

he got for the most part the voltage inversion correct however. through his design wasn't able to solve the main problem with part throttle acceleration. he was literally trying to match voltage range with no other support that's it.

His design didn't have any algorithm correction, rpm input or the hardware to support voltage adjust-ability.

if a "PNPAdurino AFM Eliminator" is to be created there is going to have to be some standardization to be put into place in order to proceed before we even bother trying to attempt to write code.

the first pieces that we need to know are what aftermarket parts we would use. i would assume we would use the MEGA Squirt MPX4250 2.5 Bar MAP Sensor $28 and the replacement IAT sensor and bun MSPNP and DIYPNP IAT Sensor Kit $29.

would bring total costs to $113 + whatever a AFM harness adapter would cost to buy. if if you really did need it plug and play.

also data-logging will be required to map the Voltage curves (which apprantly fieldeffectdave already did) a mathematical conversion Algorithm must be created in which audrino has to convert on the fly.

then last but not least after we have a stable unit working on an Naturally aspirated vehicle. a tuning program must be created so that bigger injectors or boosted applications can be supported.

then it's cake.

(btw if PNPAdurino AFM Eliminator is made let everybody know i coined the term)
blade8r is offline  
Old 07-05-2011, 06:32 PM
  #227  
Junior Member
 
JustinHoMi's Avatar
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 1
Default

Something will need to be done about acceleration enrichment too. I don't know that the ECU itself does AE... I think it's built into the AFM. Look at the brief spike in the graph right after tip in. This is the flapper overshooting the target, and then settling back down... it's a purposeful part of the design.

FYI, I have the AFM attached directly to my megasquirt instead of a MAP sensor, and no AE is required.
Attached Thumbnails Arduino as ECU?-mapvsafmloads.png  
JustinHoMi is offline  
Old 07-05-2011, 11:29 PM
  #228  
Newb
 
blade8r's Avatar
 
Join Date: Apr 2010
Posts: 10
Total Cats: 0
Default

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.
blade8r is offline  
Old 07-06-2011, 03:29 AM
  #229  
Newb
 
blade8r's Avatar
 
Join Date: Apr 2010
Posts: 10
Total Cats: 0
Default

ugh.. i just spent the last 3 hours trying to figure out how we could get "ideal gas law" to work with adurino

i was also looking into how map-ecu does it with their setup and it requires tps, rpm, iat and map sensor for it to take over. obviously without the mathematics i couldn't know how they came up with their solution to do the afm crossover.

does anybody in collage and has free time to solve and plug in this equation

"PV= nRT"

P = Absolute pressure
V = Volume of gas
N = particles in the gas
R = 8.314 J·K−1·mol−1 (<------ yea baby no idea what this means.)
T = Absolute Temperature Measured in Kelvin Scale

anyways the way i look at it. if we have a way where we could plug in our motors displacement (1.6 or 1.8) multiplied by the rpm and let it be adjusted by the manifold absolute pressure.

we would get a Volume constant. this could be in turned converted over a voltage reference to which we can apply as our afm signal.

at least i think this is how it works.. my brain hurts anybody good at math. again i know im not taking into account heat, nodes and density but **** i can't math nor do i think anybody here would want to write a code to handle gas law outright upfront.

we just need to find a volume constant and graph the correlation accordingly. hopefully by then we could get a way to include other sensors to get a much better resolution.

plz anybody else help fill in.
blade8r is offline  
Old 07-06-2011, 06:41 AM
  #230  
Junior Member
 
bloodline's Avatar
 
Join Date: Sep 2010
Location: London, England
Posts: 91
Total Cats: 0
Default

Hi blade8r,

Yes, FieldEffectDave is bang on! The idea of the Arduino ECU is an attempt to get a basic, low cost, easy to understand ECU design working. I want the source code to be easily adaptable to other micro controllers... And indeed I have ported it to the mbed micro controller board and with the mbed (100mhz 32bit) we can do more exciting things... Like mathematically modeled fuel and timing control, rather than precalculated look up tables! As you have alluded to in your posts, this also seems to interest you!

Have fun,

Matt
bloodline is offline  
Old 07-06-2011, 06:57 AM
  #231  
Junior Member
 
bloodline's Avatar
 
Join Date: Sep 2010
Location: London, England
Posts: 91
Total Cats: 0
Default

Hey blade8r,

Your "R" term is more commonly written as k, it's the Boltzmann constant. And yes my degree was in chemistry so I do know how to use these laws but going this way is probably not a great idea... My preferred method is to base my mathematical models on real world measurements...

We would run the car up on a dyno, then measure airflow, engine temp, air temp, fuel amount, power output, speed, etc... and adjust the variables and plot the results against each other, wean then use this data to determine the ideal settings for the desired output... Eg performance vs fuel consumption. A "best fit regression analysis" would then be used to determine the equation of the graph! With a nice powerful CPU (ie the mbed), we can use that equation rather than a table... A table is a good trade off, but it's not as much fun
bloodline is offline  
Old 07-06-2011, 11:26 AM
  #232  
Newb
iTrader: (1)
 
kakarot's Avatar
 
Join Date: Sep 2010
Posts: 27
Total Cats: 0
Default

An easier method is to not worry about MAF, and use a MAP, can get those for under 20 dollars. But, worry about individual cylinders and then worry about system in total.
Anyways use density fraction and then apply that to calculating the mass of air that goes into 1 cylinder of the engine, from there you get how much fuel needed and with some other simple math you figure out the pulse duration. From there you assume that each cylinder is the same, and go from there.

Tip in enrichment, you can get from engine acceleration, if you apply another equation, linear, to the standard equation of fuel calculations, you will get that spike. It is multi-variable, and should be looked in 3d instead of 2d. You wont get the spike if engine is spinning high rpm and its accelerating up a bit, but you will get it if engine is at idle and its spinning up rapidly. Also time decaying enrichment can work. Instead of time I apply engine cycles, it makes sense to me, not sure about anyone else.

Arduino is plenty powerful to do what ECU needs, it requires ingenuity and cunning to get the code compatible with arduino. Think how they did it long ago with EFI.
kakarot is offline  
Old 07-06-2011, 02:14 PM
  #233  
Newb
 
blade8r's Avatar
 
Join Date: Apr 2010
Posts: 10
Total Cats: 0
Default

Dear Blood Line

you should of just mentioned that you got the audrino code ported already into mbed or LPCmini. it would of saved me a few hours outright instead of trying to pull my hair out trying to think of a way to come up with a conversion table.

i honestly didn't want to do a afm to maf conversion. however i figured the adurino side of things is dead and i thought you wanted the mbed project to be something that was your own. i just want simplicity in a box for everybody in the miata community or any other community that is plagued by an afm. i think we all want that.

but seeing as i can't code at all. there is little help i can provide other then real world testing. so i can outright buy an lpcmini or mbed i think it's the only bet i can go with the project. but at least you guys will need to come up with a good working code.

i have completely stock car and i have some time and i can solder. lets do this.
blade8r is offline  
Old 07-08-2011, 08:46 AM
  #234  
Junior Member
 
bloodline's Avatar
 
Join Date: Sep 2010
Location: London, England
Posts: 91
Total Cats: 0
Default

Originally Posted by blade8r
Dear Blood Line

you should of just mentioned that you got the audrino code ported already into mbed or LPCmini. it would of saved me a few hours outright instead of trying to pull my hair out trying to think of a way to come up with a conversion table.
You haven't wasted any time, always start with the Arduino, since that is where I want the base to be... Once programmed the ATMega328 (the microcontroller at the heart of the Arduino) can be bought for £2! That is the key to producing a low-cost Miata ECU replacement

While I love the mbed, I always try to start with an Arduino... Then move to the mbed if I need more power.


i honestly didn't want to do a afm to maf conversion. however i figured the adurino side of things is dead and i thought you wanted the mbed project to be something that was your own. i just want simplicity in a box for everybody in the miata community or any other community that is plagued by an afm. i think we all want that.

but seeing as i can't code at all. there is little help i can provide other then real world testing. so i can outright buy an lpcmini or mbed i think it's the only bet i can go with the project. but at least you guys will need to come up with a good working code.

i have completely stock car and i have some time and i can solder. lets do this.
Well, let's see how FieldEffectDave gets on... If he can put together some good schematics I hope to be able to do some real world testing. I won't drop the Arduino as the base platform, but I want to offer more advanced features with the mbed.
bloodline is offline  
Old 08-15-2011, 05:55 PM
  #235  
Newb
 
Chief Geek's Avatar
 
Join Date: Aug 2011
Posts: 1
Total Cats: 0
Default

Everyone

Thanks for your investment in time and skills. I'm building a hill climb race car with 1/4 of the motivation being racing the car and 3/4 being the fun of the build experience, and hope to use an ECU like the one described here. The idea of using an arduino with the appropriate "shield" on top of it is just wonderful.

Does anyone know why do so many race engines use a single, relatively fine toothed crank angle sensor with only one channel (a missing tooth indicating the "home" position)? Racing engines can achieve terrifying rotational accelerations and I fear a Miata with a very light flywheel can too. Thoughts or comments?

Also, any plans for wide-band O2 feedback into the algorithm?
Chief Geek is offline  
Old 10-21-2011, 10:05 PM
  #236  
Elite Member
iTrader: (10)
 
Jeff_Ciesielski's Avatar
 
Join Date: Oct 2008
Location: Rhode Island
Posts: 1,770
Total Cats: 31
Default

Watching the progression of this thread has motivated me to attempt to undertake my own pet project:



I don't expect to accomplish anything huge, but I've always wanted to play with one of these.
Attached Thumbnails Arduino as ECU?-2011-10-21%252018.22.32.jpg  
Jeff_Ciesielski is offline  
Old 10-21-2011, 10:17 PM
  #237  
Junior Member
Thread Starter
iTrader: (3)
 
ctxspy's Avatar
 
Join Date: Jun 2008
Location: NJ
Posts: 428
Total Cats: 0
Default

hey guys i'm glad this has spawned such interest.. I'm still arduino-less, though i'm one step closer, having just ordered a Pololu servo controller for an unrelated hardware project i'm undertaking.

In the meantime i've read a lot more about Arduinos and learned a bit about its capabilities as well as the numerous shields, components, and kits out there..

That, combined with the large install / user base, I'm sure there's a real opportunity to create something big here.

good luck guys
ctxspy is offline  
Old 10-21-2011, 10:26 PM
  #238  
Boost Pope
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,027
Total Cats: 6,593
Default

Originally Posted by Jeff_Ciesielski
I don't expect to accomplish anything huge, but I've always wanted to play with one of these.
A 40 pin DIP whose marking cannot be read due to the blurriness of the photo?
Joe Perez is offline  
Old 10-21-2011, 10:29 PM
  #239  
Elite Member
iTrader: (10)
 
Jeff_Ciesielski's Avatar
 
Join Date: Oct 2008
Location: Rhode Island
Posts: 1,770
Total Cats: 31
Default

Originally Posted by Joe Perez
A 40 pin DIP whose marking cannot be read due to the blurriness of the photo?
Looked good on the phone .

Its a propeller.
Jeff_Ciesielski is offline  
Old 10-22-2011, 04:44 AM
  #240  
Junior Member
 
rb26dett's Avatar
 
Join Date: Feb 2007
Location: 11368 miles from where i would like to be
Posts: 269
Total Cats: 92
Default

There were two existing propeller ECU projects, but one found out about the other and stopped. Such is the hazard of doing something because it's cool/unique to do, I guess. The other is functional and available afaik.
rb26dett is offline  


Quick Reply: Arduino as ECU?



All times are GMT -4. The time now is 12:32 AM.