Creating a H-Bridge drive motor control (Direction,speed)

Thread Starter

Sornpraram Xu

Joined Feb 24, 2019
21
I need to create a drive motor circuit (H-bridge)
This is my current circuit that I could think

It work by pushing the button on optoisolator and the motor will run clockwise when it is not pushed it stop
But what i want is pushing it motor run clockwise and when I release it motor run anti-clockwise.

Actually my target is when there are small light the motor turn clockwise and a lot amout of light the motor turn anti-clockwise.
and also I want to change it speed (PWM) too but the Direction is my Priority.
Thank you.
 

djsfantasi

Joined Apr 11, 2010
6,127
So, assuming that you can create a circuit with an LDR to output the supply voltage when lit and output ground when dark...
  1. Send the output of that circuit to Q1 and invert the signal for Q4.
  2. And send the output of that circuit to Q3 and the inverse to Q2
Draw out a truth table for this wiring and include a column for the motor direction (CW/CCW)

Let me know what you get.

As far as the speed, replace the connection to the motor +voltage with a PWM input.
 

Thread Starter

Sornpraram Xu

Joined Feb 24, 2019
21


This is my lastest update using Opto as a switch
now it can run in both CW and CWW by push the button
And so how can I use LDR in this circuit
When there are light it run CW (U1 send output) and when it go dark it run CWW (U2 send output)
 

crutschow

Joined Mar 14, 2008
24,317
Q1 and Q2 are upside down.
Connected as shown, the body diode conducts and you can't shut them off.
The P-MOSFET source needs to go to the positive voltage.
 

danadak

Joined Mar 10, 2018
3,884
You need to drive N & P in alternate legs together, except for braking where you
either drive N's in both legs or P's in both legs together.

Do not drive same time N & P in same leg, thats shorting the power supply to
ground, first you hear sizzling sound then boom if you do.



Ignore the R values shown, especially gate R values. I see that the left leg of bridge
does not have Gate Rs, mistake or were they trying to generate dead time ? In
any event the N mosfet on left side driven together with P MOSFET on right side,
and vice versa.

Regards, Dana.
 
Last edited:

Thread Starter

Sornpraram Xu

Joined Feb 24, 2019
21
So, assuming that you can create a circuit with an LDR to output the supply voltage when lit and output ground when dark...
  1. Send the output of that circuit to Q1 and invert the signal for Q4.
  2. And send the output of that circuit to Q3 and the inverse to Q2
Draw out a truth table for this wiring and include a column for the motor direction (CW/CCW)

Let me know what you get.

As far as the speed, replace the connection to the motor +voltage with a PWM input.
How to invert the signal ?
 

djsfantasi

Joined Apr 11, 2010
6,127
How to invert the signal ?
With a transistor and a couple of resistors. Or an N channel MOSFET. And a couple of resistors. A simple Google search for “NOT gate circuit” produces many results such as this.

I failed to not that you’ll have to delay one of the signal paths on both sides. Otherwise you have a direct short for an instant, known as “shootthrough”.
 
Last edited:

djsfantasi

Joined Apr 11, 2010
6,127
Another poster had the same issue with shootthrough. He posted his solution to the issue. I am linking to it here as an example, but with this caveat. I don’t know if it will work. It is provided just to stimulate you as to possible solutions.
 
Top