Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

Current sensing on dual MC33926 motor driver shield for Arduino: low values

Summary:
Dual MC33926 driver shield attached to Arduino Uno R3 (5v).
Both motor channels appear to work fine: PWM, direction, enable/disable all behave as expected.
But current sense for both (M1FB and M2FB) read extremely low; nowhere near 525mV/A.

Connections:
Motor shield connected to Arduino Uno R3 (as a shield).
Arduino connected to USB; no external power.
External 9v power supply to shield; “Arduino Vin” jumper removed.
Note that traces for pins 4 (D2*), 10 (M2PWM), and 12 (SF*) have been cut, with jumpers installed to reconnect D2* to pin 4 and M2PWM to pin 10; see below under “Target” for why.
There is continuity between header M2FB and Arduino pin A1, and between M1FB and Arduino pin A0.

Details:
A simple Arduino sketch to run a motor on M2 works fine (M1 too, but the following covers M2).
Duty cycle 100% (no PWM); duty cycle 50%; etc. all seem to work as expected.
Motor runs at different speeds, M2A/M2B signal on 'scope shows expected voltage and PWM duty cycle. Current draw (via ammeter) between 40 and 50 mA.
However, “AnalogRead” on M2FB returns 0 (no voltage); 'scope connected to M2FB (via Arduino pin A1) shows at/near 0 mV (hard to tell; there’s an awful lot of noise).

I’ve done the same thing with 1k resistors in parallel, instead of motor (to try to avoid noise). Ammeter shows expected current draw (e.g., 50 mA), but current sense voltage at/near 0 mV.

Loading the motor to draw approx 230 mA results in AnalogRead values between 1 and 5, mostly, with occasional readings down to 0 or up to 10. 'scope shows varying signal between 20 mV and 50 mV, averaging near the middle (about 30 mV). The voltage is consistent with the expected Arduino ADC output. By my math, that’s about 130mV/A; nowhere near the 525mV/A in the spec sheet.

I need to be able to detect 60mA draw (more specifically, an increased draw of 60mA), which does not register at all on the board I have with the setup I’m using.

Questions:
Is the current sensing expected to be linear at 525mV/A? Or is this low reading at low currents normal?
SF* remains unconnected. The board does not shut down, so SF* isn’t triggering (?). But could leaving it unconnected cause the low current readings?
Is this expected with a 9V power supply? (I have 12V and 14V, but motor won’t handle it).
Does this sound like an obvious/known problem that I have simply missed?

Yes, I know that I didn’t supply photos, schematics, sketches/programs, 'scope traces, or any of the other things suggested. I can. Just figured that a basic description might be enough, if it’s an easy problem; I can provide additional data in nauseating detail if it will help.

Target:
The purpose of this is to use the motor shield as a [model railroad] DCC controller via the “DCC++” Arduino library. This library uses the AVR timers to control pulse widths (through M1DIR and M2DIR, rather than M1PWM and M2PWM). The timers used conflict with the native shield pins (4, 10, 12), which is why those traces on the shield are cut, with jumpers for D2* and M2PWM installed to map to the timer pins.
Operationally, the motor shield and DCC++ library work fine: good signal waveform on M1 and M2; trains run; decoders are programmed. However, there is “no” current sensing. Which is a problem, because reading and verifying the decoder settings is done through increased current draw: I have to detect a 60mA increased draw to detect the decoder response. The low M2FB values make this impossible.

Thank you for your detailed post. In general, we do not expect the type of current sensing mechanism the MC33926 uses to be very accurate for that kind of measurement. If you look at the “High-Side Current Sense Feedback” section of Table 4 in the MC33926 datasheet, you can see that getting zero feedback output with 300mA of motor output is a possibility.

If you need to detect that small of a current, one of our Hall effect-based linear current sensors or something like Adafruit’s INA169 Analog DC Current Sensor Breakout board might be more appropriate.

-Nathan

Geez!

And I was all ready to take pictures of the board setup and capture 'scope
traces and everything. Guess I don’t have to bother now.

I’ll look into another method to detect the low current draw.

Thanks for the prompt response.

– Thom.

Thom, It’s three years since this post… I have just been chasing the identical issue, while it appears to be resolved with “no joy”… I’ve just been in the “TrainBoard” forum speaking with a gent who’s Pololu DOES read CV codes… My Question is, Did you ever find a solution to this issue?

Thanks

Short answer: No. I never got my Pololu to read CV codes.

My solution was to use the Pololu on the layout, where the higher amperage was helpful, and a different motor shield (the standard Arduino shield) on the programming track. Not terribly satisfying, but practical.

– Thom.

Thanks Thom, I appreciate the reply. I agree with both the practical solution as well as the sentiment of “not very satisfying.” I’m using the same solution… programming with a 298 and using the Pololu on the layout.

Again, I appreciate the reply to a three year old post.

Thanks

Andy