Preventing Burned Out Motors
Page 1 of 1

Author:  magicode [ Sun Nov 21, 2010 11:13 am ]
Post subject:  Preventing Burned Out Motors

I did not think that this post belongs in the Beginners Tips section, so I put it here.

Since many people have burned out motors by putting too much torque on them, and the motors are expensive, I wrote a code that acts like a circuit breaker when too much torque is applied. It will temporarily stop the motor until the user presses a button to release it. All you need is an encoder. I have only written it for one motor, and because every robot is different, you will have to add more code to make it work for multiple motors. You can change the amount of torque that is needed before the motors stops by changing the value of the variable "threshold". Here is the code:

#pragma config(Sensor, dgtl1,  quad,                sensorQuadEncoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task clutch(){
  int quadPrev = 0; //stores previous encoder value
  float threshold = .01; //variable to increase or decrease the torque at which the motor stops.
  SensorValue(quad) = 0; //reset encoder
  wait1Msec(100); //initialize
    if(motor[port2] > 20 || motor[port2] < -20){ //checks if motor is running at a reasonable speed
      wait1Msec(100); //checks for stop and go movement
      while(motor[port2] > 20 || motor[port2] < -20){
        quadPrev = SensorValue(quad); //set quadPrev equal to the current encoder value
        wait1Msec(100);//let the motor run a little
        if(abs(quadPrev - SensorValue(quad)) < (abs(motor[port2]) * threshold)){
        //IMPORTANT PART: checks if the axle has moved the correct amount in proportion to the motor speed
          motor[port2] = 0; // stops motor
          hogCPU(); //stops task main from executing until the release button is pressed
          while(!vexRT[Btn6U]){ //this button releases the motor
            motor[port2] = 0; //stops the motor which is not running correctly
            //insert all user controls except for the motor that is being stopped
          releaseCPU(); //starts running task main again

task main(){
  motor[port2] = vexRT[Ch1];
    wait1Msec(1);//needed for multitasking to work correctly

That's it. If you implement this, let me know how it goes.

Author:  jbflot [ Mon Nov 22, 2010 5:38 pm ]
Post subject:  Re: Preventing Burned Out Motors

Thanks for the great tip!

What type of motors are you seeing burnt out?

Author:  magicode [ Tue Nov 23, 2010 1:59 am ]
Post subject:  Re: Preventing Burned Out Motors

We have seen regular motors being burned out. When people use old motors to try and lift their robot, they seem to give out under the torque. I have also heard about the high strength motors shorting if you add too much torque too quickly, but I've never actually seen this.

Author:  alton [ Fri Jul 27, 2012 1:59 am ]
Post subject:  Re: Preventing Burned Out Motors

Nice post. I like it. Thanks for sharing these information. Keep it up. :programmer:

Author:  MHTS [ Fri Jul 27, 2012 4:12 am ]
Post subject:  Re: Preventing Burned Out Motors

We don't have Cortex but the Tetrix motors we used for the Mindstorms can burn out quite easily. I opened up one of the burnt out motors and found that it has a series inductor inside the motor. If the motor is stalled, the stall current can easily fry the inductor causing it to open circuit. If you bypass the burnt out inductor by shorting it, the motor came back to life again. In the 2010 FTC competition, we fried over 10 motors, Ouch! That forced us to add stall protection in our library code. ... ib/drive.h
Basically, it detects if the power applied to the motors is exceeding some threshold but the wheels are not moving for a set period of time. When that happens, we cut the power to the motor and beep the speaker.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group