1
\$\begingroup\$

General schematicI use current sensor to prevent too high current in DC motor. Logic is powered by STM32F103C8T6 and it gets output values with ADC. This scheme (differential amplifier on Rail-to-Rail op amp) gives proper values with laboratory power supply if I connected it short-circuit with current sensor. Also current sensor works as expected with DC motor and motor driver MD13S which can be controlled with buttons in both direction, but if the logic GND of motor driver is connected to the GND of STM which supply the current sensor, this current sensor works only in 1 direction, in other it does not work at all the output value is equal 3.3 V or 0 V. Same situation if I use PWM (1000 Hz) to control motor with MD13S.

So why current sensor does not work in both direction if its GND and GND motor driver are shared?

Сurrent sensor circuit

MD13S

\$\endgroup\$
4
  • \$\begingroup\$ "PWM (1000 kHz)" Can it receive that fast? \$\endgroup\$ Commented Jul 10 at 6:56
  • \$\begingroup\$ I suggest that you draw a schematic of your sensing circuit that also includes the output stage of the motor controller and the motor itself. It will be much easier to spot why you have an issue. I suppose the motor driver is a H bridge. \$\endgroup\$ Commented Jul 10 at 7:29
  • \$\begingroup\$ What is DC average voltage at the two terminal of the sense resistor, when it works and don’t work? I could suspect some common mode issues when the GND are connected together. \$\endgroup\$ Commented Jul 10 at 8:41
  • 1
    \$\begingroup\$ It's likely to be the amplifier input common mode voltage, but we can't determine that without the circuit for the motor driver, and the point on that that is shared with the amplifier ground. \$\endgroup\$ Commented Jul 10 at 9:08

4 Answers 4

1
\$\begingroup\$

With the supply voltage of your differential amplifier, you are most likely exceeding the common mode voltage input range.

\$\endgroup\$
0
\$\begingroup\$

It appears that your MD13S motor driver is formed around a H-bridge. This means that the MOTOR B output may be connected to 0 volts when the motor is spinning in one direction but, in the opposite direction it will become connected to 24 volts. It's this latter case that causes you the problem because the 24 volts will totally exceed the input common mode range of your differential sensing op-amp (which is powered from 3.3 volts and 0 volts).

You can remedy this by vastly increasing (circa ten times) the values of R2 and R3 but, the downside is that the monitoring gain will be ten times lower and, you may need another amplifier after the differential measurement op-amp to restore the signal levels you want.

\$\endgroup\$
0
\$\begingroup\$

Your design is not symmetrical - the effect of R7 and R8 on the impedance seen at pin 3 of the opamp means that R5 is effectively 20k + 1k||1k = 20.5k ohms. So given an identical but changing voltage at both ends of R1, the output of the opamp will increase and decrease with change of common mode input voltage. Typically another op-amp would be used to buffer the midpoint voltage that you want.

Also it may be easier to design something that measures the current drawn by the motor driver IC and averages it over a short period rather than exposing the opamp circuit to the PWM frequency directly, and the inductive behaviour of the motor windings.

Because your circuit may produce spikes at the output of the opamp as the PWM outputs switch, which might be sampled by the ADC and give completely confused and confusing results.

Also consider using a Hall effect current sensor as these also provide common mode DC/AC voltage isolation.

\$\endgroup\$
0
\$\begingroup\$

You can move your current sense resistor to the PWR- pin. Then reference your current sense circuit to GND. This will be sufficient for peak current limiting. You can derive the sign of the current from DIR if needed, but it is not always correct since DIR can be updated and it will take a while for the current to change direction due to the motor's winding inductance.

But to answer your question why it does not work, the common mode voltage of the signal you are trying to measure is only in the amplifier's common mode voltage range for one direction. Some current sense amplifiers labelled as high-side current sensor amplifiers could work for your circuit.

Alternatively, use an isolated current sense amplifier or an isolated current sensor such as a hall-effect current sensor.

\$\endgroup\$

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.