Autopilot Configuration Overview *High level configuration overview* 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 -Risers (which ones exactly did we use?) – we can skip this part mayhaps? -Pre-crimped wires or crimper + wires -Crimped wire connectors (?) -Generic USB cable and recepticle (?) -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. Software The paparazzi software has been packaged for Debian based Linux distributions, and we were successful using Ubuntu 8.04. 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 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 Windows installed will be required in addition to having a Linux system prepared for the initial setup. It is possible to reduce the number of systems needed by using one of two alternate setups. *talk about windows/VMs and linux/wine* Paparazzi Software Installation Installation Methods asdf Installation via Command Line First, you will need to edit your /etc/apt/sources.list file 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. # # # # # # Uncomment just _one_ of the following lines - depending on your OS version deb http://paparazzi.enac.fr/debian etch main deb http://paparazzi.enac.fr/debian lenny main 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. Our recommendation is that you install the source files and compile it yourself, as that path has a much larger selection of sample configuration files to look through. 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 Also very important for Ubuntu is to remove the Braille TTY driver as it can have some negative interference when used with the FTDI USB to Serial cable. It can be removed as follows: sudo apt-get remove brltty Installation via Synaptic Package Manager blah blah Compiling the Source 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 Also important is to set up environment variables. Open the /home/your_username/.bashrc file for editing and add the following two lines at the end: 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 non-root 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 Configuration *talk about details for airframe configuration* Initial Autopilot Setup 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. *pictures* 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: *exact status message* *talk briefly about error resolution* 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 *elaborate on autopilot programming* 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 the PPM signal (should this also go under hardware/wiring?) 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.