The basic puzzle: how to conveniently view stepper motor current on a scope?
Edit 2014-04-14: More-sophisticated schematic and description.
I am building a test fixture to examine the behavior and parameters of small stepper motors and various inexpensive stepper driver ICs. The motors would be size NEMA 8 to 23, < 3A windings, bipolar. The drivers are Allegro A4988, commonly available mounted on a carrier with a standard pinout, such as Pololu A4988 Carrier, with related models of chip and carrier having different voltage and current specs.
I want to be able to display various voltages and currents conveniently; this question focuses on the winding current.
The schematic shows the basic idea: A stepper driver IC implements an H-bridge which can switch current to flow in either direction through a motor winding. There are two such bridges in a typical driver IC, to drive the two windings in a typical motor.
So, the "obvious" approach is to interpose a a sense resistor (here Rsense, say 0.1 ohm), across which to measure a voltage with a differential amp, providing a voltage to the scope. Example current-sense amps: Linear LT1999; Analog AD8216.
Although the DC Common-Mode Rejection Ratio of such amps is adequate (100dB = 100,000) to avoid the 30V difference between low and high states from impinging much on the 0.1V/Amp sense voltage, there is almost definitely a problem with the AC CMRR.
The stepper ICs control the current using PWM, presenting pulses with durations as short as the low microseconds, and rise-times in the tenths of microseconds. To be clear: These pulses are distinct from the change of state when going from one step to the next, and are ongoing even when the stepper is held in a specific position (or micro-position).
So Vsense is in the range of 0 to 0.3V, on top of frequent common 0-30V pulses which we wish the differential amp to reject. Yet for current-sense amps that I've examined, CMRR drops off to about 60dB (=1000) at 1MHz, and 40dB (=100) at 10MHz. It seems that an amp with specs in this range is likely to produce quite a large unwanted output from the PWM pulses.
I've considered various ways to reduce the bandwidth of the two signals seen by the differential amp, but any imbalance in their frequency response, I suspect, for the PWM pulse edges, will precipitate a differential which will get amplified.
Is there some cleverer way out of this puzzle that manages to evade the problems noted above?
Answers that are less than ideal:
Some literature on stepper drivers advocates putting the current-sense resistor in the V+ leads of the upper FETS of the bridge (for example locations 'X' in the figure). This certainly avoids the AC CMRR issue. However, that location is not exposed in stepper drive ICs.
One could put a sense resistor at 'y' or 'G' in the figure, but this could not distinguish the two directions of current, and also sums together current for the two windings that an IC controls.
Though not brought out to the carrier board's pins, the A4988 Sense1 pin would afford connection to the voltage across sense resistor Rs1 (location z). There is a separate Sense pin for each of the two windings, and the location avoids the CMRR problem. However, it still doesn't distinguish the winding current direction. Also, I had hoped to use the fixture with unmodified driver carrier boards, for easy interchange.
A proper scope current probe: Expensive, and hoping to build the current-viewing capability into the fixture.