Hi.
In fact in your 2 video the pid work each time for at least 2500 or 6000ms
I think the problem is in the result of the PID
The only way to be sure is to put the motorSpeedMaxPwm=160 the PerimeterTransitionTimeOut=5000 and add this console line after
setMotorPWM( max(-motorSpeedMaxPwm, min(motorSpeedMaxPwm, motorSpeedMaxPwm/2 - perimeterPID.y)),
max(-motorSpeedMaxPwm, min(motorSpeedMaxPwm, motorSpeedMaxPwm/2 + perimeterPID.y)), false);
and verify in the console
If the result of perimeterPID.y change very faster or is superior at motorSpeedMaxPwm/2 then it's normal that one of the 2 wheels stop then so need to change the PID value in perimeter setting(not in motor setting)..
Hope you can find the good value.
In fact in your 2 video the pid work each time for at least 2500 or 6000ms
I think the problem is in the result of the PID
The only way to be sure is to put the motorSpeedMaxPwm=160 the PerimeterTransitionTimeOut=5000 and add this console line after
setMotorPWM( max(-motorSpeedMaxPwm, min(motorSpeedMaxPwm, motorSpeedMaxPwm/2 - perimeterPID.y)),
max(-motorSpeedMaxPwm, min(motorSpeedMaxPwm, motorSpeedMaxPwm/2 + perimeterPID.y)), false);
Code:
Console.print(" MAG: ");
Console.print (perimeterMag);
Console.print(" ");
Console.print(perimeterInside);
Console.print(" PerimeterPID.y: ");
Console.println(perimeterPID.y);
and verify in the console
If the result of perimeterPID.y change very faster or is superior at motorSpeedMaxPwm/2 then it's normal that one of the 2 wheels stop then so need to change the PID value in perimeter setting(not in motor setting)..
Hope you can find the good value.