PID altitude control of quadcopter
38 ビュー (過去 30 日間)
I am designing a flight control algorithm for a UAV. In the first step, I am just designing control just altitude using PID.
I gave an step input of 50 m after 10 s as the reference altitude.
Problem 1: when i ran the simulink model, the UAV is going high and high.
Problem 2: The altitude starts rising after 3 s, even though the reference signal is 0 for first 10 s.
I tried tuning PID with simulink tuning app and with ZN method, but not getting required output.
I am attaching my simulink model for reference.
i have selected motor and propeller from T motors. The website link and other required information are mentioned in the model.
Currently, I am interpolating rpm data from the available throttle and rpm data from the website.
correct me if i am wrong here, the output of PID control is PWM and 50% throttle setting can be assumed to be 50% of voltage supply?
Do i need to add PWM block after PID block?
Thanks and regards,
回答 (1 件)
Sam Chak 2023 年 6 月 1 日
The following example is based on the pure math analysis on the contineous-time equations of motion given in your note. Thus, PWM is not considered in the design.
The Moment equations of motion (attitude model) are
... Eq. (1)
If assuming small angles on , then the Euler rate can be expressed as follows:
... Eq. (2)
and the Moment equations of motion become
... Eq. (3)
From Eq. (3), if the Control Moments are defined as
... Eq. (4)
where is assumed to be known, and are the PID controllers to be designed, then Eq. (3) can be 'flattened' to decoupled Double Integrator Systems
... Eq. (5)
which allows the Engineer to design some control laws based on simple knowledge of differential equations.
In the absence of external disturbances, state-feedback PD controllers are sufficient to stabilize the systems in Eq. (5) based on the knowledge of . Multiplying with the moment of inertia, it becomes
Iy = 5;
wy = 1; % tune this parameter to tune kp and kd simultaneously
kd = 2*Iy*wy % derivative gain
kp = Iy*wy^2 % proportional gain
Gp = tf(1, [1 0]);
Gv = tf(1, [Iy 0]);
G1 = feedback(Gv, kd);
G2 = series(kp, series(G1, Gp));
Gcl = minreal(feedback(G2, 1))
step(Gcl, 20), grid on
If the Euler angular rate signals cannot be accurately measured, then the output-feedback PD controllers (PID controller block in Simulink) should be used. The autotuner feature can be used, if you understand how it works.
Also take note that in your note, the actuation dynamics (rotors) are not considered in the design. In practice, there will be a slight delay in the signal transmission. Anyhow, you can try this design approach assuming that the nominal model is known.