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
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)?
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).
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?
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.
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?
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
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?
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