Stopping motors

lets say im using a motor for an arm, but once i move the motor and the arms move, it doesent lock, it goes back to its original state, so if i try to stand the arm up when the motor moves and the arm gets to a standing point once i stop controlling the motor the arm will fall, is there anyway to program it to stop when i stop controlling it?

What you’re describing is called open loop control. Programmatically, your control system has no idea what the arm is doing, so it can’t stop the arm from moving or falling. All it can do is take the command you’re giving it and send power to the motor to match what you’re telling it to do. There’s no loop of information, commands come from you, go to the controller and then to the arm. No information travels the other direction, thus the term “open loop.”

To get your arm to stay in one place via programming, you must close this loop by providing your controller with information about the position of the arm. The controller then decides on its own how much power to send to the motor based on the information of where the arm is now, and the input of where you want the arm to be. If you want the arm to stand still, and the controller sees the arm moving, it will send power to the motor to stop the arm. This is closed loop control because the controller gets information back from the arm and uses this information to control how much power to send to the motor. There’s an actual loop of information coming from the arm, affecting the power to the motors, which affect the position of the arm, which means new information from the arm, which changes the power to the motors further, which… and so on. Closed loop control is the PID control you’ll see people talking about here.

So, if you truly want your program to stop the arm from falling you need to add a sensor to the arm and connect this to your controller to implement PID control on the arm. Another option is to use one of the window motors to mechanically stop the arm from falling since these motors are not backdriveable. Your final option is to move the Brake/Coast jumper on your Victor 884 from BC to AB to enable dynamic braking. This will slow the motor down while the victor is in neutral. Unfortunately it slows the motor down more the faster the motor spins. This means it’s not actually capable of stopping the arm from falling. It can potentially slow it down by a large amount, however.

simeon1770, you have a few options to go about fixing this. If the arm is light enough, you can simply set the braking pin on the Victor to brake. As I understand it (read: I’m just an alumnus, not an engineer), this produces an effect similar to crossing the leads on a motor. IT makes it very difficult to turn, hence, holding it in place.

If you arm is a little heavier, then a working software-oriented fix may be mounting sensors on the robot (a shaft encoder may be a good solution here). From there, you would need to read the count and, in the simplest case, set a value you want the arm to go to and then a lower limit at which point the motor lifts the arm back up to the desired value (if you set only one value the motor will be rapidly switching on and off trying to maintain that position). If you need more control over your arm, or your arm is fragile, etc…, then a more complex control method may be in order. A PID, or Proportional, Integral, Derivative control may be a good solution then. This option gives you a little more control over the arm, but may take a little time to tune (Also, advice I’ve found useful is to use only a P control and then add the I and D terms to eliminate error in the P solution after tuning it.).
For more information, the programming side of controlling your arm has also been discussed here.

If you’re looking for a more hardware oriented fix, and have the weight to spend, adding a worm gear to the drive-motor gearing has worked well for my former team in previous competitions. Other hardware oriented solutions include adding a mechanical brake or changing up the gear ratio on the arm.

Depending on your situation, a different solution or mix of solutions may be the best for you. Hope this helps.

darn, i dont think we’ll be able to do it 2day, the robot is being shipped as we speak, well we have 10 hourse to edit at competition, so how long do you think it would take?

anyone in the midwest region at UIC pavilion?


I would at least set your victor to the Brake setting and see how that works for you. Setting up a PID loop for your arm can be a finicky process. If you have the potentiometer, a mounting plan, and the will, you can probably pull it off on practice day. I would search around on CD and learn as much as you can about PID control and write up some sample code in your team’s Fix-It Window. With that and hopefully a veteran team to help you at Midwest Regional (There’s a few) and you should be able to get it working.

For a quick and dirty fix, you could try to find a value to drive the motor at that holds the arm up. It would be a low value, maybe 135 (in the forward direction) or something like that.

You probably need to watch out for motors getting hot. They draw a lot of current when still.


Here is our solution this year. It activates whenever the motor PWM value is 127.

that’s the cleverest thing I’ve seen all week! :slight_smile:

A simple variation on Brian’s idea is to just retrim your joystick to apply the small amount of power you need to keep the arm from backdriving.

You do have to be careful of which motors you use this with. The CIM’s and globes can handle it well, but the Fisher-Price and Banebot 540 motors do not take well to being stalled.

Gary - That is one AWESOME little brake! Whomever designed that deserves an award.

Mind if we steal it? I’m pretty sure I could fab that up in the pits before Friday’s match :stuck_out_tongue:

ok, so i read the instructions on the victors, and when the light is orange that means its braking, how do i apply the break in programming to something like the trigger on the controller

You can’t. To brake a DC motor, the motor is shorted across the positive and negative terminals. This happens automatically whenever you have the brake jumper on the victor turned on and when there is no/a neutral signal going to the victor.

Feel free. I hope it works for you.

im sorry, im a little dumb, i have like NO idea about some of the stuff your talking about, can you put it in simpleton terms in how to make it stop using things that came with the robot in the red and blue box, and take it step by step, sorry if im causing any inconvience

I think you may want to go with the brake that Gary Bonner posted. If you have anybody on your team who’s more mechanically inclined, I would seek their help.

You’re probably going to have to use stuff that isn’t in the Kit of Parts to solve your problem.

I have a shaky understanding of this myself, but I’ll try to explain and hopefully an expert will come along and clear up any mistakes.

The Victors have a jumper on them, which you can use to select either “brake” or “coast” operation. When you put jumper in “brake”, it will connect the output pins together whenever the input tells it that you want to stop the motor. What this does is “short out” the windings in the motor, and the way brush DC motors work, it makes the motor hard to turn fast. The motor can still be turned slowly, so this will not keep the arm from falling under all conditions.

When the jumper is in “coast”, the Victor will leave the output terminals open circuit (disconnected), so the motor can be turned by the arm easily.

Team 1726 used a gas spring (like the black thingys that hold up hatchbacks on cars) to hold the arm up this year, the arm is very well balanced, and the motor does not have to work hard at all to move the arm, and the arm doesn’t have enough weight to turn the motor when power to the robot is turned off. This might be the best way to solve your problem, IF your arm design has a place to put the spring.

If you could post some pictures of your robot, it would really help us figure out what you could or could not do to fix the problem. There are a lot of variables here…how heavy is the arm, what motor(s) does it use, what kind of gearing is on it, etc.