I've added docs on how to setup your freeems for the first time. Anyone with a Puma should read and review these and get familiar with them. I've laid out the makings of a "how to configure it" thread, and mostly completed a "engine configs supported" thread. I also documented the hyundai hack decoder in that section, and added the mighty hyundai to the freeems vehicles section.
Tomorrow I might tidy up the Simple decoder and test that on the Hyundai too. That'll help me work on the scheduler some more as well.
Signing off at 4am after a good days dev and docs,
Fred.
Fred's firmware development diary
Re: Fred's firmware development diary
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!
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!
Re: Fred's firmware development diary
OK, I've not written any more code, or nothing worth mentioning, but I've been flat out organising others, and organising myself. I have also properly installed my Puma inside my "daily driver" known as "hotel hyundai" and just took it for the first test drive, 3rd car runs nicely and will pick up some performance once tuned as the OEM setup had a broken vacuum advance on the dizzy. So some more timing is available everywhere, by feel. I saw max 20btdc revving it in the driveway, and 5btdc idle timing, so I can make it start and idle better too. Hooray, I've got an every day dev/test car now too, wicked. We should aim for there to never again after this moment be a time without a FreeEMS car on the road being used somewhere. Deal? Thanks! :-)
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!
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!
Re: Fred's firmware development diary
OK, there are some refinements to the way ADC pins are measured required. Some of this came from logs and some from talking to friends about this stuff.
CHT should be main loop or RTI sampled and slow averaged
BRV should be decoder sampled and quickly averaged.
IAT should be fast sampled, minimal averaging
TPS should be fast sampled, minimal averaging
MAP should be decoder sampled and not averaged, or averaged VERY little, bad map values are the result of improper reading timing..
Multi MAP should be decoder sampled and minimum taken from N cylinder readings and not averaged, or averaged VERY little, bad map values are the result of improper reading timing..
EGO can be measured either from decoder (for a consistent reading) or fast from the main loop to watch cylinder to cylinder variation, both can be done and stored differently.
I'll work on that shortly. Here is something else that I should work on:
viewtopic.php?f=24&t=1089
Ground/Power white paper style document.
Fred.
CHT should be main loop or RTI sampled and slow averaged
BRV should be decoder sampled and quickly averaged.
IAT should be fast sampled, minimal averaging
TPS should be fast sampled, minimal averaging
MAP should be decoder sampled and not averaged, or averaged VERY little, bad map values are the result of improper reading timing..
Multi MAP should be decoder sampled and minimum taken from N cylinder readings and not averaged, or averaged VERY little, bad map values are the result of improper reading timing..
EGO can be measured either from decoder (for a consistent reading) or fast from the main loop to watch cylinder to cylinder variation, both can be done and stored differently.
I'll work on that shortly. Here is something else that I should work on:
viewtopic.php?f=24&t=1089
Ground/Power white paper style document.
Fred.
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!
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!
Re: Fred's firmware development diary
Just fixed a little unlikely to happen bug and upgraded the logging a bunch, will take some logs of the hotel hyundai tomorrow and try to verify the timing code and/or the decoder angle specifications. It looks like the angle could be off a little, BUT, it could just as easily be that the rate of crank accel during the cycle is different and the period scheduling/RPM is causing incorrect values to be calculated. I need to fix up the RPM code before I can verify that, HOWEVER, the timing each side of the step (of 2.5degrees) is rock solid, so that says the RPM reading isn't causing it to be wrong/bad.
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!
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!
Re: Fred's firmware development diary
I really need to document the MegaSquirt enthusiast life-cycle at some point. We've all been through it, or are going through it, and it has distinct phases. This guy is clearly early on in the process so is blind to many things, but we'll have to forgive him for that, it's hard to see the light at the end when the you're blinded by the neons at the start...I've been following the DIYEFI thing passively for a while now because I'm interested in seeing where it goes and I may yet give it a run some day if and when megasquirt stops being interesting to me.
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!
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!
Re: Fred's firmware development diary
Today I realised that FreeEMS car 3 wasn't really running on real code, so fixed that, and found a bug. I've been slowly working through the codebase tonight clearing out cruft as I go looking for the issue. I've narrowed it down a bit and should have it licked sometime tomorrow morning. I need to achieve other things tomorrow too, so it'll be a big day. I didn't sleep last night at all, I just kept going after the coding ended at 3am and talked some shit on various forums and in irc for a while.
The issue that I found is that as the post event delay becomes smaller and smaller as revs rise (due to timing vs angle) once it approaches zero output events simply stop firing. This can't be anything to do with the injector isr code as that never gets a chance to run. So it must be part of the code in the, now VERY simple, schedule-a-pin code. I'm very tired right now, but I'll review this post in the morning and should have a solution fairly quickly. I mean, it used to work... so... :-)
Fred.
The issue that I found is that as the post event delay becomes smaller and smaller as revs rise (due to timing vs angle) once it approaches zero output events simply stop firing. This can't be anything to do with the injector isr code as that never gets a chance to run. So it must be part of the code in the, now VERY simple, schedule-a-pin code. I'm very tired right now, but I'll review this post in the morning and should have a solution fairly quickly. I mean, it used to work... so... :-)
Fred.
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!
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!
Re: Fred's firmware development diary
So, since my last post, I've been busy! The scheduler had some missing bits and the real time output code was a little broken, but now it's great, the following summarises the issues that I had after getting it up and running at all:
There were a number of issues, some subtle, some obvious, some 3 years old, some 3 hours old.
1) That logic for "self set" was backwards, once reversed it had a nasty miss and then pulled to redline/the sky
2) I found a corner case in the scheduler where if overall advance = 0 (inclusive of engine offset and timing and cylinder offset) then no output event would be scheduled (we weren't hitting this, though)
3) The logic for self sched was wrong due to using a 2 bit mask to *TRY* check two conditions at the same time, I've split that into 4 or maybe in future 5 end points now instead of 2 before.
4) Added a feature to add an extra scheduled event if swapping events out from under the decoder such that one would be missed, BUT, got the var in the setter condition wrong, completely wrong, and didn't notice till just a while ago, when I did fix this, it ran/runs MINT.
5) Swapped order of register fiddling to match other code part (unlikely to have caused any affects, but consistent now)
The above took 48 hours, total, sleep, shower, etc. Now it's rock solid!
And 21 datalogs in probably around 10 short drives later too :-)
Tomorrow I might run a silver top 4age and/or a 1uzfe both on engine stands, if things go well.
Fred.
There were a number of issues, some subtle, some obvious, some 3 years old, some 3 hours old.
1) That logic for "self set" was backwards, once reversed it had a nasty miss and then pulled to redline/the sky
2) I found a corner case in the scheduler where if overall advance = 0 (inclusive of engine offset and timing and cylinder offset) then no output event would be scheduled (we weren't hitting this, though)
3) The logic for self sched was wrong due to using a 2 bit mask to *TRY* check two conditions at the same time, I've split that into 4 or maybe in future 5 end points now instead of 2 before.
4) Added a feature to add an extra scheduled event if swapping events out from under the decoder such that one would be missed, BUT, got the var in the setter condition wrong, completely wrong, and didn't notice till just a while ago, when I did fix this, it ran/runs MINT.
5) Swapped order of register fiddling to match other code part (unlikely to have caused any affects, but consistent now)
The above took 48 hours, total, sleep, shower, etc. Now it's rock solid!
And 21 datalogs in probably around 10 short drives later too :-)
Tomorrow I might run a silver top 4age and/or a 1uzfe both on engine stands, if things go well.
Fred.
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!
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!
Re: Fred's firmware development diary
More progress, I've spent the last 2 days working with Preston on his silver top 4age writing a new decoder and adapting other code to work properly in the process. Along with that, SeanK made me realise that the current scheduler won't work for any application with a single pin firing more than once per scheduler cycle (no matter the lenght of cycle), so to get the 4age firing its wasted spark setup properly, I had to do a nasty hack, but before we realised the 4age needed that, SeanK had me thinking about it, and I have a design for making that work.
There are some other limitations too, but right now, I forget what they are.
We haven't caught fire to the place yet, which is good considering how dodgy the fuel setup is (worse than the code for sure).
The decoder works great, and has noise protection (the second to have it).
It's now 335am on Sunday night, and we got one concerned/annoyed/angry talking to by his lovely mrs.
We just found out that the ignitors we were using don't react to 5v inputs with 330ohm resistors, which is not cool, my J701s react fine to that. Hmmm, more testing required for those, perhaps a step up to 12v is required to drive them. Who knows, J701s are nearly installed, ready for the next test.
Fail, again, this is VERY weird. Power and ground issues for sure, but how? Very odd. Guaranteed to make us go "ahhhhhhhhhhhhhh" when we suss it out.
Maybe one more post tonight, or not, 414am now...
Fred.
There are some other limitations too, but right now, I forget what they are.
We haven't caught fire to the place yet, which is good considering how dodgy the fuel setup is (worse than the code for sure).
The decoder works great, and has noise protection (the second to have it).
It's now 335am on Sunday night, and we got one concerned/annoyed/angry talking to by his lovely mrs.
We just found out that the ignitors we were using don't react to 5v inputs with 330ohm resistors, which is not cool, my J701s react fine to that. Hmmm, more testing required for those, perhaps a step up to 12v is required to drive them. Who knows, J701s are nearly installed, ready for the next test.
Fail, again, this is VERY weird. Power and ground issues for sure, but how? Very odd. Guaranteed to make us go "ahhhhhhhhhhhhhh" when we suss it out.
Maybe one more post tonight, or not, 414am now...
Fred.
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!
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!
Re: Fred's firmware development diary
OK, my conclusion, is that the ignitors are current amplifiers, not voltage driven, and that the coil is lower impedance and higher output than the ones that I am trying to drive with my J701 units. The XORs and code are firing nicely, but the voltage at the ignitor never moves. the voltage is all dropped across the 330ohm output resistor. I think a set of transistors attached to 12v and driven by active low (swap the resistor that controls the xor polarity, XOR for the win!!!!) and it might work a bit better. I will make some changes to my Puma with the intent to drive ignitors that way. 250ohm is the lowest I can go on the XOR and I'm already at 280 (330 and 1.?k in parallel) and it's clearly not enough.
Additionally, the act of firing the coil by manually triggering the ignitors produces an input spike on the NE RPM1 signal and makes the fuel pump come on. This illustrated another issue, the fuel pump currently turns off on average 0.5s after last rpm signal, BUT, if last RPM signal is close to the checkpoint, it can be very quick to turn off, as a result, I will update the turn off time to be 2 seconds, not one, so that min is 1 and max is 2 and average is 1.5.
It's been a LONG night, almost 5am now, and we've tried all sorts of shit, and come up with no results. Earlier in the night we had some ECU driven sparks, but they were intermittent at best. There were code issues then too, though, so it was hard to blame it on the hw at that point.
Sleep time.
Fred.
Additionally, the act of firing the coil by manually triggering the ignitors produces an input spike on the NE RPM1 signal and makes the fuel pump come on. This illustrated another issue, the fuel pump currently turns off on average 0.5s after last rpm signal, BUT, if last RPM signal is close to the checkpoint, it can be very quick to turn off, as a result, I will update the turn off time to be 2 seconds, not one, so that min is 1 and max is 2 and average is 1.5.
It's been a LONG night, almost 5am now, and we've tried all sorts of shit, and come up with no results. Earlier in the night we had some ECU driven sparks, but they were intermittent at best. There were code issues then too, though, so it was hard to blame it on the hw at that point.
Sleep time.
Fred.
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!
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!
Re: Fred's firmware development diary
Today I added a request packet for decoder name such that the decoder variant of the firmware can be identified, this completes the interrogation stuff afaik.
I also copied across the sched loop from the new decoder to the mitsi one, sans the hack.
Lastly, tonight I was thinking about the hyundai and timing inside a narrow window, and bad scheduling choice due to it thinking there isnt anything else, and I came up with the idea for virtual event scheduling and mapping to real events, which is now implemented and looks good. I will test tommorrow. If it starts easier, hooray, if there is no change, it will still be beneficial to some people at the least.
I need to take a break from coding for a while and sort out all the aspects of my life that need sorting before I jump on a jet again. There are lots of exciting fun things to code right now, so I'll do some when I get a chance, I promise.
I have a bunch of ideas about how to finish and make the decoder interface awesome, I want to do that to streamline expansion of the system into new setups.
Then there are the basic features that need adding, and a million other things too.
45mins sleep last night, now:
SLEEP!!!
Fred.
I also copied across the sched loop from the new decoder to the mitsi one, sans the hack.
Lastly, tonight I was thinking about the hyundai and timing inside a narrow window, and bad scheduling choice due to it thinking there isnt anything else, and I came up with the idea for virtual event scheduling and mapping to real events, which is now implemented and looks good. I will test tommorrow. If it starts easier, hooray, if there is no change, it will still be beneficial to some people at the least.
I need to take a break from coding for a while and sort out all the aspects of my life that need sorting before I jump on a jet again. There are lots of exciting fun things to code right now, so I'll do some when I get a chance, I promise.
I have a bunch of ideas about how to finish and make the decoder interface awesome, I want to do that to streamline expansion of the system into new setups.
Then there are the basic features that need adding, and a million other things too.
45mins sleep last night, now:
SLEEP!!!
Fred.
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!
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!