Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

© 2011 Quanser Inc., All rights reserved.

Quanser Inc.
119 Spy Court
Markham, Ontario
L3R 5H6
Canada
[email protected]
Phone: 1-905-940-3575
Fax: 1-905-940-3576

Printed in Markham, Ontario.

For more information on the solutions Quanser Inc. offers, please visit the web site at:
http://www.quanser.com

This document and the software described in it are provided subject to a license agreement. Neither the software nor this document may be
used or copied except as specified under the terms of that license agreement. All rights are reserved and no part may be reproduced, stored in
a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior
written permission of Quanser Inc.

QNET ROTPENT- User Manual 2


Contents
1 Introduction 4

2 System Description 5
2.1 ROTPENT Components 5

3 System Schematic 8

4 Specifications 9

5 Environmental 11

6 Assembly 12

7 Setup Guide 14
7.1 QNET and NI ELVIS II Setup 15

8 QNET LabVIEW Hints 18


8.1 Scaling Scopes 18
8.2 Saving Response 19

9 Troubleshooting 22
9.1 General Software Issues 22
9.2 General Hardware Issues 22
9.3 ROTPENT Issues 23

10 Technical Support 25

QNET ROTPENT- User Manual v 1.0


1 INTRODUCTION
The Rotary Inverted Pendulum Trainer (ROTPENT) is designed to teach and demonstrate the fundamentals of
inverted pendulum balance and control. The system can be configured to utalize a veriety of control methods to
swing-up and balance the pendulum. In particular, the system can be used to teach hybrid swing-up, and LQR
control fundamentals. This is done using a PC with real-time control capabilities and the NI ELVIS II. The hardware
of the ROTPENT is described in Section 2. A schematic of the hardware components is included in Section 3,
and the specifications are listed in Section 4 and Section 5. Assembly instructions are provided in Section 6. Some
helpful LabVIEW hints when using the QNET VIs are given in Section 8 along with a troubleshooting guide in Section
9.

Figure 1.1: QNET Rotary Inverted Pendulum (ROTPENT)

QNET ROTPENT- User Manual 4


2 SYSTEM DESCRIPTION
2.1 ROTPENT COMPONENTS
The components comprising the Rotary Inverted Pendulum Trainer are labeled in Figure 2.2, and Figure 2.3. and
are described in Table 1.

 Caution: Ensure the trainer is setup as dictated in the QNET Setup Guide. The trainer is susceptible to protection
impairment if not used as specified.

ID# Description ID# Description


1 DC motor 8 Pendulum link
2 Arm angle encoder 9 Pendulum weight
3 Motor metal chamber 10 PCI connector to NI ELVIS: for interfacing QNET module with DAC
4 Rotary arm pivot 11 QNET PWM/Encoder board
5 Rotary arm 12 24V QNET power jack
6 Pendulum encoder 13 Fuse
7 Pendulum pivot 14 +B, +15V, -15V, +5V LEDs

Table 1: ROTPENT component nomenclature

Figure 2.2: General layout of QNET ROTPENT

QNET ROTPENT- User Manual v 1.0


Figure 2.3: Components of QNET-ROTPENT pendulum assembly

2.1.1 DC Motor

The 24-Volt DC motor with graphite commutation, a speed constant of 286 rpm/V, and winding resistance of 8.70
Ohms.

2.1.2 Pulse-Width Modulated Power Amplifier

A PWM power amplifier is used to drive the motor. The input to the amplifier is the output of the Digital-to-Analog
converter (i.e. D/A) of channel #0 on the DAQ. The maximum output voltage of the amplifier is 24 V. Its maximum
peak current is 5 A and the maximum continuous current is 4 A. The amplifier gain is 2.3 V/V.

2.1.3 Analog Current Measurement: Current Sense Resistor

A series load resistor of 0.1 Ohms is connected to the output of the PWM amplifier. The signal is amplified internally
to result in a sensitivity of 1.0 V/A. The obtained current measurement signal is available at the Analog-to-Digital
(i.e. A/D) of channel #0. Such a current measurement can be used to monitor the current running in the motor.

2.1.4 Digital Position Measurement: Optical Encoder

Digital position measurement is obtained by using a high-resolution quadrature optical encoder. There is one optical
encoder directly mounted to the rear of the motor and another that measured the pendulum pivot angle. The motor
encoder count measurement is available at Digital Input (i.e. DI) channel #0 on the DAQ and the pendulum encoder
count is available at DI#1 on the DAQ.

QNET ROTPENT- User Manual 6


2.1.5 Analog Speed Measurement: Tachometer

An analog signal proportional to motor speed is available at the Analog-to-Digital (i.e. A/D) Input channel #4 of the
DAQ. It is digitally derived from the encoder signal on the QNET board.

2.1.6 Fuse

The QNET power amplifier has a 250 V, 3 A fuse.

2.1.7 QNET Power Supply

The DCMCT module has a 24-Volt DC power jack to power the on-board PWM amplifier. It is called the QNET power
supply. The +B LED on the QNET board turns bright green when the amplifier is powered.

 Caution: Please make sure you use the correct type of wall transformer or you will damage the system. It should
supply 24 VDC and be rated at 3.0 A.

QNET ROTPENT- User Manual v 1.0


3 SYSTEM SCHEMATIC
A schematic of the ROTPENT system interfaced with a DAQ device is provided in Figure 3.4.

Figure 3.4: Schematic of QNET-ROTPENT system

QNET ROTPENT- User Manual 8


4 SPECIFICATIONS
The specifications of the ROTPENT system model parameters are given in Table 2.

Symbol Description Value Unit

Motor:
Rm Motor armature resistance 8.7 Ω
Kt Motor current-torque constant 0.03334 N·m
Km Motor back-emf constant (same as Kt in SI units) 0.03334 V/(rad/s)
Jm Moment of intertia of motor rotor 1.80 × 10-6 kg·m2
Jeq Equivalent moment of inertia about motor shaft pivot 1.84 × 10-4 kg·m2
axis with pendulum assembly
Maximum continuous torque 0.10 N·m
Maximum power rating 20.0 W
Maximum continuous current 1.0 A

Pendulum Arm:
Marm Mass of the arm 0.08 kg
r Length of arm pivot to pendulum pivot 0.0826 m
Beq Arm viscous damping 0.000 N·m/(rad/s)

Pendulum Link:
Mp Mass of the pendulum link and weight combined 0.0270 kg
Lp Total length of pendulum 0.191 m
lp Length of pendulum center of mass from pivot 0.153 m
Mp1 Mass of the pendulum link 0.008 kg
Mp2 Mass of the pendulum weight 0.019 kg
Lp1 Length of pendulum link 0.171 m
Lp2 Length of pendulum weight 0.0190 m
Jp Pendulum moment of inertia about its pivot axis 1.70 × 10-4 kg·m2
Bp Pendulum viscous damping 0.000 N·m/(rad/s)

Pulse-Width Modulated Amplifier:


VM AX PWM amplifier maximum output voltage 24 V
PWM amplifier maximum output current 5 A
PWM amplifier gain 2.3 V/V

Table 2: ROTPENT model parameter and PWM power amplifier specifications

The viscous damping parameters of the pendulum, Bp , and of the arm, Beq , are regarded as being negligible in this
laboratory.

The specifications on the ROTPENT system sensors are given in Table 3.

QNET ROTPENT- User Manual v 1.0


Description Value Unit

Current Sense:
Current Calibration 1.0 A/V
Current sense resistor 0.1 Ω

Pendulum Encoder:
Encoder line count 1024 lines/rev
Encoder resolution (in quadrature mode) 0.0879 deg/count
Encoder type TTL
Encoder signals A,B

Motor Encoder:
Encoder line count 360 lines/rev
Encoder resolution (in quadrature mode) 0.25 deg/count
Encoder type TTL
Encoder signals A,B

Tachometer:
Tachometer calibration at QNET A/D input 2987 RPM/V

Table 3: ROTPENT sensor parameter specifications

QNET ROTPENT- User Manual 10


5 ENVIRONMENTAL
The Rotary Inverted Pendulum Trainer environmental operating conditions are given in Table 4.

Description Value Unit



Operating temperature 15 to 35 C
Humidity 20 to 90 %

Table 4: ROTPENT environmental operating conditions

 Caution: Ensure the unit is operated under the temperature and humidity conditions given in Table 4. Otherwise,
there may be some issues with the heating and cooling results.

QNET ROTPENT- User Manual v 1.0


6 ASSEMBLY
Follow the instructions below to setup the QNET Rotary Pendulum trainer:

1. Remove the four thumbscrews securing the DC motor chamber to the QNET board.

2. Attach the pendulum assembly to the motor shaft using the hex key that came with the trainer.
3. The ROTPENT device should resemble Figure 6.5.

Figure 6.5: Disassembled QNET-ROTPENT

4. Remove the thumbscrews from the bottom of the DC motor chamber.


5. Position the motor enclosure so that the four screw holes on the bottom of the enclosure are aligned with four
holes on the QNET board. The ROTPENT should be positioned as shown in Figure 6.6.

QNET ROTPENT- User Manual 12


Figure 6.6: Place the QNET-ROTPENT upright on the module and align screw holes

6. Tighten the four thumbscrews from the bottom of the QNET module board though the DC motor chamber. This
is pictured below in Figure 6.7.

Figure 6.7: Tighten four thumbscrews

7. The final system should look similar to Figure 2.2.

QNET ROTPENT- User Manual v 1.0


7 SETUP GUIDE
As illustrated in Figure 7.8, the QNET boards can easily be connected to an NI ELVIS system. The instructions in
Section 7.1 detail the setup procedure for using a QNET with an NI ELVIS II.

Figure 7.8: Connecting a QNET Trainer

 Caution: Do not position the ELVIS II so that it is difficult to disconnect the main power.

 Caution: If the equipment is used in a manner not specified by the manufacturer, the protection provided
by the equipment may be impaired.

QNET ROTPENT- User Manual 14


7.1 QNET AND NI ELVIS II SETUP
The procedure to install a Quanser Engineering Trainer (QNET) module on the NI ELVIS II is detailed in this section.
The NI ELVIS II components used in the installation procedure are located and marked by an ID number in Figure
7.9, and described in Table 5.

7.1.1 ELVIS II Components

Figure 7.9: Components on ELVIS II

ID# Description
1 NI ELVIS II
2 Prototyping board power switch
3 Power LED
4 Ready LED
5 Power Cable for ELVIS II
6 USB Connection between PC and ELVIS II

Table 5: ELVIS II components

QNET ROTPENT- User Manual v 1.0


7.1.2 ELVIS II Setup Procedure

Follow these instructions to setup a QNET board on an ELVIS II:

 Caution: Do NOT make the following connections while power is supplied to the hardware!

 Caution: The unit is provided with a grounded cord to be used with a properly grounded outlet only, this
is a safety feature, do not disable it

1. Place the small opening on the front of the QNET board over the mounting bracket on the NI ELVIS II.
2. Slide the PCI connector of the QNET module end into the female connector on the NI ELVIS II. Make sure it is
connected properly.
3. Connect the ELVIS II power cable.
4. Connect the ELVIS II USB cable to the PC.
5. Connect the supplied QNET transformer to the QNET power jack on the QNET module.
6. Power the NI ELVIS II by turning ON the System Power Switch on the rear panel.
7. Turn ON the Prototyping Board Power switch, ID #2 shown in Figure 7.9.
 Caution: Turn OFF the Prototyping Board Power switch if the DC motor begins to turn!
 Caution: Take extra care when powering the QNET module to avoid causing any damage!
8. The Power and Ready LEDs of the NI ELVIS II unit should be lit as shown in Figure 7.10.

Figure 7.10: Ready and Power LEDs on NI ELVIS II

9. As pictured in Figure 7.11, verify that the +15V, -15V, +5V, and +B LEDs on the QNET module are lit. They
indicate that the board has been properly connected to the ELVIS unit.

QNET ROTPENT- User Manual 16


Figure 7.11: QNET LEDs should all be ON

QNET ROTPENT- User Manual v 1.0


8 QNET LABVIEW HINTS
8.1 SCALING SCOPES
This section describes a handy method of changing the x or y axis in a LabVIEW scope using
QNET_DCMCT_Swing_Up_Control VI as an example. Read the steps below to reduce the y-axis range of the
Angle (deg) scope shown in Figure 8.12 in order to see the blue trace more up close.

Figure 8.12: Scope needs to be scaled

1. As illustrated in Figure 8.13, to decrease the positive range of the scope down to 40, double-click on '100' in
the y-axis, type in '40', and press ENTER.

Figure 8.13: Scope needs to be scaled

QNET ROTPENT- User Manual 18


2. The resulting scope is depicted in Figure 8.14. The blue trace is now more visible.

Figure 8.14: Y-axis of scope has been adjusted

Similarly, the minimum range of the y-axis can be changed as well as the range of the x-axis. For example, to see
a time range of 10 seconds instead of 5 seconds the x-axis range can be changed from [0.0, 5.0] to [0.0, 10.0].
However, when changing the x -axis, i.e. the time-scale, it is recommended to do the following:

1. Pause the scopes or stop the VI and clear the chart (right-click on scope, select Data Operation ∥ Clear Chart).

2. Apply the same scale change to both the output and input scopes. Otherwise, the data plotted in each scope
will not be synchronized with each other.

8.2 SAVING RESPONSE


Read the following to save a scope response:

1. Right-click on the scope and select Export Simplified Image, as shown in Figure 8.15

QNET ROTPENT- User Manual v 1.0


Figure 8.15: Right-click on scope and select Export Simplified Image

2. The dialog box shown in Figure 8.16 opens and gives various image export options. One way is to export the
image to the clipboard as a bitmap. This can then be pasted in a graphical software (e.g MS Paint, Irfanview)
and saved to a desired format (e.g. gif).

Figure 8.16: Export Simplified Image dialog box

QNET ROTPENT- User Manual 20


3. The resulting image that is saved is shown in Figure 8.17.

Figure 8.17: Sample saved response

The scope can be saved whether or not the VI is running. However, typically it is easier to stop the VI when the
desired response is collected and then export the image as instructed above.

QNET ROTPENT- User Manual v 1.0


9 TROUBLESHOOTING
9.1 GENERAL SOFTWARE ISSUES
Q1 When I try to open a QNET VI, it says there are some missing VIs and they have a ''CD'' or ''Sim'' in the
name?

The LabVIEW Control Design and Simulation Toolkit is not installed.

Q2 When I open a QNET VI a message prompts that a VI with ''ELVIS'' in the name cannot be found?

• ELVIS I: The QNET VIs use drivers that are installed from the ELVIS 3.0 or later CD. Make sure it
is installed. If the folder ''\National Instruments\NI ELVIS 3.0'' does not exist then it is not installed
(available for download at www.ni.com as well).
• ELVIS II: The QNET VIs use the ELVISmx drivers. Make sure you install the contents of the ELVIS II
CD before attempting to open any of the QNET VIs (available for download at www.ni.com as well).

9.2 GENERAL HARDWARE ISSUES


Q1 None of the LEDs on the QNET board are lit?

Make sure both the System Power switch, which is located on the back of the ELVIS I and II units, and the
Prototyping Board Power switch, which is situated on the front panel of the ELVIS I and on the top-right
corner of the ELVIS II, are ON. See the QNET Setup Guide for more information.

Q2 On the QNET board, the +15V, -15V, and +5V LEDs are bright green but the +B LED is not lit?

Ensure the QNET power connector on the QNET board is connected with the supplied QNET power
cable. See the QNET Setup Guide for more information.

Q3 At least one of the +B, +15V, -15V, and +5V LEDs on the QNET board is not lit?

• See Q2 if only the +B is not lit.


• If one or more of the +15V, -15V, and +5V LEDs is not lit then a +/-15V or +5V fuse(s) on the
Protection Board of the NI-ELVIS I is burnt. Similarly, if the +B LED is still not lit after connecting
the QNET power then the Variable Power Supplies Fuses on the ELVIS Protection Board are burnt.
See the Protection Board Fuses in the NI ELVIS User Manual and replace the fuses as directed.

Q4 The Ready LED on the ELVIS II does not go on?

QNET ROTPENT- User Manual 22


1. Go through the ELVIS II setup procedure outlined in the QNET Setup Guide
2. Once completed, launch the Measurement & Automation Explorer software.
3. As illustrated in Figure 9.18, expand the Devices and Interfaces and NI-DAQmx Devices items and
select the NI ELVIS II device.
4. As shown in Figure 9.18, click on the Reset Device button.
5. Once successfully reset, click on the Self-Test button.
6. If the test passed, reset the ELVIS II (i.e. shut off the Prototyping Board switch and System Power
switch and turn them back on again). The Ready LED on the ELVIS II should now be lit.

Figure 9.18: Reseting and performing the self-test on the ELVIS II

9.3 ROTPENT ISSUES


Q1 When I open a QNET-ROTPENT VI, the scopes are all reading '0' or near '0', as shown in Figure 9.19 below.
Why are the scopes not responding if I manually move the pendulum?

Figure 9.19: Scopes on QNET-ROTPENT VIs

The Prototyping Board switch is not ON. The LED next to the switch should be bright green. Please
review the QNET Steup Guide.

Q2 When I run the ''QNET_ROTPENT_Simple_Modeling'' VI the pendulum does not move?

• Ensure the QNET Power cable is connected. The four LEDs +B, +15V, -15V, and +5V on the QNET
board should all be bright green.

QNET ROTPENT- User Manual v 1.0


Q3 When I try to run the balance controller using the ''08-QNET_ROTPENT_Swing_Up_Control'' VI the pendulum
does not move?

• Ensure the QNET Power cable is connected. The four LEDs +B, +15V, -15V, and +5V on the QNET
board should all be bright green.
• Also, note that the balance controller is only active when the pendulum is in the upright vertical
position.

Q4 When I try to run the swing-up controller using the ''QNET_ROTPENT_Swing_Up_Control'' VI the pendulum
does not move?

• Ensure the QNET Power cable is connected. The four LEDs +B, +15V, -15V, and +5V on the QNET
board should all be bright green.
• Make sure the pendulum is perturbed to get the swing-up going by clicking on the Disturbance button
in the VI.

QNET ROTPENT- User Manual 24


10 TECHNICAL SUPPORT
To obtain support from Quanser, go to http://www.quanser.com/ and click on the Tech Support link. Fill in the form
with all the requested software and hardware information as well as a description of the problem encountered. Also,
make sure your e-mail address and telephone number are included. Submit the form and a technical support person
will contact you.

QNET ROTPENT- User Manual v 1.0

You might also like