How to Design a Simple PID Controller for Quadcopter Trajectory Tracking
Mostra commenti meno recenti
Hello everyone,
I am new to quadcopter control and am trying to design a simple PID controller for trajectory tracking in Simulink.
I am using the UAV Toolbox and started with the example "Simulate UAV Scenario Using UAV Scenario Blocks". My main questions are:
- Plotting a Trajectory: In the provided UAV Scenario scope, how can I plot a desired trajectory (e.g., a reference path) to visualize it against the quadcopter's actual path?
- Controller Design Logic: For the core controller, I need help with the logic. Let's say my desired trajectory point is [x, y, z] and the quadcopter's current position is [xp, yp, zp].
- How do I convert the resulting position error into the correct commands for Roll, Pitch, Yaw Rate, and Thrust?
- I understand this likely requires a cascaded PID structure. Could you please explain the high-level logic or provide a basic example of how the outputs should be calculated from the errors in X, Y, and Z?
Any guidance, code snippets, or pointers to relevant documentation would be greatly appreciated.
Thank you!
2 Commenti
Hi @boutegui
If you have obtained the linear state-space matrices (A, B, C, D) of the UAV in your previous post, and you have learned how to properly design a PID controller for a SISO system without blindly auto-tuning the control parameters, then you can extend the mathematical design concepts to UAV control. In this context, "blindly auto-tuning" refers to allowing the machine to auto-tune the control parameters without considering the desired performance requirements, provided that the system is asymptotically stable.
For example, the demo below allows pidtune() to auto-tune the system. However, an overshoot exceeding 20% and a settling time longer than 5 seconds do not satisfy the desired performance criteria.
sys = ss([0 1; 0 0], [0; 1], [1, 0], 0)
C = pidtune(sys, 'PD')
cL = feedback(C*sys, 1);
step(cL), grid on
stepinfo(cL)
William Rose
il 5 Ott 2025
Thumbs up for this comment.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su C Shared Library Integration in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
