Sensing resistor

Status
Not open for further replies.

eng1

New Member
I'd like to add a sensing reistor to a discrete full bridge that I use to drive a small DC motor with a PIC uC. I want the PIC to read the voltage drop on the resistor and to change the duty-cycle of the PWM signal if too much current is flowing.
I'd like to know:
1) how can I make that voltage suitable for the PIC ADC? Do I need a peak detector?
2) why could an unexpected great current flow into the motor?
3) Other aspects that I should care of?

Thanks.
 

Use an opamp to amplify it - bear in mind you want a very low value resistor so you get a very small voltage drop, so this will require amplifying.

2) why could an unexpected great current flow into the motor?

If (WHEN!) the motor stalls.

3) Other aspects that I should care of?

I would suggest checking for over current for a 'reasonably' long time, short term 'spikes' aren't a problem, and will occur in normal use. It's up to you to decide how long an overload has to occur before you take action.
 
Thank you very much.

What about the op-amp stage? Do I need a diode + cap? I am thinking that the sensed voltage is a smoothed square wave, isn't it?
 
eng1 said:
Thank you very much.

What about the op-amp stage? Do I need a diode + cap? I am thinking that the sensed voltage is a smoothed square wave, isn't it?

You could use a diode and a cap, or try and detect the peaks in the software.
 
I don't know if a pic adc + ISR will be fast enough to do this. you are measuring current rise through the motor coil which may be very fast. I'd use a comparator to do the measurement and turn off the drivers. that way it's continuous instead of discrete samples. you will want to disable the comparator during the early part of the cycle to avoid the spikes that nigel is talking about.

take a look at the allegro 3977 for a description of a chip that does this sort of thing. fairly instructive.

by the way, you will not get a smooth square wave. It won't be smooth and it will be rising. somewhere on the web there are a bunch of scope shots of the voltage across an A3977's sense resistor. very noisy.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…