Hi.
In motorcontrol in the case of no odometry the accel (setMotorPWM( leftSpeed, rightSpeed, true )) is set to true but it can't work because just after the compute of motorLeftPWMCurr it's immediately set to Pwmleftvalue and same think for RIGHT.
But only for mower without ODOMETRY because into the rest of the code the Accel is always set to false.
Code:
void Robot::setMotorPWM(int pwmLeft, int pwmRight, boolean useAccel){
unsigned long TaC = millis() - lastSetMotorSpeedTime; // sampling time in millis
lastSetMotorSpeedTime = millis();
if (TaC > 1000) TaC = 1;
if (useAccel){
// [URL]http://phrogz.net/js/framerate-independent-low-pass-filter.html[/URL]
// smoothed += elapsedTime * ( newValue - smoothed ) / smoothing;
motorLeftPWMCurr += TaC * (pwmLeft - motorLeftPWMCurr) / motorAccel;
motorRightPWMCurr += TaC * (pwmRight - motorRightPWMCurr) / motorAccel;
}
motorLeftPWMCurr = pwmLeft;
motorRightPWMCurr = pwmRight;
// ---------------------------------
if (motorLeftSwapDir) // swap pin polarity?
setActuator(ACT_MOTOR_LEFT, -motorLeftPWMCurr);
else
In motorcontrol in the case of no odometry the accel (setMotorPWM( leftSpeed, rightSpeed, true )) is set to true but it can't work because just after the compute of motorLeftPWMCurr it's immediately set to Pwmleftvalue and same think for RIGHT.
But only for mower without ODOMETRY because into the rest of the code the Accel is always set to false.