MHV Quadcopter Instruction manual

Stephen Dade
MHV Quadcopter
Workshop Manual 2
July/August 2013

V 3.1 MHV Quadcopter Workshop Page 1 of 36
Table of Contents
Objective .................................................................................................................................................3
What to bring to the Workshop.............................................................................................................. 3
The hardware.......................................................................................................................................... 3
The software ........................................................................................................................................... 3
Ground Station.................................................................................................................................... 3
Autopilot ............................................................................................................................................. 4
ESC’s....................................................................................................................................................4
Transmitter .........................................................................................................................................5
Radios.................................................................................................................................................. 5
Build Instructions .................................................................................................................................... 5
Timing..................................................................................................................................................5
Evening 1................................................................................................................................................. 5
Introduction to Quadcopters ..............................................................................................................5
Components........................................................................................................................................ 6
Generating Thrust ...............................................................................................................................6
Basic Stats ........................................................................................................................................... 7
Autopilot Modes ................................................................................................................................. 7
Initial charging of the battery .............................................................................................................8
Frame assembly .................................................................................................................................. 8
Evening 2...............................................................................................................................................10
Transmitter Firmware Upgrade ........................................................................................................10
Transmitter setup .............................................................................................................................12
ESC Firmware Flashing ......................................................................................................................14
Simulation .........................................................................................................................................16
Wiring up the system –Power train ..................................................................................................17
Propeller Balancing ...........................................................................................................................18
Radio binding (and servo test) and Failsafe......................................................................................19
Evening 3...............................................................................................................................................20
Safety ................................................................................................................................................20
Current Australian Law and Regulations.......................................................................................20
LIPO Batteries................................................................................................................................ 21
Propellers ......................................................................................................................................21
Radio Interference ........................................................................................................................22

V 3.1 MHV Quadcopter Workshop Page 2 of 36
Wiring up the system –Flight Electronics.........................................................................................22
Connecting the ground station .........................................................................................................24
Firmware Loading .............................................................................................................................25
Telemetry Radio Setup......................................................................................................................26
Telemetry Radio Connection ............................................................................................................27
RC Radio Calibration .........................................................................................................................28
Accelerometer Calibration................................................................................................................ 29
Compass Calibration .........................................................................................................................30
Loading Parameters ..........................................................................................................................31
Motor and ESC tests and calibration ................................................................................................32
Build Checklist................................................................................................................................... 33
Test Flights ........................................................................................................................................33
Evening 4...............................................................................................................................................34
Safety ................................................................................................................................................34
Startup ..............................................................................................................................................34
Longer flights.....................................................................................................................................34
LOITER ...............................................................................................................................................34
RTL.....................................................................................................................................................34
ALT_HOLD .........................................................................................................................................34
AUTO.................................................................................................................................................34
References ............................................................................................................................................35

V 3.1 MHV Quadcopter Workshop Page 3 of 36
Objective
To design and build a quadcopter for a workshop to be held at the Make Hack Void Hackerspace
(Canberra). It is designed to be:
(Relatively) Cheap
Commonly available spare parts
Open source or hackable hardware/software where available
Easy for beginners to build
Strong/tough enough to withstand beginner pilots
Able to carry a 200g payload (such as a small camera)
What to bring to the Workshop
Laptop (and charger!). Confirm that the APM Mission Planner software (see the Ground
station software section) runs on your laptop beforehand.
MHV will provide everything else.
Note the workshop will require basic soldering. If you haven’t soldered before, we can teach you
during the workshop
The hardware
The following list includes all parts (and some tools) required to build the quadcopter. Note you may
need a soldering iron for electrical work. Other hardware tools should be in your shed (or local
hackerspace!)
The list can be found at https://canberrauav.readthedocs.org/en/latest/quadcopter-
workshops/quadcopter-workshop-2-0/parts-list.html for the list of tools.
Total cost of all parts is $730.
The software
Ground Station
The standard GCS is the APM Mission Planner
http://ardupilot.com/downloads/
This will run on Windows XP/Vista/7 or Ubuntu (or similar). Linux users need to install the mono
framework.
The program does require a moderately powerful laptop/PC to run on. It will barely run on most
netbooks. An active internet connection will be required to use some features.
The APM Mission Planner is frequently updated. Fortunately, it includes auto-update software.

V 3.1 MHV Quadcopter Workshop Page 4 of 36
More advanced users can use MAVProxy (a command line GCS) instead:
http://tridge.github.io/MAVProxy/
MAVProxy is compatible on Linux and Windows platforms, and uses the Python framework.
An alternative option is APM Planner 2. It is based off the qGroundControl software, with APM-
specific improvements. At the time of writing it is still in beta. APM Planner 2 can run on any
Windows, Mac or Linux systems using the Qt framework. It is a GUI based ground station and has a
fairly small impact on system resources. It is available at:
http://firmware.diydrones.com/Tools/APMPlanner/
The telemetry radios can be (via the supplied cable) connected to a mobile phone or tablet running
Android 4.1 or later. Look for the Droidplanner app on the Google Play store.
Autopilot
We use the ArduPilotMega (APM):
https://github.com/diydrones/ardupilot
The APM mission planner includes the APM software in it. This software is being frequently updated
with bug fixes, better navigation code and more features. It is recommended to update when a new
version is released.
Note that the Pixhawk board is used for this workshop. When uploading firmware ensure the
Pixhawk version of the APM software is selected.
A note about terminology: Pixhawk refers to the physical board based on the ARM chip. APM refers
to the software running on the board. To make things more confusing, APM also refers to the
physical boards based on the ATMEGA2560 chip.
Due to the 2 hardware boards, there are two builds of the APM software:
ATMEGA board
Pixhawk (or PX4) board
It should be emphasised that the ATMEGA and Pixhawk builds run the same APM software, minus
the different hardware drivers. The high level navigation, positioning and other features are exactly
the same.
For the purposes of this workshop, I will refer to the Pixhawk when referring to the board and APM
when referring to the software.
ESC’s
The SimonK firmware is compatible with the ESC’s used in this project.

V 3.1 MHV Quadcopter Workshop Page 5 of 36
https://github.com/sim-/tgy
This firmware increases the update rate of the ESC’s, making the ESC (and hence motors) more
responsive to commanded throttle changes.
Transmitter
The er9x firmware is built for the Turnigy 9X transmitter.
http://code.google.com/p/er9x/
The er9x firmware makes the GUI far easier to navigate.
Radios
Like the APM, the radios use open-source firmware.
http://code.google.com/p/ardupilot-mega/wiki/3DRadio
The firmware is not frequently updated, so we probably won’t need to update this.
Build Instructions
Timing
The build will take several evenings. Flight testing and lessons will take an afternoon.
The timing is:
Evening 1 –Introduction. Flashing ESC’s, Transmitters and frame assembly. Soldering of
power connectors. Simulator setup
Evening 2 –Flight electronics installation.
Evening 3 –Calibration and testing. Safety Briefing
Evening 4 –Indoor flight at Dickson College. Simple flights
Afternoon 1/2 –Outdoors flight at a local oval. Training of advanced flight modes
Evening 1
Introduction to Quadcopters
A quadcopter is a flying vehicle possessing 4 identical rotors, evenly spaced around the central
fuselage (hub).
First, quadrotors do not require mechanical linkages to vary the rotor blade pitch angle as they spin.
This simplifies the design and maintenance of the vehicle. Second, the use of four rotors allows each
individual rotor to have a smaller diameter than the equivalent helicopter rotor, allowing them to
possess less kinetic energy during flight. This reduces the damage caused should the rotors hit
anything. For small-scale UAVs, this makes the vehicles safer for close interaction. Some small-scale

V 3.1 MHV Quadcopter Workshop Page 6 of 36
quadrotors have frames that enclose the rotors, permitting flights through more challenging
environments, with lower risk of damaging the vehicle or its surroundings. (Wikipedia)
Components
Electronic Speed Controller (ESC): Regulates power to the motor according to the input throttle
level. It also provides +5V power for the flight electronics
RC Receiver: A (usually 2.4 GHz) RC radio receiver on the quadcopter that receives commands from
the RC transmitter on the ground. One way link
Telemetry Link: A (usually 915 MHz or 433 MHz) bidirectional link between the flight controller and
ground station. Provides current status to the ground station and accepts flight commands to the
quadcopter.
RC Transmitter: A (usually 2.4 GHz) RC radio transmitter used by the pilot to direct the quadcopter’s
direction and position.
Hub: The central fuselage of the quadcopter. Contains the flight electronics and battery
Arm: The beam that each of the motors sit on.
Generating Thrust
The motors and propellers alternate in direction and pitch, in order to cancel out and horizontal
torque. All propeller/motor combinations still produce downwards thrust:

V 3.1 MHV Quadcopter Workshop Page 7 of 36
By altering the thrust to each of the motors, the quadcopter can move and turn:
Pitch (forward/back): Decrease thrust to motors 1 and 3. Increase thrust to motors 2 and 4 to
maintain altitude. This will pitch the quadcopter forwards, giving it a forward velocity.
Yaw (horizontal rotation): Decrease thrust to motors 3 and 4. Increase thrust to motors 2 and 1 to
maintain altitude. This will rotate the quadcopter counter-clockwise.
Roll (left/right): Decrease thrust to motors 2 and 3. Increase thrust to motors 1 and 4 to maintain
altitude. This will roll the quadcopter left, giving it a sidewards velocity.
Basic Stats
The basic stats are:
Top speed: 2.5 m/s vertical, 6m/s horizontal (no payload)
Max Payload: 400g
Flight time: 12 min (no payload)
Note quadcopters (particular those < 1kg) are very sensitive to payloads. The payload should be as
close as practical to the quadcopter’s centre of mass.
Autopilot Modes
The ArdupilotMega (2.9.1 at time of writing) has the following flight modes:
STABILISE –The primary mode. Use the RC sticks to navigate the quadcopter. Otherwise, it
will stay level
ALT_HOLD –It will maintain the current altitude. Otherwise, the RC sticks can be used to
navigate the quadcopter
LOITER –It will maintain position, heading and altitude at the current point. Altitude can be
changed by changing the throttle value
RTL –It will return to its takeoff (where the quadcopter was armed) point. Depending on the
mode settings, it will either hover at a 5-10m altitude and wait for the pilot to land it or
gradually descend until it lands.
AUTO –It will run through the waypoints currently loaded. The waypoints can be a simple
“go to point”, “loiter for X min”, “change velocity”, “land”. Note there is not automated take
off.

V 3.1 MHV Quadcopter Workshop Page 8 of 36
ACRO –Advanced Mode. The RC sticks act as rate controllers rather than position
controllers. There is no automatic stabilisation
LAND –lands the quadcopter on the ground at its current point
More modes may become available as new versions of the APM software are released.
Initial charging of the battery
The2 batteries come shipped with a nominal 60% charge. Use the battery charger to charge both the
flight battery and RC transmitter battery. The settings on the battery charger should be: 3S LiPo
battery type, charge rate 5A for the flight battery and 2.5A for the RC Transmitter battery.
Both the power cable and balance connector should be hooked up to the charger.
The batteries will be fully charged around the 12.6 V level. The charger will emit a series of loud
beeps when it is done.
Frame assembly
1. Attach the motor mounts to the end of each arm:
2. Use the M3 screws to attach the motors:
3. Attach 1 of the leg struts, along with the spring and screws:
4. Attach the other half of the strut:

V 3.1 MHV Quadcopter Workshop Page 9 of 36
5. Assemble the top of the hub plate. Note there are 3 plates here:
6. Along with the bottom plate, start attaching the legs:

V 3.1 MHV Quadcopter Workshop Page 10 of 36
7. Add in the rest of the legs:
Thread the small piece of Velcro in a loop through and underneath the bottom hub plate. It should
form a harness for the battery.
Evening 2
Transmitter Firmware Upgrade
The firmware and settings file for the Turnigy 9XR can be found at
https://canberrauav.readthedocs.org/en/latest/quadcopter-workshops/quadcopter-workshop-
2.html. Download these files and use then as needed in the following section. The firmware can be
found at http://code.google.com/p/er9x/source/browse/trunk/er-128.hex
Use the AVR programmer to connect the Transmitter’s 6-pin connector to the laptop’s USB port:
1 - The RC Transmitter connected to the AVR Programmer

V 3.1 MHV Quadcopter Workshop Page 11 of 36
Connect the USB side to a laptop and open up Epee (a sudo may be required under Linux). Go to
Burn -> Configure. Change the programmer to avrispmkII, mcu to m128 and add a “-F” to the
additional options.
2 - eePe programmer setup
Press the “burn” button on the main screen and select the supplied firmware file to upload.
3 - The eePe software on Windows
Wait for the program to complete and confirm that there were no errors during the flashing process.
To upload the settings file, go to File -> Open and select the settings file. Under General
Settings, change the owner name to something unique (like your name).
-F

V 3.1 MHV Quadcopter Workshop Page 12 of 36
4 - eePe EEPROMN editor
Then go Burn -> Write Memory to TX.
Wait for the program to complete and confirm that there were no errors during the flashing process.
After flashing, remove the programmer and confirm that the new firmware is working correctly (you
may get a few errors the first time you start it up, this is normal).
Transmitter setup
Note this section is simply a reference for manually changing the settings of the Transmitter to
match the contents of the 9XR settings file in the previous section. If you have already uploaded
the settings, you can skip this section.
Turn on the transmitter.
To go the global settings menu, press the LEFT button
Use UP/DOWN to cycle through the settings and LEFT/RIGHT to change the selected setting.
The settings that need to be changed:
Owner Name = <your name>
Beeper = NoKey
Battery Warning = 9.9 V
Splash Screen = OFF
Splash Name = OFF
Throttle Warning = OFF
Switch Warning = OFF
Mode = 1
Go to the calibration page:
And calibrate the sticks.
Press exit to get back to the main screen.

V 3.1 MHV Quadcopter Workshop Page 13 of 36
Press RIGHT to get to the model profiles. A number of different profiles (with their own settings) can
be set up here. We need to create a profile for the quadcopter.
Press RIGHT again to get into the settings for MODEL01.
The settings for it should be:
Name = Quadcopter
Go across to the MIXER page:
The channels should be setup as such:
CH1 = 100% AIL
CH2 = 100% ELE
CH3 = 100% THR
CH4 = 100% RUD
CH5 = 61% HALF ID0
-76% HALF GEA
10% HALF ID2
36% HALF ID1
CH6 = 100% FULL TRN
CH7 = 100% FULL ELE
Go across to the LIMITS page
Set CH2 to INV
At this point, your transmitter is set up with its modes:

V 3.1 MHV Quadcopter Workshop Page 14 of 36
5 - Channel layout on the RC Transmitter
ESC Firmware Flashing
Note: For the purposes of this workshop, a computer will be setup with the flashing software ready
to go.
Carefully cut off the heatshrink material, taking care not to damage the components underneath. Try
cutting from the side with a knife
6 - Location of microcontroller on the ESC
For the purposes of this workshop we are using a dedicated firmware programmer device. Using this
device, line it up over the microcontroller on the ESC (taking note of the correct orientation). Hook
the programmer to a laptop and load the SimonK firmware.
CH5 –Mode
selection
CH6 (various)
CH7 –(various)
CH1 –ROLL
(LEFT/RIGHT)
CH2 –PITCH
(FORWARD/BACK)
CH3 –THROTTLE
(UP/DOWN)
CH7 –YAW (PIVOT
LEFT/RIGHT)

V 3.1 MHV Quadcopter Workshop Page 15 of 36
7 - Using the firmware flasher on the ESC
Use the “KKMulticopter Flashtool” from
http://lazyzero.de/en/modellbau/kkmulticopterflashtool#download.
If you are running windows, ensure to install the USBASP driver first.
The black corner of the firmware flasher aligns to the pin 1 corner (the corner on the IC with the
dot).
Use the “Keda (kda)” firmware variant with the “atmega 8-based brushless ESC + enable Bootloader”
8 - kkMulticopter Flash Tool setup for ESC flashing

V 3.1 MHV Quadcopter Workshop Page 16 of 36
Under Linux, grab the Github download of the SimonK firmware (https://github.com/sim-
/tgy/downloads) and look for the “kda.hex” variant. This is the correct firmware for the Multistar
20A ESC’s. Use the following shell command to upload it:
avrdude –c usbasp –p m8 –U flash:w:kda.hex
(a sudo may be required on some systems)
Once programmed, apply (new) heatshrink to the ESC. Repeat for all 4 ESC’s.
Ignore any errors that say “warning: unable to sck period”. The ESC will still be programmed.
Simulation
The RC transmitter can be connected (via the supplied USB dongle) to your PC and used as a
standard joystick. Combined with the (various) RC flight simulators, it can serve as a decent training
module for new pilots and you can practice your flying skills in a safe environment.
Simply connect the (audio stereo) cable to the rear of your RC transmitter this cable plugs into the
dongle, which in turn connects to a USB port. The TX module must be removed (the box module on
the back of the transmitter) and the power switch of the RC transmitter must be off.
There are a few options for RC Simulators. The most popular are:
Realflight (http://www.realflight.com/) which is commercial
CRRCSim (http://sourceforge.net/apps/mediawiki/crrcsim/index.php?title=Main_Page)
which is open source.
Either will work well. In the case of this workshop we will be using CRRCSim.
Open CRRCSim, press the esc key to get the main menu. Go to Options -> Controls ->
Input Method and enable the RC Controller:
9 - CRRCSim Input Selection
Then go to Options -> Controls -> Configure. Select the correct channels for the sticks
and calibrate the controller.

V 3.1 MHV Quadcopter Workshop Page 17 of 36
10 - CRRCSim calibration page
Go to Options-> Aircraft and ensure the x-config quadcopter (attitude controlled) is
selected:
11 - CRRCSim model selection
Return to the simulation and test that the RC Transmitter controls the simulator correctly. Use this
simulation to get a feel for the quadcopter’s controls and movement.
Wiring up the system –Power train
Connect the ESC’s up to the motors and thread the power distributor through between the hub
plates and hook it up to the ESC’s. Wire ties or tape can be used to affix the ESC’s to the arms. They
ESC’s should be set back from the hub in order to reduce electrical interference to the Pixhawk.

V 3.1 MHV Quadcopter Workshop Page 18 of 36
The ESC <-> Motor connections should be left loose for the moment, as they may need to be
changed later (to set the correct motor direction).
Propeller Balancing
Given how fast the propellers on the quadcopter spin, it is important that the propellers are
balanced (equal mass on both sides). If they are not, the quadcopter may have a slight spin or drift
when it is flying.
To balance them, you need a propeller balancer:
12 - Propeller balancer
Simply place the propeller in the rod and watch for movement. If one side of the propeller is clearly
heavier, use some sandpaper to (gently) rub some mass off the top (the side with the embossed
writing on it) of the propeller until it is balanced.
Repeat for all 4 propellers.

V 3.1 MHV Quadcopter Workshop Page 19 of 36
Radio binding (and servo test) and Failsafe
Binding is the action of syncing your transmitter and receiver. Due to the nature of the process, this
can only be done one at a time.
For the servo cables: The brown cable goes to the top, red in the middle and orange on the bottom.
1. Plug in the TX Module to the Transmitter and connect the antenna. NOTE: Do not turn the
TX Module on without the antenna connected –you could damage the TX Module.
2. Hook up one of the ESC’s to the RC receiver to provide power. Attach a servo to channel 3.
3. The binding wire (the loop) should be plugged in to the bind plug on the RC receiver.
4. Power up the RC receiver by connecting the flight battery to the main plug on the
quadcopter. The RC Receiver should be flashing at a fast rate
5. Whilst holding the bind button on the underside of the RC transmitter, switch it on.
6. Wait until the light on the RC receiver stops flashing. This take around 10 seconds
7. Turn off the RC transmitter, then the RC receiver.
8. Remove the bind plug from the RC receiver
Table of contents