I froze a bit tonight but got it all ironed out. The reason for the random disengage was my original snippet allowed the set point value to go negative. I am extremely happy with the results now using the ACS712 straight or in a uturn.
// Use current PWM value as percentage to add some extra amps while U turning.
// To get more setpoint resolution between amps 10.5 amps would be entered as "105" on the settings page
if ( abs(analogValue - 512) >= (steerConfig.PulseCountMax * ( 1.2 + (abs(pwmDisplay) / (steerSettings.highPWM - steerSettings.lowPWM))* 1.1))) //amp current limit switch off
{
steerSwitch = 1; // reset values like it turned off
currentState = 1;
previous = 0;
}
}
Also tonight I learned the difference between my Chinese brt10 tablet, and Getac f110 G2. Though the brt10 runs AOG well especially going straight, I was still having some odd U turn and Contour guidance overshoot issues. The Getac runs U turns much more precise and extremely smooth. I thought AOG was great before, but I cant get over how smooth, slow and methodically it moves the steering now.