Hello to everyone, I'm currently working in a project involving 3 DOF (euler angles) attitude control. I'm hoping to do this with HDD motors, mpu6050 and an arduino UNO. I found this project on github: GitHub - joeiddon/ADCS_demo: An "Attitude Determination and Control System" demo. Created for Open Cosmos. and it's almost what a i need to do. The thing is that I don't how to establish the new kind of sensor (mpu), because the program is originally meant to use light sensors. I don't know if is it possible to enter the attitude like a step input to meat a desired condition-attitude.
Next, I need to repeat this for the other 2 axis.
Of course it's a linear model for very small error angles, if the angles are for a greater magnitude, it becomes non linear.

My approach would be to go through the code and determine how the light signals are interpreted, and how that result is presented to the PID controller.

In turn the PID controller simply minimizes the error between the observed orientation and the setpoint.

Orientation angles fit nicely into that scheme, but the MPU-6050 gyro does not measure angles, only rotation rates. The accelerometer can measure only two angles, pitch and roll.

Note that Euler angle operations are not distributive or commutative (the order of operations is extremely important), which are among the many reasons why people now use quaternions to represent 3D orientation.

Derivative part feedbacks angular velocity in fact. I can use another accelerometer to measure the yaw, right?
About quaternions, in this linear case, euler angles, quaternions and cosine directions, give the same results. Then, for greater angles it is used quaternions because of all the advantages they have.
So accelerometers can measure angle, but how do I transform the acceleration in position? I mean, I don't know if it is possible to "integrate" in arduino in order to obtain the delta angle.

Accelerometers cannot be used to measure yaw, which is rotation about the vertical. You need a point of reference on the horizon, usually supplied by a magnetometer.