From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID Output Rate Limiter VI, output rate (EGU/min) interpretet wrong

labview hilfe.PNGWhen i set the rate limiter to a max rate of 100, it takes 5s for a step of 10. that makes 2/sek. For 2/sec I'd expect a max rate of change=120 EGU/min. Where's the error?

0 Kudos
Message 1 of 7
(1,324 Views)

Hi Regler,

 

where does the time of the graph's X axis comes from?

In the little image there is no loop, so how does that snippet even has a chance to reach its output value?

How is this "0.02" constant related to the iteration time of the loop which you apparently hide somewhere else in your code?

 

Please attach the FULL VI instead of some images of part of your code when you want to discuss problems with your code!

 

With applying simple math the PID_OutputRateLimiter works as expected:

It takes exactly 250 iterations to reach the output with the given constants…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(1,317 Views)

Ok, thank you for your fast reply! The Project I'm working on is new to me and such is Labview.

The VI in the first picture (test for limiter) is run by the VI in the second picure (Control_unit.vi). I was told, that the engine scans every 20ms, so i assumed the refresh rate of the loop to be the same. Disconnecting dt(s) and setting it to it's default value (-1) produces the same results though.

 

In the graph, the X axis displays the relative time.

loop.PNG

0 Kudos
Message 3 of 7
(1,283 Views)

Hi Regler,

 


@Regler wrote:

I was told, that the engine scans every 20ms, so i assumed the refresh rate of the loop to be the same.  


Again you failed to attach VI(s)…

 

So you believe the ScanEngine sets a loop rate of 20ms - but do you know for sure?

Have you measured the loop rate?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(1,279 Views)

Hi GerdW,

 

true, sorry for grinding your gears, here's some VI! 🙂
And yes, i checked, the refresh rate is set to 20ms.

No, i did not measure the loop rate, i'll check on how to do that rn.

 

Kind regards,

Regler

0 Kudos
Message 5 of 7
(1,266 Views)

Hi Regler,

 

without your specific ScanEngine setting this VI is useless.

When I replace that TWL by a plain FOR loop the PIDRateLimiter works as expected.

 

I still guess your ScanEngine does not run at the expected scan rate…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(1,228 Views)

By multiplying the steps and the measured step time i get the correct results. Transforming the steps to time using the chart was the problem.

0 Kudos
Message 7 of 7
(1,223 Views)