OpenServo.com Forum Index OpenServo.com
Discussion of the OpenServo project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Simplified H-Bridge

 
Post new topic   Reply to topic    OpenServo.com Forum Index -> Hardware
View previous topic :: View next topic  
Author Message
clcheung



Joined: 14 Apr 2008
Posts: 27

PostPosted: Thu Apr 17, 2008 1:09 pm    Post subject: Simplified H-Bridge Reply with quote

Hi

I am trying to implement openservo for MG995. MG995 is quite small, only has available space of 15mm x 19mm. I find it difficult to put the whole v3 H-bridge to one side of the pcb.

I am considering to remove the 2N7002 and use fewer resistors. If 2N7002 is removed, the pwm.c need to be changed so that PWM output signals are reversed (high low and duty cycle time reversed).

The circuit becomes:
http://hk.myblog.yahoo.com/jw!afd6dGGRHBRkp2laqwk198fg/photo?pid=154&fid=2

I would like to ask for your opinion if this design is ok or not. I have made some tests and it seems it works as normal as the original v3 circuit.


Or, the second thought is to connect the upper H-bridge with Enable pin (high low reverse), and connect the lower H-bridge with PWM (no need to reverse). I have not test this one as I am not sure about the braking feature.

Which one will be better ? Any suggestions ?

Thanks a lot.
Back to top
View user's profile Send private message
Toortanga



Joined: 16 Mar 2008
Posts: 14

PostPosted: Thu Apr 17, 2008 9:13 pm    Post subject: Reply with quote

THe 2n7002 and pull-up resistor is required as a level shifter for the high-side PMOSs. They are neede because the microcontroller cannot provide a high enough voltage directly with it's pins to shut the PMOS off (since their source is connected to a voltage supply higher than the microcontroller's power supply (which determines the output voltage of the pins). The servo voltage will always have to be a bit higher than the microcontroller voltage since the linear regulator needs has a non-zero dropout voltage (about 1.2V or so).

When you consider that the uC doesn't output exactly it's power supply at high (as much as 1V lower than it's power supply), this means that the worst case scenario is that you apply a voltage that is 1.2V+1V lower than source voltage (the main servo voltage) when you want to turn it off. The ideal scenario is to apply a gate voltage equal to the source voltage to turn off the PMOS.

If the the source-gate voltage difference that is required to turn the PMOS on is 3.3V you are in trouble if you are only applying a 2.2V difference to turn it off. If 5V is requires you are slightly better off. Either way, the PMOS will not turn off completely. This is very borderline and too close for my comfort, but for your purposes the MOSFET might "turn off enough" to have it work.

Figure 12 will help you decide how much the PMOS will turn on by for a given gate voltage.
http://www.irf.com/product-info/datasheets/data/irf7307.pdf

It seems to say that with a 2.2V source-gate voltage difference it will still conduct 300mA if the servo is running at 5-7V (this 300mA is basically being shorted circuited straight across the power supply through the NMOS and PMOS leg on the left or right). Did you measure the current going through the "off" PMOS during your tests? Or did you just look to see if the motor was running?

What I have said applies to simply turning the PMOS on and off. As a result it always applies, regardless of whether you are using PMOS or NMOS for PWM or enable. It doesn't matter- you face the same problem either way. THe only difference of choosing PMOS or NMOS to PWM Is the difference in switching losses between the two (and which gate circuit you are using to drive them since higher gate drive means faster, more efficient switching).
Back to top
View user's profile Send private message Send e-mail
clcheung



Joined: 14 Apr 2008
Posts: 27

PostPosted: Fri Apr 18, 2008 6:58 am    Post subject: Reply with quote

Hi Toortanga

Thank you very much for your detail explanation of the theory on the H-bridge design. I am much clear now. I've only conducted my experiment on 9450N, which is far away from 7307. Although I can understand your explanation, I still don't know how to read Fig 12 on the datasheet. It seems Fig 12-14 does not match your description ?

Since I still want to move on, I am considering if there is any "dirty" ways to do this. I am not good at electronic so please correct me on the following.

One simple solution come to my mind is to use an additional voltage line or share the same voltage line with the motor voltage to avoid using a voltage regulator. This still have a limitation on the max motor voltage to be used. But currently I believe 5-6V will be enough for my little project.

If
Motor Voltage = 6V, MCU voltage = 5V => Vgs when PWM pull high <= 2V
Motor Voltage = 5V, MCU voltage = 5V => Vgs when PWM pull high <= 1V
Is this correct ?


I've also tried converting the non-duty PWM output pin as input pin and turn-off the internal pull-up. This will let the PWM output pin to move to 5V even when MCU voltage is less than 5V. I am not sure if it will do any harm to the MCU when the motor voltage is higher than 5V. However, the experiment seems working and the gate voltage is pulled to 5V.

So using this trick, the upper bridge will have a Vgs between 0-1 volt when idle, depending on the motor voltage of 5-6 volt. What do you think about this solution ? Harmful ?


Finally, since I am not able to understand well about the MOSFET datasheet, would you mind briefly explaining the reason to use IRF7307 in v3, from IRF7309 ?

Thank you very much for your help !
Back to top
View user's profile Send private message
Toortanga



Joined: 16 Mar 2008
Posts: 14

PostPosted: Fri Apr 18, 2008 12:41 pm    Post subject: Reply with quote

The 7307 and 7309 are very similar. But if you look closely, the 7307 switches at lower gate voltages. The 7307 has 0.05ohms at 4.5V at the Vgs, while the 7309 has 0.08ohms at the same Vgs. THe 7309 needs Vgs = 10V to get 0.05ohms.

You read Figure 12 like this...

First, choose the curve that has the same Vgs that you are applying across the gate-source. THis is the voltage you are using to switch the MOSFET. THen find where this curve intersects with the voltage that will appear across it's drain-source (the main terminals that let current flow through it) along x-axis. At the point they intersect, you can read the current that will flow through it on the y-axis.

It might cause damage to allow the MCU pin to exceed 5V. You might want to add a second resistor and zener diode in to clamp it, but then that's just wasting more space than using a 2N7002 and getting less performance.

You might still need a regulator even if the servo runs off the same voltage the rest of the servo because the motor is noisy, and the microcontroller might need a well regulated supply. A stable supply is more important than an "accurate" supply since the MCU has a voltage range it can handle. If you run off the servo from 3.3-5V without a regulator, it might work IF you can keep the power supply clean and stable (with capacitors?) for the MCU, and use that pull-up method with the MCU pins. But, that might take more capacitors than just doing it normally, which might take up too much space again.
Back to top
View user's profile Send private message Send e-mail
clcheung



Joined: 14 Apr 2008
Posts: 27

PostPosted: Fri Apr 18, 2008 2:08 pm    Post subject: Reply with quote

Hi Toortanga

On figure 12, for example, if say the source is at 6V, MCU voltage is 4.8V after regulated, the PWM out pin is only 4V. So the Vgs is -2.0V.
Then I pick the second last line. The drain-to-source voltage is -6V, so on the x-axis it is near the mid of right hand side. I cut it up with the second last curve, which the drain-to-source current is about 3 A, not 300 mA !?
What is wrong with my understanding ?

If 7309 switches at higher gate voltage, would it be a benefit for my need in this case ?

So my dirty trick may damage the MCU if motor voltage is above 5V. It looks like adding another voltage line to the existing four is the simplest way for a quick fix.

Thank you very much !
Back to top
View user's profile Send private message
Toortanga



Joined: 16 Mar 2008
Posts: 14

PostPosted: Sat Apr 19, 2008 7:21 am    Post subject: Reply with quote

Your logic is correct, you are just reading the graph's Y-axis wrong. It takes 10 lines on the x-axis to make 1 Amp, so each line horizontal represents 100mA, not 1A (look at the Y-axis labels).

The 7309 switches at a higher voltage, so it would be advantageous for noise immunity (and MOSFET performance, since they are not so restricted by the gate drive voltage- you have to sacrifice something to get the 7307's low gate drive voltage after all), but none of this matters if your circuit can't provide that gate drive voltage in the first place.
Back to top
View user's profile Send private message Send e-mail
clcheung



Joined: 14 Apr 2008
Posts: 27

PostPosted: Sat Apr 19, 2008 11:06 am    Post subject: Reply with quote

Hi Toortanga

The X and Y axis scale looks like a log scale to me, I still read it as 3A Embarassed .

Although I still confused on this datasheet reading, you have helped me a lot to understand the design. Thanks a lot.
Back to top
View user's profile Send private message
Toortanga



Joined: 16 Mar 2008
Posts: 14

PostPosted: Sat Apr 19, 2008 6:05 pm    Post subject: Reply with quote

It's a log scale, that's why the lines are unevenly spaced a part, but the distance between each line still represents a constant increment. YOu are assuming that the distance between each line represents 1A without actually looking at the the how 1A is labelled every 10 lines on the Y-axis.
Back to top
View user's profile Send private message Send e-mail
hyperkinetic



Joined: 14 Apr 2008
Posts: 3

PostPosted: Tue Aug 12, 2008 6:33 pm    Post subject: 2n7002 Question Reply with quote

I found this old thread and had a follow on question.

Why isn't a 2n7002 similarly needed on the low side N mosfets which are controlled by the enable pins from the uC? For all of the reasons that Toortanga explained wouldn't it also be needed?

I'm still struggling to understand Toortanga's reading of figure 12 in the data sheet - it still looks like 3 amps to me too. Once you hit 1Amp don't the lines then each mean 1amp?

Bigger question... I'd like to use this same basic circuit to control a larger motor. I would like to replace the irf7307's with discrete mosfet's - still driven by the 2n7002's - is there any reason that shouldn't work?

Thanks,
hk
Back to top
View user's profile Send private message Yahoo Messenger
clcheung



Joined: 14 Apr 2008
Posts: 27

PostPosted: Wed Aug 13, 2008 2:45 am    Post subject: Reply with quote

With my limited understanding, I believe the 2n7002 is needed only when the MCU's output pin voltage cannot completely turn on/off the mosfet.
If your N side mosfet requires a voltage > MCU supply voltage to turn on completely, you will need the 2n7002.

For the P side, since the P side's voltage follows the motor voltage, it is certainly need the 2n7002.

I'm also still struggling to understand Toortanga's reading !! Wink
Back to top
View user's profile Send private message
hyperkinetic



Joined: 14 Apr 2008
Posts: 3

PostPosted: Wed Aug 13, 2008 5:38 am    Post subject: Reply with quote

Ok thanks for the response.

So I think in my case since I'll likely be using a low side fet with a higher Ids I'll also therefore need a higher Vgs to get full turn-on (saturation region) so I'm assuming that will require a charge pump amp (2n7002) on the low side too.

Reading these datasheets is still a bit of Swahili for me.

hk
Back to top
View user's profile Send private message Yahoo Messenger
markjay50



Joined: 26 Jul 2010
Posts: 2

PostPosted: Mon Jul 26, 2010 8:14 am    Post subject: Reply with quote

It's a log scale, that's why the lines are unevenly spaced a part, but the distance between each line still represents a constant increment. YOu are assuming that the distance between each line represents 1A without actually looking at the the how 1A is labelled every 10 lines on the Y-axis. thanksssss!!!!!!
_________________
Make Money Online
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenServo.com Forum Index -> Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group