Controller Design using the Maple Professional Math Toolbox for LabVIEW This application demonstrates how you can use the Maple Professional Math Toolbox for LabVIEW to design and tune a Proportional-Integral-Derivative (PID) controller. This toolbox seamlessly integrates LabVIEW with Maple, allowing you to develop applications that use both the data acquisition capabilities of LabVIEW and the sophisticated mathematical modeling of Maple. The following example application models an existing system and tunes the controller parameters. The final parameter values are automatically exported to the live system. This application illustrates the following features: Using Maple to derive a transfer function of the overall system Using LabVIEW to control a physical system Control engineering plots: step response, Bode plot, and root locus plot Powerful Maple symbolic capability to perform sophisticated what if analysis
Controller Design using the Maple Professional Math Toolbox for LabVIEW Maplesoft, a division of Waterloo Maple Inc., 005 Introduction This application demonstrates how you can use the Maple Professional Math Toolbox for LabVIEW to design and tune a Proportional-Integral-Derivative (PID) controller. This toolbox seamlessly integrates LabVIEW with Maple, allowing you to develop applications that use both the data acquisition capabilities of LabVIEW and the sophisticated mathematical modeling of Maple. The following example application models an existing system and tunes the controller parameters. The final parameter values are automatically exported to the live system. This application illustrates the following features. Using Maple to derive a transfer function of the overall system Using LabVIEW to control a physical system Control engineering plots: step response, Bode plot, and root locus plot Powerful Maple symbolic capability to perform sophisticated what if analysis Figure : Two tank system
Problem Description This example illustrates the PID controller tuning for a two tank physical system. In this system, water flows through an input valve to Tank, and from this tank the water flows freely to Tank. The water flows freely from Tank. The input valve is controllable, while both of the output valves for tanks one and two are fixed in an open position. The goal is to control the position of the input valve to maintain the water level in Tank at some preset level. Figure : Two tank system This system can be described by the following transfer function, where H (s) corresponds to the height of tank and U(s) is the input valve position. H ( s) = U ( s) R A R A R s + ( A R + A R ) s + Here, A and A are the cross-sectional areas of Tanks and respectively, and the quantities R and R are the output valve resistances for Tanks and. The goal is to tune a PID controller to maintain a given water level in Tank and then deploy the controller parameters to a live system.
Controller Design The described system is a live system controlled by LabVIEW. It contains an existing PID controller; however, the controller parameters are not optimal. The goal is to model the system with different controller parameters using Maple and then tune the parameters to improve the system performance. The new parameters are exported to the live system. The System In this example, a LabVIEW application controls the system and displays the various parameters and states of the system. Figure 3: Live system The system output (water height level of Tank ) is shown in green in the upper-right portion of Figure. This figure illustrates the response of the system to a step change of the Tank desired height (set point) from zero to one half of the total height. From the figure, it is evident that the height of the water level in Tank (green line) never reaches the desired height. It also exhibits a steady state (settling) error. In addition, the height level first exceeds the target level, before it settles to a final value. The controller behavior is not satisfactory.
Controller Parameter Tuning Using the power of Maple, a simulation of the system is created within the LabVIEW application. Using this simulation, the system response is evaluated for different controller parameters. You can enter arbitrary transfer functions for the plant (the two tank system) and controllers in both the forward and the feedback path. Figure 4: Transfer functions for the controller, plant, and the feedback systems Maple then formulates the transfer function for the entire closed-loop system, from which the behavior of the entire system is simulated. Figure 5: Transfer function for the entire system Since Maple computes the overall system transfer function symbolically, the model and controller parameters are stored separately and are substituted only when needed. As a result, you can investigate the sensitivity of the overall behavior to each of the parameters. Figure 6: List of the model and controller parameters
In addition to generating the transfer function of the system, Maple computes several commonly used control design and analysis plots, such as the step response, Bode plot, and root locus plot. In the case of the root locus plot, instead of using the default loop gain as the varying parameter, you can select different parameters and the corresponding root locus plot for that parameter is generated automatically. This is a unique benefit that Maple offers, as a result of its symbolic manipulation it saves time by eliminating the need to manually re-derive the transfer function expression for each parameter value. Using these tools, you can tune the parameter values for the PID controller until a satisfactory result is achieved. Figure 7: Step response of the overall system Figure 8: Bode plot for the overall system Figure 9: Root locus plot for the entire system
Deployment of the Controller Parameters The controller is designed in LabVIEW, and as a result the parameters are easily exported by writing them directly to the controller VI. You do not need to stop the controller, read data files, or cut and paste the parameter values. Figure 0: The controller parameters are exported to a live VI. Figure : The response of the system is improved with the new controller parameters Summary To develop and tune a PID controller, you can use LabVIEW and Maple: LabVIEW to implement a controller for the physical system, and Maple to model the system and design a controller. This controller is designed in the LabVIEW environment, making the export of the controller value to the real system effortless. The combination of LabVIEW and Maple offers a powerful environment for rapid development and deployment of control solutions.