What is the correct way to do torque sensing on a DC motor being driven by a PWM driver? For a constant current it's assumed that torque is roughly proportional to current but in the case of a PWM driven motor the current is varying even in the constant RPM, constant load setting.

I understand internally the windings act as an inductor which can smooth the current out but how do you sense this in an h-bridge setup? Do you have a single sense resistor at the bottom of the hbridge or is there something else?


1 Answer 1


A sense resistor implies that current is being dropped across the resistor, which equates to power loss. If a very low-value resistor is used (to avoid power loss), it becomes hard to sense the very tiny voltages generated, so then amplification and filtering is needed. On an electrically noisy H-bridge, this becomes challenging.

An unusual way to detect current (pulses) with minimal invasiveness may be to add a turn or two of the H-bridge power wire through a donut toroid inductor, forming a transformer. This is most often used with AC loads. Then rectify and filter this AC voltage generated across the inductor. Since there will be more turns on the inductor (secondary) than the wrap (primary), it will "step up" the primary current to a higher secondary voltage. The higher this (filtered DC) voltage becomes during operation, the more current must have been pulsing in the primary (H-bridge.)


simulate this circuit – Schematic created using CircuitLab

As the duty approaches 100% though, the pulses stop (motor is driven with uninterrupted DC) and this concept won't work any longer; transformers can't operate at DC. There is only one practical way to detect static DC magnetic fields:

Toroid and Hall-effect sensor (Courtesy Allegro Microsystems)

This would work for DC; a hall-effect sensor. Find a slotted (or "gapped") ferrite ring, or two halves of a ring. Wrap the primary a few turns (more turns = more flux = more sensitivity) and stick the hall-effect sensor into the gap. The toroid will focus essentially all of the magnetic flux into the sensor, vastly increasing sensitivity. Then sample the (rapidly changing) hall output and interpolate in software, or filter in hardware as appropriate. AC to DC input (+/-) would give proportional and linear primary current output as a voltage. See the Allegro link for more details.

  • \$\begingroup\$ I looked at some hall modules for current sensing. Will a small period for the PWM cycle result in current becoming approximately constant even during the off phase? This current should still be present at the base off the H bridge, it just uses the flyback diodes from what I remember. \$\endgroup\$ Oct 21, 2021 at 16:29
  • \$\begingroup\$ Since the freewheeling diodes have a voltage drop, and two of them will be conducting in series during any off-period, there will always be this "jump" during the off-time, resulting in ripple, so it will never be completely smooth (as long as there are pulses.) With increasing frequency comes increasing losses though; efficacy at higher frequencies boils down to the parasitics of the H-bridge components. Ultra-fast, low-forward-drop (and low capacitance) diodes will be better at keeping the current stable during the off-time than slower, lossier diodes, etc. \$\endgroup\$
    – rdtsc
    Oct 22, 2021 at 12:54

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.