Well, the file calcs.c is at 300 lines already and 200 of them just obtain 10 basic input variables. I'm guessing it's about 15% complete, so I may cut it down into more functions or include.c files to keep it managable and clean/readable. I've laid it out in distinct stages and drawn up a todo list of stuff to add. I'll be having a solid think about what order to do everything and doing a bit of a writeup on it all soonish.
Fred.
Fuel calcs
Re: Fuel calcs
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!
-
- LQFP112 - Up with the play
- Posts: 120
- Joined: Sun Feb 03, 2008 9:30 pm
- Location: Chicago, USA
Re: Fuel calcs
Fred, Even if it is longish, I still think it is beneficial to have all the fuel calcs in one *.c file. Get to a final pulsewidth in this chunk. I do not even want to start talking about driving multiple injector sets, yet, but this chunk would be the start point for that.
Gearhead
Gearhead
Re: Fuel calcs
I agree, I would prefer one file too. We'll see just how long and difficult to think about it gets. I'd draw the line at maybe 2k lines? That's border line excessive.gearhead wrote:Fred, Even if it is longish, I still think it is beneficial to have all the fuel calcs in one *.c file. Get to a final pulsewidth in this chunk.
It could be as simple as calling a function to get initial vars, another to average them, another to get derived ones etc. Functions add overhead though.
Provided it is clean and organised into blocks with a nice sequential flow it should be OK in one file.
Why not, I've already thought about it and it's ready to be coded once the things that precede it are done ;-)I do not even want to start talking about driving multiple injector sets, yet, but this chunk would be the start point for that.
I'm on the ball I tell you ;-)
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: Fuel calcs
(P * VE * V)
Whenever looking at fuel equations, I can't help but to think about these two variables replaced with the actual measured volume so the whole thing works without tables.
Whenever looking at fuel equations, I can't help but to think about these two variables replaced with the actual measured volume so the whole thing works without tables.
Re: Fuel calcs
A minimum set of two Air Fuel Ratio points, based on load, is something to consider. 14.7 AFR is neither a Best Power ratio, nor a Best Economy ratio. 14.7 does result in the hottest cylinder head temps and hottest exhaust valves. Maybe good for warm-up or something.
Edit
Edit
-
- LQFP112 - Up with the play
- Posts: 205
- Joined: Thu Apr 10, 2008 5:51 pm
Re: Fuel calcs
You are correct. Don't forget, it results in proper operation of the catalytic converter.MotoFab wrote:A minimum set of two Air Fuel Ratio points, based on load, is something to consider. 14.7 AFR is neither a Best Power ratio, nor a Best Economy ratio. 14.7 does result in the hottest cylinder head temps and hottest exhaust valves. Maybe good for warm-up or something.
Edit
I would suggest a minimum of three or four points, the location of which in the rpm vs load plane may even be calculated from the basic engine parameters.
I would suggest a minimum:
Low load low speed (idle)
Low load high speed (cruise + decel)
High load low speed (out of the hole tip-in) <- might be able to cut this out and map the targets based on a three-point triangle (brought to you by the department of redundanacy department ) if not critical
High load high speed (somewhere well-placed in the power band[ peak power? peak torque? im thinking peak torque...VE tends to be high here])
Keith MacDonald
Control Engineering (Systems) Technologist
Control Engineering (Systems) Technologist
Re: Fuel calcs
The three point, idle, high load, and low load sounds good. I forgot about idle as a 'operating condition'.thebigmacd wrote:You are correct. Don't forget, it results in proper operation of the catalytic converter.
The catalyst needs the Exhaust Gas Oxygen to swing back and forth above and below 14.7 AFR to operate. Excess oxygen bonds to the metals on the slightly lean swing, and oxidizes the fuel compounds on the slightly rich swing. The catalysts sort of breathes.
-
- LQFP112 - Up with the play
- Posts: 205
- Joined: Thu Apr 10, 2008 5:51 pm
Re: Fuel calcs
I just played around trying to work out the algorithm to do the interpolation of three arbitrary points...it has eluded me so far.
Keith MacDonald
Control Engineering (Systems) Technologist
Control Engineering (Systems) Technologist
Re: Fuel calcs
Can the VE itself suffice as an above/below threshold value? Seems like a pretty good measure of load.
Re: Fuel calcs
Good discussion guys, but ALL variables in there are sourced for each calculation ;-)
So, my current thoughts on AFR are this :
8x8 <= AFR table <= VE table
Although, you could probably get away with less.
On top of this it would be possible to turn on a feature that switched the target back and forth when the input target was 14.7 (or close to it) for catalytic converter operation.
I think allowing the user to choose the shape of their AFR contour is a more flexible approach than interpolating based on the triangle of three points. I realise that would work well, but what if they want some waver somewhere for a particular reason, or rich in boost at 5k and slightly leaner at 7k etc. It wouldn't be enough control.
MAF support is intended and would do exactly what you say about replacing VE and V.
Fred.
So, my current thoughts on AFR are this :
8x8 <= AFR table <= VE table
Although, you could probably get away with less.
On top of this it would be possible to turn on a feature that switched the target back and forth when the input target was 14.7 (or close to it) for catalytic converter operation.
I think allowing the user to choose the shape of their AFR contour is a more flexible approach than interpolating based on the triangle of three points. I realise that would work well, but what if they want some waver somewhere for a particular reason, or rich in boost at 5k and slightly leaner at 7k etc. It wouldn't be enough control.
MAF support is intended and would do exactly what you say about replacing VE and V.
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!