<< Chapter < Page | Chapter >> Page > |
Take a few moments to familiarize yourself with the various controls and indicators that are available on thefront panel.
When you are ready, power on the ECP amplifier box and run the VI. Once the VI completes downloading tothe PXI, the closed-loop system is active (or open-loop in the case of no controller). In this example, a PID controller is being usedto control the position of a 1DOF rigid-body system. The first mass cart on the ECP Model 210 plant is loaded with four 0.5kg weightsand no springs or dashpots are attached.
You may apply a light external force to the mass cart and feel the controller respond by attempting toattenuate the disturbance. Also, notice that encoder position measurements are displayed on the front panel. Pressing the ResetEncoders control will set all the encoders back to 0.
If any of the error conditions are detected (limit switches, drive motor overvoltage, etc), the VI will performa safety shutdown and you will need to re-run it.
If you wish to command a test signal to the system, press the Command Trajectory control. The Sub VI frontpanel shown below will pop open:
Take a moment to tab through the various types of test signals that are available as well as what parametersyou may prescribe for each signal. Selecting the bidirectional inputs option causes the commanded signal to alternate directionswhen more than one repetition is specified. You may always press the Preview Trajectory control to see a preview of the signal. Whenyou are satisfied with your selection, press the Execute Trajectory control. The Sub VIs front panel will close and the signal will besent to the system as the reference trajectory that is to be tracked.
When the trajectory is complete, plot data will be calculated. This may take a few seconds depending on theduration of your specified trajectory. When the data calculation completes you may toggle on and off any trajectories that you wishto view on the graph indicator such as position, velocity, and acceleration. Note that the velocity and acceleration amplitudeshave been scaled by 0.1 and 0.01, respectively, on the graph.
Try using the graph indicator’s zoom options if you wish to zoom in on a portion of the graph.
Toggling the cursor on brings up the cursor on the graph. You may lock the cursor to any of the 14 plothistories and click and drag on it to obtain point-by-point numeric data. The first number shown in the cursor legend is the time andthe second is the amplitude for the plot to which you are currently locked.
If you wish to save the data, enter a file name in the path control on the front panel and press the Save RawData control. This will save the time, reference signal, control effort, and four encoder position histories for the commandedtrajectory; velocity and acceleration data are not saved. The file is saved as spreadsheet data on the PXI’s hard drive. You may usean FTP client of your choice to access the PXI and copy the file to your host machine.
When you are finished with your experiment, press the Abort Control control on the front panel and the VI willshut down the control loop.
Programming a Control Algorithm in the VI’s Block Diagram:
The Real-Time control loop VI has been written such that a variety of control algorithms can beimplemented with little change to the VI’s block diagram code. The only change that needs to be made is the code that exists betweenthe reference signal (desired position) and the control effort (analog output).
Open the block diagram for the VI (shown below) to see how the PID controller for this example wasimplemented:
The encoder measurement is subtracted from the reference signal to generate the error signal, which is sentthrough the PID algorithm. Finally, the control effort signal calculated by the PID is sent to the analog output channel thatdrives the plant motor.
It can be seen that programming other controllers such as phase lead, LQR, etc could be easilyaccomplished by deleting the current algorithm and coding a new one in its place.
To perform experiments for the open-loop case (useful when studying the system’s natural dynamics or whenperforming system identification), you may simply delete the feedback control algorithm and connect the reference trajectorypoint directly to the analog output. Recall that the analog output channels on the reconfigurable I/O board have a range of +10V to-10V and a 16-bit DAC resolution. Therefore, in the open-loop case, a command signal amplitude of -32768 to +32767 corresponds to -10Vto +10V sent to the drive motor.
Please refer to the following resources for more detailed plant dynamics and hardware descriptions:
ECP Plant Manuals and National Instruments Resources:
Notification Switch
Would you like to follow the 'Control systems laboratory' conversation and receive update notifications?