View unanswered posts | View active topics It is currently Tue Sep 30, 2014 5:57 pm






Reply to topic  [ 5 posts ] 
Preventing Burned Out Motors 
Author Message
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post 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:

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
  while(true){
    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(){
  StartTask(clutch);
  while(true){
  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.

_________________
sudo rm -rf /


Sun Nov 21, 2010 11:13 am
Profile
Site Admin
Site Admin

Joined: Tue May 15, 2007 9:02 am
Posts: 405
Post Re: Preventing Burned Out Motors
Thanks for the great tip!

What type of motors are you seeing burnt out?

_________________
Jesse Flot
CMU Robotics Academy
ROBOTC Support


Mon Nov 22, 2010 5:38 pm
Profile
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post 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.

_________________
sudo rm -rf /


Tue Nov 23, 2010 1:59 am
Profile
Rookie

Joined: Fri Jul 27, 2012 1:55 am
Posts: 1
Post Re: Preventing Burned Out Motors
Nice post. I like it. Thanks for sharing these information. Keep it up. :programmer:

_________________
http://www.boku.ac.at/
http://www.pmi.org/
braindumps.com
https://www.ethz.ch/en.html
http://en.wikipedia.org/wiki/Cisco_Systems


Fri Jul 27, 2012 1:59 am
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post 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.
http://proj.titanrobotics.net/hg/Ftc/20 ... 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.


Fri Jul 27, 2012 4:12 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.