Robotic Systems

Robotic Systems · teaching-draft · v0.2.0

Models, states, and simulation experiments

Lecture 1 · Week 1 · 90 minutes

Learning outcomes

  • Separate physical assumptions from numerical choices.
  • Write a first-order state-space model.
  • Define a reproducible simulation experiment.

Prerequisites: Linear algebra, ODEs, and earlier lectures in this sequence.

What a model leaves out

A model is a deliberate approximation for a particular question. A point mass can predict translational motion while omitting attitude. A rigid body adds orientation and inertia while omitting elastic deformation. Contact introduces assumptions about compliance, friction, and impact. Greater detail helps only when the parameters and numerical treatment support the intended question.

State the modeling boundary before writing code: bodies, joints, reference frames, forces, geometry, sensors, and actuators. Record which effects are neglected. A simulator can solve an internally consistent model that is still physically inappropriate.

State-space form

For a mass-spring-damper, mp¨+bp˙+kp=um\ddot p+b\dot p+kp=u, choose x=(p,v)x=(p,v):

x˙=[v(u−bv−kp)/m].\dot x=\begin{bmatrix}v\\(u-bv-kp)/m\end{bmatrix}.
The initial state and input history determine a trajectory for a well-posed model. An integrator approximates it at tk=kΔtt_k=k\Delta t. This introduces a new mathematical system, xk+1=FΔt(xk,uk)x_{k+1}=F_{\Delta t}(x_k,u_k), whose properties need investigation.

A robot configuration can live on a manifold. MuJoCo stores configurations in qpos and tangent velocities in qvel, and their lengths can differ. We derive the geometry in week 2, but keep this distinction in every interface from the beginning.

Worked dimensional check

Take m=2m=2 kg, b=0.4b=0.4 N s/m, k=8k=8 N/m, p=0.1p=0.1 m, v=−0.2v=-0.2 m/s, and u=1u=1 N. Net force is 1−0.4(−0.2)−8(0.1)=0.281-0.4(-0.2)-8(0.1)=0.28 N, so acceleration is 0.140.14 m/s2^2. Adding velocity directly to force would be dimensionally invalid; the damping coefficient supplies the missing units.

For an undamped unforced oscillator, E=12mv2+12kp2E=\frac12mv^2+\frac12kp^2 stays constant in the continuous model. That invariant gives us a numerical diagnostic.

Verification versus validation

Verification asks whether code solves the chosen equations. Compare against an analytic solution, refine the timestep, check units, and test invariants. Validation asks whether the model predicts observed physical behavior. It requires independent measurements and a declared operating range. Comparing two engines is useful cross-checking, but agreement does not establish physical validity.

The first practice produces energy and trajectory errors without a graphics window. Keeping rendering separate makes the experiment easier to automate.

Exercise

A pendulum animation looks plausible at 30 frames per second. What can you conclude? Answer: only that the displayed samples look plausible. You still need the physics timestep, integrator, units, initial conditions, and quantitative errors. A display frame is not necessarily a simulation step.

The CMU dynamics series and notebooks accompany this progression from equations to experiments CMU 16-715 CMU dynamics notebooks.

Reading and source connections

Advanced Robot Dynamics and Simulation — lecture series — CMU 16-715. Companion video series for modeling, integration, rigid-body dynamics, constraints, and contact.

16-715 lecture notebooks — CMU 16-715 course organization. Further computational examples; original notebooks are not copied into this repository.

MuJoCo computation — MuJoCo contributors. Authoritative force, generalized-coordinate, actuator, and constraint conventions.