Hello! I am tuning an indoor drone. I have tuned the drone to be stable which holds position but it continuously move around in 10 cm radius. I will explain the setup and my initial analysis.
Setup:
My drone looks like this. It is in X configuration, dimensions are 1 meter approx and motors are of good quality. Sensors: IMU, Optical Flow, Rangefinder and baro. I have not used compass since it is in indoor environment. I am aware that yaw will drift, but I have filtered gyroscope more which allows it to hold yaw for few minutes. Upon landing EKF variances occur, but in flight there is no such problem encountered.
My ardupilot version is 4.0.1. The version of 4.1.1+ doesn’t let me arm.
The red square is the above image is battery.
Experiment:
I take off in althold and switch to loiter. Sticks are left free.
Log Name: Loiter
Second experiment is in guided mode for autonomous run.
Log Name: Guided
Analysis
Visibly, the drone is quite stable but not ideal. I want to understand if this is the limitation of the controller performance or some other issue which I am not aware of. The angle controller performs good; atleast in althold. The velocity controller as seen in below figure, has a lot of delay. In my opinion, if the delay is somehow minimized then the controller will perform faster and I can improve performance.
Extras:
I added logging for desired and target variables in velocity controller which is not included in log. The desired velocities and accelerations were zero when sticks were in middle position. Thus this is purely on Velocity PID rather than feedforward. If my understanding is true, this is how it is supposed to function.
Estimation is correct. I have tried holding the vehicle and moving around. The readings were in range of 0.01 meters accuracy.
I changed Input_TC ranging from 0.1 to 0.4, Velocity PIDs, Position P gain and the estimator parameters. I tried a lot of gains, but I can’t seem to improvise any further.
Question:
How can I make the position and velocity controller more tight?
TLDR
Position hold is good, but I want to understand what is restricting it to improve further. Specifically there is a delay in velocity control.
@Leonardthall your insights on control will be much appreciated.
Thanks!