Robotics & Mechatronics · Closed-loop robot implementation
Check position, velocity and current-loop interfaces
A position command may pass through several nested loops before the motor responds. Locate a discrepancy at the interface where it first appears rather than treating the complete drive as one unexplained gain.
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
Recognise what each supplied nested loop controls, its sample/update assumptions and the measurements needed to test the combined robot response.
Read the supplied architecture
In fictional drive C2, the position loop outputs velocity request in rad/s at 100 Hz, the speed loop outputs current request in A at 500 Hz, and an internal current loop updates at 5 kHz. These are provided architecture values, not recommended rates. The sensor locations and filtering are recorded separately.
The periods are 10 ms, 2 ms and 0.2 ms. Faster inner updates do not by themselves prove stability or good tracking. Computation, sensor bandwidth, transport, limits and the supplied design assumptions remain relevant.
Localise the first visible limitation
Constructed snapshots from a supplied acceleration segment.
| Quantity | Request | Observed/limited state |
|---|---|---|
| Position | 1.0 rad | 0.6 rad |
| Outer velocity request | 4.0 rad/s before limit | 2.0 rad/s after limit |
| Speed-loop current request | 1.8 A before limit | 1.8 A after limit |
| Measured velocity | — | 1.9 rad/s |
| Measured current | — | 1.75 A |
A speed limit can explain position lag without a current-limit event
The outer request is clipped from 4 to 2 rad/s. Measured velocity 1.9 rad/s is close to the limited request, while current is below its stipulated 2 A limit. This record is consistent with outer velocity limitation contributing to position lag. It does not prove every inner-loop dynamic is correct.
If the speed request remained 2 rad/s but measured speed were 0.5 with current pinned at 2 A, current/load limitation would become another plausible explanation. Compare the exact interfaces and task phase rather than changing all loop gains.
Choose a discriminating existing test
Use a provided bounded velocity-reference test to inspect the speed/current path independently of the outer position demand, if that mode is supported and authorised. Retain the same load and configuration. A simulation can replay the given architecture; a paper route can classify supplied traces.
General loop design, stability analysis and mechanical sizing remain in their canonical branches. The Robotics evidence is that signal meaning, timing and limiting behaviour match the supplied controller implementation.
Read the timing hierarchy
One 10 ms outer period contains five 2 ms speed periods and fifty 0.2 ms current periods, under exact synchronised rates. That ratio is an architecture fact, not proof that outputs apply simultaneously.
If speed state is delayed 8 ms, it is four nominal speed periods old. A 5 kHz current loop cannot remove that upstream age. Include acquisition-to-use timing in the interface record.
Try the reasoning
What unit does the outer position-loop output have in C2?
Show the answer and reasoning
rad/s, a velocity request, not amperes or torque.
How many speed updates fit one outer period nominally?
Show the answer and reasoning
Five, assuming the declared exact rates.
Why does a fast inner loop not prove good robot tracking?
Show the answer and reasoning
Upstream delays, limits, model/load mismatch and sensor effects can still dominate.
Which supplied trace suggests a speed-request clamp?
Show the answer and reasoning
The 4→2 rad/s limited request with measured 1.9 rad/s and no current-limit event is consistent with that limitation.
What to carry forward
Inspect each nested interface’s quantity, time and limit. Localise the first supported discrepancy before changing a supplied controller.
References
Sources supporting this lesson’s explanations and examples.
ros-controls project3 sources
- ros2_control: Hardware Components and hardware interface typesros2_control contributorsOfficial software documentationKilted, displayed October 2026 documentation
- ros2_control: Different update rates for Hardware Componentsros2_control contributorsOfficial software documentationKilted, displayed October 2026 documentation
- ros2_controllers: PID Controllerros2_control contributorsOfficial software documentationKilted, displayed October 2026 documentation
- Robotic Manipulation, Chapter 2: Let's get you a robotRuss TedrakeUniversity course working notes2020–2026 working notes