Manipulator Basics · Lab 08 of 10
Lab 08: Manipulator Control
Tune joint PID, add gravity compensation, try computed torque and reject disturbances on a 2R arm with real dynamics.
Objective
Close the loop on a 2R arm with real rigid-body dynamics: tune joint PID gains, add gravity compensation, compare position, velocity and computed-torque control, inject disturbances and measure overshoot, settling time and steady-state error.
Brief theory
The arm obeys (Module 09). An independent joint PID computes
Gravity compensation adds the model’s as a feedforward, so the PID no longer has to hold the arm up. Computed-torque control cancels the whole model: ; with a perfect model the error obeys . Velocity control here is a cascade: an outer position loop sets a joint velocity reference and an inner PI loop tracks it. See Module 11.
Simulation workspace
Drag in the view where the controls say you can. Every number shown is computed live by the simulation engine running in your browser.
Loading the simulation…
Guided tasks
Each task ticks itself when the simulation sees you do it. Progress is saved in this browser.
- Tune PID parametersChange at least one gain and run the simulation.
- Track a desired trajectoryUse the quintic reference and get the RMS tracking error of both joints below 0.02 rad.
- Introduce disturbancesEnable a disturbance torque pulse and run.
- Compare poorly tuned and well-tuned controllersRun twice with "Keep previous run" on so both responses are overlaid.
Challenges
Each challenge states an objective, its constraints and how success is measured. The live line under it is computed from the simulation. Hints and full solutions are there when you want them.
Success criteria
- Metrics are measured from the simulated response, not estimated: overshoot, 2 % settling time, steady-state error, RMS error, peak torque and control effort.
- Tracking RMS below 0.02 rad on both joints with torque limits respected.
Explanation of the results
Without gravity compensation, a PD controller holds the arm only by keeping an error large enough that : that is the steady-state error you see, and it shrinks only as grows. Integral action removes it slowly and adds overshoot; gravity compensation removes it immediately, if the model is right. Computed torque tracks almost perfectly with the exact model and degrades as the model error grows: try the model-error slider.
Assumptions of this simulation. Two rigid links in a vertical plane, uniform rod inertias, viscous friction only, no motor electrical dynamics, no gear backlash or elasticity, torque saturation at the limits shown, a controller sampled every 2 ms with exact joint angle and velocity measurements, physics integrated with RK4 at 1 ms. Real joints add friction, flexibility, sensor noise and delay, which limit how high the gains can go.