1
\$\begingroup\$

I am trying to measure the current through the H-bridge and brushed DC motor and shut it off if it exceeds a pre-set limit. This is how I have it currently set up:

schematic

simulate this circuit – Schematic created using CircuitLab

OA1 acts as a non-inverting amplifier to amplify the signal that can then be compared by OA2 to a pre-set limit. And if it equals or bigger it outputs 5V signal to microconctroller, which then disables the H-bridge.

The problem is that the output from OA1 saturates at 5V. Which according to my calculations shouldn't be. If I disconnect the wire from OA1 and connects it to oscilloscope I can see a thick sine-like wave from -50mV to +200mV on the shunt resistor. Which is rather weird... The measured current only through the motor with no load is around 2A. So \$U=R\times I=0.01\times 2=20mV\$.

Whats going on?

\$\endgroup\$
6
  • \$\begingroup\$ Are you PWMing your H-bridge to adjust your motor speed or just using it for simple on/off/direction control? \$\endgroup\$
    – brhans
    Feb 4, 2015 at 20:14
  • \$\begingroup\$ What does "maxed out" mean, specifically? \$\endgroup\$
    – Phil Frost
    Feb 4, 2015 at 20:39
  • \$\begingroup\$ @brhans Just for simple direction control. \$\endgroup\$
    – Golaž
    Feb 4, 2015 at 21:00
  • \$\begingroup\$ @PhilFrost I meant it saturates. \$\endgroup\$
    – Golaž
    Feb 4, 2015 at 21:02
  • \$\begingroup\$ Yeah, I figured that much. Saturates how? Which node? What voltage? \$\endgroup\$
    – Phil Frost
    Feb 5, 2015 at 2:12

2 Answers 2

3
\$\begingroup\$

Your measurement is a classic manifestation of the difficulties involved in measuring high currents. It has two parts. The negative portion of the curve arises from the flow of current through the ground traces of your system. The apparently high amplitude comes from the inclusion of extra PC board traces in the current path which you're measuring. What you need to do is make a differential amplifier with gain

schematic

simulate this circuit – Schematic created using CircuitLab

There are a few things to consider.

The most obvious is that you need to monitor both sides of the bridge. In your original circuit, you could have a short in M3, and the MCU would never know it. Unless you've duplicated your sense circuit to provide a second MCU input, that is, but there's no need for the duplication. Apparently you just want to sense an overcurrent in the motor, so a single measurement will do.

Note that the op amp input resistors connect directly to the shunt terminals. While there can be appreciable trace lengths from the shunt to the resistors, the tie point has to be at the shunt itself, not some distance away. That specifically means that, if you're using an SMD shunt, you must connect the op amp resistor traces directly to the shunt pads, not to a via. Take a look at the resistance of pc traces, and figure how much length it takes to get parasitic resistances on the order of your shunt value.

The other change is the considerable reduction in op amp resistor values. For an op amp this fast, you need to keep resistances low to reduce the effect of parasitic capacitances. Although, as Spehro has pointed out, you also need to change op amps.

\$\endgroup\$
5
  • \$\begingroup\$ I am thinking of getting this one: farnell.com/datasheets/1830959.pdf Do you think it will be suitable? \$\endgroup\$
    – Golaž
    Feb 4, 2015 at 21:36
  • \$\begingroup\$ I wouldn't recommend it. It's pretty slow. You want a unity-gain bandwidth of well over 1 MHz. It depends on your PWM frequency, of course. It will work if you're using the bridge simply to reverse a motor which is otherwise driven at full voltage. \$\endgroup\$ Feb 4, 2015 at 22:14
  • \$\begingroup\$ I think the comments specify that there's no PWM going on. \$\endgroup\$
    – Phil Frost
    Feb 5, 2015 at 11:07
  • \$\begingroup\$ @Golaž - Sorry, missed your comment. Then I reverse my recommendation, and you should be OK with that op amp. \$\endgroup\$ Feb 5, 2015 at 11:33
  • \$\begingroup\$ @WhatRoughBeast Yes, Phil Frost is right, sorry for the misunderstanding. \$\endgroup\$
    – Golaž
    Feb 5, 2015 at 12:12
4
\$\begingroup\$

The TL972 is not a very appropriate op-amp for this purpose. It requires a negative supply since the input common-mode range only gets to within 1.15V of the negative (or positive) rail (despite the output being rail-to-rail). You show the supply grounded, which isn't going to work (assuming the current is less than 115A!).

enter image description here

It also can have as much as +/-6mV Vos which would represent an error of about +/-6% in your trip point- maybe that's okay for your purposes.

Suggest you substitute a single-supply op-amp with a relatively low input offset voltage. Since the TL972 has a standard pinout for a dual op-amp that should not be difficult.

\$\endgroup\$
4
  • \$\begingroup\$ There are a lot of them out there and I am not that good at finding the right one... Do you have any recommendation on which to use? \$\endgroup\$
    – Golaž
    Feb 4, 2015 at 21:01
  • \$\begingroup\$ What are you doing with the other op-amp?? \$\endgroup\$ Feb 4, 2015 at 21:02
  • \$\begingroup\$ I dont understand what are you saying. Aren't you suggesting I should find a different op-amp that will suit the job more? \$\endgroup\$
    – Golaž
    Feb 4, 2015 at 21:04
  • \$\begingroup\$ There are two op-amps in the single package (it's a dual). If you change the part number, the other one will also be different. If the other one is used in a circuit with incompatible requirements then it will cause other problems. \$\endgroup\$ Feb 4, 2015 at 21:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.