An overview of the software the PIC uses to combine our sensor data and autonomously stabilize the Tetracopter
The PIC mircocontroller has three inputs:
Using these three inputs, we determine the appropriate speeds that each of the four motors should run at and sends signals to their motor controllers (four Atlas Black 8 amp brushless controllers) accordingly. These speeds are determined by two PID systems:
First, we use each axis of the accelerometer to determine the error on that axis. We then feed that data into our PID algorithm which outputs the speeds required by the motors.
The second component of determining the speed is a PID system for altitude. We use the ultrasound sensor to measure our current altitude and determine an error from that. That error is fed into a second PID computation which changes the speeds of all four motors together.
In this way, we determine the speed that each motor should be run at. Clearly, the constants for the PID systems are of the utmost importance. We are still working to determine the optimal values of these constants.
The software for the Tetracopter is written in ANSI C using the SDCC compiler. If there is sufficient interest, a C18 port should not be too much trouble.
Copyright© 2007 Evan Morikawa, Andrew Barry, James Getzendanner, Marco Morales | All Rights Reserved
Design by Evan Morikawa