RMRobotics / FTC_5421_2014-2015

Assets for 2014-2015 Team 5421 FIRST Tech Challenge.
MIT License
6 stars 1 forks source link

Add stall protection #9

Open jimmyli97 opened 9 years ago

jimmyli97 commented 9 years ago

This would involve checking to see if encoder is moving a significant amount, when power is above some certain level. If it isn't moving for a specified period of time, the motors should be turned off. If we want to disable braking as well (make it easier for another robot to push us), they should be set to float speed.

Float speed for HT DC motors (where braking is disabled) is -128 (see this link).

See this link for an example implementation - search for "DriveTask" function.

jimmyli97 commented 9 years ago

As a side note, it is impossible to accomplish this for servos because the servos can't send back the actual position (or at least RobotC does not provide a function for it).

For the motors, we could use motorPWMControl, once Robomatter fixes the implementation.

jimmyli97 commented 9 years ago

All it takes for a Tetrix motor to burn out is 1-2 seconds, so this period of time should be very short.