Using the Mujoco Menagerie model for Crazyflie, I am trying to implement a cascaded PID controller to this model in a MuJoCo simulation. The drone's actuators are symolic, as in they represent thrust, x-moment, y-moment, and z-moment. Right now, I just need the drone to hover at given target location. This implementation is done using ROS2 Humble. The position and quaternion vectors are obtained straight from MuJoCo. From what I understand, the position units in MuJoCo are arbitrary.
My cascaded PID has the following structure: (1) Position PID taking as input the desired position and outputting desired velocity; (2) Velocity PID taking as input the desired velocity and outputting desired attitude; (3) Attitude PID taking as input desired attitude and outputting thrust, x-moment, y-moment, z-moment.
The desired attitude only yields the target roll and target pitch, which are then mapped to the body-frame w.r.t. the yaw angle using the rotation matrix. Then the drone points to wherever it is headed. Given the nature of the actuators, it seems I don't need an Attitude Rate PID Controller.
For now, for close enough distances, the drone manages to go and stabilize there. It does not manage to stay quite exactly at the target location given that it overshoots, which provokes the drone to turn back toward the target and it never quite stays still. Without the yaw angle conversion, it does eventually stay quite still. However, for further distance, the drone goes way too fast and overshoots and eventually becomes unstable. I noticed that this critical distance threshold is inversely proportional to the derivative gain of the velocity PID. I have not yet tuned the gains, just enough to get acceptable behaviour. I noticed that when the target yaw is fixed when the drone comes close to the target, it actually stabilizes for further distances as well.
Is it realistic and achievable to obtain an almost perfect positional controller with just a cascaded PID (a controller that for any distance it manages to fully stabilize itself with negligible error)? If so, is this achieved by tuning gains? If so, how can I tune these gains? From what I understand, I first need a mathematical model of the drone, which I don't have. I believe that this is quite a hassle to derive.