Depending on the method that you acquire your Tiny 2.11 autopilot

advertisement
Autopilot Configuration
Hardware Overview
The major hardware components in the plane are:









Autopilot Control Board
Battery
Datalink Radio-Modem & Antenna
GPS Receiver
IR Sensor Board
Motor & Controller
RC Receiver & Antenna
Servos
Payload = Camera & Video Transmitter
Autopilot Control Board
The autopilot board is the heart of the system. It takes inputs and outputs to each of the other
components.
Battery
The on board battery is typically used to power everything on the plane. Operating DC voltage for the
autopilot is 6-28V. CHECK THIS FIGURE
Datalink Radio-Modem & Antenna
The on board modem is a separate RF communication channel to a ground modem connect to a
computer running the ground control station software. This is directly connected to the autopilot board
for telemetry downlink and instructions from the groundstation.
GPS Receiver
The GPS is also directly connected to the autopilot board. It gives speed, elevation, and location
information to the autopilot which also forwards the information to the groundstation.
IR Sensor Board
The IR sensor or sensors are used to detect the aircraft’s attitude relative to the ground. Differential
outputs from thermopile pairs are used for each axis.
Motor & Controller
The motor is a brushless three phase motor controlled by an electronic speed control (ESC) which uses
power from the battery. The ESC converts the power from the DC battery into a suitable form for the
motor. It also controls the motor’s speed.
R/C Receiver and Antenna
The R/C receiver communicates with a R/C transmitter on the ground. This is used as a failsafe should
the autopilot malfunction. It can also be used for landing, takeoff, and autopilot testing.
Servos
Servos are mechanically connected to control surfaces. The autopilot controls the servos electronically
either with its own algorithms while in autopilot mode or as a pass through from the R/C receiver while
in manual mode.
Payload
Payloads can be added. The autopilot has provisions for controlling additional electronics.
Hardware Preparation
The Tiny v2.11 board is the heart of the autopilot system, and there will need to be one built for every
airframe that is produced. Gerber and drill files are available on the project wiki, as well as a
recommended parts list. The board consists of an ARM7 microcontroller, a GPS receiver, and many
connectors as well as other miscellaneous components. Premade boards may be purchased from
several distributors. (links or appendices?)
Note about crimped wires: The paparazzi board requires the use of a very specific type (Molex
picoblade) of crimp for its connections, and it is possible to either purchase pre-crimped wires for your
build, or purchase a very specialized crimper to make these crimped wires yourself. The pre-crimped
wires cost ~$10 per bag of 10 precrimped on both ends, and you need approximately 40-60 per board,
depending on your setup with servos and other connections. The specialized crimper is approximately
$200. You can elect to purchase the crimper and purchase the contacts and wires separately to do your
own wire making.
Bill of Materials for Board Programming
-FTDI USB to Serial cable
-Pre-crimped wires or crimper + wires
-Picoblade connectors
-Generic USB cable
-Heat shrink tubing
Creating Custom Cables/Wiring
We used precrimped wires to save on the cost of the wire crimper. As a result we cut each precrmiped
wire in half and soldered on the pigtail to the appropriate wire. This precrimped wire is then inserted
into a picoblade end which can be inserted and removed from the autopilot receptacles. While
soldering wires, it’s important to tin each stripped end, ensure a wet solder joint, and cover the
interface with heat shrink tubing of the appropriate size.
Bootloader Cable
Serial Cable
Software
The paparazzi software has been packaged for Debian based Linux distributions, and we were successful
using Ubuntu 8.04. This guide assumes that Ubuntu is the platform being used, however it should be
possible to install on other distributions without too many changes. Refer to the wiki for specifics if
another distribution is preferred.
This will need to be installed on either its own partition, or potentially a virtual machine residing in
another operating system of your choice. It is also highly recommend that a laptop is used, as the
machine will need to be taken with you wherever you wish to do testing. Also important to note is that
for one part of the initial board setup a Windows program will be needed for configuration of the GPS.
This only needs to be done once, but access to a system with a version of Windows installed will be
required in addition to having a Linux system prepared for the initial setup.
Paparazzi Software Installation
Installation Methods
Installation can be done through one or two methods. Depending upon preference, the software can be
installed either by command line or through the Synaptic Package Manager tool. Both of these methods
are presented below.
Before beginning make sure to note which version of Ubuntu you are running as some steps will be
dependent upon your version. The table below lists the three most recent Ubuntu versions as of 11/08.
Version
7.10
8.04
8.10
Release Name
Gutsy Gibbon
Hardy Heron (version tested)
Intrepid Ibex
Installation via Synaptic Package Manager
To launch Synaptic Package Manager, click on the 'Applications' menu in the upper left and navigate to
System Tools. Next, click on the Synaptic Package Manager to launch the application.
Open the 'Settings' menu and select 'Repositories'. Set the following options:
URI = http://paparazzi.enac.fr/ubuntu
Distribution = gutsy OR hardy OR intrepid (depending on your Ubuntu version)
Section = main
For the next step, the recommendation is that only the paparazzi-dev and paparazzi-arm7
packages are installed, as they will contain more example airframes and will contain the most up to date
autopilot code. The dev package also contains many more configuration files for a wider variety of
airframes.
Click 'Search', and search for either paparazzi-dev and paparazzi-arm7, or paparazzi-bin
depending upon your choice of installs. Mark each one of the packages for installation by right clicking
on the package name. Left click apply, and the packages should be downloaded and installed.
Installation via Command Line
First, the /etc/apt/sources.list file needs to be edited to include the paparazzi repositories (shown
below) so that your system will be able to find and install the proper files. Depending on your version of
Ubuntu (or Debian) you will need to uncomment the appropriate line. The # symbol denotes that a
given line is a comment, so just remove the symbol to uncomment a line. Make sure to save the file
once editing is complete.
#
#
#
#
Uncomment just _one_ of the following lines - depending on your OS version
deb http://paparazzi.enac.fr/ubuntu gutsy main
deb http://paparazzi.enac.fr/ubuntu hardy main
deb http://paparazzi.enac.fr/ubuntu intrepid main
Next you have the choice of installing either the latest source files for paparazzi or a released binary.
The recommended option is that you install the source files and compile it yourself, as that route has a
much larger selection of sample configuration files to look through. The released binary option will have
everything precompiled and you would just need to run the software yourself. If you choose that
method, any time the 'paparazzi3' folder is referred to, it will just be the 'paparazzi' folder at that same
location instead.
Run the following three commands to install the necessary source files:
apt-get update
apt-get install paparazzi-dev
apt-get install paparazzi-arm7
Run the following two commands to install the binaries:
sudo apt-get update
sudo apt-get install paparazzi-bin
Compiling the Source
Note: This is not necessary if the binary version is installed.
To compile and install the source into your home directory, do the following:
cd ~/
cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/paparazzi co paparazzi3
cd paparazzi3
make
This will install to a directory called paparazzi3 in your home folder.
Post Install Configuration
Very important for Ubuntu is to remove the Braille TTY driver as it can cause some negative interference
when used with the FTDI USB to Serial cable. It can be removed as follows:
sudo apt-get remove brltty
Environment variables will also need to be configured. Open the /home/your_username/.bashrc file for
editing and add the following two lines at the end, saving the file when finished:
export PAPARAZZI_HOME=your paparazzi3 directory
export PAPARAZZI_SRC=your paparazzi3 directory
In order to flash the Paparazzi board's microcontroller, the following may be necessary to allow nonadministrator users to directly access the USB bus. Run the following command:
sudo adduser <your username> plugdev
Replacing <your username> with your respective login name.
Also necessary will be the installation of the rules file for the USB handler. Once the environment
variables have been configured, you can run the following command from a terminal window:
sudo cp $PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules /etc/udev/rules.d/
Airframe File Configuration
The paparazzi system uses an XML based system to configure parameters for different airframes and
components. When building a program to flash to the autopilot board, these XML files are read by the
paparazzi center software and used to set various autopilot variables at compilation time. These files
allow for a large amount of control over many things, and it is important to ensure correct settings.
To access these XML files, navigate to the paparazzi install directory and run the 'paparazzi' executable.
For a brand new airframe configuration, select A/C and create a new A/C with your desired name. Next,
proper XML files will need to be selected to match your components. The example shown below is a
sample configuration for the FunJet airframe that we used along with a T6EXAP radio.
Configuring Rad
Initial Tiny 2.11 Software Configuration Overview
Depending on the method that you acquire your Tiny 2.11 autopilot board, there may be additional
configuration required before the board can be used as an autopilot. If the board is ordered from a
distributor, these steps may have already been done for you. Check with your supplier to find out for
sure.
With a brand new Tiny 2.11, the first thing to be done is to flash the bootloader software. This enables
the Tiny to be programmed over USB by Paparazzi center.
The GPS also requires some configuration, but in order to gain direct access, special 'tunnel' software
needs to be programmed to the Tiny. This software allows direct serial communication with the GPS
receiver. Once the tunnel has been programmed, software from the GPS receiver's manufacturer is
used to perform the final configuration. In our case, the u-blox receiver software was only supported for
the Windows operating system.
Acquire New
Paparazzi Board
Flash Bootloader to
Autopilot Board
Program GPS Tunnel
to Autopilot Board
• Order from a distributor
• Build yourself
• Allows autopilot to be
programmed over USB
• Uses custom serial cable
• Special program that
creates a direct serial
connection to the GPS
receiver
• Uses regular USB
programming cable
Program GPS
• Needed to for GPS to
interface properly with
autopilot
• Software runs in Windows
• Uses custom serial cable
Flashing the Bootloader
This step may or may not be necessary depending upon how you obtained your Tiny 2.11 board. If you
ordered your board from a supplier, it may have already been loaded and be unnecessary to program
again. Check with your supplier to find out if that is the case. Also be sure to check whether the GPS
has been programmed already, as that will also affect what you need to do to get your board set up. If
you built your board yourself, both the bootloader and the GPS will need to be programmed.
The bootloader is what allows the Tiny to communicate with the Paparazzi software and be flashed via
USB. It is programmed over the Tiny’s serial port, which is labeled as X on the board layout. In order to
do this, the special cable for programming the bootloader is required. Also necessary is to hold the
GPS_RESET pin low, which is best done by connecting them to the ground on the bootloader cable. This
setup is shown below.
Once the cable has been connected to the board properly as shown, execute the following command
from within your paparazzi3 folder:
make upload_bl PROC=GENERIC
This will compile the bootloader and attempt to flash it to the microcontroller on the Tiny. A successful
flash will yield the following status message:
This will compile the bootloader and attempt to flash it to the microcontroller on the Tiny. There should
be some compiling messages as well as a several status messages similar to the following:
<compiler messages>
arm-elf-objcopy -O ihex bl_ram.elf bl_ram.hex
arm-elf-objdump -x --syms bl_ram.elf > bl_ram.dmp
lpc21isp -control sw/airborne/arm7/test/bootloader/bl.hex /dev/ttyUSB0 38400 12000
lpc21isp version 1.27
File sw/airborne/arm7/test/bootloader/bl.hex:
loaded...
converted to binary format...
image size : 7304
ioctl get ok, status = 6
ioctl set ok, status = 6
ioctl get ok, status = 6
ioctl get ok, status = 6
ioctl set ok, status = 4
ioctl get ok, status = 4
ioctl get ok, status = 4
ioctl set ok, status = 0
ioctl get ok, status = 0
Synchronizing. OK
Read bootcode version: 2.12.0
Read part ID: LPC2148, 512 kiB ROM / 40 kiB SRAM (67305253)
Sector 0: ...............................................................................................
Sector 1: ...........................................................................
Download Finished... taking 6 seconds
Now launching the brand new code
ioctl get ok, status = 0
ioctl set ok, status = 2
ioctl get ok, status = 2
ioctl get ok, status = 2
ioctl set ok, status = 0
ioctl get ok, status = 0
An incorrect connection will result in a large number of ioctl messages followed by a “no answer on '?'”
message. If this occurs, ensure that the RX and TX pins (receive and transmit) are connected correctly.
The RX on the FTDI cable needs to be connected to the TX on the Tiny board and vice versa.
Programming GPS Unit
To configure the GPS unit to talk with the autopilot, it will be necessary to install the GPS tunnel
program on to the Tiny. This program lets the GPS unit talk directly to the serial port on the Tiny board
through the onboard microcontroller, allowing the GPS to be programmed to work with the autopilot
properly. Without this step, GPS functionality will not work.
First, to load the tunnel, connect the USB programming cable, power up the board, and execute the
following command from the paparazzi3 folder:
make AIRCRAFT=myplane tunnel.upload
Where ‘myplane’ should be changed to be your airframe file.
*Note on troubleshooting*
With the tunnel successfully programmed, you will be able to program the GPS. This can be done in a
number of ways, however the easiest method we found for U-BLOX GPS units was to use their supplied
Windows software to do the configuration.
Links and directions to download the software as well as the files used for programming are including in
the handbook’s Appendix X. Once these files are downloaded and installed in the case of the U-BLOX
software, you are ready to program the GPS.
*Exact steps used*
Programming Autopilot Over USB
Programming the autopilot is performed from the Paparazzi center program. Navigate to the directory
you installed paparazzi and execute the 'paparazzi' executable. The configuration files will need to be
edited to match your airframe, details for this are contained in the previous section.
Connect the USB programming cable to the autopilot board, followed by powering on the board. It is
important that it is done in this order as the autopilot board is only in programming mode if the USB
connection is present on power-up.
Steps:
1. Ensure proper A/C is selected as well as desired modifications to configuration files have been
performed.
2. Select Target to be 'ap' (autopilot).
3. Click clean.
4. Click build.
5. Click upload.
If the session has been configured appropriately, the paparazzi ground station can be executed by
clicking the Execute button in the upper right.
Modifying IR sensors
We use FMA Direct IR sensors for pitch and roll detection. These are readily available off the shelf units.
The two axis x-y sensor (CPD4SENUNIT) is required. In addition, a single axis z sensor (FS8ZS) can be
used for optimum performance. These sensors are designed for a 5V input. The paparazzi autopilot is
designed to supply 3.3V. This effectively sets the amplifier gain to 5/3.3. With this setup, the sensor is
more liable to saturate before the aircraft is banked 90° while operating in high infrared contrast
locations, for example a desert or snow covered field. To rectify this issue, we need to replace resistors
on each IR sensor board to keep the amplifier gain set to unity:
X-Y sensor:
For the X-Y sensor we need to change R3 and R6 to 1kΩ.
Z Sensor:
The Z sensor needs R3 changed to 1kΩ.
These resistors are 0603 size surface mount parts. Special care must be taken to replace these resistors.
It is not necessary to make these modifications unless operating in a high infrared contrast area.
Tapping PPM Signal (best location for this is?)
The so called “PPM” signal is actually a series of PWM channels which are time division multiplexed.
This signal is normally received generated by the receiver after demodulating the FM signal from the
transmitter. Under normal RC operation, it is then demultiplexed and the channels sent to specific pins
assigned to different servos.
When used with a Paparazzi autopilot, the RC receiver is only used for FM signal reception and
demodulation. The multiplexed “PPM” signal is tapped before it is demultiplexed and sent to the
autopilot for demultiplexing and assigning to servo channels. Incidentally, this means an inexpensive
receiver which is designed to output to only a few servos can be used with the eight channel tiny
autopilot board as the full PPM signal is still sent to the autopilot.
When we tap into the PPM signal, we are reverse engineering the work of the receiver designers.
Typically the PPM signal can be found on a surface mount integrated circuit on the receiver board.
Sometimes these ICs are not silk screened so it’s difficult to tell what chip is what. To find the PPM
signal, we must use trial and error by testing each pin on all the IC’s of the receiver for the correct signal.
The correct signal may be found using an oscilloscope. To confirm it is the correct signal you should see
different pulse width changing as different channels on the transmitter are varied.
Once the correct signal is found, we solder a small gauge wire (~30ga) to the appropriate pin and apply
medium to thick cyanoacrylate around the pin to avoid wear and tear. If needed, shielded wire can be
attached to this wire and run to the autopilot board.
Procedure:
Open the receiver to expose the circuit board
Connect the receiver to a battery.
Connect the negative terminal of the oscilloscope probe to one of the negative servo pins.
Use the probe to look for the correct pin to attach a wire to.
When the pin is found, attach a small wire to the pin with solder and CA.
If you wish to use the receiver case you may need to drill a hole to run the new wire out of the receiver.
RF Troubleshooting
You may experience increased interference at some stage of your UAV setup. As a result, we
recommend range testing with manual R/C controls from time to time during your build. If you
experience greatly reduced range with the R/C system, there are several things you can do including:
-Shielding the PPM line coming from the receiver to the autopilot board
-Spatial separation of the components, especially the receiver and any high noise electronics including
the ESC, autopilot board, and modem
-shielding of the noisy components with copper foil
It may be useful to examine the PPM signal with a oscilloscope as you move different components
around on the airframe to find the optimal location for each component.
Download