RobotGuide

Engineering practice · topic F2 · 35 hours

Sim2Real & system identification

Getting it working in sim is only the beginning. Whether it transfers to hardware decides whether the whole approach is worth anything.

Engineering stage · Hardcore
Algorithm · Proficient System software · Aware Embedded & controls · Aware Mechanical · Aware

Tools
Tools

What to learn

  • Domain randomization: which parameters to randomize (mass, friction, latency, noise) and by how much
  • Actuator model identification: testing the motor + gearbox as a black box with latency and friction
  • Latency compensation: explicitly adding the system's fixed delay into the model
  • Transfer evaluation: how to measure «80% transferred» instead of going by feel

The lesson · plain words

The source of the sim-to-real gap is «the model does not match the machine». System identification uses real-robot data to back out the model parameters — so the robot in your simulation and the robot on your desk become the same robot.

Identification: drag the parameters until the two curves overlap

Look at the figure: the gray dashed line is a recorded step response from the real robot, the colored line is the model in simulation. Drag inertia and damping until the two lines overlap — once they overlap, the model «matches». The residual (the part that does not fit) is the friction, compliance, and latency you have not modeled.

That is the essence of identification: design an excitation (step, sine sweep), record the hardware response, and back out parameters with least squares / optimization. Richer excitation separates the parameters better (the identification discipline from B3).

Interactive figure · drag it and see

What this figure shows: a step-response plot where the gray dashed line is the measured hardware response and the colored line is the model simulation — two sliders set model inertia and model damping/friction, and a fit-error RMS readout tracks how close the curves are. Takeaway: sim2real step one is making the model match the hardware; whatever residual remains is unmodeled friction and flex.

The four sources of the gap

① Dynamic parameters (mass/inertia/friction) — fixable by identification; ② actuator details (backlash, dead zone, current-loop bandwidth) — fixable by high-fidelity modeling; ③ sensing differences (noise, latency, resolution) — inject them explicitly in sim; ④ communication latency — add a latency model in sim (F3).

Fix them in this order: identify the dynamics first, then inject sensor noise, then add latency. The wrong order wastes work — tuning noise on a wrong model is meaningless.

Domain randomization: not matching, generalizing

The other route: do not tune the sim to match; randomize the parameters instead (friction ±50%, mass ±30%, latency ±10 ms) so the policy sees it all — the real robot's «one particular value» is guaranteed to fall inside the randomized range. The workhorse method of RL training (G5).

Identification and randomization are not opposites: identify the critical parameters precisely (link masses), randomize the secondary ones (surface friction) — the combination is the current engineering optimum.

How deep to go

You can run a complete step/sweep identification and produce parameters; list error sources as a four-category checklist; and explain the boundary between identification and domain randomization. The same methodology applies to «any model that does not match measurements» — not just robots.

Three questions — do you really get it?

1. What is the essence of system identification?

  • AFiddling with parameters until the curves look right
  • BBacking model parameters out of measured data; residuals point to what is unmodeled
  • CMaking the simulation finer-grained
Show answer

B. Excitation + measurement + inversion. A residual is not failure; it is a clue to «physics not yet modeled».

2. Of the four sources of the sim-to-real gap, which one can identification fix?

  • ACommunication latency
  • BDynamic parameters (mass/inertia/friction)
  • CSensor noise
Show answer

B. Dynamics come from identification; sensor noise from explicit injection; latency from a latency model; actuator details from high-fidelity modeling.

3. What is the idea behind domain randomization?

  • ATuning the sim until it equals the real robot
  • BRandomizing parameters during training so the policy generalizes across the range where the real robot lives
  • CReducing the amount of training
Show answer

B. Do not chase an exact sim; make the policy insensitive to parameters. Transfer works as long as the real values fall inside the randomized range.

Keep going deeper

Links without a marker stay on this site; the rest point to the Chinese edition until its translation batch lands.

How it fails in the field

  • Randomizing only visuals and lighting, not dynamics and latency — the policy collapses the moment it touches hardware
  • Identification done with static tests only; dynamic behavior (friction, compliance) never measured

You have learned enough when

You can complete one actuator identification and produce latency and friction parameters, and you can design a set of transfer-evaluation metrics.

The Chinese edition carries the full topic page for Sim2Real & system identification, including the complete outline, depth requirements per career track, and further derivations: robotguide.dev/k/F2/.