Hi I'm trying to get two L6388E high/low side driver chips to work as an H Bridge using the internal bootstrap driver. In the end I'd like to create a 3 phase inverter for a BLDC motor, but I'm trying to start simple.
As it stands now I can't get any significant signals to come out of the high/low side gate driver pins. With an oscilloscope I see all the proper signals appear on the LINs and HINs, but nothing on LVG or HVG. I've never worked with MOSFET drivers so I'm looking for any troubleshooting tips. Hopefully it's just something stupid I'm doing wrong.
Referring to the datasheet link below, my schematic is simply two Fig.1's with a 100 ohm resistor as the load (OUT1 to OUT2). For the sake of testing is it allowed to have a purely resistive load?
Logic - 5V
Vcc - 12V
H.V. - 12V - same supply as Vcc, is this a problem?
Arduino Uno - PWM/signal control
CD4011BE - quad NAND to act as driver/inverter for signals
STW34NB20 - power NMOS's
Depending on what PWM frequency I experiment with I've tried varying Cboot between 0.33uF and 1uF.
Because the internal bootstrap circuit is "driven synchrously with the low side driver" - pg.8 - this means than LIN must be high for Cboot to charge, right? So that means this high side PWM control scheme wouldn't work, right? Because during each off period of the PWM, LIN is still low so Cboot can't recharge before the next high period.
LIN1 - H
HIN1 - L
LIN2 - L
HIN2 - PWM
LIN1 - L
HIN1 - PWM
LIN2 - H
HIN2 - L
One way or another the method above doesn't work so I've tried controlling the whole H Bridge with one PWM signal as such:
LIN1 - PWM
HIN1 - ~PWM
LIN2 - ~PWM
HIN2 - PWM
Didn't work. What's the right control method?
Is there an even simpler circuit I can put together for testing each L6388E separately? Regardless of what's on Vboot, HVG and OUT, if I keep HIN low and apply pulses to LIN, shouldn't something appear on LVG?? Apparently not.
A few times when I messed around with the circuit the chips got kinda hot.. no melting/burning or anything so hopefully they're still good?
Any suggestions would be greatly appreciated.
Last things first - with Vcc=12V, HIN low, pulse applied to LIN, you should see the pulse
across a 100 ohm resistor between LVG and ground. If you don't, the chip is probably
fried. The bootstrap method requires the low side FET to be switched on and off to
pump up Cboot and make a voltage 12V or more above H.V. to drive the hi side FET.
It's OK to connect H.V. to Vcc if you are only switching 12V in the H bridge. But
applying the PWM to HIN and keeping LIN low won't produce the Vboot you need,
so you will see no HVG signal. Also, applying the same PWM signal to both HIN and
LIN causes the logic in the chip you are using to turn off both HVG and LVG. The
bootstrap method requires an approximate square wave drive, and is usually used in
switching power supplies. With a PWM, even if it is applied to LIN with HIN low, you
probably won't get enough bootstrap voltage when the PWM duty cycle is not
near 50% (as you correctly point out).
The solution to all this is to abandon the bootstrap method completely. Do not
use Cboot, but use an isolated DC-to-DC converter with its -out connected to OUT
and its +out connected to Vboot. The converter voltage should be 15V or 18V
(most FETs have a Vgs limit of 20V, and need at least 12V to turn on completely).
You will need a separate converter for each hi side, as the converter -outs are
connected to opposite sides of the H bridge. You might think that you need only a
low current from the converter to drive FET gates, but this is not the case. The
converter must charge the gate-to-source capacitance rapidly to avoid dissipating
too much power in the FET during the off to on transistion. The chip you are using
can drive up to 400 ma, and the maximum Cgs of the FET you are using is 3.3nF.
With a 400 ma drive, this gives a transistion time of about a microsecond, which
should be OK. So you need a DC-to-DC converter of about 15v times .4 amps,
or 6 watts. The logic will still lock out the drive when both HIN and LIN are
high, but you should see a pulse across a 100 ohm resistor between HVG and OUT
if you apply a pulse to HIN while LIN is low.
Thanks for the reply.
I'm not very familair with isolated DC-DC converter devices. Would this be the right kind to get?
I like the DC-DC converter idea, but it's extra parts. I'm convinced that I should at least be able to get the external bootstrap diode method to work (granted I have a chip that isn't fried).
If you care to take a look.. on pg.15 of this BLDC motor app note from Microchip is a schematic for a 3 phase driver. They use IR2101 chips, which I guess are basically like the L6388E without an internal bootstrap driver. Seeing as how the motor speed is controlled by the PWM duty cycle, I imagine the 3.3uF Cboot is charging properly even at higher duty cycles. Wish they would show what exactly the PWM0-5 signals look like.
Also, I found this brushed DC motor drive user manual from STM which uses the L6388. On pg.11 the control method is described and the schematic is on pg.14. I haven't looked at it much, but it seems the use of dual NPN-PNP transistors instead of NMOS's makes the internal bootstrap driver work. (in a different way?)
Microchip says its circuit is for a "brushless DC motor", but it is more like an AC
motor, with the "AC" being effected by switching DC currents into diffferent coils at
different times. The bootstrap circuit works here because each driver is switched
on and off at regular intervals, which charges and discharges the boot capacitor
to keep the high side voltage pumped up. I don't think you can get much speed
control out of this cicuit (the article says 25% from nominal is possible).
The STM circuit is for a true DC motor and an H bridge
driver. The NPN-PNP transistors provide the gate drive for the FETs in the H bridge.
What STM does not make clear is that the circuit will not work for 0% or 100%
duty cycle. This is because the side of the boot capacitor connected to OUT MUST
be switched at regular intervals between the + supply and ground. This point
goes to + when the high side driver is on, and discharges to ground through the motor
and opposite side low side driver when the high side is off. STM does not say how
close you can get to 0% or !00% before the circuit shuts off, but they do mention that
a fault condition occurs if the motor current is too high or too low, meaning the duty
cycle is too high or too low. So the bootstrap circuit is OK if you are willing to stay
far enough away from 0% or 100% duty cycle.
The DC-DC converter you ask about is fine, but converters of this power are somewhat
pricey. I should have pointed out that you can use a converter of considerably less
power if you connect a capacitor (say 10 microfarads) across its output. This will provide
the extra current pulse you need when the hi side FET turns on, and you need almost
no current at other times. But be careful - I have seen some low cost DC-DC converters
that self-destruct with too small a load, so check the specs.
Any isolated DC supply will work, not necessarily a DC-DC converter. For example,
if this is for non-portable equipment and 115vac is available, you can make a crude
but adequate isolated DC supply for under $6 in parts.
I have a bunch of info below. All I ask for is at least a yes/no for the numbered questions.
1. So does an isolated converter 'always' maintain its rated Vout between Out+ and Out- regardless of what voltage is present at Out-?
2. When I eventually get to driving a motor, do I have to be concerned about inductive kickback on the motor terminals affecting the voltage that appears at the high side gate via Vboot/Out+? Positive spikes could max out Vgs if Out+ is always, say 15V, above Vsource/Out-. Or will the NMOS body diode take care of it sufficiently?
3. Say I have an H bridge powered by Vsupply-to-ground that cycles between 'forward' and 'reverse' every second. For either high side NMOS, when it is on, Vsource is around Vsupply so Vboot should be about Vsupply+15V. When it is off, Vsource is around 0V.. so for the first instant that it comes on again Vboot should be about 15V.. but then the NMOS turns on and Vsource jumps to Vsupply and Vboot jumps to Vsupply+15V. Is this what goes on in a high side gate driver? It seems stupid(?) that you only need a smaller Vgate for a split second. If it weren't for the max Vgs limitation, you could just keep Vboot at Vsupply+15V... or I'm completely wrong about all of this.
I found a simple 555 timer voltage doubler charge pump in this IRF application note on pg.18 http://www.irf.com/technical-info/appnotes/an-978.pdf
Going off of what I mentioned in question 3 about a constant Vboot.. since my Vsupply is 12V and my max Vgs is +/-30V I have the pump running continuously (Vcc connected directly to 12V - no zener or 100K-100nF RC network), with Cboot referenced to ground instead of Vs.. and no bootstrap diode.
Other things I changed: used discharge pin on 555 instead of output feedback, higher frequency, 1A diodes instead of 1N4148, made Cboot large - 10uF.
With my new IRS2101 chips I have a working H bridge now (resistive load). I use the same charge pump for both Vboots. When a high side is on, Vboot sags from like 23V to 21V, but theres hardly any ripple because my PWM frequency is high enough. Last thing I tried was an analogWrite of 220 and everything was fine. So this circuit won't work perfectly for longer 'on' pulses, but it works well enough to turn the high side NMOS on. Seems to be turning on hard enough, but ~10V Vgs is on the lower end.
Last thing I was thinking of doing was using like a MC34063A boost converter to get a more stable 24V from my 12V supply. Cheaper than any isolated DC-DC converter, and it has higher output current.
4. For my application with Vsupply=Vcc=12V and Vgs max = +/-30V is there anything wrong with having a constant Vboot around 24V?
You mentioned doing a crude AC-DC supply. Under $6? Does that include a 60Hz transformer? Or is it like a switching supply? Would it provide a constant voltage relative to ground, or relative to Vs like the isolated converter.
1. Yes, provided you don't exceed the maximum output current rating of the converter.
2.No problem. The low side FET is still on, so the low side motor winding is held
near 0 volts. When the hi side FET turns off, the motor inductance tries to raise
the voltage at the hi side source, but the body diode conducts and keeps this
voltage (briefly) at the drain voltage. Make sure you have a large capacitor between the
drain supply and ground to absorb the current pulse. In any case, the driver tries
to maintain Vgs at 0, limited only by the Isink spec of the driver.
3. You are exactly right. H bridges are often run at hundreds of volts on the FET drains,
and no FET has a Vgs rating this large.
Good article at irs.com. The boost converter should also work. Both of these are
OK because you are using a fairly small drain voltage, so you don't exceed the Vgs
4. OK for reason given above.
The cheap power supply uses a 60 Hz transformer like Digikey 237-1032-ND ($4.54)
to make 12.6vac at 200 ma. Follow this with 4 diodes (any 1A will work fine) connected
as a full wave bridge rectifier, and a 1000uF capacitor across the bridge output
(Digikey 493-1065-ND, $0.63). The transformer provides the isolation. The voltage out
is unregulated and will vary with the line voltage, but this floating supply voltage only
needs to stay in the range of 15 to 20 (or 30) volts in your application.
Oops! I must have been asleep when I wrote the answer to question 2 (this seems
to happen more often recently). What actually happens when the hi side FET turns off
is the motor inductance tries to drive the hi side FET source negative, not positive.
So the body diode of the lo side driver (which is turned off) conducts and prevents
Vout from going much below ground. So there is still no problem.
There is a problem with keeping Vboot at 24v relative to ground. The L6388E
datasheet recommends no more than 17v between Vboot and Vout, and Vout
is near ground when the hi side FET is off, which gives 24v between Vboot and
Vout. I did a quick search for other half bridge drivers that allow a 24v difference,
but found none that recommended more than 20v. You may be stuck with using
2 floating supplies.
Oh yeah I forgot there's a minimum Vs rating relative to Vboot, thanks for pointing this out. Lucky for me though, I'm using IRS2101 drivers now which have a Vs,min of Vboot-25V http://www.irf.com/product-info/datasheets/data/irs2101pbf.pdf
So for the time being I guess my 555 charge pump will do.
So I ended up using a MC34063A to get 24V from 12V. Now I need to figure out how to get my motor started in open loop and then bring it up to a minimum speed where I can start detecting the BEMF signals. Here is the data sheet for the motor I'm using http://www.surplussales.com/motors/pdf/mot-000-0222.pdf I know from taking it apart that the rotor has 2 pole pairs. The only thing I know how to calculate is the commutation time based on a certain RPM. I am using the 6-step commutation control method to make programming easier.
period_motor = 60/(RPM * #pole pairs)
commutation time = period_motor/6 from this I calculate a value to load into the output compare register of whatever timer I'm using
1. Can I get the motor to spin with 6-step commutation even if the motor I'm using has sinusoidal BEMF?
All the app notes I've looked at that use 6-step commutation show waveform diagrams with trapezoidal BEMFs. I see a sine wave when I connect an oscilloscope probe across two of the motor terminals and spin it.
2. How do I calculate the PWM duty cycle based on RPM?
I've just assumed that they're directly proportional. Given that my power supply is right at 12V, RPM = PWM duty cycle * max_RPM(15,000)?
Here's an app note that has a pretty detailed description (pg.15-20) on open loop startup http://www.atmel.com/Images/doc8305.pdf I guess the bottom line is that you have to ramp up the PWM duty cycle while ramping down the commutation time to accelerate the motor. You can't just pick a certain duty cycle and commutation time and expect it to spin. I'm a little confused by the equations for pwm1 and pwm2 because they involve monitoring the motor current.
3. Do I need some sort of current feed back to make sure the right duty cycle is being applied during the ramp up?
4. How many amps should my power supply be able to handle? How does the PWM duty cycle affect the current that flows through the motor coils?
If the duty cycle is 50% that doesn't mean V+ is 6V, right? During a high pulse 12V is always connected across the motor terminals. So if the motor isn't moving and a duty cycle > 0 is being applied, that's bad news right? 12V would be connected across a resistance of 0.24 ohms..
If the motor is moving at say 250 RPM during startup the BEMF is only 0.305V(according to Ke=1.22V/KRPM). Assuming trapezoidal BEMF (BEMF_A = 0.305V, BEMF_B = -0.305V, BEMF_C is ramping up or down because it's not being driven) a current of (12V - (6V+0.305V))/0.12 ohms = 47.46A would be flowing? Or does the fact that the duty cycle is only 250RPM/15000RPM = 1.67% limit how quickly the current can rise? Think I’m just confused in general how PWMing the voltage across a load controls the current.
I was unable to reply sooner because I had to re-install the operating
system on my computer (hard drive problems). I see you are now using
a 3-phase driver instead of the H bridge we discussed earlier. The PWM
signals must be commutated through the high side drivers and at the same
time through the low side drivers to produce the coil drives U, V, W as
shown in figure 3 of the Atmel paper. Let me try to answer your questions.
1. The back EMF (BEMF) on each coil only appears when it is not being
driven and the other two coils are driven. If you spin the motor shaft manually
and look at the coil voltage with a 'scope, you will see a sine wave induced
by the remanent magnetism in the rotor. The Atmel paper says you will
get a voltage roughly linear with time on the open coil while it is transitioning
between its high and low driven voltage, and I think that is probably right.
2. The current through the motor sets the load that the motor can drive. For
your motor the torque constant is 1.65 oz-in per amp. Spinning the motor
faster produces a higher back EMF in the motor windings, so the voltage
applied to the motor must be increased to keep the same current and torque.
The back EMF is proportional to the RPM, and the effective voltage applied
to the motor is proportional to the PWM duty cycle, so it appears that the
RPM will increase linearly with the duty cycle, for a given load. But doubling
the load, for example, means you have to double the PWM duty cycle to keep the
same RPM. Your motor spec says it can produce 25 in-oz continuously at
15,000 RPM and a 12V supply. The 12V supply in your case means a 100%
duty cycle on the PWM. If your load is 12.5 in-oz, I would expect that you
would need an effective 6V supply, meaning 50% PWM duty cycle, to get
3. The Atmel paper does not suggest a current feedback during ramp-up, and
that would probably be difficult to implement. Instead, the Atmel paper suggests
finding the correct ramp-up parameters experimentally ("tuning").
4. The motor spec gives a limit of 25 in-oz continuously and 1.65 in-oz per amp,
so you will need 25/1.65=15.2 amps for continuous operation, and somewhat more
if the torque limit is exceeded momentarily. Yes, it is very bad news if a significant
effective voltage is applied while the motor is stalled. The motor current is not
directly related to the BEMF, but is controlled by the effective voltage, the resistance
and inductance of the windings, and the commutation frequency. A motor winding
does not burn up when driven by pulses because the current is limited by the inductance.
Applying a DC voltage V to a winding with resistance R and inductance L causes the
current to rise according to I=V/R(1-exp(-Rt/L)) for I in amps, V in volts, R in ohms,
L in henries and t in seconds. For your motor, L/R=.11 mH/.12 ohms=917 microseconds.
This means that a step pulse applied for this time with a 12V supply brings the
current up to 63% times 100 amps= 63 amps, which will quickly destroy the motor.
So you need to keep the step time shorter, say no more than 400 microseconds.
Then the PWM period must be no more than 1/10 of this, according to the Atmel paper,
which doesn't give a lot of room for duty cycle resolution.
On further consideration, I think part of what I wrote yesterday is not right.
The motor spec says the DC resistance is .12 ohms, but does not say
if this is for each of the 3 windings, or across any pair of leads (2 windings
in series), I took it to mean the latter. The maximum allowable continuous
current when running is 15 amps, but each winding averages 10 amps in
this condition, so I will use 10 amps as the maximum current to avoid motor
burn-out in a stalled condition.
To start up the motor, the commutation rate must be very low, perhaps
only 1 Hz, or else the rotating magnetic field will get too far ahead of the rotor.
For very low RPM the winding inductance has no effect on
limiting the current, only the winding resistance does this. So to avoid
motor burn-out on startup, the average applied voltage must not exceed
10 amps times .12 ohms, or 1.2 volts. This corresponds to a 10% PWM
duty cycle with a 12V supply. As the motor starts to spin up, the commutation
rate must be increased to avoid holding the rotor back, the back EMF builds
up and the duty cycle must be increased to increase the average applied
voltage to buck the back EMF if the same current is to be maintained. It
appears that you just have to try faster and faster increases in the
commutation rate with a matching increase in the duty cycle
until the acceleration drops off, indicating that the rotor can't keep up with
the commutation rate. When you reach the desired RPM, the duty cycle is
held at its present value.
The motor spec gives a back EMF of 1.22 volts per 1000 RPM, or .0732
volts per Hz, so this tells you that the PWM duty cycle should be
increased by 7.32/12=0.61 per cent for each 1 Hz increase in the
commutation rate as the motor spins up.
I hope my confusion was not too contagious!
Thanks for all the useful info. No major confusion yet
1. What I was trying to get at in my first question is how there are two kinds of stator windings - pg.2 paragraph 4 explains
the difference http://www.magnelab.com/uploads/4c51d9ba6fe5a.pdf Also, this EE Times article explains the same thing http://www.eetimes.com/design/industrial-control/4014259/Brushless-DC-BLDC-Motor-Fundamentals Anyways, how can I tell what shape BEMF my motor has? Even if it is does have a sinusoidal BEMF, will the 6-step commutation control method work?
2. Not quite sure what you meant by 'PWM period should be no more than 1/10 of this.' The max motor frequency (#pole pairs=2) is (15000*2)/60 = 500Hz, so the min PWM frequency should be 10*500Hz = 5KHz. Does that sound right?
3. I measured the resistance across two terminals with my crappy ohmmeter and it keeps toggling between 0.4 and 0.5. Taking it apart again I see there are 6 stator windings --> 2 windings/phase --> 4 windings between two terminals, so the 0.12 ohm spec probably refers to a single winding. I guess I'll say Req = 0.48 ohms and Leq = 0.44mH? The time constant won't change, but the max current will.
4. So does the PWM period limit how high the current can rise - how much torque the motor can output? If my PWM is 5KHz at say 90%, the high PWM pulse is 180us. Plugging it into the RL circuit equation (with V/R=12/0.48=25A) I only get 4.46A. And with some BEMF it's obviously going to be less than that. At first I just want to start the motor without a load, so I don't really care about torque, but if 5KHz is the supposed min PWM frequency how am I going to be able to attach any kind of load? Maybe 10x the max motor frequency is a bit extreme? Searching around a bit I found some sources say 5x is ok.
5. Without a load is it necessary to maintain constant torque during startup? Can I just hold the PWM at some value low enough not to exceed the max current and high enough to overcome the BEMF at whatever end speed? The angular acceleration won't be constant.. idk, maybe this won't work.
6. When the high side switch is opened, Req becomes super large which makes the time constant huge so the current thru the motor drops really fast - no need to worry about having a long enough off PWM pulse, right?
7. Not a big deal, but with 2 pole pairs, 1000RPM = motor frequency of 33.33Hz, so it should be 0.0366 V/Hz. For an 8-bit PWM the max resolution is
12*(1/255)=0.04706V --> 1.286Hz/step --> 38.57RPM/step. I assume this might be too steep of a speed ramp? I'll have to use the only 16-bit timer on the Arduino, but I kinda need it for measuring time between BEMF zero-crossings. Anyways, that's a different issue.
Here's my current understanding:
1. The Atmel paper says the BEMF is linear, but it should't much matter if it takes some other path between the hi and lo driven states. In any case, it will probably be "monotonic", meaning it won't reverse direction between the two points. So part of a sine wave that is monotonic should be ok.
2. Your calculation of 500 Hz is right (what's a factor of 10 between friends?), but this is for 1 revolution, and the commutation goes through 6 phases during a revolution. You need to get in several periods for each phase, so I would recommend a minimum PWM frequency of 5 kHz, and more is better.
3. The R to L ratio only matters for the highest frequency components of the driving signals. I don't expect that to be an issue. But you are right, the resistance is critical to getting the parameters right. You can get a better idea of R by connecting a 1.5v battery across the leads, and measuring both the voltage and the current (at the same time), then apply Ohm's law.
4. The PWM period should not matter if it is high enough, but the PWM duty cycle sets the average voltage applied to the motor, and this average minus the BEMF is what the windings see, setting the current to
(Vave-BEMF)/R. The current sets the torque. I think the static inductance does not matter, as the effective inductance clearly must drop to get enough current into the windings. The situation is something like a transformer; if you short the secondary of a transformer, the primary current is not limited by the primary's inductance. The "mutual inductance" is what counts in addition to the static inductance, and in the motor the mutual inductance between the rotor and stator effectively lowers the stator inductance. As for load, a larger load will take longer to spin up, so you either need to set the rate of rise of the commutation frequency for the maximum load (and slowest spin-up), or change the rate of commutation frequency rise depending on the load (so a small load can spin up faster).
5. sure, you can keep the PWM duty cycle low during spin-up until the RPM reaches the final value for that duty cycle and load, but you don't get as fast a spin-up as you would by increasing the duty cycle.
6. The time constant shouldn't matter, but be sure to put reversed-biased diodes between each stator lead and the + supply and ground to suppress any inductive spike.
7. What you said.