RCU Forums

RCU Forums (https://www.rcuniverse.com/forum/)
-   Multi Rotor Helicopters (https://www.rcuniverse.com/forum/multi-rotor-helicopters-487/)
-   -   quadrotor from scratch ?s (https://www.rcuniverse.com/forum/multi-rotor-helicopters-487/6752415-quadrotor-scratch-s.html)

haobuhao 12-13-2007 01:46 PM

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 rightfront

leftback rightback


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?

thanks



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

haobuhao 12-13-2007 05:06 PM

RE: quadrotor from scratch ?s
 
1 Attachment(s)
some pics

ADI 12-20-2007 03:51 AM

RE: quadrotor from scratch ?s
 
Hi haobuhao ,

A lot of the info you're after can be found here:
http://www.rcuniverse.com/forum/m_14..._1/key_/tm.htm

To point you in the right direction ...... PID control is where you need to direct your attention.
If you've mastered Kalman filter, then PID will be a breeze.

Rather than picturing your quadrotor like an "X" you need to picture it like a "+" so you have front and rear motor pair CW rotation and left and right motor pair CCW rotation.

Cheers ADI
http://homepages.paradise.net.nz/jameskea/

Yub, yub, cmdr! 01-19-2008 09:47 AM

RE: quadrotor from scratch ?s
 
Hey Haobuhao, can you help me with the kalman filter? I've been having problems with that in a ground based environment. Could you show me that part of your code? I have yet to find an introduction to the filter that doesn't necessitate an existing knowledge of the mathematics behind Bayesian networks.


All times are GMT -8. The time now is 08:28 PM.


Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.