Beth Test Bench

From PaparazziUAV
Revision as of 17:10, 9 March 2011 by Esden (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction

Beth fixture.jpg

The Beth test bench is two things:

  • 1. A three degree of freedom mechanical test bench
  • 2. A paparazzi build target that provides the code and configuration for the Lisa/Overo and Olimex STM32 boards mounted on item 1

Architecture

Potentiometers

The mechanical system is laid out with one potentiometer measuring azimuth mounted below the rotating electrical joint. The joint provides complete rotational freedom while also providing six electrical circuits. A pair of circuit is used for passing GND, another for power (+12V), and the final two circuits for CAN communication. Above the azimuth joint, two additional potentiometers measure elevation and tilt.

Beth joint close.jpg
Beth render joint.jpg

Beth Boards

The azimuth potentiometer is sampled using a Beth board, and another identical board is used to sample the elev/tilt pots. The two boards communicate on the same CAN bus. Each of these boards provides a socket for the Olimex STM32 header board, a 5V LDO, a op-amp for buffering the ADC inputs, a CAN transceiver, and the connectors for interfacing.

Beth board close.jpg

PCBs

Software

The main_coders target in sw/airborne/beth will build and flash via Olimex JTAG the olimex header boards mounted on the beth boards.

Compile and upload by launching the following command:

paparazzi3/trunk$ make AIRCRAFT=BETH main_coders.upload

Initially I2C was used for inter-board com, but that was abandoned in favor of CAN.

Science Payload

Beth payload.jpg

On the end of the long carbon arm are two brushless motors with controllers and an attachment point for the control system. At this time we are using a paparazzi Lisa board and a crista IMU. Lisa fetches the pot measurements via the CAN bus interface, and interfaces to the outside world using wifi. This wifi traffic includes uploading new overo programs (via scp), starting the programs (via ssh), paparazzi telemetry and datalink (via link's -udp option)

Lisa is programmed with two separate targets in sw/airborne/beth :

  • 1. main_overo : Linux application that runs on gumstix overo; libevent driven loop that sends telemetry, receives datalink, initiates the spi link com with Lisa's stm32, and is otherwise free to run control algorithms.
Compiled (and uploaded) using following command :
make AIRCRAFT=BETH clean_ac main_overo.upload

The compilation generates an elf file, and the upload uses scp to place it in your home directory on the overo. Because of this a network connection to the overo is necessary. See Notes below for how this can be accomplished with wifi.

  • 2. main_stm32 : runs on stm32; recuperates pot values from CAN, reads IMU, sends the motor commands, and responds to the overo spi link transactions (receiving thrust and pitch commands from overo and sending sensor data back: see AutopilotMessageBethUp and AutopilotMessageBethDown structures for details).
Compiled (and uploaded) using following command :
make AIRCRAFT=BETH clean_ac main_stm32.upload


The overo must have a linux system running on it, and this is achieved using the openembedded omap3-lisa-image recipe LisaOveroImage.

Software Notes

  • Setting up wifi :

Assuming you have a usb wifi stick connected and a functioning linux driver you will have a wireless network device listed in the output of the ifconfig command. It should look like "wlan0" or "ra0", although the 0 could be another integer instead.

the interface typically needs to be brought up (), then the ssid set (), then the encryption method configured (for wpa, use wpa supplicant), then the IP address set (if a dhcp server is available, use dhcpclient). More notes available here: Rt3070usb#Configuration.

  • Overo/STM communication on SPI:

A whole wiki page might be needed here.

  • Datalink/Telemetry over wifi


  • Startup/Stopping program on overo

Right now just catching control-C to close log file. Will add soft motor start/stop functionality to permit nice and easy takeoffs and landings.

  • Periodic and Event functions

As with all paparazzi code, you'll find a periodic function that runs at the rate defined in the makefile (or makefile section of your aircraft xml). Beth uses 512 Hz. This timing is generated regularly by libevent (in this case, every ~2ms the periodic function should run). We can register to receive other events (for example here for receiving datalink messages) by registering the functions with libevent.