• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Couldn't turn on and off the logic MOSFET....

Status
Not open for further replies.

Styx

Active Member
Lets go back to your topology:

I appreciate that you have only One PIC PIN (the PWM pin) BUT in your figure you have 2 signals comming from the PIC.

PWM
You have a "PWM Pulse" and a "PIC Input" I take it by "PIC input" it is actually an output from the PIC?


So you do have at lest 2 pins available?

Right Now you are saying you are using "PIC Input" as some form of H-Bridge direction signal? and the "PWM Pulse" as your driving pulse?

PIC Input LOW
With "PIC Input" LOW The no matter what the "PWM Pulse" signal does no current will flow

PIC Input HIGH
With "PIC Input" HIGH there is a problem. With PWM Pulse LOW: There is no path for current to flow around the supply - ok BUT you have both top FET's ON!!! Zero-loop across the motor, that ok.

BUT you are also supplying gate voltage to the bottom FET's They are now ON!!!! the only saving grase is there is no close-path for the supply current to flow

However, When PWM Pulse is fired and thus turning on the lower FET you now are A 5 FET's on and effectivley a short across the supply

I fail to see how this is ever expected to work, upless I am missing soming



The only way this would work is IF each side "PIC Input" was their own signal, complement of each other which from what you are saying they dont.


Please If I am mis-understanding how you are driving this please correct me, it is my week off and I am just spending the week getting drunk watch DVD's. But I have seen no H-bridge topology where it is driven like that. You always need the complement PWM




Thus what I am saying is scrap the bottom FET, this now gives you TWO PIC output pins. feed one of these signals to the left input and the other to the right. The difference between the two signals is that they are the complement of each other.


50% duty => Net current = 0
>50% duty => Net current >0
<50% duty => Net current <0

Scrap your bottom FET and your circuit should work. Use mine and you have the benefit of dedicated gate-drive and tuneable shoot-though protection.
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Styx said:
The only way this would work is IF each side "PIC Input" was their own signal, complement of each other which from what you are saying they dont.
I can't say I've studied what he's said, but you are quite right in that the two PIC direction PIN's need to be complements of each other - that's commonly how simple H-bridges work (you can add extra logic to make it use a single pin). In order to use PWM though you need a third input (the enable input on an L298), this is connected to the hardware PWM output, with the other two connected as direction controls.

My PWM tutorial uses such a scheme, you can use it with either one or two direction pins - simply ignoring the second pin is your H-bridge doesn't require it.

Please If I am mis-understanding how you are driving this please correct me, it is my week off and I am just spending the week getting drunk watch DVD's. But I have seen no H-bridge topology where it is driven like that. You always need the complement PWM
Many of the simple discrete H-bridges, and integrated circuit ones too, work in this way.

Thus what I am saying is scrap the bottom FET, this now gives you TWO PIC output pins. feed one of these signals to the left input and the other to the right. The difference between the two signals is that they are the complement of each other.
Unfortunately this precludes the easy use of the hardware PWM.
 

Styx

Active Member
ok fair enough Nigel, not a PIC man myself (analogue and power)
But as it stands Fabbies implementation will not work and will burn something out

It might be simpler my way though. Feed one PWM to the LEFT and another to the right.

Effectively the way Fabbie is trying (and you have describe) using the PIC inputs (complements of each other for the left adn right) you are still effectively PWMing with them, just disconnecting the power at the bottom. This does have the benefit of the free-wheel path is now a zero-volt loop meaning current wont decay as fast as if it was around the supply (in the way I have)
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Styx said:
ok fair enough Nigel, not a PIc man myself (analogue and power)

So you take that PWM pin and pass it through an inverter and then feed the true PWM to the LEFT LEG and the complement to the RIGHT LEG.

Keep the Bottom FET and use it as a power-on disconnect rather than a PWM This will ensure that the drive is only active once you want it to be. Otherise you are running straight away
Doing that would reduce PWM resolution (by 50%), although that wouldn't be a problem with the 10 bit resolution available - it would give STOP at 50% duty cycle, and forwards and backwards above and below 50%.

That is also the extra logic I mentioned previously, allowing a single pin to control direction.
 

Styx

Active Member
Soz Nigel an edit
 

Styx

Active Member
Not bad. All I did was scale down one of my 20kW H-Bridges so might have missed that sneaky method. BUT present topology still has the gate-drive problem. That is why I would prefer my method - ensuring FET's are hard-driven
 

Styx

Active Member
Ahh I see what you mean by the loss in resolution (see I am not a PIC man)

For an 8bit PIC 2^8 = 258

My method has direction coded into it so effetively In one direction (LEft to right say) PWM at a certain duty will give a certain voltage


So 12/128 = 93.75mV per bit


Now for the other method that you explained

12/256 = 46.8mV per bit.

I'ts not to bad of a resolution. OK the resolution wil get worse with increase DC-link voltage BUt then you wouldn't drive it that way
 

Styx

Active Member
OK revision:

2^10 = 1024

My way => 12/512 = 23.44mV per bit output voltage


"your" way => 12/1024 =11.72mV per bit output voltage


still I dont see the halving of resolution as a problem.

Could you then explain one thing.

Unfortunately this precludes the easy use of the hardware PWM.
PWM is just a ON/OFF signal. A pic is a digital device dealing with ON and OFF so what is soo special abt the PWM pin, that another pic cannot do? If it is just sourcing current, nothing a BJT to boost that cant fix
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Styx said:
Unfortunately this precludes the easy use of the hardware PWM.
PWM is just a ON/OFF signal. A pic is a digital device dealing with ON and OFF so what is soo special abt the PWM pin, that another pic cannot do? If it is just sourcing current, nothing a BJT to boost that cant fix
The PWM pin is connected to specific hardware inside the PIC, you simply set a few registers and it runs without any further intervention. To alter it's output you simply change the value in one of the registers, it makes PWM so very easy!.

You can do PWM in software (and so use any pin), but it's fairly complicated to write, it doesn't run anywhere near as well as the hardware one does, and it takes lots of clock cycles - the PWM hardware takes no processor clock cycles at all!.

There are various PIC's which have two PWM outputs, this makes them VERY useful for motor control in a small robot or model.
 

Nigel Goodwin

Super Moderator
Most Helpful Member
samcheetah said:
i dont want to interrupt the ongoing discussion here but ive found a H-bridge circuit and its driver in the August 2004 issue of EPE. what are your comments about it
It's a crude little circuit, but fine for what it was intended. My biggest problem with it is driving the motor from the emitters, you lose so much battery voltage by doing that, and the transistors run hotter because you can't get enough base current into them.
 

samcheetah

New Member
okay Nigel ill note that

actually we did a simulation in our lab in which we had to build a H-bridge circuit and drive a motor with it and measure the voltages and the currents. the circuit that our teacher gave us was simillar to this one. the motor was being driven by the emitters. uptil that day i had only seen H-bridges in which the upper transistors were PNPs (or P channel MOSFETs) and the lower ones NPNs (or N channel MOSFETs) so the motor was driven by the collectors. i told the teacher that the configuration that you have given us is wrong and it should be the other way round. he said that it doesnt matter, you just have to make a path for the current to flow. could you you explain how the base current is low and the voltage drop is higher
 

TheOne

New Member
The selected C on the gates (the value of about 10nF was needed) of the N devices may solve the spike problem at the rising edge but there's still a problem on the falling edge.
 

Attachments

Styx

Active Member
As I said It must be tuned.

Increase R4 to about 7k
 

TheOne

New Member
Makes no difference even with a 20K. You most probably need a big cap at the top as well.
 

fabbie

New Member
Styx said:
I appreciate that you have only One PIC PIN (the PWM pin) BUT in your figure you have 2 signals comming from the PIC.

PWM
You have a "PWM Pulse" and a "PIC Input" I take it by "PIC input" it is actually an output from the PIC?


So you do have at lest 2 pins available?

Right Now you are saying you are using "PIC Input" as some form of H-Bridge direction signal? and the "PWM Pulse" as your driving pulse?

PIC Input LOW
With "PIC Input" LOW The no matter what the "PWM Pulse" signal does no current will flow

PIC Input HIGH
With "PIC Input" HIGH there is a problem. With PWM Pulse LOW: There is no path for current to flow around the supply - ok BUT you have both top FET's ON!!! Zero-loop across the motor, that ok.

BUT you are also supplying gate voltage to the bottom FET's They are now ON!!!! the only saving grase is there is no close-path for the supply current to flow

However, When PWM Pulse is fired and thus turning on the lower FET you now are A 5 FET's on and effectivley a short across the supply

I fail to see how this is ever expected to work, upless I am missing soming



.
Maybe i wasnt clear enough. Sorry about that. Just in case that you might have misunderstood, currently i have 3 pins altogther. 1 to control forward and one to control reverse ( I labelled them PIC input, i think u might have misunderstood, really sorry about that). The 3rd pin is the PWM pin to drive the motor.

By having 2 separate pins, i am able to complement the inputs to each other. Therfore, i dont think any shoot-throughs would happen.

This is what happened during my circuit testing.
I had my forward output HIGH and my REVERSE output LOW. I inputted a 100% duty cycle PWM signal into my LOWER FET. No overheating occurred.
Then when i changed my cycle to 50%. LOTS of distortion occurred and suddenly it starts to HEAT up real quick. However, having the reverse and forward output complementing each other, i dont think any shoot-through occurs.
Anyway, thanks for the great circuit. I definitely would change to yours. The ON OFF timing seems FAR better
 

TheOne

New Member
TheOne said:
Makes no difference even with a 20K. You most probably need a big cap at the top as well.
I found this strange, so after trying another FET model I re-run the simulations. This time the delay was enough with a much smaller value of C (100pF) and the 7k resistor suggested by Styx originally.

That specific model must have been flawed as it made no real difference if I had a 1k gate resistor or 100k!
 

Nigel Goodwin

Super Moderator
Most Helpful Member
samcheetah said:
actually we did a simulation in our lab in which we had to build a H-bridge circuit and drive a motor with it and measure the voltages and the currents. the circuit that our teacher gave us was simillar to this one. the motor was being driven by the emitters. uptil that day i had only seen H-bridges in which the upper transistors were PNPs (or P channel MOSFETs) and the lower ones NPNs (or N channel MOSFETs) so the motor was driven by the collectors. i told the teacher that the configuration that you have given us is wrong and it should be the other way round. he said that it doesnt matter, you just have to make a path for the current to flow. could you you explain how the base current is low and the voltage drop is higher
In the existing configuration (with the emitter the output), the emitter has to be 0.7V lower than the base - so you're losing at least 0.7V straightaway, plus losses in the transistor.

Then the base current, this is governed by ohms law, and is equal to voltage across the resistor divided by the value of the resistor. Because the base has to go high, you've got no voltage to work with - so the base can't go as high as 12V (again restricting the output voltage).

Assuming the base can get within 0.3V of the 12V rail, and the transistor has a gain of 100, and it's driving a motor requiring 1A. This gives a base current of 10mA. So to calculate the base resistor, 0.3/0.01, giving only a 30 ohm resistor feeding the base. The values used in the circuit shown will limit the output current considerably, resulting in a much lower voltage to the motor, and the transistors running MUCH hotter than they need to. There's also the obvious disadvantage of two 30 ohm resistors permanently across the power supply, wasting lots of your battery power! (one from each side of the H-bridge, either top or bottom, depending how it's switched).

My 'best case' calculation above would only supply a theoretical maximum of 10V from the 12V supply - but the values in the circuit would be far less under load.

With the transistors the other way round, things get MUCH better - for a start the voltage drop in that configuration is much less - 0.2V or 0.3V may well be possible, depending on the transistor. You've also got MUCH more voltage to play with for your base current, instead of the paltry 0.3V I suggested above, you've now got a whopping 11.3V instead! - so you don't need 30 ohm resistors anymore!.

If we assume a worst case of 0.5V drop across the transistors, we now have a reliable 11V for the motors, from the 12V supply, with the transistors turned hard ON, and running a great deal cooler.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top