Fred's firmware development diary

Official FreeEMS vanilla firmware development, the heart and soul of the system!
Locked
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary

Post by Fred »

v0.0.10 is called squashed :-)

http://sourceforge.net/project/showfile ... _id=586475

0.0.10 (squashed) - 23/3/08
Fixed bug 1 : array index out of bounds corruption in scheduler.
Added code to limit retard/advance of fueling, untested, may not be working correctly.
Added modulus down counter interrupt to flash "user led" to indicate board is functioning.
Fixed banked in and out calcs system

Admin.
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
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary

Post by Fred »

I just found and fixed a bug whereby if the unit was reset with a high rate of rpm, injection would be broken on channels 1, 2, and/or 3 for a while, but would eventually self right :-)

This was caused by the scheduler scheduling fueling before the data required was present and valid.

Only engine_position_isrs.c was affected, and changes were minor.

Admin.
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
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary

Post by Fred »

Man, I LOVE the soundcard scope :-)

It's not perfect, but it's pretty bloody good :-) It just illustrated another bug for me :-)

The good news is, timing of injection works perfectly as does pulse width, however, the combination of the two doesn't quite behave right. Reason being that the logic that checks for impending overlap and just hard on's the injector isn't accounting for advance. Thus as soon as the end of the pulse gets to where the start WOULD be if there was no advance it becomes solid on.

I'll add it to the bug thread and find a solution this afternoon (should be easy enough)

I'll take a video of it working properly as soon as it does, and release 0.0.11 with that and a few other fixes.

I'll also add a bunch of scope screenies to that scope thread :-)

Admin.
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
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary

Post by Fred »

A VBR mp3 of the JimStim breaking up above 8k RPM in Nippon Denso 24/2 mode :

http://www.divshare.com/i/4106253-9eb

Import into audacity to view or just listen to hear it fall apart.

Starts low rpm, rises, breaks up a lot, falls gradually back down.

Ignore the noise on the tops of the square waves, that is all mp3 artifact. Amazing how far from the original it is. The 128k compressed one wasn't worth uploading it was THAT bad! I sure am glad I archived all those wav files of my music collection backups.

Admin.
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
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary

Post by Fred »

Screen shot from audacity looking at the raw recording on top and the VBR at the bottom. It starts fully broken up, ends working normally.

Image

Admin.
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
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary

Post by Fred »

No bug fix release tonight unfortunately, today has been mostly admin stuff. emails, site changes, etc...

Priority number one is fix bug 3 in the morning and release like that. then move onto ignition.

After that I'll move the calcs to the SWI and then probably start on serial comms :-)

Admin.
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
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary

Post by Fred »

Bug 3 turned out to be simply not clearing a flag ever. So, once set it remained set. Fixed, I'll give it a tidy up, and release it as 0.0.11. I'll have to consult the release name ideas thread for information on what to call this one, I seem to remember promising someone to use their idea soon.

Admin.
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
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Click

Post by Fred »

To eliminate bug 4 I need to do more work to the "wheel decoder" as the current half pie solution is not enough.

Because engine position ISRs utilise the timer extension they can read out to 54 minutes. This is WAY longer than double the maximum period between two pulses. Thus if the difference between two values exceeds half of 54 minutes it is safe to assume that the actual difference was the inverse of this and that we know which came first.

eventX = timerValue;
eventY = timerValue;

diff = eventX - eventY;

if(diff > 0x80000000){
diff = eventY - eventX; // redo diff to get correct figure if we need it.
// do things for when X was first
// TODO
}else{
// do things for why Y was first
// TODO
}

I don't know why, but it took me far too long to get my head around that!

Admin.
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
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary

Post by Fred »

Mint, it's working perfectly now as far as I can tell, advance, pulse width, overlap, rpm change, everything :-)

Admin.
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
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary

Post by Fred »

v0.0.11 is released and called "cookin'" as suggested by Rob/m2cupcar

https://sourceforge.net/project/showfil ... _id=587543

0.0.11 (cookin') - 27/3/08
Added freemind mind map of FreeEMS code layout/structure
Removed legacy code snippets.c
Found and fixed bug where the period time was being used before it was valid
Found and fixed a bug where injector timing was not functioning correctly
Found and fixed a bug whereby overlapping injection working correctly relied on an accurate period of a future cycle
Added more realistic sync loss in several places
Changed some variable names etc

http://www.youtube.com/watch?v=jsXPi2KWRAU

It's a good one :-)

Admin.
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!
Locked