Hello everyone !
I started to read and learn how the quadcopter works and now I'm building my own quad.
I use a Gaui 330x frame with Gaui motors and ESC and a Spektrum remote, a Arduino 2560 R3 and 2 senors for my data: ITG3200 gyro and ADXL345 accel.
Since now i had succes in making the sensors work, the remote work, the motors, all works but not the stabilization of my quad.
I use a kalman filter to determine the angles.
I need some help and tips on the stabilization part.
From what i read and saw in other people's code for quadcopters I need to create 2 PID's for eatch axis.
Here is what i figured out till now, but I don't know if it is correct or not:
For Pitch axis:
I make PID1 to tell me the correction I need to apply to my motors to get to the setpoint:
Setpoint = 1500 ( 180 degrees - horizontal ) and Input from remote 1400 ( aprox 160 degrees ).
The PID1 will tell me I need a 100 correction if kP=1, kI=0, kD=0.
Now that i know that I make PID2 that takes the PID1 as setpoint ( so 100 is the setpoint ) and the gyro angle rate as input ( lets say its 10 degree/s and I transforme it in range -500,500 with the Arduino MAP function ).
And this 2nd PID returns me a value that I use to correct my angle to setpoint of 1500(180 degrees).
My problem is if this is correct or not, because it doesen't seem to work.
Thank you !