Andrus Kangro's Posts (1)

Sort by
T3

My autopilot

I received request to publish more information about my "custom" autopilot, used for TTT contest, so here it is:My autopilot current version is 4. It all started when I received Welleman pic programmer & experiment board as Christmas present (to be honest, it was selected by myself). My initial interest was to make my sailplane turns more efficient and for that I needed to hold wings always crossed with gravity vector.Initial autopilot (V1) was built around 16f627 pic controler and the only thing it did was to use Parallax dual-axis accelerometer for controlling ailerons; rudder and everything else was under manual control. V2 autopilot used pic16f870 chip and added airspeed measurement (using mpxv5004dp sensor) and attempted to regulate sailplane speed by controlling elevator (it also had MPX4115 sensor for altitude measurement, but it was not used at this stage) . When I upgraded my RC-equipment to 2.4G and receiver inputs started to come in parallel groups, then 8-bit PIC did not manage any more and I upgraded autopilot core to dsPIC30f4013 (autopilot v3), adding also GPS to it. As I struggled to understand, what was actually going on inside autopilot during flights, then I attempted to add SD-card logging into autopilot, but faced memory shortage issues on 30f4013. So I upgraded autopilot core to 30f6012 and current version of autopilot (v4) was born.V4 hardware has 3 revisions, I'm using currently revA, but there is also one board of revB ready and its clear by now that there will also be revC. revA has 10 digital change notification inputs (8 for receiver and 2 for accelerometer, all used), 8 analog inputs (gyros, battery voltage, current sensor, 2 pressure sensors - 6 used currently) and 8 servo outputs(5 used), serial port for GPS/2x16 display and SPI port for SD-card. RevB has 14 digital inputs (change notification or input capture), 8 analog inputs and 8 servo outputs, 2 serial ports (for gps and terminal/radio modem), SPI for SD-card and i2c for (future)electronic compass + 3 led's. RevC will change location of some inputs/outputs. I attached Eagle schematics for revision B board here:apv4.sch.Is my autopilot inspired by UAV devboard - no, its parallel development. However, I would probably use UAV devboard, if it would have more powerful chip, much more inputs/outputs and SD-card on board. I'm also looking forward to implement cosine matrix transform in my software like in Matrixnav (waiting for gyros to arrive at the moment). I sometimes browse through Paparazzi and Matrixnav and other firmwares in order to get ideas and avoid inventing bicycle - however, I find it much easier to understand what others have been doing, if I have been working on topic myself also at least to some extent. So, I will keep inventing my own wheel also.As my goal was never to hold wings level with horizon, then there are no IR sensors, although they can probably be connected to vacant analog port if needed.What I've done with my pilot so far: the progress has been very guick since I got SD-card logging working. Once gyroscopes got involved, then direction control started to work reliably as well. My target was to make my sailplane to hunt for thermals and come home automatically and I succeeded on that: current autopilot can control plane speed, altitude and direction and can bring it home if I order it to. It also detects thermals and circles in them, attempting to shift circling center closer to stronger lift area, while making sure that it does not drift too far from "home". During best flight it used engine only for climbing into altitude and the plane stayed up thermalling for one hour without needing to turn on engine again (then I had to leave and took plane down). Thermalling is problematic in my area due to closure of the airport, so I can not do any altitude records where I usually fly. But, if there is suitable weather during some weekend and no family activities, then I plan to drive to G1 airspace area (this is reserved for sailplane flying) and see, how high it really goes....TTT competition is good stimulus for improving autopilot software and algorithms, I'm looking forward for next round. At the end of it I will probably have wp navigation mode with altitude control done via elevator and speed via motor, also navigation accuracy should be greatly improved. Better control over plane (especially when cosine matrix transform is implemented) will help me to make better thermal turns also, so its all very positive what is going on here.
Read more…