HN user

jonny5532

15 karma
Posts0
Comments4
View on HN
No posts found.

(Jonny the author here)

I plan to write this up more completely, but here are some more technical details:

Most of the bits (the foam plane, servos, speed controller, radio modules, IMU, barometer and GPS) came from eBay or HobbyKing. I started off with a little USB development board with an Atmel SAM7 on it, and then moved to the PCB and a newer Atmel SAM3 (partly after discovering how cheap prototype PCBs are from ITEAD).

I initially wrote the algorithms in python, using pyserial to talk to the built-in bootloader the chips come with, through which you can manipulate registers and control the peripherals. This made writing and debugging the C much easier. The chip runs TNKernel, a little RTOS, which handles the radio and IMU processes (and soon GPS and barometer).

Control is currently simple proportional control based on the IMU output, but I may add integral and differential terms once I'm more comfortable flying it, to see if can improve stability. It is remarkable how happy it is flying with the relatively crude algorithm it currently uses.

Launching it is still slightly nerve-wracking - you have to throw it quite hard and hope that it is going to go up rather than down. There's also the risk that it'll fly out of radio range and keep on going, but if this happens it automatically cuts the throttle, in theory at least!

(Jonny the author here)

Thanks for the kind words! This is primarily a taster article to introduce the UAV project, I intend to write a more technical report and publish the designs/code in due time (and some more videos!).

The presentation uses Story Glass, also a project of mine, which we hope to offer soon as a service. It is an experience, lying in a damp field shooting a video to think about how the text will flow over it!

(Jonny the author here)

At the moment the control is proportional - the microcontroller works out the difference between the desired angle (set by the pilot on the ground) and the actual angle (as reported by the IMU algorithm fed by the gyro/accelometer). This error signal is then scaled and sent to the aileron servos.

The USB flight-controller I am using has a spare knob on it so I can adjust the scaling coefficient in flight. It still isn't perfect (as the video at the bottom demonstrates) - it veers to the right, probably because the IMU isn't held down very well!

A neat trick with uWSGI is to dynamically set the number of worker processes to 0, which causes incoming requests to hang whilst waiting to be processed by no-longer-extant workers.

As long as you can apply DB migrations before the waiting requests timeout (and then set the number of workers back to something sensible) you can perform quite major upgrades without even dropping connections.