Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: DennisVR on August 09, 2013, 03:20:56 PM

Title: Is it possible to detect motor stall this way ?
Post by: DennisVR on August 09, 2013, 03:20:56 PM
While looking for a simple way to detect a motor stalling i came up with following solution. Now please bare i mind that i'm a novice when it comes to electronics. And it's possible my reasoning is wrong or too simplistic. But i prefer a solution that i understand but might not be perfect than a solution that's perfect but i don't have a clue how it actually works.

The solution is based on the fact that a motor's resistance changes according to it's state(still,running,stalling). So when using the motor as 1 resistor of a voltage divider circuit and connecting this to an analog input of an Arduino or in my case a Beaglebone Black. I think it should be possible to detect if the motor is stalling. Of course picking the right 2nd resistor to match the max voltage of the analog input.

Could this work ? Am i overlooking something ?

(http://code529.com/stalldetector.png)
Title: Re: Is it possible to detect motor stall this way ?
Post by: jwatte on August 09, 2013, 06:17:18 PM
What you have is a basic resistive current sensor circuit. It can be used to detect current draw, and if your motor has a consistent current draw when stalling, you could use it for that.

With a few caveats :-)

The motor is basically a large, switched, inductor. This means that the voltage you will see over the resistor varies as the motor turns. Hook up a scope to look at it. You may be able to fix this with a second resistor from sense point to output, and a capacitor across that output, to filter the high-frequency EMI.

The motor may also generate EMI that is higher in voltage than the 3.3V that your analog input would accept. Thus, you need some other kind of protection against over-volting the sensing input, such as a Zener diode and a small amount of resistance. Paralleling the Zener with the filter capacitor is likely to work OK.

You also need to size the resistor appropriately, both in Ohms, and in Watts. For example, if your motor draws 0.5 Amps when stalled, then your resistor will dissipate (0.5*0.5*10) = 2.5 Watts of power. A regular 1/4" resistor will probably go up in smoke after a short while with that amount of current going through it. In general, the power dissipated by a resistor is amp-squared-times-resistance.
Also, you want to make sure that the resistance is small enough that even a heavy draw from the motor won't make the voltage go too high on the output. You also don't want it to be too high so that you lose a bunch of efficiency.
A good option here might be to use a much smaller resistor (0.1 Ohm sense resistors are common, for example) and an opamp with some pre-determined gain to get the voltage to where you want to sense it with your microcontroller.

Here's an example of what a robust circuit would look like as per the above. In this case, the sensitivity is set by R3 (currently, a 48:1 amplification of the input voltage, which is 0.1V / A, so 0.5 A in will give 2.4 V out.) The opamp should be fed 3.3V and GND, too.

(http://watte.net/currentsense.png)
Title: Re: Is it possible to detect motor stall this way ?
Post by: DennisVR on August 11, 2013, 11:15:21 AM
@jwatte,

Thanks for the clear and informative explanation. That really helps. I like the idea of the zener diode and capacitor. 

Not sure if i need to op-amp as the analog input of the Beaglebone is 1.8v i don't see the need for amplification or am i missing something ?

Title: Re: Is it possible to detect motor stall this way ?
Post by: waltr on August 11, 2013, 03:49:47 PM
Notice the value of the current sensing resistor in jwatt's schematic. It is 0.1 Ohm which is 1/100th of what you had.
This is to minimize the Voltage drop and thus the power dissipated in the sense resistor enabling a physically reasonable size resistor (your circuit required a 10W resistor, jwatts requires a 100mW resistor). The down side is that the Voltage is lower therefore an op-amp with gain is required. But there is a up side to using the op-amp and that is the sense Voltage is filtered and buffered in front of the op-amp and the op-amp output can cleanly drive an ADC input (ADC's require a fairly low drive impedance for best operation).

I'm sure your simpler circuit could work but is more likely to only work part of the time (or conditions) and the sense resistor can get pretty big as jwatt explained.
Title: Re: Is it possible to detect motor stall this way ?
Post by: DennisVR on August 13, 2013, 05:25:46 AM
@waltr,

Thanks, i think i understand it now ;)