Hacker News new | ask | show | jobs
by lordnacho 4243 days ago
This is awesome. I want to do this myself. I have a degree in EE, but I've somehow never built anything like this. One issue is how to get the bits. What I mean is where is there a summary of all the bits one might need (like a box of lego), and how to get the pcb made? Also, do you sit with an oscilloscope and debug? Or is it all simulation? What do you use to simulate?

Also, do you employ control theory for the stabilization? Predictive filtering and all that?

2 comments

(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!

What's your background? Are you an engineer, or self taught?
There's lots of tutorials out there for this kind of thing, and looking at other people's project logs (like this submission) is good. I like to use OSHPark to get my PCBs made, but some people also like ITead Studio. Personally, I rarely simulate stuff if I'm just hacking around unless it's a filter or maybe an amplifier. For that I use either MultiSim (not free) or LTSPICE (free). An oscilloscope is good for debugging stuff like the PWM output to your servos. In general, it's a good tool to have, and you don't need a very expensive one for most applications. If you live near the DeAnza Electronics Flea Market, you can pick one up for probably a $20 bill. Otherwise, there's plenty on eBay. As someone mentioned in another comment, the control theory for a UAV like this is usually just a PID loop or a subset of that. It's nothing fancy, but it works quite well.