DIYEFI.org Forum
http://forum.diyefi.org/

Rules instead of maps?
http://forum.diyefi.org/viewtopic.php?f=8&t=2607
Page 1 of 3

Author:  Rufe0 [ Wed Jul 22, 2015 8:42 am ]
Post subject:  Rules instead of maps?

Hello

I'm new to the forum, never built an ECU or had much experience with them but I am a tinkerer, a programmer, and very interested in engines.

It strikes me that an ECU could run an engine based on a few simple mathematical rules instead of maps.

I was wondering if there where any good reasons to use maps instead of a rule based system?

My hypothesis is that when ECU's where first developed the hardware was lacking in speed and power, making it faster to lookup a value in memory rather than calculate it. By the time hardware caught up maps would be the industry standard, but surely now we have the hardware to calculate the values on the fly?

Having a rule based system would be beneficial to the tuner in that there would only be a handful of rules and values to tweak.

Thanks Rufe0

Author:  Fred [ Thu Jul 23, 2015 10:37 am ]
Post subject:  Re: Rules instead of maps?

On the contrary, we use tables because they're easy and fast to calibrate. Models are difficult to understand, and to model the typical curves of a million engines would be very difficult indeed, as the shapes vary wildy. OEMs use models, however they have large budgets and entire teams of engineers to develop calibrations with.

Author:  Rufe0 [ Thu Jul 23, 2015 12:48 pm ]
Post subject:  Re: Rules instead of maps?

Hmm the kind of formulas I'm thinking of would definitely be easier than maps and probably would fit all types of engines with only a few tweaks of a couple values.

I can see how some engines, variable valve timing etc would start to get considerably more difficult but still doable.

Consider a basic engine with fixed valves and intake geometry, throttle by wire so pedal position sensor, throttle servo, rpm sensor, knock sensor, temperature sensor and lambda sensor.

Startup rules would be something very simple like increase fuel by X% for 1min or until temp > 80degrees C or whatever, retard spark by Y% etc, simple stuff.

Then you would have a system where you have a target RPM(pedal position sensor) and actual RPM , if there is a discrepancy adjust throttle servo accordingly based on a percentage of a max aggressiveness value. This would give you an acceleration factor which is a temporary number which tells the rest of your code if the engine is trying to accelerate and by how much. Its a bit like tuning a servo motor on a CNC machine if you've ever done that. Basically just a few values which control how aggressively the algorithm tries to match the target and actual speed which stops overshooting and hunting.

Then you have a loop that would check the AF ratio and adjust your injector timing as necessary, factoring in a value that adjusts AF ratio based on acceleration factor.

Same for spark timing, adjust timing based on RPM*spark value+ any adjustments needed based acceleration factor + knock value.

Then simply max and min RPM.

Thats 4 tuning values and 3 or 4 basic parameters. The code needed to run it would be probably 4 or 5 code blocks probably couple hundred lines max.

You could easily optimize the 'tune' of this system by driving around, logging the acceleration factor, adjusting your values, rinse repeat untill you have a lowest average acceleration factor, meaning that the engine is achieving the desired RPM more of the time. It would even be easy to have the ECU adjust itself with some sort of learning algorithm based on average acceleration factor.

It could get more complicated if you have to set tuning values based on RPM instead of fixed values but still relatively easy to use.

Am I wrong?

Author:  Rufe0 [ Thu Jul 23, 2015 1:09 pm ]
Post subject:  Re: Rules instead of maps?

Obviously I left out that you need a crank position sensor and a code loop that would handle each cylinder based on crank position or whatever.

Author:  sim [ Fri Jul 24, 2015 2:30 am ]
Post subject:  Re: Rules instead of maps?

Carburettors and distributors use rules.

Author:  Fred [ Fri Jul 24, 2015 7:47 am ]
Post subject:  Re: Rules instead of maps?

Rufe0 wrote:
Am I wrong?

Basically, yes :-) I don't have time to go into it more, though. Sorry.

PS, sim's post was before he could see your last two posts. Whether that affects what he'd have written, I don't know. Probably not much.

Author:  Rufe0 [ Fri Jul 24, 2015 8:21 am ]
Post subject:  Re: Rules instead of maps?

Could you possibly go into detail when you have more time?

Author:  reanimotion [ Fri Jul 24, 2015 10:20 am ]
Post subject:  Re: Rules instead of maps?

Table based mapping is done because it's easy, not because it's the only correct way.
Model based engine control is just simply difficult and very engine specific by nature, which is why virtually every generic ECU avoids it.

Look at true VE and pulse width fuelling, some of the high end systems avoid even VE because it's not as easy to explain to the end user.
Some claim they use VE but don't, and others claim they only need milliseconds of fuel, and some are just misguided or following tradition.

There are still correction tables even in the OEM world regardless of the control strategy as engines are just not able to play nice and follow rational formulae.
Have a look at the SAAB Trionic8 system for a pretty well documented torque demand/delivery model, Bosch ME-Motronic might also be a relevant reference.

Given enough time and money anything is possible, so if you have an idea and some time to spend on developing it, then go ahead and have a whack at it.
The task won't be easy, but you know that :)

Author:  reanimotion [ Fri Jul 24, 2015 10:28 am ]
Post subject:  Re: Rules instead of maps?

Rufe0 wrote:
Having a rule based system would be beneficial to the tuner in that there would only be a handful of rules and values to tweak.

This is probably the sticking point, "tuners" aren't rocket scientists so there is going to be a bit of resistance to learning new things, new concepts and the science behind them just wont be an easy sell.

Author:  Rufe0 [ Fri Jul 24, 2015 10:54 am ]
Post subject:  Re: Rules instead of maps?

Hmmm OK so I think I'd like to have ago at making a virtual mathematical engine which I could write control algorithms for and run on a virtual dyno to see how well the control algorithm works.

I can see this being very useful but it would have to do a decent job of replicating a real engines oddities.

Writing the simulation and the control mechanism means I could easily get into a situation where I'm setting it up to work perfectly every time which wouldn't be useful at all.

Do you think it's feasible? Would it be useful? Is there already something out there like this? Would you be willing to help?

I guess for a start I would need a detailed list of all engine parameters, what effect a high value would have and what effect a low value would have. Assume I know nothing about engines at all.

Thanks Rufe0

Page 1 of 3 All times are UTC [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/