LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help on PID VI

Good day all, i'm implementing a PID. Its actually a simple "auto heading" application. The compass outputs heading in degrees from 0 to 360 and controls the rotation of the motor to align with the set point. I'm not sure how setpoint is represented. I know the output is represented in percentage +/- 100%. Is the setpoint represented in percentage or arbitary values? For example i set the setpoint to be 18 degrees? Should i input 16 or 5 (%)??
0 Kudos
Message 1 of 9
(3,011 Views)

The PID algorithm is actually agnostic about the unit. If you have all percentage, then you will have percentage on the output. But you can use Engineering units and you should be able to obtain engineering units as output (the Proportional gain will try to compensate for this change).

 

If you use engineering units, don't forget to change the output limits accordingly since the output limits is set to +/- 100. For example, if your output is +/- 10 V, then you should change the lower limit to -10 and the upper limit to +10.

 

Hopefully this helps

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 2 of 9
(2,996 Views)
Hi thanks for the guidance. Can it be illustrated in the following: My Heading spam from 0 to 360. My output is from -10 to 10V. Therefore my set point is from 0 to 360 degree, and my output range is from -10 to 10. If i have my setpoint at 10 degree and if i set the PV (mannualy) at 10 degrees, i shld get a steady state i suppose hovering around 0V. But it wasn't that case, i always get the extreme end range. Not sure if i get ur hints correctly.
0 Kudos
Message 3 of 9
(2,961 Views)

Hi J3r3my,

If your heading range is 0-360 with output of -10 to 10V, if your setpoint is 10 degree, the steady state would be (10/360 * 20) + (-10) = -9.45 instead of at 0 V.

0V would be setpoint of 180 degree.

 

Hope this helps.

- Meadow -
LabVIEW 7.0 - 2011, Vision, RT, FPGA
TestStand 3.0 - 4.5
0 Kudos
Message 4 of 9
(2,958 Views)

Thanks for the reply.

 

Sorry i don't really get you. What u did seems like a linear equation y = mx + c to compute the value.

 

Correct me if i'm wrong, the output is computed base on the error (setpoint - PV). In a perfect situtation, setpoint = PV. the output shouldn't output anything; in this case 0V.

 

I have gone through my exampls from the LV and NI website, but all seems too complex.

0 Kudos
Message 5 of 9
(2,954 Views)

Hi J3r3my,

I am sorry for the confusion over the previous message. I was assuming that the voltage output were your set point instead of your heading. You are right that the output to control (Vout) the process should be minimal when it is close to setpoint.

 

When you set a setpoint of 10 degree and PID continues to go from extreme to extreme, it might be caused by untuned value of the PID. P&I value that is too big would cause the signal to overshoot over and undershoot the setpoint and unable to settle on the setpoint.

 

I was looking for a reference to assist you on this and actually wikipedia have quite a good explanation on PID. It shows graph on the effect of P values and I values and D value over the PV values.

 

Please let me know the result of trying to adjust the PID values.

- Meadow -
LabVIEW 7.0 - 2011, Vision, RT, FPGA
TestStand 3.0 - 4.5
0 Kudos
Message 6 of 9
(2,944 Views)

I attached a VI. I wonder if i'm at the right direction? I did try on various values for the PID gains. It seems that the it works if I & D gains are 0. Any comments are welcomed!! 😄

0 Kudos
Message 7 of 9
(2,941 Views)

Can't open your VI - don't have LV 2010 available right now - but if it works with just Proportional control, then you're most of the way there.  It's possible you do not need any Integral or Derivative control depending on your system and the desired response.  If the proportional control gives you a stable output with a constant offset, then you need some Integral gain.  It is important to understand that in the LabVIEW PID toolkit, the integral value is specified as a time in minutes, and that the shorter the time, the more integral response.  You should therefore start with a large value for the integral time and slowly reduce it until you get the performance you want.  Alternatively you can go through a standard tuning procedure such as Ziegler-Nichols to calculate good initial values, which you can then adjust slightly if necessary.  Do not introduce derivative control unless you're certain you need it - it is mostly useful for speeding the response of slow systems that do not have much noise.

0 Kudos
Message 8 of 9
(2,918 Views)

Hi J3r3my,

I don't have Labview 2010 now but sounds like that your adjustment to PID value works. As nathand mentioned, you are closing to the setting for your PID. Smiley Wink

 

As mentioned, you may want to adjust the P&I values so that the control stabilizes on the PV without much noise (overshoot or undershoot).

 

 

- Meadow -
LabVIEW 7.0 - 2011, Vision, RT, FPGA
TestStand 3.0 - 4.5
0 Kudos
Message 9 of 9
(2,901 Views)