Pages: [1]   Go Down
Author Topic: PWM shunt current measurement  (Read 2061 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

How do you get the right time if pwm is used for measuring a shunt voltage? I won't use some electronic circuits except the voltage gain amplifier to scale from e.g. 0-20 mV to 0-4V.
Is there a function to call to get the pwm pin is just now high?

Please help!

Yours, Stefan
Logged

Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You could add a capacitor to smooth out the voltage on the shunt, although it may also affect the voltage reading,
Or take many reading fast and find the ones that count, mind you may also want adjust in software that the duty cycle varies so the avg current is different than at the instant its on
or add a capacitor and or inductor to the output to smooth the voltage and keep the current constant
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks to winner10920 !

But this question is unanswered.

Quote
Is there a function to call to get the pwm pin is just now high?

Please help
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Hello there,

1. Remember V=IR
2. If you have a signal 4-20mA coming, add a 250Ohms in parallel to have an equivalent of 1-5VDC (perrrrfect for arduino analog input)
3. If you 0-20mA, you have to use (1) to find the shunt to have a proportional Voltage acceptable for Arduino analog inputs
4. Forget any capacitor or any amplifier...

Hope this helps
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I want to ask new, because the main question could be confusing.

The situation:

There's a pwm driven Motor. On the high side current is measured with a shunt and the corresponding voltage is amplified with an opamp circuit to 0,2 - 4V. This voltage goes to the ain input of the arduino.

So, you know that pwm current isn't smooth so the simplest measurement method is to measure at the right time -> if the digital port of the pwm driver is high.

Now my question again:

Is there a function (or any way) to call to find out that the digital port (pwm driven) is just now high?


Also I could take some true rms ics like the AD636. I won't need it because I don't need any absolute measurements here.

The 3rd method would be to measure like the ad636:

Vrms = (Avg * ( Vin^2) )^(1/2)

Any code suggestions?

Thanks!
« Last Edit: July 22, 2012, 12:20:56 am by tuxstef » Logged

Pages: [1]   Go Up
Jump to: