my simple ECU

Free Open Source Firmware project discussion forum. Post your Free Open Source firmware projects here!
User avatar
russian
LQFP112 - Up with the play
Posts: 154
Joined: Fri Feb 01, 2013 4:18 pm
Location: Jersey City, USA

my simple ECU

Post by russian »

I've been playing with this for some time and finally I have at least something I am not embarrassed to share.

So, my idea is that modern MCUs are fast enough so that a relatively high-level programming would be possible. stm32f4discovery gives me 168MHz for about $15, http://www.chibios.org was the first RTOS I've stumbled upon - this hides most of the lower-level hardware control and even gives me threads.

To begin, at first I was trying to control only fuel or only ignition (with stock ECU controlling the other piece of the puzzle), but soon enough I've realized that I should also control the idle air valve. Crank signal and MAF voltage are currently my only two inputs and I've extracted the fuel map from the stock ECU.

So, currently I control fuel injection and idle. Stock ECU does ignition. This thing starts and I can set idle RPM programmatically.There is still a bug somewhere because things are not super smooth if I push the throttle pedal rapidly, but still :)

Here it is: https://sourceforge.net/projects/rusefi/

And here is this thing in action: http://www.youtube.com/watch?v=GcxLY697WwM

PS: is there a way to embed video here?
Bangbug
QFP80 - Contributor
Posts: 74
Joined: Fri Jan 14, 2011 11:03 pm
Location: Auckland New Zealand
Contact:

Re: my simple ECU

Post by Bangbug »

:) Congrats.

Probably not super smooth as MAF lags what's actually going on.

Actually ignore me, I just want to contribute and I don't know what else to put apart from smiley faces and congratulations :P
Thanks for the video!!!
User avatar
russian
LQFP112 - Up with the play
Posts: 154
Joined: Fri Feb 01, 2013 4:18 pm
Location: Jersey City, USA

Re: my simple ECU

Post by russian »

Bangbug wrote:Probably not super smooth as MAF lags what's actually going on.

Actually ignore me, I just want to contribute and I don't know what else ...
There is something you can do - you can "like" the video!

The stock ECU is way smoother with the same set of inputs (I've disconnected all the other wires) so it's something either with my logic or my implementation. I kinda have an idea where to look...
crazyafrican
DIP8 - Involved
Posts: 24
Joined: Fri May 10, 2013 5:43 am
Location: Auckland, New Zealand

Re: my simple ECU

Post by crazyafrican »

Awesome! Could you put up your schematics please? I might just order a board now they are so cheap haha

You have no acceleration enrichment implemented yet which could be why it is not so smooth when you push the throttle pedal rapidly. Count me in for further testing :D
User avatar
russian
LQFP112 - Up with the play
Posts: 154
Joined: Fri Feb 01, 2013 4:18 pm
Location: Jersey City, USA

Re: my simple ECU

Post by russian »

crazyafrican wrote:Could you put up your schematics please?
There is not much of schematics - for instance, crank sensor is connected right to the board with just a capacitor to reduce the noises

The driver circuits were fun to figure out, they now look like that https://www.circuitlab.com/circuit/8mpj ... /1024x768/
User avatar
russian
LQFP112 - Up with the play
Posts: 154
Joined: Fri Feb 01, 2013 4:18 pm
Location: Jersey City, USA

Re: my simple ECU

Post by russian »

It was a bug in my code - in case of a long enough injection I was trying to schedule it in the past, and it was not really working well. Anyway, this is fixed now. I have also re-enabled ignition code and it actually does start & run with me controlling both injection and ignition.

I guess now I need to implement sequential injection.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: my simple ECU

Post by Fred »

russian wrote:I guess now I need to implement sequential injection.
What were you doing before?
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
russian
LQFP112 - Up with the play
Posts: 154
Joined: Fri Feb 01, 2013 4:18 pm
Location: Jersey City, USA

Re: my simple ECU

Post by russian »

Fred wrote:What were you doing before?
I do not have a toothed wheel, my primary crankshaft sensor does not give me CID info, so I was squirting all injectors at the same time. This also simplifies the schematic you know :)]

I will now solder three more channels and start handling the other crankshaft signal, which seems to be not really available while cranking but it does contain CID.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: my simple ECU

Post by Fred »

What is a "CID" ? Cylinder ID?

What are the two patterns, exactly?
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
russian
LQFP112 - Up with the play
Posts: 154
Joined: Fri Feb 01, 2013 4:18 pm
Location: Jersey City, USA

Re: my simple ECU

Post by russian »

yes, Cylinder ID

There are three wires actually, no idea why so many.
First one is the one I am currently using: (hopefully pseudo-graphics would be digestible)
XXXX___XXXX___XXXX___XXXX___
(so that's say 60% duty cycle, four equal waves per shaft revolution)

Another one is more or less
_X_X____X_X____X_X____X_X___
(four series of two short waves)

and the third one, the only one where one of the cylinders looks differently:
_X_X_X__X_X____X_X_____X_X__
So in this one one quarter has three waves and the other three have two. I will need to recognize this special 9th wave as cylinder ID signal.
Post Reply