That works for me. If someone messes that one up then they were really trying.Admin wrote:You raise an excellent point. In the time it took my bogged down firefox to load this post page I realised that you expose all 16 bits to the world and right shift them to where you want them in the code. If we even want to do this of course. It definitely has to be enforced in some way, and the use 16 shift back to 10 (or whatever) method seems most infalible.jbelanger wrote:Yes but you better make sure this cap is enforced everywhere the value can change otherwise you screwed. It also has to be very clear in the code that this is needed because someone could be tempted to use the full 16 bits at some point without changing the math behind.
Fixed point mathematics [now with POLL please vote]
Re: Fixed point mathematics [now with POLL please vote]
Re: Fixed point mathematics [now with POLL please vote]
OK, so the consensus is that we use 16 bit fields and at some later date decide how much of the resolution we really need/can deal with (may as well use it all if there is no penalty with overflow etc...) and scale it down on calc with a bit shift to the right if required.
Reason being : engines where idle and boost are so far apart in efficiency that idle ends up with low values that have stupidly low resolution.
That way we can use anything from 16 down smoothly as required. Most likely 10 or 16 at this stage. What ever number of bits we use, max value will be close to 128 with appropriate scaling etc.
Fred.
Reason being : engines where idle and boost are so far apart in efficiency that idle ends up with low values that have stupidly low resolution.
That way we can use anything from 16 down smoothly as required. Most likely 10 or 16 at this stage. What ever number of bits we use, max value will be close to 128 with appropriate scaling etc.
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: Fixed point mathematics [now with POLL please vote]
I think that's a good call to make, and I'd code with it, but in the mean time, for discussions sake:
If you take every row of a decent MS table, and divide it by the MAP, you should get your table, right? This thing where it's normallized to mainfold pressure, and all numbers are near 100.
In that case, the table would be symetric about 100. Or symetric about 0, I guess. Either way, I would expect effeciencies around +/- 20%. If I had a map in front of me, I could figure out better. I guess the things like very high high pressure and very low rpm ( or low pressuse and high RPM) where the tables are rarely tuned well anyway would look funky.
I know about idle I'm ~44 on the table, and at full boost maybe 115. I guess I'll make up this table later and share it. But my ponit is, 125% max might be too low, and 0 would never be used if it's normalized to the manifold.
If you take every row of a decent MS table, and divide it by the MAP, you should get your table, right? This thing where it's normallized to mainfold pressure, and all numbers are near 100.
In that case, the table would be symetric about 100. Or symetric about 0, I guess. Either way, I would expect effeciencies around +/- 20%. If I had a map in front of me, I could figure out better. I guess the things like very high high pressure and very low rpm ( or low pressuse and high RPM) where the tables are rarely tuned well anyway would look funky.
I know about idle I'm ~44 on the table, and at full boost maybe 115. I guess I'll make up this table later and share it. But my ponit is, 125% max might be too low, and 0 would never be used if it's normalized to the manifold.
Re: Fixed point mathematics [now with POLL please vote]
All ms variants are supposed to be like that already, except Ken's "mult map off" version...
The differences are due to inertia and resonances etc.
Regardless of which figure is used, it will always be enough... the point is to make people default to being close to the ceiling... not default to half way to the floor. If you need to exceed the ceiling you scale the table back and inc/dec the master fuel number, whatever we end up calling that.
Yes zero will never get used, BUT, it simplifies the math to leave it referenced to zero.
My map was similar to yours (similar engine too). Either the efficiency falls at partial throttle openings (probable) or the ms math is all broken (unlikely, someone would have spotted it).
Fred.
The differences are due to inertia and resonances etc.
Regardless of which figure is used, it will always be enough... the point is to make people default to being close to the ceiling... not default to half way to the floor. If you need to exceed the ceiling you scale the table back and inc/dec the master fuel number, whatever we end up calling that.
Yes zero will never get used, BUT, it simplifies the math to leave it referenced to zero.
My map was similar to yours (similar engine too). Either the efficiency falls at partial throttle openings (probable) or the ms math is all broken (unlikely, someone would have spotted it).
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!