quadrotor from scratch ?s
I have the gizmo basically built - 4 rotors, carbon fiber and aluminum frame.
Electronics consist of 3 single axis gyros and 1 triple axis accelerometer hooked up to an atmega168 controller. I've written my kalman filter code so that from the gyro and accel I can get a roll and pitch estimate. For the yaw estimate, I basically integrate the angle seen over time.
I've read a lot of interesting papers from all over the world that discuss the flight control of the quadrotor. I will try to summarize what I want to do below.
If the motor is configured like so:
leftfront and rightback share rotational direction, and leftback and rightfront share the opposite direction.
I can see how to easily use the kalman estimates to send offsets to the pair of motors to balance them out. But, I have yet to wrap my head around how to balance each motor individually within its pair set. For example, if leftfront is slightly stronger than rightback, there will be some rotation if they continue to receive the same offset. Is there an algorithm to programmatically calculate their strength difference while in flight?
My next algorithm I need verification on is the following. If I am controlling the device, I will be able to send it the following factors: thrust, yaw, roll, and pitch (from a radio or through a script). I would be sending the following to the motors:
leftfront = thrust + pitch - yaw
rightfront = thrust - roll + yaw
leftback = thrust + roll + yaw
rightback = thrust - pitch - yaw
Now, I would like to integrate my kalman estimates. I can't seem to wrap my head around this. Should I be applying my kalman estimates while the motors are being actuated by the radio/script? Or should I wait to apply my offsets after the actuation is complete? For example, if the motors are to be actuated for 30deg of roll, it takes X amount of time to complete that motion to get to 30deg. In that amount of time and after completing the motion to get to 30deg, my controller is calculation kalman estimates at 60Hz. At any calculated moment, I have an offset of DESIREDANGLE - KALMANESTIMATE. At these moments, I can send an additional offset to the motors to get it their quicker.
One last question (for now). How do I scale my angles to actual motor timing? I can do it programmatically with the use of my sensors, and continue to increase actuation values until achieving my angles. But is there a way to know/calculate some sort of constant so that if I wanted to move 10deg roll, it would be equal to X amount of servo timing?
Comments? Suggestions? Corrections?
ps - the device lifts, hovers, however jittery it may be. I am now working for jitter removal and overall control with radio and scripting.
pps - also posted on rcg