You are on page 1of 14

AUTOMATION SANDBOX

Proportional-Integral-Derivative (PID) algorithm is the most common control algorithm used in


industry. Often, people use PID to control processes that include heating and cooling systems, fluid
level monitoring, flow control, and pressure control. In PID control, you must specify a process
variable and a set point. The process variable is the system parameter you want to control, such as
temperature, pressure, or flow rate, and the set point is the desired value for the parameter you are
controlling.

Following are few steps to display the graph in LabVIEW.

1) First of all, open Block Diagram window and right click on the editing (white) space to open
Function Menu, now draw while loop with stop button. Fig 1.0.

Fig 1.0

For stop button, just right click on the Loop Condition and create control. Stop button will
automatically generate at Front Panel window and you can resize according to your wish.
AUTOMATION SANDBOX

2) Now again right click on the editing space to open Function Menu to open PID.vi. Fig1.1.

Fig 1.1

3) Now right click on while loop to add shift registers. Fig 1.2.

Fig 1.2
AUTOMATION SANDBOX

4) Now expand your vi, by right click on PID.vi function and click View as Icon and drag the
function you’ll come to know the details (i.e. connecting terminals) of this function. Fig 1.3.

Fig 1.3

5) Now right click on this PID gains and then Create to select Control. Fig 1.4.

Fig 1.4
6) To select the set point, let’s select a Vertical Pointer Slide, for that go to Front Panel window
and select the sliders from Numeric function. Fig 1.5.
AUTOMATION SANDBOX

Fig 1.5
7) Be remain in Front Panel, now rename the slider to set point and right click on the slider to
select its Properties. Here you can change its dimensions, color etc. in Appearance tab. Here
I’m unchecking the increment/decrement buttons in the slider. And in scale tab, define your
required range of the slider, here I’m selecting 0 to 100. Finally click Ok. Fig 1.6

Fig 1.6
AUTOMATION SANDBOX

8) Now, for Preset value select vertical progress bar from Numeric function, as indicator. Fig 1.7.

Fig 1.7

9) Now click right button of mouse on it and change its dimensions (your wish), range from
Scale Tab and Representation to DBL from Data Type Tab. Fig 1.8.

Fig 1.8

10) Both icons will appear on Front Panel automatically. Fig 1.9.

Fig 1.9
AUTOMATION SANDBOX

11) Further we have to select the VI for the calculations, which might not be available in your
software. You can download it from our website. The vi is Plant System.vi. To select this VI
right, click on the editing space and click Select a VI and click Ok. Follow your file path to load
the file in LabVIEW. Fig 1.10.

Fig 1.10

12) Expand your Plant System.vi function (as we did in step 4). Fig 1.11

Fig 1.11

13) Now, follow few steps:


a) Connect the terminal of Set Point function to Set Point of PID.vi.
b) Connect the Output terminal of PID.vi to Plant Input of Plant System.vi.
c) Connect Plant Output to shift register.
See Fig 1.12.
AUTOMATION SANDBOX

Fig 1.12

14) Here we have to initialize the shift register also, i.e. initialize it from 0. Now shift register has
two terminals ( ). Right click on the left side of shift register and then Create & Constant.
Fig 1.13.

Fig 1.13

15) Now connect right side terminal of shift register to the Process Variable of PID.vi and also
Preset Value function to Process Variable. Fig 1.14.
AUTOMATION SANDBOX

Fig 1.14

16) Let’s plot a graph to display both values. So go to block diagram and right click anywhere and
select Graph function. Fig 1.15.

Fig 1.15

17) Be remain in block diagram, we have to display two values on the graph. So let’s make some
changes in the graph. So right click on the waveform chart and go to properties (Same way we
did in Step-9 & 7).

 Appearance Tab: Rename it to Process Values & Plots shown to 2. You can also display
the digital values by just clicking on the check box of Show digital displays.
 Scale Tab: Here, rename the X and Y axis of the graph and there range also (see
maximum and minimum). Also change its Grid and Scale style for both X and Y axis.
 Plots Tab: First rename the plots from Plot 0 to PV and Plot 1 to SV. Here you’ll define
the graph color and thickness of graph line for both X and Y axis.
 And finally click Ok. See Fig 1.16.
AUTOMATION SANDBOX

Fig 1.16

18) Here’s your graph will look like and its function will appear in front panel automatically.
Fig 1.17.

Fig 1.17

19) Now go to your front panel and find Bundle function by right click anywhere and open
Clusters, Class, & Variant function to get Bundle. Fig 1.18.

Fig 1.18

20) Now connect Preset Value and Set Value functions to its inputs and output to Process
Values Graph. Fig 1.19.
AUTOMATION SANDBOX

Fig 1.19

21) Final step is to include the Process parameters of Pant System vi. By just right clicking on it
and Create Control. Fig 1.20.

Fig 1.20
AUTOMATION SANDBOX

22) Now go to block diagram window set following values for Process Parameters. Fig 1.21.

Fig 1.21

23) Now final step is to add some delay in your program. Let’s say 100ms. So go to Front Panel
and right click anywhere to go Timing function & select a delay function Fig 1.22

Fig 1.22

24) Here is your final Front Panel. Fig 1.23.

Fig 1.23
AUTOMATION SANDBOX

25) Now go to block diagram and let’s define the set point, from 0 to something else, let’s say
34. And its digital display’s digit up to decimal 2 in display format. And click Ok Fig 1.24.

Fig 1.24

26) Follow the same procedure for Preset Value progress bar i.e. change its digital display’s digit
up to decimal 2 in display format.
AUTOMATION SANDBOX

27) Let’s make it default by right clicking on the Slider not on its digital display. Fig 1.25

Fig 1.25

28) Here is the final Block Diagram and hit Run. Fig 1.26.

Fig 1.26
AUTOMATION SANDBOX

29) And here is your final output, vary the Set Point according to your requirement, Preset
Value will follow the Set Point. Fig 1.27.

Fig 1.27

You might also like