Quanser QBall 2 Setup guide

CAPTIVATE. MOTIVATE. GRADUATE.
USER MANUAL
QBall 2 for QUARC
Set Up and Configuration

© 2015 Quanser Inc., All rights reserved.
Quanser Inc.
119 Spy Court
Markham, Ontario
L3R 5H6
Canada
info@quanser.com
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. Quanser Inc. grants the following rights: a) The right to reproduce
the work, to incorporate the work into one or more collections, and to reproduce the work as incorporated in the collections, b) to create and
reproduce adaptations provided reasonable steps are taken to clearly identify the changes that were made to the original work, c) to distribute
and publically perform the work including as incorporated in collections, and d) to distribute and publicly perform adaptations. The above rights
may be exercised in all media and formats whether now known or hereafter devised. These rights are granted subject to and limited by the
following restrictions: a) You may not exercise any of the rights granted to You in above in any manner that is primarily intended for or directed
toward commercial advantage or private monetary compensation, and b) You must keep intact all copyright notices for the Work and provide the
name Quanser Inc. for attribution. These restrictions may not be waved without express prior written permission of Quanser Inc.
QBALL 2 - User Manual 2

1 Presentation
1.1 Introduction
The Quanser QBall 2 (Figure 2.1) is an innovative rotary wing vehicle platform suitable for a wide variety of UAV
research applications. The QBall 2 is a quadrotor helicopter design propelled by four brushless motors fitted with
10-inch propellers [3, 4, 5]. The entire quadrotor is enclosed within a protective carbon fiber cage (Patent Pending).
The QBall 2's proprietary design ensures safe operation as well as opens the possibilities for a variety of novel
applications. The protective cage is a crucial feature since this unmanned vehicle was designed for use in an indoor
laboratory, where there are typically many close-range hazards (including other vehicles). The cage gives the QBall
2 a decisive advantage over other vehicles that would suffer significant damage if contact occurs between the vehicle
and an obstacle.
To measure on-board sensors and drive the motors, the QBall 2 utilizes Quanser's on-board avionics data acquisition
card (DAQ) and a wireless Gumstix DuoVero embedded computer [1]. The DAQ is a high-resolution inertial
measurement unit (IMU) and avionics input/output (I/O) card designed to accommodate a wide variety of research
applications. QUARCr, Quanser's real-time control software [2], allows researchers and developers to rapidly
develop and test controllers on actual hardware through a MatlabrSimulinkrinterface. QUARCr's open-
architecture hardware and extensive Simulinkrblockset provides users with powerful controls development tools.
QUARCrcan target the Gumstix embedded computer, automatically generating code and executing controllers
on-board the vehicle. During flights, while the controller is executing on the Gumstix, users can tune parameters in
real-time and observe sensor measurements from a host ground station computer (PC or laptop).
The interface to the QBall 2 is MatlabrSimulinkrwith QUARCr. The controllers are developed in Simulinkrwith
QUARCron the host computer, and these models are downloaded and compiled into executables on the target
seamlessly. A diagram of this configuration is shown in Figure 2.2.
Section 2 outlines operator warnings found throughout this manual, Section 3 goes through the prerequisites, and
Section 4 lists various documents that are referenced in this manual. The general system description, component
nomenclature, specifications, and model parameters are all given in Section 5. Section 6 goes into detail on
how to setup the QBall 2, and Section 7 describes the battery charging procedure. Lastly, Section 8 contains a
troubleshooting guide.
QBALL 2 - User Manual DRAFT - April 6, 2015

2 Operator Warnings
Caution
This symbol marks specific safety warnings and operating procedures that are
important for the safety of the QBall 2 and users. Read these warnings carefully. The
QBall 2 is a powerful and potentially dangerous vehicle if used improperly. Always
follow safe operating procedures when using the QBall 2. Quanser is not responsible
for damages and injury resulting from improper or unsafe use of the QBall 2. Before
connecting batteries or attempting to run the QBall 2, be sure to read this document
and become familiar with the safety features and operating procedures of the QBall 2.
Caution
When handling the QBall 2, always make sure there are no models running and the
power is turned off. It is recommended that users wear safety goggles to protect the
eyes.
Figure 2.1: Quanser QBall 2
QBALL 2 - User Manual 4

Figure 2.2: System diagram
QBALL 2 - User Manual DRAFT - April 6, 2015

3 Prerequisites
To successfully operate the QBall 2, the prerequisites are:
i) To be familiar with the wiring and components of the QBall 2.
ii) To have QUARCrversion 2.4 installed and properly licensed.
iii) To be familiar with using QUARCrto control and monitor the vehicle in real-time, and in designing a controller
through Simulinkr. See Reference [2] for more details.
[1] Gumstix: http://gumstix.com/
[2] QUARCrUser Manual (type doc quarc in Matlabrto access)
[3] Park 480 Brushless motor - 1020Kv:
http://hobbyhobby.com/store/product/68211%22Park-480-Brushless-Outrunner-Motor%2C-1020Kv%22/
[4] Propellers description and technical information:
http://www.rctoys.com/rc-products/APC-10-047-SF-CR.html
[5] Hobbywing Flyfun-30A electronic speed controller manual:
http://www.hobbywing.com/uploadfiles/sx/file/Manual/HW-01-V4.pdf
[6] STMicroelectronics L3G4200D 3-axis gyroscope:
http://www.st.com/web/catalog/sense_power/FM89/SC1288/PF250373
[7] Freescale MMA8452Q 3-axis accelerometer:
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MMA8452Q
QBALL 2 - User Manual 6

4 System Hardware
4.1 Main Components
To setup this experiment, the following hardware and software are required:
•QBall 2: QBall 2 as shown in Figure 2.1
•Router A high-end router pre-configured to enable wireless connectivity to QBall 2
•Batteries: Two 3-cell, 2700 mAh Lithium-Polymer batteries
•Real-Time Control Software: The QUARCrSimulinkrconfiguration, as detailed in Reference [2]
4.2 Diagram
Figure 4.1 below is a basic diagram of the QBall 2, showing the axes and angle. Note that the axes follow a right-hand
rule with the x axis aligned with the front of the vehicle.
Caution
The tail or back of the vehicle is marked with colored tape. When flying the vehicle it
is common to orient the vehicle such that the tail is pointing towards the operator with
the positive x axis (front) pointing away from the operator.
Figure 4.1: Quanser QBall 2axes and sign convention
4.3 QBall 2 Components
The components comprising the QBall 2 are labled in Figure 4.2, Figure 4.3 and Figure 4.4 and described in Table 4.1.
The QBall 2 joystick is illustrated in Figure 4.5.
QBALL 2 - User Manual DRAFT - April 6, 2015

(a)
(b)
Figure 4.2: QBall 2 components: cage and propellers
(a) (b)
(c)
(d)
Figure 4.3: QBall 2 components: DAQ and power board
QBALL 2 - User Manual 8

(a)
(b)
Figure 4.4: QBall 2 components: sonar and batteries
Figure 4.5: QBall 2 joystick
ID # Description ID # Description
1 QBall 2 protective cage 9 USB input
2 QBall 2 frame 10 QBall 2 DAQ power cable
3 10x4.7 propeller 11 QBall 2 power distribution board
4 Brushless DC motor 12 QBall 2 power switch
5 ESC 13 QBall 2 power LED
6 QBall 2 DAQ 14 Battery velcro strap
7 Battery connector 15 Connected batteries
8 Sonar 16 QBall 2 LiPo batteries
Table 4.1: QBall 2 components
QBALL 2 - User Manual DRAFT - April 6, 2015

4.3.1 QBall 2 frame
The QBall 2 frame (#2 in Figure 4.2) is the crossbeam structure to which the QBall 2 components are mounted
including the DAQ, power distribution board, motors and speed controllers. The frame rests inside the QBall 2
protective cage (#1 in Figure 4.2). The QBall 2's protective cage is a carbon fiber structure designed to protect the
frame, motors, propellers, and embedded control module (DAQ and Gumstix computer) during minor collisions. The
cage is not intended to withstand large impacts or drops from heights greater than 2 meters.
Caution
Do not pick up the QBall 2 from the cage as this may stress the cage and cause damage.
Instead, when transporting the QBall 2 lift it from the ends of the frame using both
hands to lift the frame from both sides.
4.3.2 QBall 2 DAQ
The DAQ is the QBall 2's data acquisition board. Together with the Gumstix embedded computer, the DAQ controls
the vehicle by reading on-board sensors and outputting motor commands. The DAQ is located inside a protective
enclosure underneath the cross frame of the QBall 2. The enclosure lid is opened by gently rotating the lid clockwise
when viewed from the top.
Each motor speed controller (#5 in Figure 4.2) is connected to a PWM motor output on the DAQ (#6 in Figure 4.2).
There are four motor output channels available on the DAQ and they are labeled F, B, L, and R to represent motor
commands to the front, back, left, and right motors, respectively. Each motor speed controller should be connected
to its corresponding PWM output with the ground (black wire) towards the inside of the DAQ board (see Section 6.2
for wiring details). The QBall 2 comes with the motors already connected to the DAQ, so no manual assembly is
necessary.
If it is ever required to remove the DAQ for testing or troubleshooting, the cables and wires must first be disconnected
from the DAQ PCB and removed from the DAQ enclosure. Remove the DAQ cover by gently rotating it clockwise
(when viewed from the top of the QBall 2). Disconnect the power, sonar, motor, and any other I/O cables plugged
into the DAQ and carefully extract them through the slots in the DAQ enclosure. Reattach the DAQ cover. Using an
allen wrench, remove the four screws shown in Figure 4.6, being careful to support the DAQ enclosure so it does
not fall. When reassembling the DAQ, first attach the DAQ enclosure to the frame, making sure to align the arrow
on the DAQ enclosure with the front of the vehicle (positive X axis direction). Then, remove the lid and carefully feed
the power, sonar, and motor cables through the enclosure slots. Reattach the cables to their corresponding headers
and screw on the enclosure lid.
Figure 4.6: QBall 2 DAQ case mounting points
QBALL 2 - User Manual 10

4.3.3 QBall 2 power distribution board
The QBall 2 uses two 3-cell 2700 mAh LiPo batteries (#16 in Figure 4.2) to power the DAQ and motors. These
batteries are housed atop the QBall 2 power distribution board (#11 in Figure 4.2) above the QBall 2's cross frame
and held in place using the provided velcro strap (#14 in Figure 4.2). The power distribution board connects both
LiPo battery packs in parallel and routes power to the four motors as well as the DAQ.
Caution
Make sure the batteries are connected and secured with the velcro strap before
attempting to fly the QBall 2.
Secure the batteries to the power board before connecting the batteries to the QBall 2 battery connectors (#7 in
Figure 4.2) and always turn off the power using the QBall 2 power switch (#12 in Figure 4.2) before changing
batteries.
Caution
LiPo batteries can be dangerous if charged improperly. Review the battery charging
procedures (see Section 7) and monitor battery levels frequently during flight. The
3-cell LiPo batteries can become damaged and unusable if discharged below 10 V. It
is recommended that the batteries be fully charged once they reach 10 Vor less.
4.3.4 QBall 2 motors and propellers
The QBall 2 uses four E-Flite Park 480 (1020 Kv) motors [3] (#4 in Figure 4.2) fitted with paired counter-rotating APC
10 ×4.7propellers [4] (#3 in Figure 4.2). The motors are mounted to the QBall 2 frame along the X and Y axes
and connected to the four speed controllers [5], which are also mounted on the frame. The motors and propellers
are configured so that the front and back motors spin clockwise and the left and right motors spin counter-clockwise
(when viewed from the top). The electronic speed controllers (ESCs) receive commands from the controller in
the form of PWM outputs from 1ms (minimum throttle) to 2ms (maximum throttle). Minimum throttle and maximum
throttle are mapped to values between 0and 1, respectively, using the HIL Write block to outputs the motor commands
(see Section 6.2 for details on the HIL blocks). The ESCs used in the QBall 2 are configured with the appropriate
throttle range during assembly. It is important that when the controller executes it initializes the ESCs by setting
the motor outputs to the minimum throttle 0, otherwise you can enter the program mode and alter the ESC settings.
Review the ESC's manual for instructions on changing ESC settings [5].
4.3.5 QBall 2 Joystick
The QBall 2 joystick is a critical component in operating the QBall 2. The joystick allows the operator to fly the QBall
2 using the controls for height (using the sonar to regulate the QBall 2 height), roll (rotating the QBall 2 about the x
axis to fly left/right), pitch (rotating the QBall 2 about the y axis to fly forward/backward), and yaw (rotating the QBall
2 about the z axis to change its direction or heading). Even when flying the QBall 2 in autonomous modes with the
provided controller the joystick is used to initialize and enable the QBall 2 and acts as a kill switch in the event the
QBall 2 controller goes unstable and must be stopped. Section 6.5 describes how to use the joystick to fly the QBall
2 using the provided Simulink models.
QBALL 2 - User Manual DRAFT - April 6, 2015

5 QBall 2 Model
This section describes the dynamic model of the QBall 2. The nonlinear models are described as well as linearized
models for use in controller development. For the following discussion, the axes of the QBall 2 vehicle are denoted
(x, y, z) and are defined with respect to the vehicle as shown in Figure 4.1. Roll, pitch, and yaw are defined as the
angles of rotation about the x, y, and z axis, respectively. The global workspace axes are denoted (X, Y, Z) and are
defined with the same orientation as the QBall 2 sitting upright on the ground.
5.1 Actuator Dynamics
The thrust generated by each propeller is modeled using the following first-order system
F=Kω
s+ωu(5.1)
where uis the PWM input to the actuator, ωis the actuator bandwidth and Kis a positive gain. These parameters
were calculated and verified through experimental studies and are stated in Table 5.1. A state variable, v, will be
used to represent the actuator dynamics, which is defined as follows,
ν=ω
s+ωu. (5.2)
5.2 Roll/Pitch Model
Assuming that rotations about the x and y axes are decoupled, the motion in roll/pitch axis can be modeled as shown
in Figure 5.1. As illustrated in this figure, two propellers contribute to the motion in each axis. The rotation around
the center of gravity is produced by the difference in the generated thrust forces. From Equation 5.2, let u= ˜u,
where ˜uis the control input for the pitch or roll dynamics that causes an increase or decrease in thrust force in the
two pitch/roll motors shown in Figure 5.1 and such that the changes in force of each motor are opposite in direction
so that the net result is a torque. E.g., the control signal is applied to increase the force in motor 1 and decrease
the force in motor 2. This change in motor forces is what causes the resulting torque and roll or pitch dynamics, so
we can ignore the net thrust force used to hover the QBall 2. The change in thrust generated by each motor can be
calculated from Equation 5.1. The roll/pitch angle, θ, can be formulated using the following dynamics
J¨
θ= ∆F L, (5.3)
where
J=Jroll =Jpitch (5.4)
are the rotational inertia of the device in roll and pitch axes and are given in Table 5.1. Lis the distance between
the propeller and the center of gravity, and
∆F= ∆F1−∆F2(5.5)
represents the net change in the forces generated by the motors. Note that the difference in the forces is generated
by the difference in the inputs to the motors, i.e.
∆u= 2˜u. (5.6)
By combining the dynamics of motion for the roll/pitch axis and the actuator dynamics for each propeller the following
state space equations can be derived
QBALL 2 - User Manual 12

Figure 5.1: A model of the roll/pitch axis
˙
θ
¨
θ
˙ν
=
0 1 0
0 0 2KL
J
0 0 −ω
θ
˙
θ
ν
+
0
0
ω
˜u. (5.7)
To facilitate the use of an integrator in the feedback structure a fourth state can be added to the state vector, which
is defined as follows
˙s=θ. (5.8)
After augmenting this state into the state vector, the system dynamics can be rewritten as
˙
θ
¨
θ
˙ν
=
0 1 0
0 0 2KL
J
0 0 −ω
θ
˙
θ
ν
+
0
0
ω
˜u. (5.9)
5.3 Height Model
The motion of the QBall 2 in the vertical direction (along the Z axis) is affected by all the four propellers. The dynamic
model of the QBall 2 height can be written as
M¨
Z= 4F cos(r)cos(p)−Mg, (5.10)
where Fis the thrust generated by each propeller, Mis the total mass of the device, Zis the height and rand p
represent the roll and pitch angles, respectively. The total mass, M, is given in the Table 5.1. As expressed in this
equation, if the roll and pitch angles are nonzero the overall thrust vector will not be perpendicular to the ground.
Assuming that these angles are close to zero, the dynamics equations can be linearized to the following state space
form
˙
Z
¨
Z
˙ν
˙s
=
0 1 0 0
0 0 4K
M0
0 0 −ω0
1 0 0 0
Z
˙
Z
ν
s
+
0
0
ω
0
u+
0
−g
0
0
.(5.11)
QBALL 2 - User Manual DRAFT - April 6, 2015

5.4 X-Y Position Model
The motion of the QBall 2 along the X and Y axes is caused by the total thrust and by changing roll/pitch angles.
Assuming that the yaw angle is zero the dynamics of motion in X and Y axes can be written as
M¨
X=4F sin(p),
M¨
Y=−4F sin(r).
Assuming the roll and pitch angles are close to zero, the following liner state space equations can be derived for X
and Y positions.
˙
X
¨
X
˙ν
˙s
=
0 1 0 0
0 0 4K
Mp0
0 0 −ω0
1 0 0 0
X
˙
X
ν
s
+
0
0
ω
0
u,
˙
Y
¨
Y
˙ν
˙s
=
0 1 0 0
0 0 −4K
Mr0
0 0 −ω0
1 0 0 0
Y
˙
Y
ν
s
+
0
0
ω
0
u.
5.5 Yaw Model
The torque generated by each motor, τ, is assumed to have the following relationship with respect to the PWM input,
u:
τ=Kyu,
where Kyis a positive gain and its value is given in Table 5.1. The motion in the yaw axis is caused by the difference
between the torques exerted by the two clockwise and the two counter-clockwise rotating propellers. The model of
the yaw axis is shown in Figure 5.2.
The motion in the yaw axis can be modeled using the following equation
Jy¨
θy= ∆τ.
In this equation, θyis the yaw angle and Jyis the rotational inertia about the z axis, which is given in Table 5.1. The
resultant torque of the motors, ∆τ, can be calculated from
∆τ=τ1+τ2−τ3−τ4
˙
θy
¨
θy
=
0 1
0 0
θy
˙
θy
+
0
Ky
Jy
∆τ
QBALL 2 - User Manual 14

Figure 5.2: A model of the yaw axis with propeller direction of rotation shown.
Parameter Value
K120 N
ω15 rad/sec
Jroll 0.03 kg.m2
Jpitch 0.03 kg.m2
M1.79 kg
Ky4N.m
Jyaw 0.04 kg.m2
L0.2m
Table 5.1: System parameters
QBALL 2 - User Manual DRAFT - April 6, 2015

6 System Setup
Section 6.1 describes setting up the vehicle hardware. Section 6.2 describes the QBall 2 sensors and how they are
accessed in QUARCr. Section 6.3 and 6.4 describe the procedures for configuring the wireless connection in order
to communicate with the QBall 2. Finally, Section 6.6 and Section 6.7 list the MatlabrSimulinkrfiles provided with
the QBall 2 and describe in detail the QBall 2 controller.
6.1 QBall 2 vehicle setup
1. First, make sure that the router is setup and connected to your PC (its network adapter). See Section 6.3 for
network and IP settings.
2. Check that all motors are securely fastened to the vehicle frame. Check that the propellers are firmly attached
to the motors in the correct order: clockwise propellers (viewed from the top) on the front and back motors,
counter-clockwise propellers on the left and right motors. Note that the back motor is indicated by a bright
colored marking tape on the QBall 2 frame.
Caution
Check that the motors are firmly secured to the frame regularly (after every 2 hours of
flight). Over time, vibrations in the frame may loosen the motor mounts. If a motor or
mount feels loose, tighten it immediately.
If a propeller is loose, use an allen key to remove the cap holding the propeller to the motor and ensure the
propeller mounting collar is pushed fully down onto the motor shaft. Replace the propeller on the mounting shaft
and replace the motor cap and tighten it with an allen key. Never change propellers or other components
of the QBall 2 with batteries connected.
3. Install the batteries as illustrated in Figure 6.1. With the power switch in the off position, insert the batteries
into the battery compartment on top of the power distribution board, making sure the batteries rest against the
far wall of the compartment. Secure the batteries in place using the velcro strap. Connect the batteries to the
power board battery connectors.
4. Power on the QBall 2 using the power switch located on the power distribution board. After approximately 1
minute the Gumstix wireless module should be active and connected to the WiFi (see Section 6.3 for network
setup).
6.2 QBall 2 sensors
This section describes the blocks that are used to read the QBall 2 sensors in Simulinkrand write outputs to the
motors. The QUARCrHardware-In-the-Loop (HIL) blockset it used to communicate with Quanserrdata acquisition
cards. For detailed information on the HIL blockset see the QUARCrHIL user guide in the Matlabrhelp under
QUARC Targets/User's Guide/Accessing Hardware.
The QBall 2 DAQ provides several high-resolution avionics sensors, which are used to measure and control the
stability of aerial vehicles. The I/O of the QBall 2 DAQ includes:
•4PWM motor outputs
•2configurable PWM outputs
•3-axis gyroscope, 250/500/2000 degrees-per-second selectable range
•3-axis accelerometer, ±2g/4g/8gselectable range
• Sonar height sensor, 0.2−7.65 mrange, 1cm resolution
QBALL 2 - User Manual 16

Figure 6.1: Battery connection procedure
• Battery voltage measurement
•2analog inputs, 12-bit, 0−5V
•1SPI
•8digital I/O
•1UART
•1I2C
Figure 6.2 shows the location of the I/O listed above on the QBall 2 DAQ. The DAQ I/O listed above is accessed using
the QUARC HIL blockset. The UART, SPI, and I2C communication channels are accessed through the QUARCr
Stream blockset. For more information on accessing communication stream data see the QUARCrhelp under
QUARC Targets/User's Guide/Communications. Table 6.1 lists the HIL blocks used to communicate with the QBall
2's data acquisition hardware.
QBALL 2 - User Manual DRAFT - April 6, 2015

Block Description
The HIL Initialize block selects the DAQ board and configures the board
parameters. The HIL Initialize block is named via the Board name parameter,
and all other HIL blocks reference the corresponding HIL Initialize through its
name. The HIL blocks will interface to the DAQ specified in the HIL Initialize
Board type parameter (qball2).
The HIL Read Write block is used to read sensor measurements from the DAQ
and write motor commands to the four QBall 2 motors. The inputs and outputs
are specified with numeric channel numbers given in Table 6.2 and Table 6.3,
respectively.
The HIL Watchdog block is used to set the timeout limit for the watchdog timer.
For the QBall 2 DAQ board, if there is no motor output command received for
a consecutive period of time exceeding the watchdog timeout value then the
watchdog will trigger, forcing the motor outputs to 0. The default timeout value
for the watchdog is 50ms unless specified otherwise with this block. This block
can be used to change the timeout value if 50ms is not suitable.
Table 6.1: HIL blocks
Figure 6.2: QBall 2 DAQ board.
QBALL 2 - User Manual 18

To initialize the QBall 2 DAQ board, a HIL Initialize block must be placed in the model. The HIL Initialize block is used
to initialize a data acquisition card and setup the I/O parameters. In the HIL Initialize block, select the board type
'qball2' to configure the QBall 2 DAQ and, if desired, enter a name in the Board name field as shown in Figure 6.3.
Next, to read and write from the QBall 2 DAQ, add a HIL Read Write block to the model (note that the QBall 2 DAQ is
optimized for best performance when a single HIL Read Write block is used in a model, adding more HIL I/O blocks
may reduce the performance, particularly the maximum sample rate). In the HIL Read Write block, select the board
name corresponding to the board name given in the HIL Initialize block. The channels available for reading and
writing for the DAQ are listed in Table 6.2 and Table 6.3 below. Enter the channel numbers to be read/written or use
the browse buttons to open a channel selection dialog as shown in Figure 6.4.
Figure 6.3: HIL Initialize block with the QBall 2 board selected.
Channel type Read channel numbers Description Units
Analog 0−1Analog inputs V
2Supply voltage (battery) V
Encoder none -
Digital 0−7Reconfigurable digital I/O
Other 0Sonar height sensor m
3000 −3002 3-axis gyroscope (x, y, z) rad/s
4000 −4002 3-axis accelerometer (x, y, z) m/s2
10000 Temperature sensor ◦C
Table 6.2: QBall 2 input channels
QBALL 2 - User Manual DRAFT - April 6, 2015

Channel type Write channel numbers Description Units
Analog none -
PWM 0−1PWM outputs % duty cycle from 0-1
Digital 0−7Reconfigurable digital I/O
8LED
9ESC enable
Other 11000 Left motor Throttle from 0-1
11001 Right motor Throttle from 0-1
11002 Front motor Throttle from 0-1
11003 Back motor Throttle from 0-1
Table 6.3: QBall 2 output channels
Figure 6.4: Channel selection dialog for the HIL Read Write block
For the QBall 2, the Other output channels 11000 −11003 are used to command the front, back, left, and right
motors, respectively. The range of the motor output values is 0to 1(minimum throttle to maximum throttle), which
corresponds to a 1ms to 2ms PWM pulse, respectively. A command of 0corresponds to zero throttle, which will
cause the motors to stop.
The 3-axis gyroscope and accelerometer measurements are used to measure the QBall 2 dynamics and orientation
(roll, pitch and yaw). These IMU inputs are crucial for controlling the flight of the QBall 2. The QBall 2 DAQ utilizes
a STMicroelectronics 3-axis gyroscope [6] and a Freescale 3-axis accelerometer [7]. The QBall 2 sonar sensor is
the Maxbotix XL-Maxsonar EZ3, which measures distances between 20cm and 765cm with 1cm resolution. Objects
between 0-20cm are ranged as 20cm. The sonar sensor is positioned at the bottom of the QBall 2 and is used to
measure the QBall 2 height for closed-loop height control.
QBALL 2 - User Manual 20
Table of contents
Other Quanser Drone manuals