5205-2G h-bridge goes into error when motor direction reversed - Page 1
Forum section: electronics / projects

author: nilium
author_rank: Contributor
timestamp: April 20, 2015, 11:22:51 am
content: Hi all:I've built the attached circuit to drive an actuator with a 5205-2G h-bridge (datasheet attached). IN1 IN2 and EF are connected to GPIO pins of main board containing a microcontroller. As can be see in the datasheet, IN1 and IN2 should be set to LL and LH respectively to drive the motor in either direction.Everytime the direction is reversed, the h-bridge's error flag (EF) is switched on and the motor stops. I've observed that I can successfully reverse the motor direction if I set IN1 and IN2 to high before switching directions (I'm inclined to think there's some back EMF helping the transistors act funky). The catch is , that only works if HH is held long enough (still under a second). I could add some logic gates to override the inputs to HH every time the EF is high but I think that would be a patch-up solution, not a proper one.I'm wondering if anyone could shine some light to this problem. I'm thinking of trying the 5206, which allows to open both pairs of transistors with the HH and LH inputs respectively. I think I'll have feed it HH when going from CW to CCW and HL when going from CCW to CW (or vice-versa). Thoughts?Thank you in advance.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: April 20, 2015, 11:59:42 am
content: So, this is a regular PMDC motor?Nice little chip, if you had done that with a "dumber" device it probably would've exploded!Motor control works just like anything else... if you try to change it instantly, it won't be pretty. What's the DC resistance of the motor, fractional ohm? Consider how much current you're trying to dump into it. Starting from a dead stop, it's VCC / R. Starting from full speed to full reverse, take that anddouble it.The first thing you should do, you should realize -- before anything else -- is that you're doing a DAC here. The inputs are digital and the outputs, well, they meet the analog world. Not so much electrically as mechanically, but the same rules apply. You're also doing power switching, so you should have a current monitor (something better than the fault detect in that chip), and put that into a feedback loop somehow. And as a feedback loop, it will have to change gradually, in the only means available (PWM, or any other kind of pulse density modulation scheme).If you did this, just as-is, open loop, you'd get an exponential ramp, a "soft start". Which will at least reduce the surge currents during start-up and stopping. But it won't account for stalled conditions (say if the motor comes down with a bad case of dust, or the load is... uncooperative). That's why you should always have current control.The most general point is this: anywhere you have signals meeting the outside world, be it electrical or mechanical; you must carefully consider what happens not only during average DC conditions, but also the dynamics, when signals are switched from high to low or vice versa, and what happens in those intervening microseconds; and what happens if someone is an absolute dick and shorts out a couple of wires on you, or not even that, but just some bad circuitry that itself failed shorted, or got zapped by ESD, or... Even if you don't address the failure modes defensively, the dynamics are still utterly critical and inescapable.Tim

author: H.O
author_rank: Frequent Contributor
timestamp: April 20, 2015, 12:02:29 pm
content: (Tim posted while I was typing but I'll post this anyway, since it was already typed....)Are you saying that you're going "full tilt" forward and then simply trying to reverse the motor by switching from 00 to 01?If so, and the motor is of any considerable size, it's going to pull quite a large amount of current which is probably tripping the overcurrent protection.Going "thru" the off-state (HH) for a second or whatever allows the motor to coast long enough so that its velocity (and therefor the voltage generated by the motor) is reduced enough so that when you actually apply voltage in the "reverse direction" the current pulled is low enough not to trip the overcurrent protection.Basically: When the motor is turning full speed in one direction its generated back EMF is equal to applied voltage, 12V for example. If you now, suddenly, reverse the polarity of the applied voltage the supply voltage ends up in series with back EMF generated by spinning motor and armature "sees" double the voltage (24V). The current drawn by the motor would be twice that of starting the motor.

author: nilium
author_rank: Contributor
timestamp: April 20, 2015, 01:18:43 pm
content: Thank you, both, for your great responses. That makes a lot of sense--motor R is indeed quite low (0.8 ohm) and the motor is rated for 4 amps nominal.The GPIO pins that I used can be made into PWM pins, which I'm going to try next.Cheers,NV

author: max_torque
author_rank: Super Contributor
timestamp: April 20, 2015, 06:21:37 pm
content: If you are not using PWM, then you are effectively going from "Full forwards" instantly (well in a few uS probably) directly in to "full reverse". As mentioned, the resulting overcurrent is tripping that smart H Bridges saturation detection and it goes into a safe mode (both halves of the bridge to high impedance state) until the control pins are set to "off" and the device resets.The 5205/5206 are really good robust devices, with overcurrent, overtemp and disconnected loaded detection all integral to them!