LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CRio, FPGA PID controller

Hi

I'm trying to understand the PID controller for the FPGA on a Compact ROI system. I'm not sure about the parameter "Sampling Time". It says in the help documentation that it specifies the loop time at which the PID loop on the FPGA target will run. So, if I have a While loop which has a loop time of 25 µs and specify the Sampling Time to 1 s what will happen? Will the while loop be decelerated to a loop time of 1 s or will be a calculation be done every 1 s?

 

For now I have the PID gain cluster wired out as an input parameter. Now I don't specifies PID as gain and times but as quantized gains, already incorporating the I-, D- and sampling time. Does this means the parameter Sampling Time is now obsolete? To my observation I can't see any difference if I set a Sampling Time 1 s or 10 µs.

 

I want to use the PID controller to control a temperature. I can choose on my CRio modules to use them Calibrated or Raw. Using Raw helps avoiding fix point numbers by using only integers. So, I use setpoint and process variable as raw integer numbers as well as I specify the output range of the PID output to integer number which correspond to an analog output module set as Raw. Is this a proper way to do or just stupid?  

Regards

Martin

0 Kudos
Message 1 of 3
(3,539 Views)

Hi,

 

The Sampling Time defined in the PID vi is just used to scale the gains. It does not effect the rate of the loop it is located in. However, you should set both, the loop rate and the Ts to the same value in order to scale your gains appropriately.

 

Of course you can use RAW but it doesn't make much sense if you don't edit the PID vi too, since it expects to get FXP values and converts them to I16 anyhow.

Right-click the PID vi and select "Convert to SubVI". Open the SubVI and remove all the conversion and save it as your custom PID vi.

 

 

Christian

0 Kudos
Message 2 of 3
(3,536 Views)

I also had same issue i cant find the way to tune the Ts correctly, i want to decide pwm on time according to output of pid controller but i faced the tuning issues, is there any criteria for its selection.

0 Kudos
Message 3 of 3
(2,862 Views)