|
Re: Radio cuts out, student's foot run over
We have found a problem also that causes the robot to take off, when the dongle is switched from Autonomous/Kill, to Operator Control mode.
It seems the first value read from the joystick was 0 (which, when the value was copied to the Victor, made the motor go suddenly full-speed). After that the joystick values were read correctly. This was with Master Code V12, we have since upgraded to V13.
At first we put in a 1/2 second delay in Operator Control mode, before reading the joystick the first time. It seemed to work, but as code was being developed we had other accidents where motors were set to full-speed.
So we put the Victor output for left-side and right-side into two C procedures. The procedures check for legitimate PWM values 1-253. Joystick input procedures were similarly modified, to avoid the extreme values 0 or 254.
In this way, a 'glitch' or coding accident cannot send 0 or 254 to the Victors.
This has solved our problem.
|