LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog gauge with damping

Solved!
Go to solution

Whenever I place a guage to display analog data, i always feel it should behave like a car speedometer. Smooth with no jerks ... most times the user is interested the level of a parameter and it makes no sense if the needle flutters reacting to all data variations.

 

I have tried a concept with shift registers as below and it seems to work - but the downside is the number of shift registers cannot be altered by the end user as its hard coded.  Ideally i would like to have a control called "Damping Factor " which the user can adjust depending on the raw data. Like for instance there is little to gain by damping a Temperature reading which anyway does not change fast.  Here is the Sub.VI that does it  :

 

DampingIdea.png

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
Download All
0 Kudos
Message 1 of 7
(4,196 Views)
Solution
Accepted by topic author MogaRaghu

damping.png

 

edit: and I would not call it "damped" value, but "moving average" or "rolling average", as it is...

Message 2 of 7
(4,166 Views)

Excellent Blokk !!

The exact solution that I was looking for .. initial check outs are fine and I have full control over the behaviour.

I am a bit not clear about the Initialize input though. When I close the main VI where I will be using this sub, the data always comes to zero. So I am not if I should wire it to a control at all.

 

( The location of the Mean Point By Point is inside Signal Processing and I missed it looking inside Mathematics !!)

 

Thanks.

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 3 of 7
(4,151 Views)

... and a "moving average" can be shown to be the equivalent of a low-pass filter (a bit of Fourier math is involved).

 

Bob Schor

0 Kudos
Message 4 of 7
(4,148 Views)

@MogaRaghu wrote:

Excellent Blokk !!

The exact solution that I was looking for .. initial check outs are fine and I have full control over the behaviour.

I am a bit not clear about the Initialize input though. When I close the main VI where I will be using this sub, the data always comes to zero. So I am not if I should wire it to a control at all.

 

( The location of the Mean Point By Point is inside Signal Processing and I missed it looking inside Mathematics !!)

 

Thanks.


If you want to empty the buffer of the internal moving average, you can set the Initialize input to True value for once. Of course, after that you need to use it again with False. Naturally, if you keep this input True, no value will be produced at the output (always emptying the buffer).

0 Kudos
Message 5 of 7
(4,140 Views)

@Bob_Schor wrote:

... and a "moving average" can be shown to be the equivalent of a low-pass filter (a bit of Fourier math is involved).

 

Bob Schor


Fourier math chapter left in choice in third year control technique paper Smiley Wink

Incidentally when I am using this to smoothen out about six analogue gauges on the same screen I guess I need to set the Execution property of the sub VI to "Preallocated clone re-entrant execution"  ?

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 6 of 7
(4,117 Views)

@MogaRaghu wrote:

@Bob_Schor wrote:

... and a "moving average" can be shown to be the equivalent of a low-pass filter (a bit of Fourier math is involved).

 

Bob Schor


Fourier math chapter left in choice in third year control technique paper Smiley Wink

Incidentally when I am using this to smoothen out about six analogue gauges on the same screen I guess I need to set the Execution property of the sub VI to "Preallocated clone re-entrant execution"  ?


If you mean the subVI which contains this Point by point Mean calculation, yes (never change the code or execution mode of a built-in LV vi). So if you have your subVI 6 times present in the block diagram, you can set its mode to re-entrant as you mentioned, and in this way 6 instances of the subVI will be present in the memory, holding the 6 "Mean Point by Point.vi" separated.

0 Kudos
Message 7 of 7
(4,110 Views)