I want to make a quadcopter flight controller for my University project. Lately I was searching for systematic architecture of control system used by quadrotors. I have implemented one of the architectures which is shown below.
Here is what i understood and implemented:
main loop: for loop(5 times): sample_current_Angle() sample_RC_input() required_Rate = Angle_controller() ---- (P controller) Rate_controller() ---- (PID controller) write_motor_pwm() sample_body_rates()
According to this when i keep my quadcopter on strings (opposite arms on strings - testing of single axis at a time), the quad behaves perfectly fine, what i mean is : if you give 30° input through RC, the quad goes at setpoint and holds the angle perfectly and as soon as i leave the RC stick (setpoint 0°) the quad levels up at 0, my PID tuning is perfect (i feel so) as there are no overshoots and the response is quite fast. BUT, when i left it for independent flight, it seems to be nowhere perfect, it does lift but very difficult to control. I need a stable takeoff just like ArduCopter. I think that I am lacking something but can figure it out. Any thorough guidance will be very helpful. If someone wants to look at my code, just mention it i'll add it (its about 450 lines of arduino code).Thanks !