Robotics & Mechatronics · Simulation, models and reproducible tests
Separate software, hardware-in-loop and physical evidence
Different test stages include different parts of the robot. Name what is real, what is simulated and which fault each stage can reveal before treating a passing result as a system claim.
All numerical tables, scenarios and records are original constructed teaching data unless a specific external dataset is named. No physical experiment is claimed. A worked simulation model is distinguished from an executed simulator.
Lesson preparation and course links
Use the local explanations and supplied units, diagrams, tables and examples; advanced chapters build on the named local chapters. External links are point-of-need depth, not a requirement to finish an entire map.
Back to the Robotics chapterAfter reading, you can
Plan test stages that expose interface and timing faults while preserving what each stage can and cannot establish.
Allocate defects to the earliest informative stage
Stage names vary across organisations; this table declares its own boundaries.
| Stage | Included boundary | Example defect it can reveal | Important omission |
|---|---|---|---|
| Paper/supplied replay | Given records and decision logic | Wrong threshold equality or unit conversion | No executed runtime or physical timing |
| Software-in-loop | Actual controller software + simulated plant/interfaces | Logic, message identity, some timing/configuration faults | Physical drive/sensor/harness absent |
| Hardware-in-loop | Actual chosen controller/interface hardware + simulated plant | Real I/O protocol and measured selected timing | Simulated mechanics/loads remain |
| Physical task test | Configured robot, sensing, environment and task | Installed calibration, coupling, load/response and task outcome | Broader conditions and rare failures still untested |
A missing component limits the claim
A logic inversion can be found in a paper truth table before any hardware exists. A wrong voltage level cannot be established by a software mock that accepts every value. A loose coupling needs an appropriate physical or faithfully injected interface test; a rigid ideal model will not reveal it spontaneously.
Hardware-in-loop is not automatically a whole-robot test. Name which controller, bus, sensor emulator and timing path are real. A desktop application sending messages to a simulated robot is not hardware-in-loop merely because a computer is physical hardware.
Retain a reproducible replay record
Store initial state, exact input sequence, timestamps/clock domains, software/configuration versions, expected output/state and comparison. Include normal, boundary, stale, out-of-order and restart cases. Retain both the failing and corrected traces.
When moving stages, keep the same task requirement where possible but add the newly included boundary’s observations. A perfect software replay does not establish drive response; a physical endpoint pass does not prove untested restart logic.
Use stage results to justify progression
The verification matrix should say passed, failed, not applicable or pending per claim and stage. Avoid one global green label. A failed electrical interface claim cannot be waived because the simulation passed. Equally, waiting for physical equipment does not prevent independent software/supplied-data learning.
The task’s exact evidence chain grows with each stage. That lets learners complete meaningful work without pretending absent hardware was tested.
Reproduce one exact interface replay
Fixture RF1: initial state MOVE, epoch 1, coordinate A1 in mm, aligned monotonic seconds, age maximum 50 ms, threshold x≥70 mm. Read/validate/decide/commit order is fixed; all quality/reference fields are valid unless named otherwise.
| Receiver / s | Acquisition / s | State identity/value | Expected result |
|---|---|---|---|
| 0.000 | −0.010 | seq 10; x=68 mm | MOVE; +20 mm/s |
| 0.020 | 0.010 | seq 11; x=70 mm | STOP_REQUESTED; normal stop |
| 0.080 | 0.010 | duplicate seq 11; x=70 mm | Age 70 ms: FAULT_RESPONSE; no normal motion decision |
| 0.200 | 0.190 | Restart epoch 2; old epoch 1 command delivered | Reject old task; remain unarmed until explicit readiness/new task |
Retain enough to compare implementations
Store RF1 inputs exactly, initial state and the actual branch/output log. A paper trace predicts the four rows; software-in-loop executes the controller; a declared HIL setup adds its real interface timing. The same expected semantics apply, while measured timing and physical response are separate added evidence.
Place three seeded defects
Defect A uses x>70 instead of x≥70. A paper/replay case at exactly 70 exposes it. Defect B attaches an old epoch to a delayed command. Software-in-loop can test rejection with exact message identities.
Defect C is an intermittent output coupling under load. An ideal rigid simulation lacks that failure path. A physical task test with independent output observation, or an explicitly injected coupling-failure model for software handling, addresses different parts of the question. Report which was performed.
Try the reasoning
Does a HIL pass prove the simulated mechanism’s strength?
Show the answer and reasoning
No. The mechanical boundary was not physically included.
Why preserve the same input replay after a repair?
Show the answer and reasoning
It checks the original defect under matched inputs and makes the change reviewable.
Can supplied-data analysis count as a completed learning exercise?
Show the answer and reasoning
Yes, when labelled accurately; it establishes reasoning over that case, not executed hardware performance.
What must a test-stage label state?
Show the answer and reasoning
Which software, interfaces, hardware, plant and timing paths are real or simulated, and the claim being assessed.
What to carry forward
A stage proves only the boundaries it includes. Keep a claim-by-stage matrix and carry exact evidence forward.
References
Sources supporting this lesson’s explanations and examples.
- Robotic Manipulation, Chapter 2: Let's get you a robotRuss TedrakeUniversity course working notes2020–2026 working notes
- Gazebo Jetty: SensorsGazebo contributorsOfficial simulation tutorialJetty versioned documentation
- Assembly Performance Metrics and Test MethodsNIST Intelligent Systems DivisionResearch program overview