Page 3 of 3
Posted: Sat Dec 31, 2005 12:25 pm
by kalvinlk
Nevermind, it seems I have found the answer after catching up one some topics!
http://www.megasquirt.info/ms2/configure.htm#lag
I'll have to order the newer MS2, as my first generation MS2 can't support the new code. Out of curiosity, what version of the embedded code did this get implemented in?
Posted: Sat Dec 31, 2005 2:34 pm
by Jedrik
I was noticing the battery correction was causing my cruse PW to oscilate enough to feel seat of the pants...
This is with v2.1 code. So I added the v2.3 stile lag factor
Code: Select all
if(first_adc > 0)
outpc.batt = (short)adcval;
else
outpc.batt += (short)((10 * (adcval - outpc.batt)) / 100);
With the Lagfactor hardcoded to 10. Still plenty fast for the voltage!
Here are the datalogs. No lagFactor left, with lag factor on the right.

Posted: Sat Dec 31, 2005 4:26 pm
by kalvinlk
Good info! Is there anything else in the code I should be concerned with, or is it simple to just add a few lines, seeing as I don't have $70 to get a new MS2.
Posted: Sun Jan 01, 2006 10:01 am
by Jedrik
Took a quick look at the 1.31 code and the adc area seems to be the same so this method should work.