Memuat
Memuat
State-Space LQR Controller for Robotics and Mechatronics
0 views
Design and simulate LQR control so that the pendulum angle tracks its target through the cart force, accounting for the pendulum length. LQR designs a state feedback gain that minimises a quadratic cost on state deviation and control effort. It suits multivariable systems with a state-space model, such as pendulums, suspensions, or aircraft.

Design and simulate LQR control so that the pendulum angle tracks its target through the cart force, accounting for the pendulum length.
| Role | Variable | Unit |
|---|---|---|
| Main | Pendulum angle | deg |
| Supporting 1 | Cart force | N |
| Supporting 2 | Pendulum length | m |
The LQR controller (K1=0.54, K2=1.25) settles Pendulum angle within a 2% band in 3.4 s with a peak control effort of 0.83 on Pendulum length and total cost J=2.48.
Computed from illustrative synthetic data, not from a real study.
LQR designs a state feedback gain that minimises a quadratic cost on state deviation and control effort. It suits multivariable systems with a state-space model, such as pendulums, suspensions, or aircraft.
Report Q, R, the gain K, closed-loop poles, and state and control responses. Explain the effect of changing Q and R on response speed and control signal size.
A short starting script with this project's variable names. The delivered version is adapted to your data and fully commented.
A = [0 1; -2 -0.5];
B = [0; 1];
C = eye(2);
D = zeros(2, 1);
sys = ss(A, B, C, D);
fprintf('Controllability rank: %d\n', rank(ctrb(A, B)));
cart_force = [1; 0]; % initial state
t = 0:0.01:10;
figure; hold on;
for rr = [0.1 1 10]
Q = diag([10 1]);
R = rr;
K = lqr(A, B, Q, R);
Acl = A - B*K;
syscl = ss(Acl, zeros(2,1), C, zeros(2,1));
[pendulum_angle, tt, x] = initial(syscl, cart_force, t);
u = -(K * x')';
fprintf('R=%g K=[%.3f %.3f] poles: %s\n', rr, K, mat2str(eig(Acl), 3));
subplot(2,1,1); hold on; plot(tt, x(:,1), 'DisplayName', sprintf('R=%g', rr));
subplot(2,1,2); hold on; plot(tt, u, 'DisplayName', sprintf('R=%g', rr));
end
subplot(2,1,1); ylabel('Position'); legend show; grid on;
subplot(2,1,2); ylabel('Control u'); xlabel('Time (s)'); grid on;Choose how much help you need. Each higher package includes everything in the lower ones. Prices exclude 11% VAT.
Package 1
US$38
excl. 11% VAT
Duration: 7 working days
Output: MATLAB files + result figures
Deliverables
Package 2 · most chosen
US$113
excl. 11% VAT
Duration: 13 working days
Output: Code + analysis + interpretation notes
Includes all of Package 1, plus
Package 3
US$244
excl. 11% VAT
Duration: 18-21 working days
Output: Code + analysis + guidance until ready to present
Includes all of Packages 1 & 2, plus
Yes. State-Space LQR Controller is commonly used at this level in Robotics and Mechatronics. We adapt the analysis to your research question, your own data and your supervisor's requirements.
No. The sheet is computed from illustrative synthetic data so you can see the kind of output MATLAB gives. For your order we run the same method on your own data.
That is the point of the packages. Every script is commented, and Package 3 includes two coaching sessions plus practice questions so you can explain the method and the results at your seminar and defence.
Each project has three packages: Package 1 (code and explanation) US$38, Package 2 (your data analysis and interpretation) US$113 and Package 3 (full guidance) US$244, excluding 11% VAT. Larger datasets, extra methods or tight deadlines adjust the quote after a short consultation.
The result sheet uses illustrative synthetic data. MATLAB is a trademark of The MathWorks, Inc.
Back to MATLAB portfolio