Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

current measuring in pwm mode

Status
Not open for further replies.

tictac

Full Member level 5
Joined
Oct 22, 2006
Messages
297
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
Polland
Activity points
3,572
hi
I want to measure the current of a motor dc that control its speed with pwm.I use below circuit for measuring the current.but I dont know a good value for resistor and capcitor.I take this value that shown in the picture,voltage has changing proper to the current but its change is very low.and after the motor being off,the voltage doesnt return to the first value.please help me

5_1195940532.jpg
 

Let's walk through this calculation. It starts with a value for the current-sense resistor between the MOSFET and ground. What's the maximum curren that you wanty to run through the motor? How much power can you dissipate on the current sense resistor (if you care about it at all)?
 

maximum 3A-at normal rotating of motor the current is 500ma
by regards

Added after 1 minutes:

actually I use l298 for control the motor's speed.but for showing it I assume one mosfet in place of l298

Added after 1 minutes:

and I use 1 ohm 5wat at sense pin of l298

Added after 1 minutes:

when I want read the value of current in micro,it change rapidly and abnormally.
 

3A through a 1 Ohm resistor will dissipate 1W. Probably, you didn’t fry the resistor because you were running a low enough duty cycle. Still, I would either pick a resistor with a smaller resistance or with a higher power rating or put two 1 Ohm 5W in parallel.

Next question: what voltage range (swing) do you want to achieve at the output of your current sense amplifier? Since V(I) goes to the micro, I would guess that the range is from 0 to 5V or to 3.3V. Right?

when I want read the value of current in micro,it change rapidly and abnormally.
There are, probably 2 sources of noise in your circuit: PWM noise and brush noise. The frequency of the PWM nosie is proportional to your PWM frequency. The brush noise is caused by the commutation of the windings and brushes as the motor turns. The frequency of the brush noise is twice revolution rate of your motor.

By the way, I’ve done a L298 with current sensing a couple of years ago (the schematic is attached). It worked with a PIC and Zilog micros. I didn’t write down the max motor current and PWM frequency, but I think it was 1A and 1kHz. The noise filret is set by R5 and C4: f_cutoff=1/(2*pi*R5*C4).
 

    tictac

    Points: 2
    Helpful Answer Positive Rating
I put one inverter with 1/3 amplify factor to decrease voltage level and out positive voltage to the micro.I put voltage refrence of adc to 1 volt

Added after 19 minutes:

As I know R5=155k and C4=100uF

f_cutoff=1/2*pi*R5*C4

f_cutoff=1/2*3.14*155*1000*0.0001=0.010 hz


but you design it for 1000hz

is my calculation wrong???
 

dont put integrator instead of filter - it will wind up with time . Otherwise you have to reset integrator from time to time
 

tictac said:
f_cutoff=1/2*3.14*155*1000*0.0001=0.010 hz

but you design it for 1000hz

is my calculation wrong???

Your calculation is correct. I was expecting the brush noise at about 1Hz. I only wanted a DC component for the current, so the cutoff frequency set too low didn't hurt me.

That brings about another question: why do you want to sense the motor current?
 

    tictac

    Points: 2
    Helpful Answer Positive Rating
I want to sense the current because of dont let the motor go to stall

Added after 1 minutes:

and I show a progress bar on graphics lcd that relate to cuurent

Added after 2 minutes:

is the output of your opamp has a positive voltage?I think it have.and does R5 reset the opamp?

Added after 2 minutes:

can you give me the value of cap and resistor for 168 hz of pwm pulse
 

kender said:
3A through a 1 Ohm resistor will dissipate 1W. Probably, you didn’t fry the resistor because you were running a low enough duty cycle. Still, I would either pick a resistor with a smaller resistance or with a higher power rating or put two 1 Ohm 5W in parallel.

Let's look at that again for DC, and RMS:

W = I*I*R

W = 3*3*1 = 9 Watts
 

I use R5=950 and C4=1uF for 168 HZ of pwm frequency

Added after 2 minutes:

it solve reset problem of capcitor but I still have a change of ADC value .

Added after 12 minutes:

the output of omamp is change proper to the current but in adc conversion doesnt have a fix value

Added after 7 minutes:

I use lm324 instead of lm6462.does it make a problem?
 

tictac said:
I use R5=950 and C4=1uF for 168 HZ of pwm frequency
it solve reset problem of capcitor but I still have a change of ADC value .

f_cutoff = 1 / (2*pi*950*1e-6) = 167.5

At this frequency the amplitude of nosie from PWM is attenuated by 3dB (i.e. a factor of 2). You also have brush noise, because you have a DC motor. My suggestion: set the f_cutoff to less than one half of your ADC sampling rate (Nyquist theorem).

tictac said:
I use lm324 instead of lm6462.does it make a problem?
LM342 shouldn't cause problems. Any rail-to-rail opamp will work.
 

    tictac

    Points: 2
    Helpful Answer Positive Rating
my circuit didnt work with this circuit
I use one normal integral circuit and one inverter with above value of RC.its work better but still I have a changing in ADC reading at about 30-100
decimal value.My ADC is work at 67khz
 

tictac said:
My ADC is work at 67khz
67kHz? 8O That's a very fast sampling rate for your application. Fast rate per se doesn't hurt you, but 67kHz is a definite overkill if you only want to monitor for motor stall and display current to the user.

I'm just curious. Which ADC chip are you using? What microcontroller are you using?
 

    tictac

    Points: 2
    Helpful Answer Positive Rating
I use codevision for programming avr ATMEGA128
when I use wizard to define ADC it add some code for initialize ADC for using.I say the speed of adc in place of clock's ADC
ADC Clock frequency: 86.400 kHz
but how this value can calculate to define the ADC speed????Im sorry
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top