- Settling time less than 2 seconds
- Overshoot less than 5%
- Steady-stage error less than 1%
state feedback control and observer
165 次查看(过去 30 天)
显示 更早的评论
Can you explain how to design a state feedback control and an observer for a DC motor with the following specifications? If you could provide instructions for both MATLAB and Simulink, I would greatly appreciate it.
Rs = 0.47;
Ld = 1.23e-3;
B = 0.0002;
Kb = 0.42;
Kt = 0.73;
J = 6.5e-4;
% Second-order State Matrix
A1 = [-B/J Kt/J;
-Kb/Lq -Rs/Lq];
B1 = [0;
1/Lq];
C1 = [1 0];
D1 = 0;
0 个评论
采纳的回答
Sam Chak
2023-4-5
Hi @영탁 한
Like many collaborative robot arms and autonoumous vehicles, it is necessary to design the desired reference trajectory so that the control systems can follow. In this exercise, a reference model (transfer function) is designed to satisfy the design criteria.
From the reference model, one can obtain the desired closed-loop pole and the pole placement technique (solving algebraic equations) can be applied. The rest of the controller and observer design are procedural steps. So, the key is the reference model design!
% Parameters
Rs = 0.47;
Lq = 1.23e-3;
B = 0.0002;
Kb = 0.42;
Kt = 0.73;
J = 6.5e-4;
% State-space Matrices of the Uncompensated Plant
A = [-B/J Kt/J;
-Kb/Lq -Rs/Lq];
B = [0;
1/Lq];
C = [1 0];
D = 0;
% Reference trajectory design
wr = 3; % reference omega, ω
zr = 0.7; % reference zeta, ζ
nr = wr^2;
dr = [1 2*zr*wr wr^2]; % x" + 2·ζ·ω·x' + ω²·x
Gr = tf(nr, dr) % reference model
stepinfo(Gr)
% Controller design
cp = pole(Gr) % controller poles
K = place(A, B, cp) % controller gains
% Closed-loop control system without observer
sys = ss(A-B*K, B, C, D);
Nbar = 1/dcgain(sys); % Normalizer (to rescale the reference input)
cls = ss(A-B*K, B*Nbar, C, D)
stepinfo(cls)
% Observer design
or = 10*real(cp(1)); % make the observer response 10 times faster
op = [or+1 or-1] % observer poles (make op ≪ cp but no repeated poles)
L = place(A', C', op)' % observer gains
% Combine state-feedback controller and observer
Aco = [A-B*K B*K;
zeros(size(A)) A-L*C];
Bco = [B*Nbar;
zeros(size(B))];
Cco = [C zeros(size(C))];
Dco = 0;
% Closed-loop observer-based control system
clco = ss(Aco, Bco, Cco, Dco)
step(clco, 6), grid on
stepinfo(clco)
sse = fix(1 - dcgain(clco)) % steady-state error
As shown, all three design criteria are satisfied.
3 个评论
Sam Chak
2023-11-18
I'm glad to hear that. If you found the explanation on the design of the integrated full-state feedback controller and observer helpful, please consider voting 👍 as a token of appreciation. Thank you!
Siddharth Jawahar
2024-11-29
Great answer by Sam! I am commenting on how you could implement the controller design in Simulink. Please look at the final model attached and the script to setup the variables.
%% Step 1: Define Plant Dynamics
% Parameters
Rs = 0.47;
Lq = 1.23e-3;
B = 0.0002;
Kb = 0.42;
Kt = 0.73;
J = 6.5e-4;
% State-space matrices of the plant
A = [-B/J, Kt/J;
-Kb/Lq, -Rs/Lq];
B = [0;
1/Lq];
C = [1, 0];
D = 0;
% Reference trajectory design
wr = 3; % reference omega, ω
zr = 0.7; % reference zeta, ζ
nr = wr^2;
dr = [1 2*zr*wr wr^2]; % x" + 2·ζ·ω·x' + ω²·x
Gr = tf(nr, dr) % reference model
% Export to workspace
assignin('base', 'A', A);
assignin('base', 'B', B);
assignin('base', 'C', C);
assignin('base', 'D', D);
%% Step 2: Design State Feedback Controller
% Desired closed-loop poles for the state feedback
desired_poles = [-30, -40];
% Calculate state feedback gain (K)
K = place(A, B, desired_poles);
% Feedforward gain for tracking
N = -1 / (C * inv(A - B * K) * B);
% Export to workspace
assignin('base', 'K', K);
assignin('base', 'N', N);
%% Step 3: Design the Observer
% Desired poles for the observer
observer_poles = [-50, -60];
% Calculate observer gain (L)
L = place(A', C', observer_poles)';
% Export to workspace
assignin('base', 'L', L);
%% Step 4: Display Calculated Variables
disp('State-space matrices and gains calculated for Simulink:');
disp('A, B, C, D (Plant Dynamics)');
disp('K (State Feedback Gain)');
disp('N (Feedforward Gain)');
disp('L (Observer Gain)');
Please follow the steps below on constructing the Simulink model:
- Plant Dynamics: Add a State-Space block with matrices A, B, C, D for the plant.
- Reference Input: Add a Step block to generate the desired tracking signal.
- State Feedback: Use a Gain block with K to implement feedback and a Gain block with N for feedforward.
- Observer: Add another State-Space block for the observer with:
A - L * C for A
[B, L] for B
eye(2) for C
zeros(2, 2) for D
- Feedback Integration: Connect the observer states to the feedback gain (K).
- Sum Block: Combine scaled reference signal (N * r) and feedback signal (-K * observer states).
- Control Signal: Feed the combined signal to the plant input and observer.
Once you run the simulation the tracking performance is below:

HTH,
Sid
更多回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!