GLOBAL KNOWLEDGE ARK

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 chapter

After reading, you can

Recognise what each supplied nested loop controls, its sample/update assumptions and the measurements needed to test the combined robot response.

01

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.

C2: nested position, velocity and current feedbackThe reference position in radians enters a position-error sum. Its measured position feedback is subtracted. The 100 Hz position controller outputs velocity request in radians per second to a velocity-error sum, where measured velocity is subtracted. The 500 Hz velocity controller outputs current request in amperes to a current-error sum, where measured motor current is subtracted. The 5 kHz current controller commands the power stage, which acts on motor and load. A current sensor on the motor-current path returns current to the inner sum. Declared position and velocity sensing returns state to the two outer sums. Each feedback path is drawn separately. Sensor location, filtering, timing and interface limits still require the C2 record; this is a functional architecture, not a stability proof.C2: nested position, velocity and current feedbackPosition loop100 HzVelocity loop500 HzCurrent loop5 kHzPower stageapplied outputMotor + loadphysical responseCurrent sensingi / A + timePosition / velocity sensinglocation + filtering declaredq / rad; ω / (rad/s); time+−+−+−q ref / radω ref / (rad/s)i ref / Amotor currentmeasured imeasured ωmeasured qViolet: command path · Orange: actuation · Dashed blue: measured feedbackRates imply nominal periods only; limits, filters and acquisition age remain explicit.
The reference position in radians enters a position-error sum. Its measured position feedback is subtracted. The 100 Hz position controller outputs velocity request in radians per second to a velocity-error sum, where measured velocity is subtracted. The 500 Hz velocity controller outputs current request in amperes to a current-error sum, where measured motor current is subtracted. The 5 kHz current controller commands the power stage, which acts on motor and load. A current sensor on the motor-current path returns current to the inner sum. Declared position and velocity sensing returns state to the two outer sums. Each feedback path is drawn separately. Sensor location, filtering, timing and interface limits still require the C2 record; this is a functional architecture, not a stability proof.
02

Localise the first visible limitation

Constructed snapshots from a supplied acceleration segment.

Localise the first visible limitation
QuantityRequestObserved/limited state
Position1.0 rad0.6 rad
Outer velocity request4.0 rad/s before limit2.0 rad/s after limit
Speed-loop current request1.8 A before limit1.8 A after limit
Measured velocity—1.9 rad/s
Measured current—1.75 A
03

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.

04

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

  1. 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.

  2. How many speed updates fit one outer period nominally?

    Show the answer and reasoning

    Five, assuming the declared exact rates.

  3. 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.

  4. 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.

  1. ros-controls project3 sources
    1. ros2_control: Hardware Components and hardware interface typesros2_control contributorsOfficial software documentationKilted, displayed October 2026 documentationcontrol.ros.orgRead source
    2. ros2_control: Different update rates for Hardware Componentsros2_control contributorsOfficial software documentationKilted, displayed October 2026 documentationcontrol.ros.orgRead source
    3. ros2_controllers: PID Controllerros2_control contributorsOfficial software documentationKilted, displayed October 2026 documentationcontrol.ros.orgRead source
  2. Robotic Manipulation, Chapter 2: Let's get you a robotRuss TedrakeUniversity course working notes2020–2026 working notesmanipulation.mit.eduRead source