update rates

Discuss issues and ideas you have to configuring displays with PowerVision
ngustavson
Posts: 11
Joined: Mon Oct 11, 2010 7:45 am

update rates

Post by ngustavson » Fri Jul 29, 2011 3:12 pm

We have a busy display screen that's having issues with slowdowns. One potential issue is that our gauge information is updating very quickly on the CAN bus, many of the measured parameters come in at a 50ms rate. Is there a way to tell a gauge/database parameter to only sample every 5 messages or so?
ksaenz
Enovation Controls Development
Enovation Controls Development
Posts: 263
Joined: Thu Aug 19, 2010 7:53 am

Re: update rates

Post by ksaenz » Wed Aug 03, 2011 8:08 am

Hello ngustavson,

You can lower the smoothing value for the gauges.

The smoothing value must be a number from 0.0 to 1.0.

Regards,

ksaenz
ngustavson
Posts: 11
Joined: Mon Oct 11, 2010 7:45 am

Re: update rates

Post by ngustavson » Wed Aug 03, 2011 8:18 am

Can you explain a bit more what smoothing does internally? I was under the impression that decreasing the smoothing number would increase interpolation points between successive measurements, and therefore increase the load.
jedwards
Enovation Controls Development
Enovation Controls Development
Posts: 16
Joined: Fri Jul 30, 2010 8:24 am

Re: update rates

Post by jedwards » Thu Aug 04, 2011 9:21 am

How many measured parameters (CAN packets) are coming into the system at that fast 50ms rate and what baud rate is used?

The pipeline from the CAN to the screen is as follows:
1) As packets arrive, the values are parsed out of the message and placed in our internal database. This occurs at the rate packets arrive.
2) All the screen objects are updated with "new" data from the internal database. This occurs at the rate of 5 times per second.
3) All the screen objects are updated on the screen during the drawing loop. This occurs at the rate of 12 to 15 times per second as CPU resources allow.

Alpha Smoothing (all gauges)
----------------------------------
Each gauge object on the screen has a parameter called "Smoothing". This is an function that the data acquired during step 2 moves through to be displayed in step 3. It is a simple weighted smoothing function using the value of 0.0 to 1.0 to determine the strength of the smoothing.

1.0 = no smoothing, data is 100% from the refresh cycle straight from the database.
0.0 = maximum smoothing, data is smoothed with a target moving toward the data from the database.

Here is the smoothing function:
currentValue = ( target * alpha ) + ( currentValue * oneMinusAlpha )
where currentValue is the value to be displayed in the next drawn from, target is the value set in the 5 Hz data refresh loop from step 2, and alpha is 0.0 to 1.0 (and oneMInusAlpha = 1 - alpha).

While this function is always running, it in itself will have no affect on CPU usage, however, for a low alpha value, 0.1 or 0.2, it may keep your value from changing as often and therefore not updating the gauge with new text so fast.

Number of Samples (text gauges only)
---------------------------------------------
Number of samples is a second stage smoothing function that is only available in the text gauge. This is an adjustment to allow the text gauges to average the given "Number of Samples" (where samples are sourced from the alpha smoothing above on each draw frame update), and use this average value as the value actually displayed. This smoothing complexity is based on the number of samples set by the configuration since it is a true average of a buffer of samples.

To help CPU usage, the more smoothing you do can cause your gauges to change slower and therefor use less CPU usage. However, there could be other things using CPU usage unknowingly on the screen that have nothing to do with the rate at which the gauges are being updated.

I hope this explanation helps you understand what the smoothing properties are doing.

Sincerely,
john
ngustavson
Posts: 11
Joined: Mon Oct 11, 2010 7:45 am

Re: update rates

Post by ngustavson » Fri Aug 05, 2011 7:48 am

>To help CPU usage, the more smoothing you do can cause your gauges to change slower
The gauges position would change slower, but it would actually be changing places more often (in smaller increments), which would use more bandwidth as it would keep the gauge from going static.....wouldn't it?

>However, there could be other things using CPU usage unknowingly on the screen
I'm sure they are, but I don't know what they are and have no simple method of finding them, and reducing the number of objects on the screen and the rate it updates noticably effects performance.