-Arm/Disarm Motors.
-Collective down and yaw left for off.
-Collective down and yaw right for on.
-The LED will show the current status.
The code is simple with only one main loop, and no interupts. CPU utilization (ATMega48 at 8MHz) is about 80%, so there is time to add own code.
More CPU time can be freed by adding interrupt driven pulse reading and generation, but for now I wanted to keep things simple and easy.
Any reciever which outputs the channels in the standard sequensial way can be used. No need for a single summed stream.
I use the Futaba Fasst R606FS reciever, which luckily have a frame rate of 16ms, instead of the normal 20ms. This gives a control loop speed of 62.5Hz.
The calculations is done in a 16.16bit (16bit integer with a 16bit fraction) math library for the AVR, also made by me
The math library simulates an array of 16.16bit registers, and is used the same way as the AVR's 32 8bit registers, and the registers can also be given names.
The stabilization is a simple rate dampening. I tried angular velocity (heading hold, attitude hold), but I could not get rid of the severe oscillations. Maybe the PPM output is to slow?
| Autor: | KapteinKuK |
| Kategorie: | Firmware |
| Datum: | 14. April 2011 |