Overview
This demonstration includes a sample experiment using the Quanser Inverted Pendulum Trainer, and demonstrates the self balancing of the control system in a step-by-step manner. This experiment is a part of a larger set of experiments demonstrating the various educational theories that can be observed and taught using the Quanser Inverted Pendulum trainer.
Click Quanser Controls Design to go back to the main page
Quanser Inverted Pendulum Balance Control Model
Please note that the VI required to run this experiment is obtained with the purchase of the Quanser Inverted Pendulum. This experiment is provided as a demonstration of the step by step instructions
Procedure
Before you start, make sure that you are running the correct VI. The VI for this particular example is called 08-QNET_DCMCT_Swing_Up_Control.vi.
Double click the 08-QNET_DCMCT_Swing_Up_Control.vi and let LabVIEW load all the relevant subVIs into memory. After the VI is completely finished loading all of the subVIs into memory, you will see the following screen.
Figure 1. DC Rotational Pendulum Simple Modeling Control Front Panel
Balance Control
- Activate the control by clicking on the Start Control button.
- In the Signal Generator section set:
-
- Signal Type = 'square wave'
- Amplitude = 0.0 deg
- Frequency = 0.10 Hz
- Offset = 0.0 deg
- In the Control Parameters section set:
-
- kp_theta = -2.65 V/rad
- kp_alpha = 40.0 V/rad
- kd_theta = -1.29 V/(rad/s)
- kd_alpha = 6.46 V/(rad/s)
- mu = 375 m/s^2/J
- Er = 20.0 mJ
- Activate Swing-Up = OFF (de-pressed)
- Click on Update Control in the Control Parameters section to ensure this controller is implemented.
- Adjust the Angle/Energy (deg/mJ) scope scales to see between -200 and 200.
- Manually rotate the pendulum in the upright position until the In Range? LED in the Control Indicators section turns bright green. Ensure the encoder cable does not interfere with the pendulum arm motion.
- Observe what occurs to Offset in the Signal Generator section when the balance controller is activated.
- Vary Offset and observe the Arm Angle (deg) response in the Angle/Energy (deg/mJ) scope. Do not set the Offset too high or the encoder cable will interfere with the pendulum arm motion.
- As the pendulum is being balanced, examine the red Arm Angle (deg) and blue Pendulum Angle (deg) responses in the Angle/Energy (deg/mJ) scope.
- In the Signal Generator section set:
-
- Signal Type = 'square wave'
- Amplitude = 40.0 deg
- Frequency = 0.10 Hz
- Offset = 0.0 deg
- Adjust the Angle/Energy (deg/mJ) scope scales to see between -100 and 100.
- Observe the behavior of the system when a square wave command is given to the arm angle. Why does the arm initially move in the wrong direction?
- Click on Stop Control to disable the balance controller.
As a quick module description, the table 1 below lists and describes the main elements composing the QNET-ROTPENT Swing-Up Control virtual instrument user interface. Every element is uniquely identified through an ID number as identified in Figure 1.
Table 1. Main Elements of the DCMCT Rotational Pendulum Simple Modeling Front Panel
|
ID # |
Label |
Parameter |
Description |
Unit |
|
1 |
Theta |
|
Arm angle measured by encoder on motor. |
deg |
|
2 |
Alpha |
|
Pendulum angle measured by encoder on pendulum pivot. |
deg |
|
3 |
Current |
Im |
Motor armature current numeric display. |
A |
|
4 |
Voltage |
Vm |
Motor input voltage numeric display. |
V |
|
5 |
Signal Type |
Type of signal generated for the input voltage. |
||
|
6 |
Amplitude |
Generated signal amplitude input box. |
V |
|
|
7 |
Frequency |
Generated signal frequency input box. |
Hz |
|
|
8 |
Offset |
Generated signal offset input box. |
V |
|
|
9 |
Disturbance |
Vsd |
Apply simulated disturbance voltage. |
V |
|
10 |
kp_theta |
|
Arm angle proportional gain input box. |
V/rad |
|
11 |
kp_alpha |
|
Pendulum angle proportional gain input box. |
V/rad |
|
12 |
kd_theta |
|
Arm angle derivative gain input box. |
V.s/rad |
|
13 |
kd_alpha |
|
Pendulum angle derivative gain input box. |
V.s/rad |
|
14 |
mu |
|
Proportional gain for energy controller. |
m/(s2.J) |
|
15 |
Er |
Er |
Reference energy for energy controller. |
mJ |
|
16 |
Activate Swing Up |
When pressed down the energy controller that swings-up the pendulum is engaged. |
||
|
17 |
Update Control |
Applies the control gains kp_theta, kp_alpha, kd_theta, and kd_alpha in the Control Parameters to the running controller (note: mu and Er are updated automatically). |
||
|
18 |
h |
h |
Sampling time interval of virtual instrument input box. |
s |
|
19 |
Mp |
Mp |
Mass of pendulum assembly (link + weight). |
kg |
|
20 |
lp |
lp |
Center of mass of pendulum assembly (link+weight) input box. |
m |
|
21 |
Marm |
Marm |
Mass of rotary arm. |
kg |
|
22 |
r |
r |
Length from motor shaft to pendulum pivot. |
m |
|
23 |
Jp |
Jp |
Pendulum moment of inertia relative to pivot. |
kg.m2 |
|
24 |
Jeq |
Jeq |
Equivalent moment of inertia acting on the DC motor shaft. |
kg.m2 |
|
25 |
Kt |
Kt |
Current-torque or back-emf constant: they are equivalent in SI units. |
N.m/A |
|
26 |
Rm |
Rm |
Electrical resistance of the DC motor armature. |
ohm |
|
27 |
Update Model/Design |
Updates the ROTPEN model that is used in the energy calculation and simulations in the Open-loop Analysis and Control Design tabs. |
||
|
28 |
Amplitude |
Ad |
Dither signal amplitude input box. |
V |
|
29 |
Frequency |
fd |
Dither signal frequency input box. |
Hz |
|
30 |
Offset |
Vd0 |
Dither signal offset input box. |
V |
|
31 |
In Range? |
Balance controller is engaged when this LED is turns bright green. |
||
|
32 |
Energy |
Numeric display of the pendulum energy. |
mJ |
|
|
33 |
Swing-Up Control Tab |
Tab control that contains the scopes and simulations for the open-loop and closed-loop ROTPEN system. |
||
|
34 |
Angle / Energy |
|
Scope with measured arm angle (in red), measured pendulum angle (in blue), and pendulum energy (in green). |
deg/mJ |
|
35 |
Voltage |
Vm |
Scope with applied motor voltage (red). |
V |
|
36 |
Pause Plots |
Pauses the Angle and Voltage scopes. |
||
|
37 |
Start Control |
When not pressed, both the energy and balance control output are ignored and a voltage of zero is applied to the motor. |
||
|
38 |
EXIT |
Stops the LabView virtual instrument from running. |
||
|
39 |
Q-Guide |
Loads the QNET Interactive Learning Guide experiment procedure for this VI. |
||
|
40 |
Real-Time? |
The green light indicates that the sampling rate is being maintained. |
Reader Comments | Submit a comment »
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
