Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

We Value Your Feedback!
Could you please spare a few minutes to share your thoughts on Cloud Connected vs On-Premise Services. Your feedback can help us shape the future of services.
Learn more about the survey or Click here to Launch the survey
Schneider Electric Services Innovation Team!

Calculate Standard Deviation in an ION Meter

Metering & Power Quality

Schneider Electric support forum about Power Meters (ION, PowerTag, PowerLogic) and Power Quality from design, implementation to troubleshooting and more.

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results forย 
Showย ย onlyย  | Search instead forย 
Did you mean:ย 
  • Home
  • Schneider Electric Community
  • EcoStruxure Power & Grid
  • Metering & Power Quality
  • Calculate Standard Deviation in an ION Meter
Options
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
Charles_Murison
Picard Charles_Murison Picard
477
Ramasamy_N
Captain Ramasamy_N Captain
113
Robert_Lee
Admiral Robert_Lee Admiral
92
Mehran_Mehrnia
Captain Mehran_Mehrnia Captain
85
View All

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Solved Go to Solution
Back to Metering & Power Quality
Solved
Sepehr_Zarrabi
Lieutenant Sepehr_Zarrabi Lieutenant
Lieutenant

Posted: โ€Ž2019-07-17 02:34 PM

0 Likes
4
1771
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

โ€Ž2019-07-17 02:34 PM

Calculate Standard Deviation in an ION Meter

Is it possible to somehow calculate Standard Deviation in an ION meter (ideally PM8000)? We have an opportunity to sell multiple PM8000's to a firm that audits wind turbine production. We can meet everything they need to do except calculating Standard Deviation for power (kW) over 10-minute periods. 

 

One possible solution is to log kW every second and calculate Standard Deviation in the software but given the power of ION, I am hoping we can come up with a framework that does this calculation on board the meter. 

 

I would appreciate any suggestions.

 

Thank you!

Reply
  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
Sepehr_Zarrabi
Lieutenant Sepehr_Zarrabi Lieutenant
Lieutenant

Posted: โ€Ž2019-07-18 11:20 AM . Last Modified: โ€Ž2019-07-24 02:23 PM

0 Likes
2
1764
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

โ€Ž2019-07-18 11:20 AM

Thank you for your response @Hal_Etheridge. I basically came across the same thing that the Standard Deviation must somehow be calculated in real-time as data is "steaming".

 

I came across this pseudo code, which I was able to implement in the PM8000 meter using an Averaging module and a couple of Arithmetic modules and Store module (ION framework attached).

 

double std_dev2(double a[], int n) {
    if(n == 0)
        return 0.0;
    double sum = 0;
    double sq_sum = 0;
    for(int i = 0; i < n; ++i) {
        sum += a[i];
        sq_sum += a[i] * a[i];
    }
    double mean = sum / n;
    double variance = sq_sum / n - mean * mean;
    return sqrt(variance);
}

 

I ran some tests and the results were very promising:

    Sample set 1: 1 to 900.

        The Std Dev as calculated by Excel is  259.8074607602.

        The value calculated by the PM8000 is 259.8074340820.

        The values match to within 4 decimal points.

    Sample set 2: 1000 to 1600.

        The Std Dev as calculated by Excel is  173.4935157290.

        The value calculated by the PM8000 is 173.4935150146.

        The values match to within 5 decimal points.

 

I have been around ION technology for 17 years and it still amazes me with how powerful it is!

Thank you for looking into this and responding.

See Answer In Context

Attachments
Standard Deviation.zip
Reply
DanL
Captain DanL Captain
Captain

Posted: โ€Ž2019-08-23 03:08 PM

3 Likes
0
1744
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

โ€Ž2019-08-23 03:08 PM

I agree and confirmed that using just 4 modules (two AVG and two ART), the standard deviation of up to 16 quantities can be computed in a PM8000 meter.

The first AVG module has "Calc Mode" set to "RMS Mode"

The second AVG module has "Calc Mode" set to "Average Mode"

Both AVG modules have their reset linked to "Rev Intvl Reset" (output of PulseMerge#6 in the FWN I'm looking at)

 

The ART modules each have their source inputs linked to a group of 8 AVG module outputs.

The formulas in the ART modules will look like "SQRT(S1^2-S2^2)"

Where S1 and S2 are the RMS and AVG of a particular quantity respectively.

 

The results you should expect will typically be in agreement for the first 7 significant (decimal) digits - which is what to expect since ION meters uses 32-bit floating point (IEEE 754 single precision aka. binary32). Excel uses 15 digits of precision.

The effect of subtractive cancellation can reduce the digits of precision as the standard deviation result approaches zero, but the absolute accuracy will still remain.

See Answer In Context

Reply
Replies 4
Hal_Etheridge
Janeway Hal_Etheridge Janeway
Janeway

Posted: โ€Ž2019-07-17 04:37 PM

0 Likes
3
1767
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

โ€Ž2019-07-17 04:37 PM

Normally to calculate standard deviation you need the complete data set.  This would be difficult to do on the meter itself using that algorithm.

 

A few years ago I came across a method to incrementally calculate the standard deviation on data as it is being received (ie. a streaming operation).  This can likely be implemented in a ART module with some creative formulae.  I am not sure if accumulated error due to the repeated floating point operations will impact the final value enough to matter though.  Internally the meter ART module uses 32 bit floating point numbers so this may be fine if the number of samples is kept "small"... a 15 minute interval's worth of data will probably meet this requirement but you would need to do some testing to be certain. ๐Ÿ™‚

 

The following may help:

https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance  (See the Welford's online algorithm section)

https://dev.to/nestedsoftware/calculating-standard-deviation-on-streaming-data-253l

 

Reply
Sepehr_Zarrabi
Lieutenant Sepehr_Zarrabi Lieutenant
Lieutenant

Posted: โ€Ž2019-07-18 11:20 AM . Last Modified: โ€Ž2019-07-24 02:23 PM

0 Likes
2
1765
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

โ€Ž2019-07-18 11:20 AM

Thank you for your response @Hal_Etheridge. I basically came across the same thing that the Standard Deviation must somehow be calculated in real-time as data is "steaming".

 

I came across this pseudo code, which I was able to implement in the PM8000 meter using an Averaging module and a couple of Arithmetic modules and Store module (ION framework attached).

 

double std_dev2(double a[], int n) {
    if(n == 0)
        return 0.0;
    double sum = 0;
    double sq_sum = 0;
    for(int i = 0; i < n; ++i) {
        sum += a[i];
        sq_sum += a[i] * a[i];
    }
    double mean = sum / n;
    double variance = sq_sum / n - mean * mean;
    return sqrt(variance);
}

 

I ran some tests and the results were very promising:

    Sample set 1: 1 to 900.

        The Std Dev as calculated by Excel is  259.8074607602.

        The value calculated by the PM8000 is 259.8074340820.

        The values match to within 4 decimal points.

    Sample set 2: 1000 to 1600.

        The Std Dev as calculated by Excel is  173.4935157290.

        The value calculated by the PM8000 is 173.4935150146.

        The values match to within 5 decimal points.

 

I have been around ION technology for 17 years and it still amazes me with how powerful it is!

Thank you for looking into this and responding.

Attachments
Standard Deviation.zip
Reply
Tom_Stevenson
Picard Tom_Stevenson Picard
Picard

Posted: โ€Ž2019-07-22 03:03 PM

0 Likes
0
1759
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

โ€Ž2019-07-22 03:03 PM

Very cool Sepehr !

 

It would be cool to post the sub-framework here if there are no hoops to jump through - cool application !


@DanL 

 

Tom

Reply
DanL
Captain DanL Captain
Captain

Posted: โ€Ž2019-08-23 03:08 PM

3 Likes
0
1745
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

โ€Ž2019-08-23 03:08 PM

I agree and confirmed that using just 4 modules (two AVG and two ART), the standard deviation of up to 16 quantities can be computed in a PM8000 meter.

The first AVG module has "Calc Mode" set to "RMS Mode"

The second AVG module has "Calc Mode" set to "Average Mode"

Both AVG modules have their reset linked to "Rev Intvl Reset" (output of PulseMerge#6 in the FWN I'm looking at)

 

The ART modules each have their source inputs linked to a group of 8 AVG module outputs.

The formulas in the ART modules will look like "SQRT(S1^2-S2^2)"

Where S1 and S2 are the RMS and AVG of a particular quantity respectively.

 

The results you should expect will typically be in agreement for the first 7 significant (decimal) digits - which is what to expect since ION meters uses 32-bit floating point (IEEE 754 single precision aka. binary32). Excel uses 15 digits of precision.

The effect of subtractive cancellation can reduce the digits of precision as the standard deviation result approaches zero, but the absolute accuracy will still remain.

Reply
Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

ย 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings ยฉ 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of