Measure PWM Current with a Modified Moving Average

For general Flowcode discussion that does not belong in the other sections.
Post Reply
viktor_au
Posts: 47
http://meble-kuchenne.info.pl
Joined: Wed Jul 12, 2023 7:09 am
Has thanked: 7 times
Been thanked: 12 times

Measure PWM Current with a Modified Moving Average

Post by viktor_au »

Hi
I need to use the Acs712 to measure the current of 220v ( PWM).
I have crossed this article:
https://www.baldengineer.com/measure-pwm-current.html
This tutorial explains how to measure PWM current and voltage, using a Modified Moving Average (MMA) algorithm.
----------------------
Has anybody implemented this method?
Thanks

BenR
Matrix Staff
Posts: 1952
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 698 times

Re: Measure PWM Current with a Modified Moving Average

Post by BenR »

Hello,

There is a running average component in Flowcode 10 already, You may need to do a full library update to get these if you don't have them already.

It's not quite the same as MMA in that it takes a percentage of the filtered value and a percentage of the new sensor value. e.g. 90% old + 10% new. I tend to use this a lot in the various applications I put together.

I'll see if we can also add a MMA filter for you as that would also be handy.

BenR
Matrix Staff
Posts: 1952
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 698 times

Re: Measure PWM Current with a Modified Moving Average

Post by BenR »

I've now added a floating point version of the MMA filter, let us know how you get on with using it.

I'll try and find some time later today to also do an integer version. Edit - this is now there too.

viktor_au
Posts: 47
Joined: Wed Jul 12, 2023 7:09 am
Has thanked: 7 times
Been thanked: 12 times

Re: Measure PWM Current with a Modified Moving Average

Post by viktor_au »

Thank you Ben.
The integer is my goal.

Post Reply