Robotics from zero · Chapter 4

Control and feedback

A command expresses an intention. Feedback measures the result, compares it with a target and changes the next command.

After this chapter

Identify the target, measurement, error and control action; explain why correction still has limits.

Change the load, then compare both speed traces.

Two conveyor belts under the same loadFixed command · dashed; With feedback · solid; Target speed1210 s6 sm/s
  1. Fixed command · dashed: 0 m/s
  2. With feedback · solid: 0 m/s

Target speed: 1 m/s · Feedback speed error: 1 m/s

This is a model. Its numbers explain an idea. They are not safety settings for a real robot.

How does a robot correct what it is doing?

Two conveyor belts should run at 1 m/s. The same resisting load appears after 2 s. One keeps its original command; the other measures speed and adjusts the drive. Scrub to the end before and after changing the load.

How does a robot correct what it is doing?1 is the target, 2 the controller, and 3 the sensor returning the measured result. The controller uses the difference to change the actuator command.±123
1 is the target, 2 the controller, and 3 the sensor returning the measured result. The controller uses the difference to change the actuator command.

1 Target and error

The target says what should happen. Error is target minus measured result. Choose what matters: position, speed or contact force. Correcting the wrong quantity can still miss the task.

2 Controller and actuator

A controller converts error into a command. An actuator produces force or motion. A stronger command may help, but only within the actuator’s power, current and speed limits.

3 Repeated observation

Feedback is a repeating loop. Delay and measurement noise change how it behaves. Increasing gain makes correction more aggressive; it does not guarantee better behavior on every robot.

Apply the idea

  1. A robot arm’s angle sags when its payload changes. What feedback could help it hold the angle?

    Show the answer

    Measure the joint angle, compare it with the desired angle, then adjust joint effort within its limits. A camera label saying “holding” cannot replace measuring the relevant physical result. Also check whether the actuator can support the new load.

Under the hood

Open the model assumptions and calculations

Both runs use the same first-order speed model, initially at rest. Load is a speed-equivalent disturbance in m/s, not a measured force. The fixed command is 1 m/s equivalent. Feedback adds twice the speed error, bounded between 0 and 2 m/s equivalent. The response time is 0.6 s and the step is 0.1 s. With load 0.6, steady speeds approach 0.4 without feedback and 0.8 with feedback.

target = 1 m/s; Kp = 2; τ = 0.6 s; Δt = 0.1 s
u = clamp(target + Kp × (target − v), 0, 2 m/s)
v[k+1] = max(0, v[k] + (u − load − v[k]) × Δt / τ)
load = 0 → selected value at t = 2 s
steady error = load / (1 + Kp), when unsaturated
Pseudocode
error = target_speed - measured_speed
drive = clamp(target_speed + 2 * error, 0, 2)
motor.set(drive)

Real-world catch

This P controller leaves a steady error: load divided by 1 plus gain when unsaturated. The model has perfect speed measurements and no sensing delay. Real loops may oscillate or saturate. Gain tuning alone cannot repair weak hardware or stale measurements.

The stopping lab shows why sensing delay and braking still matter even with correct logic. Next, separate choosing a route from tracking it.

Next lesson →

Sources