# H-Bridge current measurement High side

Discussion in 'Electronic Design' started by Jens Niemann, Sep 25, 2003.

1. ### Jens NiemannGuest

Hello erverybody
I have a problem with measuring the current of a motor via a shunt.
The DC motor (14 Volts) (bidirectional up to 30 amps) is located in an
H-Bridge.
The H-Bridge consists of 2 Relays.
Additionally there is a low-side MOSFET which is performing PWM (20khz)
The shunt (1.875 milli-Ohm) is located directly in the motorpath (in the
horizontal line of the H)
The Voltage of the shunt is distributed to a special High Side Differential
Amplifier with a non changeable gain of 50.

My questions:
Is it good design practice to locate the shunt directly into the motor path?
Do I need a low pass filter to clean the differential signal?
Is a RFI filter sufficient? If yes how do I calculate it?
Is it practicable to measure the voltage loss in a so small shunt.
The voltage varies from 0 to 50 mV with an offset voltage of up to 14 Volts.
Does the noise from the motor and the PWM bury my signal?
Are there any similar applications in the net?
I only found Applications with shunts in the ground path.

Thanks for your help

Jens

2. ### FredGuest

If you gave me the problem I would common the lower MOSFETs sources together
and place the shunt between these and earth. If necessary I would filter
the voltage to obtain the average and use a differential amplifier.
Naturally the polarity of current would be dependent on which pair was on
and if using a flywheel diode care must be exercised where this goes.

3. ### Jens NiemannGuest

Hi Fred, I agree with you.
But we use a flywheel diode.
Because of this component the current through the a shunt located between
lowside MOSFET and Ground and the Motor is not the same when PWM is used.

4. ### FredGuest

If the high side MOSFET is doing the PWM and you are relying on the
inductance of the motor, then you could use 2 diodes. One on each terminal
of the motor returned to the junction of the low side MOSFET and shunt.
Wouldn't that work? You need to draw a diagram.

5. ### John JardineGuest

It sounds a bit dodgey sitting the shunt voltage on top of the 14 volt motor
drive square wave.
If the diffamp has a fair CMRR of 1000:1 then expect a constant 0.7Vpp of
unwanted common mode signal to get through to the amp output as compared to
a maximum of 2.8Vpp (at 30amp) for the motor current. This is a pretty poor
measurement ratio.
Either ensure an excellent CMRR for the diff' amp or use a current
transformer or stick the current monitoring resistor in a supply rail
somewhere. (yes ... and with a low pass filter set just fast enough to allow
the current measurement circuit to function).
regards
john

6. ### Kyle MillerGuest

Yes. The only alternative would be to place it near the power supply,
and that would only help if the differential amplfier needs a
reference to ground?
If the motor is PWM, then you have to filter the signal from the shunt
unless your meter reading the shunt averages the voltages
sufficiently.
The time constant of your filter can be a wide range of values
depending on the response rate that your readings require. If you only
need 1 reading per second then you can use a very large capacitor for
a filter.
Yes, voltage amplifiers can easily multiply the voltage, and digital
multimeters can read quite well in that range.
Offset voltage could be a design complication.
Not much, It would not be a perfect square wave, but quite accurate
for current measurement.

7. ### Adam SeychellGuest

No. Too much high frequency CMRR will is needed in this approach.

Put two identical current shunts between the +14V supply and the
relays. One shunt connects the inverting input of a differential
amplifier and other shunt connects to its non-inverting input. You
must also have high speed switching power diodes between the motor and
the +14V supply. These will handle the free wheeling current when the
MOSFET switches off and the motor's self inductance is being
discharged. Note: the free wheeling current should bypass the shunts
to avoid effecting current measurement, hence the diodes connecting
between the motor and +14V. The output of the amplifier will be
proportional to the motor winding current and will retain correct
polarity. Any of the rail-to-rail input opamps will should be
suitable.

8. ### Ted WilsonGuest

Hi Jens

I think one or two of the responses have misunderstood your circuit
configuration, and assumed a conventional MOSFET H-bridge.

Just to clarify, as I understand it, your motor is connected as the
cross-member of an H-bridge, with the four switches of the bridge
being implemented as two change-over relay contacts, and the return
leg of the two sides of the H-bridge connect through an N-channel
MOSFET to 0V, this MOSFET being used to deliver PWM control of the
motor. Your current-sense resistor is in series with the motor coil in
the cross-member of the H-bridge. (Presumably, the relays are used
purely for direction control of the motor?). In which case the circuit
is:

+14V ___________________________________
| |
| |
o Motor o
RL1 o-----[O}--^^^^^----o/ RL2
o/ Rsense o
| |
|_______________________|
|
PWM MOSFET |-
|-
0V_______________________|______

(If your circuit is not as I describe, ignore the rest of my
ramblings).

If this in fact your basic configuration, I suggest a couple of minor
modifications:

Move Rsense from in series with the motor to be in series with the 14V
supply to the H-bridge and connect a suitably rated diode, (in terms
of opperating voltage, current and reverse recovery time), between the
14V supply and the MOSFET drain, diode cathode to +14V. Your circuit
should now look like so:

Rsense
+14V ----^^^^-----------------------
| | |
_|_ | |
/_\ o Motor o
| RL1 o-----[O}------o/ RL2
| o/ o
| | |
|_______|__________________|
|
PWM MOSFET |-
|-
0V_______________________|______

Now your sense resistor is at a fixed voltage and you have provided a
flyback path for motor current when the MOSFET turns OFF.

With regard to filtering, there will be a fair bit of noise around,
generated by the PWM, and you will see all sorts of spikes and noise
across the sense resistor. However, you do not need to control current
on a cycle by cycle basis and you are only interested in average motor
current. You can therefore apply quite heavy filtering to the voltage
obtained across Rsense and compare the filtered measurement with the
actual demand to generate your PWM mark/space control - this is
usaully done with an error amplifier/integrator, a triangular waveform
at the PWM frequency and a comparator.

(By the way, it might make life easier to turn everything on its head,
use a high-side P-channel MOSFET foe PWM and place Rsense on the 0V
line).

Hope this helps

Ted Wilson

9. ### Jens NiemannGuest

Hi Ted, thanks for your reply,
yeah, you're right . The relais is for direction.
I think it is a good idea to put the Rsense shunt away from the motor path
and put it in series with +14V.
This will make a lot of things easier.
The flywheel diode is already in the circuit implemented.
The suggestion with the P-channel MOSFET is intersting.
But I think too expensive.
N-Channel MOSFET is much cheaper with comparable resistance values.
The most important electrical parameter of a component is the price ;-)
This is also the reason why we use a mechanical relais instead of MOSFETs
for the H-Bridge.

Ciao
Jens

10. ### YzordderexGuest

Snip----

Jens,
Just curious as to what exact application is. Drill? RC model? One
of a kind? Mass production? Also, what information you are trying to
obtain from the current sensor? I think I might have heard the term
avarage current. What is this signal to be used for? Mosfet
protection? Displayed current?

Sorry if these have been already answered and I didn't see.

Regards,
Bob

11. ### Ted WilsonGuest

Hello again Jans

Understand your desire to stick with N-channel, and there's nothing at
all wrong with using a relay for direction control - if you handle
things right, you can arrange to reverse direction when there is
little or no motor current flowing, so the demands on the relay can be
minimised. Inductive loads can be the pits for relay contacts.

Abit more information which may be of help:

Ignoring the spikes on your sense resistor due to commutation and PWM,
what you will have is a DC level, equivalent to the motor current,
with a triangular waveform supperimposed on this. This triangular
waveform is due to PWM and the current ramps up during the drive
period and ramps back down during the flyback period. When current is
at equilibrium, the amount of ramp up and ramp down are equal.

The reason you don't need to worry about individual cycle current and
can simply measure the average is that, in the course of one cycle,
the current is not going to change very much. Assume your motor
inductance is of the order of only 10mH, (low for an iron-cored
motor), and assuming that all 14V is available to drive inductor
current, (i.e. no back-emf due to armature rotation or volts-drop due
to resistive losses in the inductor/MOSFET), and assume the worst case
situation where the MOSFET conducts for the whole of the 20kHz period:

From V = L dI/dt, you get dI = 14 dt/L = 14 x 50E-6/10E-3 = 70mA

You can therefore heavily filter the voltage from your sense resistor,
the limit being when the corner frequency of the filtering starts to
introduce significant phase lag within the passband of your motor
control response - unless this is a tiny motor, this is likely to be
in the region of a few tens or, at most, low hundreds of hertz.

Regards

Ted Wilson

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Continue to site