MultiWii Flight Controller Guide
The following
is a brief guide for how to configure and use a MultiWii flight controller
board. It shows how to compile and
upload the MultiWii library, connect the components, configure, and operate the
board.
Source
files
The following
rar file contains the most recent version (version 2.4) of the MultiWii library
and configuration tools:
http://users.encs.concordia.ca/~bwgordon/MultiWii_2_4.rar
You should
download it and expand the file into a separate folder (e.g. my_multiwii). You will configure files in this folder and
then compile the library and upload it to your MultiWii board. Note the MultiWii libraries (all versions)
can also be found here:
https://code.google.com/archive/p/multiwii/
The following
steps can be used to setup and operate the MultiWii board.
1)
Safety
guidelines
Multi-copters
can be fairly dangerous depending on the capability of the motors. Regardless, you should be careful of your
fingers and wear eye protection when first using your multi-copter with a new
flight controller board. Install an
on-off switch and always turn it off when working with the board or at least
disconnect the battery. A flight
controller board can potentially turn the motors on with full voltage at
unexpected times.
To reduce the
risk when first working with a flight controller board you should remove the propellers
from all the motors and at first even disconnect the battery (i.e. just
run the MultiWii from the USB port).
Li-poly
batteries can also be dangerous if you short the wires (resulting in very
bright sparks and very hot wires). You
should be careful when connecting li-poly batteries to your multi-copter and
tape off one wire if you are directly wiring a battery or its connector. Li-poly batteries are also a fire hazard and
should be stored in a sturdy metal box when not in use. They should not be left unattended when
charging.
2)
Install
USB drivers and software
The flight
controller board is normally connected to a PC with a micro USB cable. In some cases there is a USB – FTDI adapter
to connect to the board. In either case
you usually need to install the appropriate driver software. For Flip 1.5 and 2.5 boards the following
CP210x device driver is needed.
https://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx
Note: you
need to be administrator of the computer in order to install the device
driver. However, some computers might
already have the drivers installed and in some cases Windows will install the drivers
automatically after the board has been plugged in (wait 30s or so).
You should
install a good C++ text editor such as Notepad++ (for Windows) or TextWrangler
(for Mac) in order to modify the text files in the MultiWii library. Please see the Text Editor section of the
following link for instructions on installation and configuration for these
packages.
http://users.encs.concordia.ca/~bwgordon/lesson1_software_installation.html
Install
Arduino IDE version 1.6.8 from the following link.
https://www.arduino.cc/en/Main/OldSoftwareReleases#previous
More recent
versions might work, but there are no guarantees since I did my testing on this
version.
You should
also install VLC to watch the videos on this webpage:
3)
Test
the board
Once the USB
driver has been installed you should perform a simple test of the board from
the Arduino IDE. The following video
shows how this is done.
http://users.encs.concordia.ca/~bwgordon/test_multiwii_board.mp4
Note in order
to watch the videos on this webpage you should right click (two finger click on
Mac) on the link of the video and select “Save Link As …” on Google Chrome or
“Download Linked File As ...” on Safari.
The file can then be opened and played with VLC.
If the
testing process doesn’t work it’s most likely because the driver was not
installed properly or due to some incompatibility between the computer and the
board. In that case you should try
another computer / operating system.
4)
Modify
the configuration file
In order to
compile and upload the MultiWii library you first need to modify the
configuration file. The following
webpage describes how this is done.
http://users.encs.concordia.ca/~bwgordon/MultiWii_config.html
5)
Compile
and upload the library
The following
video shows how to compile and upload the MultiWii library to the flight
controller board.
http://users.encs.concordia.ca/~bwgordon/compile_multiwii.mp4
6)
Run
the configuration program
The following
video shows how to use the MultiWii configuration program with just the USB
cable connected. Don’t connect the other
components yet.
http://users.encs.concordia.ca/~bwgordon/multiwii_config.mp4
7)
Connect
the board to other components
The following
document shows how to connect the board to the other hardware components.
http://users.encs.concordia.ca/~bwgordon/multiwii_connection_diagrams.pdf
Note: you
should also install a battery connector and an on-off switch on the
multi-copter. If you are modifying an
existing drone you can normally recycle these components from the drone.
It’s also a
good idea to install a battery monitor so you know when your drone is running
out of power. Information about this
will be added in the near future – ask me if you don’t see it.
8)
Operational
testing
Note: to reduce the risk when first working with the
flight controller board you should remove the propellers from all the motors
and at first even disconnect the battery (i.e. just run the MultiWii from the
USB port).
The following
video shows how to configure the board and test its operation after the
components have been connected (except the propellers).
http://users.encs.concordia.ca/~bwgordon/multiwii_operation1.mp4
Note: in
order to arm the controller the MultiWii board must be flat.
In the video
above it was seen that for the Spektrum DXe Transmitter and AR610 Receiver the
yaw input signal (needed for arming/disarming the controller) varied from 1190
to 1790 (with the input trim switches centered). The throttle input (also used for arming and
disarming) varied from 1090 to 1850. However, in order to arm the controller
the MultiWii library expects a yaw input of greater than 1900 and a throttle
input of less than 1100. In order to
disarm the controller, the library expects a yaw input of less than 1100 and a
throttle input of less than 1100. This
problem was solved in the video by adjusting the trim switches, but that was an
inconvenient short term solution.
There are two
ways of solving this problem for a given transmitter/receiver. The first way is to configure the transmitter
so that the range of the inputs (yaw, throttle, etc.) vary from 1075 to
1925. For the Spektrum DXe you need a
special USB cable (which I don’t feel like buying or using).
The second
way (my preferred method) is to adjust the expected input range in the MultiWii
library. This can be done by changing
the following lines in “MultiWii.h” as follows.
#define
MINCHECK 1205
#define
MAXCHECK 1775
A yaw input
of less than MINCHECK is required to disarm. This will now occur for the
observed minimum value of 1190 for the transmitter. A yaw input of greater than MAXCHECK is
required to arm. This will now occur for
the maximum input signal of 1790. The
throttle must also be less than MINCHECK to arm / disarm which will occur for
the minimum observed value of 1090.
Note: the
MINCHECK and MAXCHECK values might have to be adjusted for different
transmitters and receivers. The
transmitter input ranges can be observed using the configuration program as
illustrated in the above video. Before
doing that make sure the trim switches are centered. This should result in a special clicking
sound from the transmitter and an input value of around 1500.
Note: In the Spektrum DXe transmitter the rate switch
above the right stick controls the range of the input signals. When the switch is high the range is as noted
above. When the switch is low the range
is from 1105 to 1905 when the trims switches are centered. This is the recommended rate switch setting
since the range is closer to the MultiWii default range. For the rate switch on this setting the
following parameters are appropriate:
#define MINCHECK 1115
#define MAXCHECK 1895
I suspect the rate switch on my transmitter is maybe
upside down (the round switches can get lose and change direction
tightened). Be careful to make sure you
are using the correct rate switch setting in order to stay consistent. This can be checked with the configuration
program.
After the
MINCHECK and MAXCHECK values have been modified in MultiWii.h the library must
be re-compiled and uploaded again (step 5) and the board sensors calibrated
(step 6). After these steps are
completed you can move on to the next video which illustrates more aspects of
operational testing and configuration.
http://users.encs.concordia.ca/~bwgordon/multiwii_operation2.mp4
Note: it seems that the board prefers to be horizontal
and pointing approximately in the north direction in order to arm (not completely
sure about the north direction though – could depend on the board and flight
controller mode).
In the video above it was found that the motor outputs
would not go to zero (i.e. the motors wouldn’t stop) even when the MINTHROTTLE
was small (the minimum observed value was 1220). In order to fix this problem the following
line (#37) in EEPROM.cpp needs to be changed:
eeprom_read_block((void*)&conf,
(void*)(global_conf.currentSet * sizeof(conf) + sizeof(global_conf)),
sizeof(conf));
The line needs to be changed to:
eeprom_read_block((void*)&conf,
(void*)(global_conf.currentSet * sizeof(conf) + sizeof(global_conf)),
sizeof(conf));
conf.minthrottle = MINTHROTTLE;
Reversing transmitter stick directions
For the Spectrum DXe transmitter I found (after some
initial flights with my pimped Syma X5C) that the right stick in the horizontal
direction (Aileron) had the wrong direction.
You need to reverse its direction if it hasn’t been done so already. The
instructions for reversing stick directions are given here:
http://users.encs.concordia.ca/~bwgordon/Spektrum_DXe_manuals.rar
Note: before
tuning the PID controllers and testing the multi-copter brushless ESCs must
first be calibrated (brushed ESCs don’t require calibration). Information about how this is done is given
in the Lynxmotion MultiWii “Electronics & Wiring” manual in the “ESC
Throttle Calibration” section. Note you
should not use the “Alternate ESC Calibration” in the Lynxmotion MultiWii
“Software Configuration” manual. Both
manuals are provided here for reference.
http://users.encs.concordia.ca/~bwgordon/multiwii_software.pdf
http://users.encs.concordia.ca/~bwgordon/multiwii_electronics.pdf
For some
multi-copters the propellers might need to be balanced. This is discussed in “Propeller Balancing”
section of the Lynxmotion electronics manual above. Note that a plastic propeller can sometimes
be balanced by trimming a small amount of material from the tip of the
propeller.
9) Flight
testing
Note: make sure you disconnect the USB cable before
flying the multi-copter. It’s very easy
to damage (i.e. pull off) the USB connector on the MultiWii board.
Note this section is just preliminary. Don’t proceed until I have looked at your
multi-copter.
For initial
flight testing, find a relatively large open space indoors (greater than 10
feet by 10 feet). Make sure all
participants are aware of the test and well away from the drone before
connecting it and flying.
After you
have completed step 8 you should be able to arm and disarm with the battery
connected and the USB not connected. The
motors should then respond appropriately with adjustments of the transmitter
stick. Note that the default PID gains
should be sufficient to perform some initial test flights.
At this point
you can connect your propellers back on your multi-copter (make sure the
battery is not connected). Place your
drone flat on the ground pointing approximately in the north direction. Power up the transmitter (this should always
be done before connecting the battery). Then
connect the battery while keeping your hands away from the propellers. Step well away from the multi-copter and then
arm the flight controller. Then disarm
the flight controller to make sure you know how disarm in case you run into
problems. Note you should always
disarm controller before you get near the multi-copter – make sure you can see
the arm and disarm LED on your drone for confirmation.
Arm the
controller and slowly increase the throttle so that the drone is 6-12 in above
the ground and note any tendencies to move in one direction. Then land and make
small adjustments of the trim switches to reduce any tendencies. Repeat the process in this paragraph until
the trim switches are adjusted.
At this point
you should try flying the drone 3-12 in above the ground for some time to build
up your intuition of how the drone flies.
Then try gradually increasing the height as you become more
confident. Note that larger drones are
heaver and can be more easily damaged when dropping from significant heights
especially when dropping onto hard surfaces.
This is one of the reasons I like small quads such as the Syma X5C.
10) PID
controller tuning
This will be
added later. Take a break for now.