Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Nonlinear Control 22 Feedback Linearization

5. Consider the system


𝑥ሶ1 = 𝑥2 + 2𝑥12 , 𝑥ሶ 2 = 𝑥3 + 𝑢, 𝑥ሶ 3 = 𝑥1 − 𝑥3 , 𝑦 = 𝑥1
Design a state feedback control law such that the output 𝑦
asymptotically tracks the reference signal 𝑟(𝑡) = sin𝑡
Solution
𝑦 = 𝑥1 → 𝑦ሶ = 𝑥ሶ 1 = 𝑥2 + 2𝑥12
→ 𝑦ሷ = 𝑥ሶ 2 + 4𝑥1 𝑥ሶ1 = 𝑥3 + 𝑢 + 4𝑥1 (𝑥2 + 2𝑥12 )
Let 𝑒 ≝ 𝑦 − 𝑟 = 𝑥1 − 𝑟
→ 𝑒ሶ = 𝑥ሶ 1 − 𝑟ሶ = 𝑥2 + 2𝑥12 − 𝑟ሶ
→ 𝑒ሷ = 𝑦ሷ − 𝑟ሷ = 𝑥3 + 𝑢 + 4𝑥1 (𝑥2 + 2𝑥12 ) − 𝑟ሷ
Take 𝑢 = −𝑥3 − 4𝑥1(𝑥2 + 2𝑥12) + 𝑟ሷ − 𝑘1𝑒 − 𝑘2𝑒ሶ
= −𝑥3 − 4𝑥1(𝑥2 + 2𝑥12) + 𝑟ሷ − 𝑘1(𝑥1 − 𝑟) − 𝑘2(𝑥2 + 2𝑥12 − 𝑟)ሶ
where, 𝑘1 and 𝑘2 are positive constants. The tracking error 𝑒 is satisfies
the equation 𝑒ሷ + 𝑘2 𝑒ሶ + 𝑘1 𝑒 = 0, which shows that 𝑒 𝑡 → 0 as 𝑡 → 0
as 𝑡 → 0: 𝑦 = 𝑥1 → 0, 𝑥ሶ 3 = −𝑥3 → the internal dynamic is stable
HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien
Nonlinear Control 23 Feedback Linearization

5. Matlab simulation
% initial value
u(1)=0; x1(1)=0; x2(1)=0; x3(1)=0; r(1)=0; dr(1)=1; d2r(1)=0;
% sampling time
dt=0.001; t=0:dt:7; n=length(t);
% desired trajectory
for i=1:n
r(i)=sin((i-1)*dt); if i>1 dr(i)=cos((i-1)*dt); d2r(i)=-sin((i-1)*dt); end
end
% controller gain
k1=100; k2=10;
% main
for i=2:n
e(i)=x1(i-1)-r(i-1); de(i)=x2(i-1)+2*(x1(i-1))^2-dr(i-1);
x1(i)=(x2(i-1)+2*(x1(i-1))^2)*dt+x1(i-1);
x2(i)=(x3(i-1)+u(i-1))*dt+x2(i-1);
x3(i)=(x1(i-1)-x3(i-1))*dt+x3(i-1);
u(i)=-x3(i)-4*x1(i)*(x2(i)+2*(x1(i))^2)+d2r(i)-k1*e(i)-k2*de(i);
end
plot(t,r,t,x1); xlabel('Time, s'); ylabel('y'); title('Output y=x1'); hold on;
figure; plot(t,e); xlabel('Time, s'); ylabel('e'); title('Error e=y-r');

HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien
Nonlinear Control 24 Feedback Linearization

5. Simulation Results
𝑥ሶ1 = 𝑥2 + 2𝑥12
𝑥ሶ 2 = 𝑥3 + 𝑢
𝑥ሶ 3 = 𝑥1 − 𝑥3
𝑦 = 𝑥1
𝑢 = −𝑥3 − 4𝑥1 (𝑥2 + 2𝑥12 ) + 𝑟ሷ − 𝑘1 (𝑥1 − 𝑟) − 𝑘2 (𝑥2 + 2𝑥12 − 𝑟)ሶ

HCM City Univ. of Technology, Faculty of Mechanical Engineering Nguyen Tan Tien

You might also like