Circuit for motor control opinion

Will this circuit work?

  • Yes!

    Votes: 1 100.0%
  • No!

    Votes: 0 0.0%

  • Total voters
    1

MaxHeadRoom

Joined Jul 18, 2013
30,654
So presumably when there is 5v present, there must be a PWM signal output if so it would be something in the programming.
I have the DM board, The Mechatronics version works fine, .!
Max.
 

ebeowulf17

Joined Aug 12, 2014
3,307
But I need to see if this one works, because its better designed with pull-up and pull-down resistors to remove leak currents.
I don't understand what benefit the pull-up and down resistors add, other than insuring that the motor won't be activated if the PIC loses power, leaving those pins floating.

I have essentially no experience with H bridges, and I'm interested in learning more about them, including any pitfalls like the leakage currents you mentioned. Where would those currents occur, and how do the resistors help?
 

Thread Starter

ArakelTheDragon

Joined Nov 18, 2016
1,366
The resistors pull the voltage up or down. If its a pull up resistor, the voltage up from the base of the transistor will be 5V, while down on the wire (1Ohm resistance) it will be close to 0V. If its a pull down resistor, the voltage down will be 5V, while the voltage up will be closer to "0" with the resistance of the wire.

A wire has resistance, even if its small. If there is current through that wire and you have connected the base of the transistor in the middle of the wire, you will get VCC(lets say 5V power supply) divided into 2. So the voltage on the base of the transistor should be "2.5V". However in real life a lot of things can affect this wire and you can never put the connection in the middle, this will lead to unpredictable behaviour and must be avoided. Therefore if you put a pull-up resistor, the voltage will be higher over the point, if you put a pull-down it will be higher under the point, avoiding the voltage to be divided as "2V" and "3V" only because of the wire.

I am not good at leakage currents and how they cause the transistor to switch faster and take the current down to ground or up to VCC. I am guessing that when there is a pull-down or pull-up resistor, the current stored in the transistor because of the capacitance will go to source or ground faster, but let someone more experienced explain please!
 

Thread Starter

ArakelTheDragon

Joined Nov 18, 2016
1,366
The voltage on the base of the transistor 2n2222A is "0V" and "5V" every "1ms" with a period of "2ms". I tried with a period of "20ms", duty cycle 50% again and when there is "0V" on the base of the transistor, the voltage over the coil is "5V", when the voltage on the base is "5V", the voltage over the coil is "12V". I am asking how is it possible that the voltage over the base is "0V" and we have "5V" over the coil? There is nothing wrong with the programming since this is an Orcad simulation with a digital stimulus (digital generator of square impulses), please check the "Orcad circuit" up. I have either made the stimulus with a too big period, connected something wrong or the circuit is wrong. I have how they show on a video that the circuit works, but I dont know why it doesnt works on Orcad. I have given both the original circuit and the Orcad one.
 

ebeowulf17

Joined Aug 12, 2014
3,307
The voltage on the base of the transistor 2n2222A is "0V" and "5V" every "1ms" with a period of "2ms". I tried with a period of "20ms", duty cycle 50% again and when there is "0V" on the base of the transistor, the voltage over the coil is "5V", when the voltage on the base is "5V", the voltage over the coil is "12V". I am asking how is it possible that the voltage over the base is "0V" and we have "5V" over the coil? There is nothing wrong with the programming since this is an Orcad simulation with a digital stimulus (digital generator of square impulses), please check the "Orcad circuit" up. I have either made the stimulus with a too big period, connected something wrong or the circuit is wrong. I have how they show on a video that the circuit works, but I dont know why it doesnt works on Orcad. I have given both the original circuit and the Orcad one.
Have you tried probing the other side of the coil? Is it also 5V? Or have you tried probing current through the coil?

Is it possible that leakage currents hold both ends of the coil at 5V, and there's no voltage across the coil, and therefore no current through the coil?
 

ebeowulf17

Joined Aug 12, 2014
3,307
A wire has resistance, even if its small. If there is current through that wire and you have connected the base of the transistor in the middle of the wire, you will get VCC(lets say 5V power supply) divided into 2. So the voltage on the base of the transistor should be "2.5V". However in real life a lot of things can affect this wire and you can never put the connection in the middle, this will lead to unpredictable behaviour and must be avoided. Therefore if you put a pull-up resistor, the voltage will be higher over the point, if you put a pull-down it will be higher under the point, avoiding the voltage to be divided as "2V" and "3V" only because of the wire.
What you've described here might make sense of you were analyzing a wire that was connected to VCC on one end and ground on the other, with no other connections in between. In that case there would be a gradient of voltages divided reasonably evenly across the wire. Of course, unless that wire had very high resistance, you'd also soon have melted wire or some other catastrophic failure, because that scenario describes a dead short from supply to ground.

In most scenarios, including your schematic, there aren't any dead shorts. Every path from supply to ground includes one or more sources of resistance/impedance which limit the current to reasonable levels. These resistances are where most of the voltage is dropped, and there is negligible voltage drop across the wire itself, because its resistance in tiny compared to all of the intentional sources of resistance in the circuit.

I understand how pull-up and pull-down resistors are typically used in other circuits, but I don't think they're doing what you think they're doing here. R3 and R9 make sense to me, because otherwise their corresponding MOSFET gates could be left floating when Q1 and Q2 are off. I don't think R4 and R6 serve any purpose at all, unless it's to protect the circuit in the event that the microcontroller (or other square wave source) is disconnected or powered down.
 

Thread Starter

ArakelTheDragon

Joined Nov 18, 2016
1,366
R4 and R6 are pull down resistors, when the microcontroller is first initialized, the pins are at their default state (input, output), if there are no pull down resistors, a false value may be recorded by the MCU, plus they increase the speed of the reacition for the transistor.

I checked the voltage over the coil and its the same on both ends, I didnt check for current, but any current should be removed through the diodes.
 

Jony130

Joined Feb 17, 2009
5,598
First of all, in Orcad you do not measure the voltage across the "motor". You are only measuring the voltage at the MOSFET's drains. Also the "motor" inductance looks way too low. For the simulation purposes try to add some resistance in series with the inductor or replace the inductor with the 12 Ohm's resistance.
And what motor type you will be using in the real world ?
 

ebeowulf17

Joined Aug 12, 2014
3,307
plus they increase the speed of the reacition for the transistor.
How would they do that? When the mcu is sending a high signal, they're pulling down (ever so slightly) against that, so clearly they're not helping there. When the mcu is sending a low signal, there's only 330ohms between the gate and ground. Do you really think adding a secondary ground path with 10k resistance on it is making much difference? Maybe I'm missing something, but I don't see it.
 
Top