i'm using 3 analog gyro from hk401b hobbyking, 3axis accelerometer from a faked nunckuck (i2c), atmega368 at 16mhz, 6ch PPM tx/rx (but i'm using only 4, power pitch roll yaw), 4 25A PWM ESC (Hobbyking SS, but they seems to have soft cut-off), 4 DT750 brushless
the stabilization algorithm is a DCM (direct cosine matrix, code adapted from: Google Code Archive - Long-term storage for Google Code Project Hosting.), really fast (it take about 500microsec and has sqrt, sin and cos inside!)
I'm also doing the code very modular: actually you can easy change the gyro, accelerometer, IMU and stabilization algorithm simply rewriting the class respecting the public method (update() and getData()).
The loop() code runs in 2ms, faster than the PPM signal (20ms) to engine, so there is enough time left for other calculation.
I like this ways because everybody can easily add their hardware and share changes (but this code is born just as personal challenge, and I want also let it fly planes) and because no one seems to use as pid's input actual angle and desired angle, but just unmeaning number. When my algorithm will work, you can say to quad "incline roll of 4 radiant (respect floor)" and this is the first series of step before autonomous flight.
obviously I'll buy magnetometer and GPS.
Also for communication I was thinking about
SparkFun Transceiver Breakout - nRF24L01+ (RP-SMA) - WRL-00705 - SparkFun Electronics, it has 100mt of radius but for autonomous flight it should be enough.. at least for test
or xbee pro http://www.robot-italy.com/product_info.php?products_id=1470 for 1200meters radius
and GPRS.. I was looking at Arduino GSM shield - Open Electronics - Open Electronics but their libraries support only GSM, but module should do also GPRS http://wm.sim.com/sim/wm/html/en/WMS/EDGE%20Module/ProductDetail.aspx?id=770
Join this room here a test of the IMU, the PC response on video is a bit slow because I was updating the value every 100ms (10 fps) and also PID of DCM was to be tweaked.
Join this room this is the first stabilization test.
TODO:
Actually I have 2 engine PID algorithm:
1- motor's PID that input the angle (from -PI to PI) and desired angle (from -PI to PI), and give a number to sum to the engine power (the one in the video)
GOOD:
actually maintain the stability, but IMHO is a little slow to respond
BAD:
changing throttle seem to break the PID: maybe dynamic PID based on engine power?
-
use as input and output value from -1 to 1 (and does something like desiredPower/2+desiredPower*thisEnginePID)
GOOD:
should work for all throttle value without dinamic PID
BAD:
actually it doesn't
-
should try the PID libraries on the Playground: maybe mine is too "basic"
in this week-end I should test the three algorithm and compare them, actually no one seems to work correctly. I will upload the code on reference once it's over and functional, because of its modularity it will be slitted in multiple tutorial, from basic like "write a class for read analog sensor" to "read PPM signal with multiple pin interrupt"
PS: the problem with this test is that low battery will influence really bad, as I cannot program the ESC to remove soft-cutoff (i think..)
PPS: the truth is that I never played with a microcontroller, esc gyro accelerometer, plane, copter etc. before. So I'm quite happy of my results and I will let this thing fly with my own code! 