Author Topic: Reversing a DC motor using H bridge  (Read 1688 times)

0 Members and 1 Guest are viewing this topic.

Offline engineheatTopic starter

  • Frequent Contributor
  • **
  • Posts: 267
  • Country: us
Reversing a DC motor using H bridge
« on: July 11, 2019, 08:11:14 pm »
Hi,

I'd like to control a hobby DC motor with an Arduino (PWM) with a H-bridge. I'd like to have the motor spin in one direction for a few seconds (up to a max speed), and then reverse direction (up to a max speed), and so on...

Would it damage anything if the current is reversed while the motor is at a high RPM? I heard this causes a back voltage spike which can cause damage to the power supply, and so forth...

If so, how does a driver like L298N work? For size considerations I'd rather use a single H bridge IC rather than a complete driver like the L298N.
Thanks
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: Reversing a DC motor using H bridge
« Reply #1 on: July 12, 2019, 06:56:22 am »
If the circuit is correct, reversing motor direction should not harm the circuit. The motor on the other hand is a different matter. Suddenly changing direction is not going to be good on the mechanics.

Why can you not stop the motor first before changing direction?

Stopping is acutually easy with a H bridge, just turn off any transistors in the upper part of the H and tur on both transistor in the bottom of the H. This is shorting the motor to 0V.

You are partially correct about back emf. Inductors, like the coils in the motor, will cause a back voltage when the current flow through them stops. In a motor, this happens when the comutator switches to the next coil in the motor. Any switching circuit for coils should always have fly back diodes to protect the transistor.

If the PSU cannot handle the voltage spikes, you need a better psu. The regulator on the Arduino may not have a diode across the Voltage regulator, a diode across the Vreg input to output protects the Vreg output from injecting a voltage to the output. The diode must be in the right direction, blocks voltage from the Vreg input to output.

Do not kniw about L298N.

 

Offline pwlps

  • Frequent Contributor
  • **
  • Posts: 372
  • Country: fr
Re: Reversing a DC motor using H bridge
« Reply #2 on: July 12, 2019, 10:42:13 am »
A better way is to insert an inductor between H bridge and motor to smooth out the speed control PWM in driving mode, and use as boost inductor in braking mode, so you have regenerative braking.

If the PWM is fast enough there is no need even to add an inductor (the motor inductance may be enough). The general condition for efficient regenerative braking is to keep the PWM period much smaller than the L/R time constant.   There is a nice explanation here:

https://electronics.stackexchange.com/questions/56186/how-can-i-implement-regenerative-braking-of-a-dc-motor
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19528
  • Country: gb
  • 0999
Re: Reversing a DC motor using H bridge
« Reply #3 on: July 12, 2019, 09:27:27 pm »
The problem is what to do with the energy when the motor is reversing?

If the motor is powered from a rechargeable battery, then it's fairly straightforward to simply use the motor as a dynamo and charge the battery.

If the motor is powered from a non-rechargeable battery or the mains, then it's a bit more tricky. The energy could be stored in a capacitor, then used later to accelerate the motor, but the capacitor will have to be huge, if the motor's load has a lot of inertial Alternatively the energy could be dissipated in a resistor.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf