LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID Controller

Hello,

 

I am trying to build a PID controller with my variables being: Setpoint and process variable is velocity, Controller output is voltage. I have attached my VI below. From what I can tell, my process variable is never approaching my setpoint which leads me to believe the controller output voltage is not working. Does anyone have any ideas why it is not working? Could it be my PID gain values? I did not really have a process of getting the values because I wanted to just test if it works first before tuning it to get better values. Any help would be appreciated.

 

Thank you,

Shafique

 

 

0 Kudos
Message 1 of 2
(561 Views)

Hi Shafique,

 


@Shafique9601 wrote:

From what I can tell, my process variable is never approaching my setpoint which leads me to believe the controller output voltage is not working. Does anyone have any ideas why it is not working? Could it be my PID gain values?


Well, surely the PID gains have to (atleast) point in the right direction…

 

Other things:

  • You setup the DAQmx task using a samplerate of 2kS/s, but then you read just one sample per iteration. This will most likely end up with "buffer overflow" errors…
  • Defining the DAQmx buffer to 10M samples is still just a bandaid (to avoid those buffer overflows)! What's the point in creating a buffer of 5000s (or 1.4h) when your loop processes the samples way too late???
  • How should the PID controller work when you NEVER set any AO value inside the PID loop???
  • Why do you build up unbounded arrays in all those shift registers?
  • Is your pv really the result of a 1000 samples mean value, scaled by some factors and then taking the derivative???
Best regards,
GerdW


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