LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

mult-channel PID control using PID Toolkit

I am controlling the light level in six locations (zones) using light sensors, dimmable ballasts (which respond to a 2 to 10 VDC signal) and the PID toolkit.  In my VI, I loop through 6 times (once for each zone) to control the light levels.  I use the simple PID.vi to determine the next setpoint for the dimmable ballast on the lights.  My problem is as follows, I think:
 
The PID algorithm uses past response and the current difference between the measured variable and the setpoint to calculate the next setpoint.  If my understanding is correct, then I am confusing the PID algorithm by calling it with 6 different data sets.  It is almost as if I need 6 separate PID functions, one for each zone. 
 
Perhaps I am wrong about the operation of the PID algorithm.  Can someone straighten me out?
 
Attached is a snapshot of the VI.  The FOR loop goes from 1 to 6, that is, once for each sensor zone.

Message Edited by rgentry on 04-29-2007 09:11 PM

0 Kudos
Message 1 of 5
(3,081 Views)

Could you point to me where do you find this PID algorithm?

you could always try to build your own PID subvi, and check again. you might need different gain parameters for each lamp tough...

 

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 2 of 5
(3,062 Views)
Could you point to me where do you find this PID algorithm?
 
The algorithm is part of the PID Toolkit.  I'll have to check to see if the code inside the VI is "viewable".
0 Kudos
Message 3 of 5
(3,052 Views)

rgentry,

The PID has two modes of operation: Single Channel and Muti-channel. The way you developed your algorithm, you are using single channel algorithm with multiple setpoint and variables. This will not work properly since LV will not keep the internal states correct for each channel.

To fix this, it is pretty simple. Remove the For Loop and provide the whole 1D array to the PID.vi. This will enable the "multi-channel" mode and every time you call your VI, it will keep the internal states for each channel, as if you had 6 different PIDs in parallel. Notice that the interpolation also will work the same way, you just need to remove the build array primitive.

Hope this helps!

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 4 of 5
(3,042 Views)
Barp:  This helps a lot.  I'll rework the control VI as you suggest.  Thanks again.
0 Kudos
Message 5 of 5
(3,038 Views)