There are several ways to get braking on a dc motor:
1/ Turn off the supply and connect a resistor across the terminals (called dynamic braking).
This is kind of crude and the braking torque drops off as the speed falls.
A bit of an enhancement is to use a MOSFET or transistor to control the current and thus braking torque.
2/ Apply reverse torque by forcing current through the motor in the regenerating direction.
This will require a current regulator to keep control of the current regardless of motor CEMF.
It is often called regenerative braking.
3/ Apply reverse voltage to the motor. This again requires a good current regulator and is no better than
2/ above so I would not recommend using it.
As far as damage to the motor goes, the source of damage to any dc motor is overheating caused by too much current for too long and commutator flashover caused by a very large overcurrent and/or a high rate of change of current. So in both cases if you keep good control of the current they will not happen.
I've used all of these methods on larger motors and they all work very well when carefully designed.
The key in all cases is a good regulator algorithm and from posts I've seen I'm not sure these robots etc.
use a very well thought out regulator.
One of the best for many (not all) applications is a speed/current regulator in which you control speed using speed regulator with speed feedback which provides a reference to a current regulator with current feedback. Using this you simply put limit on the current regulator reference to keep control of current.
A PID speed or position loop might be worth experimenting with - if you have the relevant encoders.
Such can be tuned to avoid being too aggressive (and spinning the wheels).
You know that cars have brakes that are separate from the motivation source, right? That heavy a robot should have brakes, too.
Haha no I didnt know cars have brakes, its to much of a mechanical issue to add extra brakes, motors will have to do.
If you rapidly reverse a DC motor, it briefly draws twice the stall current.
Given that the stall current is typically 5-10X the running current, could your motor driver handle 200 or more amps?
No my driver can only handle around 40amps for a few seconds, but that stall current you give is if you put the motor in full reverse(255pwm), will it not be a lot lower with a lower pwm value?
I have tested the reverse brake briefly nothing has gone wrong yet,I just needed to check that im not damaging the motors.
Thanks phoxx for your input, I will do some reading up.
A PID speed or position loop might be worth experimenting with - if you have the relevant encoders.Such can be tuned to avoid being too aggressive (and spinning the wheels).
Yes that would work well but my arduino is already running close to its max so it wont be able to handle more interrupts from encoders.
One consideration (depending on the motor type) is to configure it so that when you want to stop, you provide an effective short across the motor (you should have some current limit to set the braking force). That forces the motor to work as a generator and dump the power into the short. While it does not do much for very low speed movement, it can be very significant when moving fast. This will only work with a motor that can work as a generator though (which rules out AC motors - you handle them different). The most efficient system is what they call "regenerative braking" where your control system takes power from the motor acting as a generator and feeds it back into the batteries to partially recharge them. That is probably out of the scope of this, but shorting the motor with a load resistor will create significant braking at any speed.
Something else you might want to consider :
If you reverse the armature voltage the resultant armature current will be exceedingly high and this will have the tendency to demagnetize the field magnets. In a well designed motor this is an unlikely event but abusing a motor takes you outwith the design parameters.
That's a good point - although a modern neodymium magnet motor is pretty indestructible,
and I can't remember about ferrite magnets (a lot of cheap motors are ferrite).
In the old days alnico was used and its very easily demagnetized (it was the strongest
magnet of its day I think), so you couldn't disassemble a motor without a keeper for the
stator magnet slid in place as the armature was removed!
A partially demagnetized motor can become dangerous as it will run much faster unloaded,
possibly exploding (actually pretty unlikely, the copper windings tend to pull out and jam up the
works before the steel laminations fracture)
Series wound dc motors have the same failure mode and should never be powered up unloaded.
As I said in my post a while ago a good current regulator is needed and this will prevent most of the problems mentioned.
gpsmikey:
Solidly shorting the armature is a bad idea; put in enough resistance to limit the current to, say < 3 PU
MarkT:
The magic word PID by itself is not really the answer. You need at least 2 nested loops each of which can be, but is not necessarily a PID. These would be an outer speed control loop and an inner current control loop. The speed control can easily be PID but in my experience the "D" component is usually needed more when something else has not been done right.
The current regulators I've had the most experience with were an inner current rate control loop and a double integrating current control loop. There was a history behind these and I doubt that we have to get that sophisticated. Probably a plain old "P" regulator would work in most cases where we simply need to control the current for special situations such as braking.
PID is the best term to use to help newcomers google for more information though. For braking
position control is perhaps the best approach as velocity control won't guarantee the two wheels
turn the same amount and the thing stops straight.
Yes, I guess if a newcomer, unfamiliar with regulators sorted through the PID he or she would learn a lot and could then decide what to use. It's very big subject.
So will it work if I use a mosfet between my motor driver and motor to control the current via pwm so that if my robot is moving forward pwm is 255 but just before I put the motors in reverse I bring the pwm down(need to figure to what number) to limit the stall current?
Hmmm but that probably wont work because a N mosfet sinks a load and the polarity of the motor changes?
So please could you link to some current limiting pages.
If you have a motor driver then it already has some good MOSFETs. You don't need to add any more, unless it's a weird one that doesn't take PWM and then you will probably destroy it by trying to throttle its output.
If you don't have a motor driver, then you need to get one. Sparkfun, Pololu, Adafruit all make good ones for Arduinos.