Hi Henrik,
Thanks for your help and code sample, I'll use this as a guide for other timing tasks if it doesn't work for this particular role.
I understand the ratio calcs for Duty Cycle and have done this a few times before, but with gasoline injectors where their on time is proportional i.e. let's say max rpm limits maximum duty cycle to 20ms. In such circumstances DC is easy - 10ms = 50%, 20 = 100%, etc.
But with modern diesel common-rail injectors (extremely high fuel pressure so inj open times are in microseconds) the ratio between on-times and period blows out so much to be unusable in normal math for DC. It doesn't need to be exact but does need to be reliable and repeatable as DC will form an axis in a lookup table to control vnt turbo characteristics and boost curve via a PWM solenoid valve. I will start a different thread soon and request suggestions on how to do 3D mapping.
It's a catch-22 situation in that I don't know what a particular engine's max DC is unless fully loaded on a dyno and 'scope measurements are taken - expensive. In a gasoline engine this isn't needed due conventional math taking care of it. I can make an educated guess and set the diesel's max DC as 1000us (typical full load) then measure on-the-fly using this as the reference to derive some data as the engine is loaded - if it exceeds 100% then code could update the ref and store this along with the max pulse length... do you see another way?
Kind regards,
Bill
Bookmarks