Shop OBEX P1 Docs P2 Docs Learn Events
How to brake using DC motors — Parallax Forums

How to brake using DC motors

Kris CardoenKris Cardoen Posts: 46
edited 2012-12-18 11:15 in Robotics
Hi,

I'm building my robot with the parallax stingray kit, using the propeller board.
It is my first robot with DC motors and it seems to be more difficult then I suspected.

The biggest problem for me is how to stop the robot, without driving some extra distance. If one of my senors detects an object it needs to have a full stop.(the wheels always spin some more after the halt command)

In the past I have used smaller servo motors who do not have this issue. Is there a way to solve this?

Maybe instead of setting my pulse 1500, I could send a reverse pulse for a very short period? But this might be a bad idea for the motors

Any suggestions, or info would be much appreciated

Regards,
Kris

Comments

  • Martin_HMartin_H Posts: 4,051
    edited 2012-12-04 06:22
    To brake you want to short the two motor leads together. How you do this depends upon the motor driver you are using. For example my recent project is using a SN754410NE to control the motors. It uses three pins per motor and to brake I bring the ENA pin high and the other two pins low.

    I think sending a reverse pulse is a bad idea because it will use more power and be hard on the motors. You mention sending a 1500 pulse, are you using the HB-25?
  • Kris CardoenKris Cardoen Posts: 46
    edited 2012-12-04 06:28
    Yes I'm using 2 HB-25 controllers together with the motors from the stingray kit
  • NWCCTVNWCCTV Posts: 3,629
    edited 2012-12-04 06:50
    The HB-25's act almost like Servos. Pulseout 750 should be stopped.
  • ercoerco Posts: 20,256
    edited 2012-12-04 06:59
    Real continuous rotation servos have decent dynamic braking, I'm not sure about this motor/HB25 combo. Per Martin_H, shorting the motor leads together is the easy way to brake a DC motor. Adding a SPDT or DPDT relay (with nice beefy contacts) between each HB-25 and motor may be the most direct method. A quick blip of the relay disconnects power first, then shorts the motor leads together. That's what I did on the Scribbler below.

    A modification to a stock Scribbler for better odometry. It's pretty easy to see the difference when the robot stops with dynamic braking (green LED on) versus coasting to a stop with no braking (green LED off).
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-12-04 11:28
    in another thread someone had said you can use dynamic braking to regain battery power, can someone give some rough details on that? im writing my motor functions right now and am curious how this would work.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-12-04 12:02
    in another thread someone had said you can use dynamic braking to regain battery power, can someone give some rough details on that? im writing my motor functions right now and am curious how this would work.

    This depends entirely on the design of the h-bridge, and would have little to do with your code. Using the term loosely, dynamic braking (actually regenerative braking) uses the un-powered motor as a generator, feeding the current produced by the spinning motor back into the battery supply. If you short the motor leads all the current is dissipated as heat in the motor. This is dynamic braking, but not regenerative.
  • ercoerco Posts: 20,256
    edited 2012-12-04 14:06
    Talking about dynamic breaking while braking, this poor chap released the magic smoke from his sailboat trailer: http://www.designnews.com/author.asp?section_id=1368&doc_id=253173&cid=Newsletter+-+Sherlock+Ohms
  • Kris CardoenKris Cardoen Posts: 46
    edited 2012-12-18 11:15
    I don't know why, but I have placed a sort pause after the stop command of 100 ms and the problem seems fixed. Maybe gost in the machine? :-)
Sign In or Register to comment.