Skip to content

About

Feedback linearization vs. sliding-mode control for a single-link flexible-joint robot arm — symbolically verified MATLAB models with a full robustness study (parameter mismatch, matched disturbance, chattering).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Single-Link Flexible-Joint Robot Arm — Feedback Linearization vs. Sliding Mode Control

MATLAB Toolbox Simulink

A nonlinear-control course project that designs, proves, and simulates two controllers for the classic Spong (1987) single-link flexible-joint robot arm — an exact-input–output feedback-linearizing (FBL) controller and a sliding-mode (SMC) controller — and compares their robustness to parameter mismatch, matched disturbances, actuator saturation, and chattering.

The elastic transmission decouples the motor angle from the link angle, which makes the plant a genuine relative-degree-4, fourth-order nonlinear system with no zero dynamics — a textbook benchmark for putting exact feedback linearization head-to-head against sliding mode control.

📄 Report.pdf — the full written report (46 pages): modeling, control design with proofs, simulation results, and the MATLAB listings.

Full plant derivation, Lie-derivative algebra, stability proofs, and a data-driven Simulation Results section also live in docs/flexible_joint_FBL_SMC.md.


System architecture

Closed-loop block diagram: quintic reference generator and Lie-derivative error chain feed the FBL law (blue) and SMC law (red); both share the symbolically-verified a(x), pass through the switch and the saturating actuator, and drive the flexible-joint plant with an optional matched disturbance.

Both controllers reconstruct the output derivatives through the model's Lie derivatives (no numerical differentiation), share the symbolically-verified $a(x)=L_f^4h$, and use only the nominal parameters — while the plant may be perturbed by ±20 % or hit with a matched disturbance torque.


Highlights

  • Symbolically verified model. Every Lie derivative ($L_fh,\dots,L_f^4h,;L_gL_f^3h$) is re-derived from scratch with the Symbolic Math Toolbox and checked term-by-term against the hand derivation; relative degree $= 4$ and $b(x)=k/(IJ)=\text{const}$ are confirmed automatically.
  • Two controllers, one plant. FBL via 4th-order pole placement (≈2 s settling); SMC via a 3rd-order sliding surface + boundary-layer reaching law.
  • Honest robustness study. Nominal, ±20 % parameter perturbation (several combinations), and a 1 N·m matched disturbance — controllers always use the nominal model.
  • The punchline (matched disturbance): FBL keeps a fixed 0.090 rad (≈5.2°) steady offset; SMC rejects the same torque to 2.7×10⁻⁵ rad — ~3300× smaller.
  • Reproducible. Pure .m files (ode45 + fixed-step ZOH), no Simulink; every figure and number in the docs is generated by main_simulation.m.
Tracking error (nominal · perturbed · disturbed) RMS error & control effort
error metrics

Repository structure

.
├── src/
│   ├── plant_dynamics.m          # Nonlinear ODE f(t,x,u,params) + saturation + matched disturbance (Sec 2.2)
│   ├── params_flexible_joint.m   # Nominal parameter struct (Sec 2.3 table)
│   ├── reference_trajectory.m    # C-smooth quintic 0->pi/2 move + 4 analytic derivatives (Sec 5)
│   ├── symbolic_verification.m   # Re-derives & verifies the Lie algebra, exports a(x) (Sec 3)
│   ├── controller_FBL.m          # u = (IJ/k)(v - a(x)), pole-placement error law (Sec 3.2)
│   ├── controller_SMC.m          # sliding surface + equivalent control + reaching law (Sec 4)
│   ├── main_simulation.m         # Runs all scenarios, plots, and the phi sweep (Tasks 6-8)
│   └── a_of_x_gen.m              # AUTO-GENERATED verified a(x) (created on first run)
├── figures/                      # Generated PNGs (committed for the docs/README)
├── docs/
│   └── flexible_joint_FBL_SMC.md   # Derivation, proofs, and Simulation Results
└── Report.pdf                    # Final written report (LaTeX sources not tracked)

Getting started

Requirements: MATLAB (developed on R2023b) with the Symbolic Math Toolbox. No Simulink.

cd src        % all source lives in src/
main_simulation

This will, in order:

  1. run symbolic_verification.m (prints PASS/FAIL for each Lie derivative and writes the verified a_of_x_gen.m),
  2. simulate FBL and SMC across all scenarios,
  3. save every figure to figures/ and print a metrics summary table,
  4. sweep the boundary-layer thickness $\phi$.

To verify the math alone:

cd src
symbolic_verification(true);

All gains and scenario definitions are collected in a single tunable configuration block at the top of main_simulation.m (FBL pole, SMC sliding poles $\mu$, switching gain $K$, boundary layer $\phi$, perturbation multipliers, disturbance amplitude/onset, …).


The controllers (in one line each)

Feedback linearization (Sec 3.2) — cancels the drift exactly and places a Hurwitz quadruple pole:

$$u = \frac{IJ}{k}\big(v - a(x)\big),\qquad v = y_d^{(4)} - k_3 e''' - k_2\ddot e - k_1\dot e - k_0 e.$$

Sliding mode (Sec 4) — equivalent control plus a boundary-layer switching term that dominates bounded matched uncertainty:

$$s = e''' + \lambda_2\ddot e + \lambda_1\dot e + \lambda_0 e,\qquad u = u_{eq} - \frac{IJ}{k},K,\mathrm{sat}(s/\phi).$$

Both build the error derivatives from the measured state through the model's Lie derivatives, so no noisy numerical differentiation is required.


Selected results

Nominal tracking Finite-time reaching of the surface
tracking sliding
Actuator saturation & chattering Chattering-vs-accuracy tradeoff
control phi sweep
Scenario FBL RMSE [rad] SMC RMSE [rad]
Nominal 0.041 0.036
±20 % parameter mismatch 0.214 0.106
1 N·m matched disturbance 0.076 0.036

See docs/flexible_joint_FBL_SMC.md#6-simulation-results for the full tables, steady-state numbers, and discussion.


Notes & design takeaways

  • Because relative degree $=$ system order, all parametric uncertainty is matched; SMC's switching term therefore helps under mismatch as well as disturbance, but both controllers share a small residual from reconstructing $\ddot y,,y'''$ with the nominal model.
  • Chattering is a sampled phenomenon: in continuous time the boundary layer keeps the SMC torque smooth; in a digital (ZOH) loop it re-appears once $\phi \lesssim K/f_s$. The $\phi$-sweep makes this tradeoff quantitative.

Reference

M. W. Spong, "Modeling and Control of Elastic Joint Robots," ASME J. Dyn. Syst. Meas. Control, 1987.

License

Released under the MIT License — see LICENSE.

About

Feedback linearization vs. sliding-mode control for a single-link flexible-joint robot arm — symbolically verified MATLAB models with a full robustness study (parameter mismatch, matched disturbance, chattering).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages