# Course 4: Feedback Control & Robot Dynamics

- HTML Page: https://roboticsconcepts.dev/courses/feedback-control-robot-dynamics/
- Estimated Time: 4–5 hrs

## Core Focus
Bridge pure geometry to physical forces, mass, gravity, and closed-loop motor commands so a robot actually tracks desired motions cleanly in the real world.

## Why It Matters Today
High-level learned policies almost never output raw motor voltages directly at kilohertz rates; they command targets into fast PD, impedance, or whole-body torque controllers that keep hardware stable under contact and payload shifts.

## Modules
- **Module 4.1: [Open-Loop vs. Closed-Loop Feedback](https://roboticsconcepts.dev/courses/feedback-control-robot-dynamics/open-loop-vs-closed-loop-feedback.md)** | [Python notebook (.py)](https://roboticsconcepts.dev/downloads/notebooks/course-4/01_open_loop_vs_closed_loop.py)
  Why blind motor commands drift or sag under gravity and friction; error signals, feedback loops, and disturbance rejection.
- **Module 4.2: [PID Control Intuition and Practical Tuning](https://roboticsconcepts.dev/courses/feedback-control-robot-dynamics/pid-control-intuition-and-tuning.md)** | [Python notebook (.py)](https://roboticsconcepts.dev/downloads/notebooks/course-4/02_pid_control_tuning.py)
  Understanding proportional spring stiffness, derivative damping, and integral steady-state error correction, alongside integral windup and sensor noise limits.
- **Module 4.3: [Mass, Center of Mass, and Inertia Tensors](https://roboticsconcepts.dev/courses/feedback-control-robot-dynamics/mass-center-of-mass-inertia-tensors.md)** | [Python notebook (.py)](https://roboticsconcepts.dev/downloads/notebooks/course-4/03_mass_com_inertia_tensors.py)
  How mass distribution shapes rotational inertia, and why placing heavy actuators near the shoulder instead of the wrist transforms arm agility.
- **Module 4.4: [Rigid-Body Equations of Motion](https://roboticsconcepts.dev/courses/feedback-control-robot-dynamics/rigid-body-equations-of-motion.md)** | [Python notebook (.py)](https://roboticsconcepts.dev/downloads/notebooks/course-4/04_rigid_body_equations_of_motion.py)
  Breaking down the classic manipulator dynamics equation piece by piece: configuration-dependent mass matrix, centrifugal and Coriolis coupling, and gravity loading.
- **Module 4.5: [Feedforward and Compliant Control](https://roboticsconcepts.dev/courses/feedback-control-robot-dynamics/feedforward-and-compliant-control.md)** | [Python notebook (.py)](https://roboticsconcepts.dev/downloads/notebooks/course-4/05_feedforward_impedance_control.py)
  Gravity compensation, computed torque control, and virtual spring-damper impedance control for safe, compliant interaction with surfaces and people.

## Interactive Sandboxes
- **Gravity-Loaded Single-Joint Arm PID Tuner** (marimo): Tune Kp, Ki, and Kd on a gravity-loaded pendulum arm and click to poke it with live external disturbances.
- **Mass & Rotational Inertia Slider Lab** (mujoco-wasm): Slide a heavy motor mass from the wrist back toward the shoulder and compare peak actuator torque and swing speed.
- **Interactive Impedance Control Sandbox** (mujoco-wasm): Push a compliant robot arm against virtual walls and compare stiff position control vs. tuned virtual spring-damper impedance.
