H-bridges and IN1+IN2 vs. PWM+DIR, or, is BRAKE mode broken?

I know enough of electronics to be dangerous with a screwdriver. My brother Bruce is experimenting with motor control using one of the New Micros TPIC0108B-based NMIH-0030 H-bridge boards, and this past weekend I was attempting to help him work through the datasheet. Along the way I noticed an oddity in the '0030's input -- it appeared that they were simply re-labelling the TPIC's IN1/IN2 inputs as DIR/PWM.

Is this a "reasonable" / "good" / "acceptable" thing to do?

Here's why it doesn't feel right (I'm hoping someone can point out a big hole in my reasoning so I can stop worrying about it):

The TI TPIC0108B data sheet has the following Function Table for IN1+IN2:

-----------------------+--------------------------------- IN1 IN2 OUT1 OUT2 | MODE --- --- ---- ---- | ---- 0 0 Hi-Z Hi-Z | Quiescent supply current mode 0 1 LS HS | Motor turns clockwise 1 0 HS LS | Motor turns counter-clockwise 1 1 HS HS | Brake, both HSDs turned on hard -----------------------+--------------------------------- HSD = high side drivers LSD = low side drivers Hi-Z = high impedance

So... when you want to drive FORWARD (CW), you hold IN1 LOW and put a PWM pulse in IN2. This alternates the motor connections between full-on-CW and Hi-Z (disconnected). So far, so good.

But when you try to do the same thing with REVERSE (CCW), and you hold IN2 LOW and toggle IN1 with your PWM pulse, you're switching the motor connections between full-on-CCW and... BRAKE ???

I didn't hit this previously because my current project uses an L298N -- I set the inputs to control direction and then toggle the Enable line with my PWM.

I feel like I _have_ to be overlooking something somewhere. After all, there are lots of H-bridges out there, and at least _some_ of them seem to be using this approach without letting their magic smoke escape.

(It was a bad weekend. I'm even more mystified how a chip rated with Rds(on) of 0.300ohm per driver -- so 0.600ohm for the bridge -- can handle 3A without exceeding its maximum Continuous power dissipation of 1.29W. When I do the obvious I*I*R on my calculator it gives me 3*3*0.6 = 5.4W. Aaaagh!)

No rush... if it works, it works, and if it doesn't I'll hear about it soon enough (;-).

Frank McKenney

-- "We are not creatures of circumstance; we are creators of circumstance." -- Benjamin Disraeli

-- Frank McKenney, McKenney Associates Richmond, Virginia / (804) 320-4887 Munged E-mail: frank uscore mckenney ayut minds pring dawt cahm (y'all)

Reply to
Frnak McKenney
Loading thread data ...

Peak rated power could be greater than continuous rated perhaps?

Putting the PWM signal onto the enable on a 298 presumably gives you torque rather than speed control?

best regards

Robin G Hewitt

Reply to
Robin G Hewitt

You are overlooking something in the truth table. You are right about IN1 LOW and IN2 PWMed. But look again at IN2 LOW and IN1 PWMed. It's the same thing. IN2 LOW and IN1 LOW is Hi-Z and IN2 LOW and IN1 HI is motor CCW. You never have IN1 and IN2 both HI. I don't understand why they don't build an inverter into these chips and have IN1 and /IN2 bar so that you could do locked anti-phase without an external inverter.

The chip will exceed its maximum temperature dissipating that power. The spec is telling you what YOU need to do so that the chip doesn't burn up. You need to provide adequate heatsinking so that enough heat is dissipated that the chip doesn't get too hot.

Looks like an interesting chip. The only thing I don't like is the maximum recommended switching frequency of 2KHz (slow switching times which might increase power dissipation). If these are issues, you might consider the L6203 family or L6205 which switch much faster.

Mitch

Frnak McKenney wrote:

Reply to
Mitch Berkson

I have driven this chip to 10khz.

The notion of not having the inverter is that this is for an open loop system, or closed velocity system. Locked anti-phase is a bit "strenuous".

Reply to
Blueeyedpop

If you want to drive IN1 with DIR and IN2 with PWM, you would need to invert the PWM signal for reverse (usually done by doing a negative in firmware). Consider slow forward to slow reverse. forward: IN1 - low, and low duty cycle PWM on IN2. reverse: IN1 - high, high duty cycle PWM on IN2 (the short low pulse does the reverse).

PWM through an inductive load results in the motor seeing an average current (similar to how a capacitor filters a voltage) - the PWM frequency has to be high relative to the LR time constant. So the motor (most motors) wouldn't respond fast enough to move and brake every half millisecond ;-). When the TPIC says HI-Z, it isn't really Hi-Z, the current in the motor has to continue flowing and it will either flow through the HS drivers (in Brake mode) or diodes inherent in the HSD structure (recirculation mode).

I hope you will stop worrying - at least using it this way shouldn't release the magic smoke...

Kevin

Reply to
Kevin Gomez

With a worst case driver turn-on time of 100 us, if you want a switching frequency of 10KHz, it seems like a different chip would be better.

What do you mean by "strenuous"? Locked anti-phase is used all the time in closed loop velocity and position feedback systems.

Also even if the inverter were present, it wouldn't preclude driving it with an inverted control signal to reclaim whatever it is that was the benefit of having both inputs logically the same.

Mitch Berkson

Reply to
Mitch Berkson

Robin,

Thanks for replying.

One would expect so. Which is why I was surprised that my 5.4W based on the TPIC0108B's continuous current rating was four times what the data sheet gave for continuous power dissipation.

Sorry, I think you lost me here. The L298's inputs (IN1, IN2, and ENABLE) are all digital. The ST Microelectronics data sheet's block diagram shows all three as being buffered by gates before hitting the "drivers", so it feels like (DIR=IN1+IN2, PWM=ENABLE) would have the same effect on a load (motor) as (PWM+DIR=IN1+IN2, ENABLE=HIGH). Am I missing something in all this?

Frank McKenney, McKenney Associates Richmond, Virginia / (804) 320-4887 Munged E-mail: frank uscore mckenney ayut minds pring dawt cahm (y'all)

Reply to
Frnak McKenney

Aaaaauuuuggggghhh! Excuse me a second while I beat my text editor to death with a wet noodle.

Mitch, thanks for pointing out my (completely unintentional) error. If you and everyone else will hold on a minute, I'll try to clear things up a bit.

The TPIC, as described in the data sheet, makes sense. Using IN1+IN2 for DIR+PWM works, as you've pointed out, exactly as one might expect. It makes reasonable electronic sense (if slightly tricky to drive if your microcontroller only has one PWM pin).

But remember that "Function Table"? (Hi-Z, CW, CCW, BRAKE)? Here's the Function Table from the NMIH-0030 PDF file:

-----------------------+--------------------------------- PWM DIR OUT1 OUT2 | MODE --- --- ---- ---- | ---- 0 0 Hi-Z Hi-Z | Quiescent supply current mode 0 1 LS HS | Motor turns clockwise 1 0 HS LS | Motor turns counter-clockwise 1 1 HS HS | Brake, both HSDs turned on hard -----------------------+---------------------------------

THIS is the "control set" my brother Bruce was using, and the one that started me wondering about whether a PWM that swung between (turning) and (BRAKE) was entirely healthy.

I then spent several hours searching out H-bridge chips, theory, and anything related that seemed to apply. I _did_ discover that an awful lot of "H-bridge" chips (L293, L298, 754410, MC33886, Allegro 3968, IR3220, and various boards built around these) use the IN1+IN2+ENABLE approach (or just IN1+IN2), and only a few (of those I found) offer true PWM and DIR pins (e.g. the LMD18200).

So I started wondering if it really _was_ reasonable to treat (e.g. IN1 as PWM and IN2 as DIR. But it just didn't feel right, hence my original post.

Aha! So the procedure is:

- Calculate specific applications expected current requirements. - Use Rds(on) and IsquaredR to calculate expected power dissipation. - If this exceeds (chip rating + comfort factor), use heat sink.

Thank you for clearing that up. BTW, the NMIH-0030 gives _its_ total power dissipation as 1.29 -- mW --. Board is apparently _much_ more sensitive than the chip (;-).

Thanks for the suggestions. I'll take a look at them for the future, but we're still at a stage where an off-the-shelf board is more productive than building our own. However, (and assuming we make it past this stage), our next step will need an H-bridge+drivers design that can handle a couple of used PowerWheels motors, something on the order of

2x 10A/12V-continuous. These are not cheap, so a hand-assembled circuit might make a lot of sense.

Frank

-- "If you think health care is expensive now, wait until you see what it costs when it's free." -- P.J. O'Rourke

Reply to
Frnak McKenney

Kevin,

Thanks for tak> If you want to drive IN1 with DIR and IN2 with PWM, you would need to invert

Right. And, in fact, that's what Bruce's software is doing now -- or was until I got worried about power dissipation during the cycle.

Oooo-kay (he says). Then, assuming one is using a microcontroller, and that the software guy is reasonably skilled, IN1 and IN2 are pretty much interchangeable -- assuming one manages to get the pulse duty cycle and pin connections correct (;-). This part I have no trouble with.

Ah. Time (PWM vs. armature rotation through PM field). I need to sit down and think this part through -- on paper -- but you've pointed out what I need to think about. Thanks.

Minor query: "the current in the motor has to continue flowing"

Why? I ask because I've hand-cranked a magneto (I think from an old telephone, but I won't swear to it), and I know how much harder it was to crank when it had a load on it than when it was disconnected.

And _that's_ the big one! (;-) Thanks for clearing this up for me. ("My brother thanks you, his robot thanks you, my robots-to-be thank you, and I thank you." -- Never said by James Cagney )

Frank

-- An asymmetry in our moral observations about what people are really like comes from the fact that we have a tendency to focus on extreme acts of immorality and ignore the fact that most of the time, most people are gracious, considerate, and benevolent. For every act of violence or deception that appears on the nightly news, there are 10,000 acts of kindness that go largely unnoticed. In fact, violence and deception make the news precisely because they are so unusual in our daily experience. -- Michael Shermer / The Science of Good & Evil

-- Frank McKenney, McKenney Associates Richmond, Virginia / (804) 320-4887 Munged E-mail: frank uscore mckenney ayut minds pring dawt cahm (y'all)

Reply to
Frnak McKenney

There are two chips on the NMIH-0030. My guess would be that the PWM and DIR inputs to the board go through some logic before driving IN1 and IN2 of the TPIC. Do you have a board schematic or can you look at the board to see whether this is the case?

Mitch

Reply to
Mitch Berkson

Mitch,

Thanks for asking a question I _can_ answer (;-). Bruce says that besides the TPIC0108B there's a VHCT50A (presumably a MC74VHCT50A, a hex non-inverting buffer / CMOS logic level shifter).

But see Kevin Gomez's explanation for why it works -- it should be just after (or maybe before, USENET posts aren't guaranteed to be synchronous (;-)).

Frank

-- Truth comes out of error more readily than out of confusion. -- Francis Bacon

-- Frank McKenney, McKenney Associates Richmond, Virginia / (804) 320-4887 Munged E-mail: frank uscore mckenney ayut minds pring dawt cahm (y'all)

Reply to
Frnak McKenney

Frank,

Excuse me if some of this is stuff you already know. A dc-motor is usually modeled as an inductance (coil and armature), a series resistance (coil, contact resistance) and a voltage source (back emf). This impedance is usually largely inductive and an inductor is a storage element - when current is applied, a field is produced and this stores energy - 0.5(L i ^2). This energy cannot change instantaneously (just like the voltage across the capacitor cannot change instantaneously -energy in a cap

0.5CV^2). What happens if the current is suddenly switched off, where is the current going to flow? Well, as the field collapses, a high voltage (-L* di/dt) appears accross the inductor and the current is going to flow whatever way it can, either as an arc through the air or in the case of an electronic switch, there usually is a path through a protective (or intrinsic) diode to the power or ground, if this path didn't exist, the inductor will forge one - usually with distructive consequences. Do a Google search on "current through an inductor" and you'll get a few pretty good hits.

As for the magneto, or any generator, the load allows a current to flow which in turn induces a field in the armature which opposes the motion (analogous to the case of the motor where torque is proportional to the current into the motor).

Kevin

Reply to
Kevin Gomez

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.