Dynamics, actuators and control

← Robot list · The basics

Kinematics says where the robot should go. This course explains what it takes to really get there: the forces and torques (dynamics), the motors and gearboxes that produce them, the sensors that measure the result, and the control laws that close the loop, from a simple PID to force control and trajectory generation. It also covers the imperfections of real robots: friction, backlash, vibration.

The big picture

A robot is a feedback machine. Every millisecond the same cycle runs:

  1. Plan: the trajectory generator says where each joint should be now (lesson 7).
  2. Sense: encoders, current and force sensors measure what happened (lesson 3).
  3. Compute: the control law turns the error into a torque request (lessons 4, 5, 6) using the dynamic model (lesson 1).
  4. Act: the drive sends current to the motor, the gearbox multiplies the torque (lesson 2).

Lessons 8 and 9 show how all this is organised in a real controller and what the real world adds.

1

Dynamics: forces, torques and the equation of a robot

14 min
You will learn

why a robot needs torque to hold still and to accelerate, and how this is written in one equation.

1.1 Kinematics is not enough

Kinematics ignores mass: it says “joint 2 must be at 40° at time 0.5 s”. But a motor does not produce an angle, it produces a torque. To know which torque is needed we need dynamics: the relation between torques and motions. Without it, a robot cannot be sized (which motor?), simulated, or controlled well at high speed.

1.2 One link, by hand

A link of mass m whose centre of mass is at distance l from the joint, turning in a vertical plane (θ is measured from the horizontal). Newton for rotation: the torque of the motor, minus the torque of gravity, minus friction, equals inertia times angular acceleration.

τ = I θ̈ + b θ̇ + m g l cos θ

Worked example

A 2 kg point mass at the end of a weightless 0.5 m arm: I = m·l² = 2 × 0.25 = 0.5 kg·m². To hold it horizontally: τ = m g l = 2 × 9.81 × 0.5 = 9.81 N·m, with no motion at all. To also accelerate it at 10 rad/s²: add I θ̈ = 0.5 × 10 = 5 N·m, so 14.8 N·m. Hold it vertical (θ = 90°): gravity needs 0.

1.3 The equation of a robot

For a robot with n joints the same idea gives the dynamic model, found with the Lagrange method (energies) or the Newton–Euler method (forces, link by link):

M(q) q̈ + C(q, q̇) q̇ + g(q) + f(q̇) = τ

TermNameMeaning
M(q) q̈InertiaTorque to accelerate. M depends on the pose: an arm stretched out is much harder to turn than a folded one.
C(q, q̇) q̇Coriolis and centrifugalTorques caused by the velocities of the other joints. Small at low speed, large when fast.
g(q)GravityTorque to hold the robot still. Depends only on the pose and the payload.
f(q̇)FrictionViscous (proportional to speed), Coulomb (constant, opposite to the motion) and the Stribeck bump at very low speed.
The two-joint arm (point masses at the ends of the links)

M11 = (m1+m2)L1² + m2L2² + 2m2L1L2 cos θ2, M12 = m2L2² + m2L1L2 cos θ2, M22 = m2L2²

g1 = (m1+m2) g L1 cos θ1 + m2 g L2 cos(θ1+θ2), g2 = m2 g L2 cos(θ1+θ2)

With h = m2L1L2 sin θ2, the Coriolis and centrifugal terms are −h(2θ̇1θ̇2 + θ̇2²) on joint 1 and +h θ̇1² on joint 2. Note the coupling: moving joint 2 produces a torque on joint 1.

1.4 Using the model

  • Sizing: find the peak and RMS torques of a task and choose motors and gearboxes (lesson 2).
  • Simulation: integrate the equation to test a controller before touching the robot.
  • Control: compute feedforward torques (lesson 5).
  • Identification: the masses, centres of mass and friction are rarely known exactly; they are measured by running test motions and fitting the equation (it is linear in the inertial parameters).
  • Payload check: a heavier tool changes M and g; the controller must be told the payload data.

Key terms

  • dynamics
  • torque
  • inertia
  • Lagrange / Newton–Euler
  • Coriolis
  • gravity compensation
  • friction
  • payload
Check yourself
  1. A 4 kg point mass is at the end of a weightless 0.3 m arm, horizontal. What torque holds it?

    τ = m g l = 4 × 9.81 × 0.3 ≈ 11.8 N·m.

  2. Why is a stretched arm harder to accelerate than a folded one?

    The inertia grows with the square of the distance of the masses to the joint (I = m l²), so M(q) is largest when stretched.

  3. What is the difference between the gravity term and the Coriolis term?

    Gravity exists at rest and depends only on the pose. Coriolis exists only when joints move (velocity products).

Dynamics in the Master-level course →

2

Actuators: motors, gearboxes and how to size them

14 min
You will learn

the main kinds of actuators, why a gearbox is almost always needed, and how to choose a motor for a joint.

2.1 The kinds of actuators

ActuatorStrengthsWeaknessesTypical use
Brushless motor (BLDC / PMSM)High torque density, efficient, long life, precise with an encoder.Needs an electronic drive (commutation).Almost every modern robot joint.
Brushed DC motorSimple, cheap, easy to drive.Brushes wear out, noise, lower power density.Toys, small educational robots.
Stepper motorPosition without a sensor (open loop), cheap, holds position.Loses steps if overloaded, vibrates, low speed torque only, heats.3D printers, gantries, small arms.
Hobby servoMotor + gearbox + sensor + electronics in one box.Low precision and speed control, plastic gears.Education, RC models.
Hydraulic cylinderHuge force, compact, robust.Pump, oil, leaks, noise, hard to control precisely.Excavators, heavy legged robots, forging.
Pneumatic cylinderCheap, fast, clean, naturally compliant.Air is compressible: poor position control.Grippers, pick and place between two stops.
Series elastic actuator (SEA)A spring between motor and load measures and softens the torque.Lower bandwidth, extra mechanics.Cobots, exoskeletons, legged robots.
Artificial muscles, shape-memory alloys, piezoLight, silent, bio-inspired, or nanometre precise.Low force or stroke, hysteresis, special drives.Soft robots, micro-positioning.

2.2 Why a gearbox?

An electric motor is fast and weak (for example 3000 rpm and 0.1 N·m); a robot joint is slow and strong (for example 30 rpm and 10 N·m). A gearbox with ratio N turns one into the other:

τjoint = N · η · τmotor, ωjoint = ωmotor / N, Jreflected = N² · Jmotor

The efficiency η (0.6 to 0.95) accounts for the losses. The last relation matters a lot: the motor inertia seen from the joint is multiplied by N². With a high ratio, the motor inertia dominates the arm inertia, and the joints are almost independent of each other (lesson 5), but the robot is hard to back-drive (to push by hand) and forces cannot be felt through the gearbox.

GearboxRatioBacklashNotes
Spur / planetary3 – 100small to mediumRobust, cheap, back-drivable at low ratio.
Harmonic drive (strain wave)50 – 160almost zeroCompact and precise; flexible, so it adds elasticity. Very common in robot wrists and cobots.
Cycloidal / RV30 – 200very smallStiff and shock-resistant: base and shoulder of industrial robots.
Belt, cable, tendon2 – 10smallLight, allows the motor to sit near the base. Elastic.
Direct drive (no gearbox)1noneVery accurate and back-drivable, but large and heavy motors for the torque.
Worked example: choose a motor for a joint

A joint must give 10 N·m (peak) at 2 rad/s (19 rpm). Gearbox: N = 100, η = 0.8.

  • Motor speed: 2 × 100 = 200 rad/s ≈ 1910 rpm.
  • Motor torque: 10 / (100 × 0.8) = 0.125 N·m.
  • Mechanical power at the joint: 10 × 2 = 20 W; at the motor: 0.125 × 200 = 25 W.
  • Check: the motor must give 0.125 N·m continuously (RMS) and about 2 to 3 times that at peak, at 1910 rpm, without overheating. A 50 to 100 W BLDC motor with margin is fine. Also check that the reflected inertia 100² × Jmotor is not more than a few times the load inertia.
Remember
  • The torque that matters for heating is the RMS torque over the whole cycle, not the peak.
  • Torque is proportional to current: τmotor = Kt · I. The drive controls the current.
  • Brakes: a robot arm falling when power is cut is dangerous, so most joints that carry gravity have a spring-applied brake.

Key terms

  • brushless motor
  • stepper
  • gear ratio
  • harmonic drive
  • backlash
  • reflected inertia
  • RMS torque
  • brake
Check yourself
  1. A motor gives 0.2 N·m at 3000 rpm. With a 50:1 gearbox of efficiency 0.8, what do you get at the output?

    Torque: 0.2 × 50 × 0.8 = 8 N·m. Speed: 3000 / 50 = 60 rpm.

  2. A gearbox of ratio 100 is used and the motor inertia is 2·10⁻⁵ kg·m². What inertia does the joint feel?

    N² × J = 10 000 × 2·10⁻⁵ = 0.2 kg·m².

  3. Why do most robot arms use harmonic or cycloidal gearboxes rather than ordinary gears?

    They combine a high ratio, compactness and almost no backlash, which is needed for precise positioning.

3

Joint sensors: how the robot knows what it is doing

12 min
You will learn

the sensors inside a robot (proprioception) and what resolution, accuracy and noise really mean.

Sensors that measure the robot itself are proprioceptive (like your sense of where your limbs are with your eyes closed). Those that measure the world are exteroceptive (cameras, lidar…; see the “Perception” course).

SensorMeasuresHow it worksNotes
Incremental encoderAngle changesA disc with slits and a light sensor: counts pulses (two channels A and B give the direction).Cheap. Forgets the position when switched off: needs a homing move.
Absolute encoderAngleEach position has a unique code (optical or magnetic), often multi-turn with a small battery or gears.Robot knows its pose at power-on. Standard in modern arms.
ResolverAngleA small rotating transformer, analogue.Very robust to heat, shock and dirt.
Potentiometer / Hall sensorAngle (coarse)Variable resistance or magnetic field.Cheap; used in hobby servos.
Motor current sensorTorque (estimated)The torque is proportional to the current (Kt).Free, but friction in the gearbox blurs the estimate. Used to detect collisions.
Joint torque sensorTorque (measured)Strain gauges on a flexible part of the joint.Needed for precise force control and safe cobots.
6-axis force / torque sensorForce (3) and moment (3) at the wristStrain gauges on a small elastic body.Assembly, polishing, hand guiding (lesson 6).
IMU (accelerometer + gyroscope)Acceleration, angular rateMEMS sensors.Mobile and legged robots, drones, vibration monitoring.
Limit switch, proximity sensorEnd of travelMechanical or inductive contact.Homing and safety.

3.1 Resolution, accuracy, repeatability

  • Resolution: the smallest change that the sensor can show. A 17-bit encoder gives 217 = 131 072 counts per turn, i.e. 0.0027° per count.
  • Accuracy: how close the reading is to the true value. A good encoder can have a high resolution but a poor accuracy (eccentric disc, temperature).
  • Repeatability: how close the readings are when the same situation is repeated. Industrial robots are very repeatable (±0.02 mm) but less accurate (a fraction of a millimetre, until calibrated).
  • Noise and quantisation: differentiating an encoder to get the speed amplifies both; speed is filtered (or estimated with an observer).
Worked example: resolution at the tool

A 17-bit encoder on the motor, with a 100:1 gearbox: one count is 360° / (131 072 × 100) = 0.0000275° at the joint (0.48 µrad). At the end of a 1 m arm this is 0.48 µm: the sensor is far finer than the mechanics. In practice the limit is the elasticity and the backlash of the gearbox: that is why robots often add a second encoder on the output side (dual encoder) to measure the real joint angle.

Remember
  • Absolute encoders remove the homing step; incremental ones need it.
  • Motor-side measurement is precise but does not see the gearbox elasticity; output-side measurement does.
  • Current is a free, rough torque sensor; strain gauges are a true torque sensor.

Key terms

  • proprioceptive
  • encoder
  • homing
  • resolution
  • accuracy
  • repeatability
  • force / torque sensor
  • IMU
Check yourself
  1. What is the angular resolution of a 12-bit absolute encoder?

    360° / 4096 ≈ 0.088° per count.

  2. A robot is switched on and does not know its pose until it makes a small calibration move. What sensor type does it have?

    Incremental encoders: they only count changes and need homing.

  3. An industrial robot is repeatable to ±0.02 mm but 0.5 mm off the programmed point. Which word describes each fact?

    Repeatability ±0.02 mm; accuracy 0.5 mm. Calibration improves accuracy, not repeatability.

4

Feedback and PID control

14 min
You will learn

how a feedback loop works, what P, I and D each do, and how to tune a joint controller.

4.1 Open loop and closed loop

Open loop: send a command and hope (a stepper motor, an oven timer). Closed loop (feedback): measure the result, compute the error e = wanted − measured, and correct. Feedback fights the things that the model does not know: friction, payload changes, a push. Almost all robot joints are closed loops.

4.2 The PID law

u(t) = Kp e(t) + Ki ∫ e(t) dt + Kd ė(t)

TermWhat it doesIf too largeIf too small
P (proportional)Pushes in proportion to the error now: like a spring pulling to the target.Overshoot, oscillation, instability.Slow, large remaining error.
I (integral)Accumulates the error over time: removes the permanent error (against gravity or friction).Overshoot, slow oscillation, windup.Error stays forever.
D (derivative)Reacts to the speed of the error: a damper that brakes before the target.Amplifies sensor noise, buzzing.Overshoot and ringing.
Worked example: a joint with inertia

Joint inertia J = 0.5 kg·m², no friction. With a PD law, J θ̈ + Kd θ̇ + Kp θ = Kp θd: a mass-spring-damper with natural frequency ωn = √(Kp/J) and damping ratio ζ = Kd / (2√(Kp J)). To get ωn = 10 rad/s and ζ = 1 (no overshoot): Kp = J ωn² = 50 N·m/rad and Kd = 2 × 1 × √(50 × 0.5) = 10 N·m·s/rad.

Now add gravity: a 2 kg mass at 0.5 m needs 9.81 N·m to be held. With P only, the arm settles where Kp e = 9.81, that is e = 9.81 / 50 ≈ 0.2 rad ≈ 11°. That is the steady-state error. Cures: add the integral term, or better, add the gravity torque g(q) as feedforward (lesson 5).

4.3 Tuning and good practice

  • Manual tuning: start with Ki = Kd = 0, raise Kp until it is fast but starts to overshoot, add Kd to damp it, add a little Ki to remove the remaining error.
  • Ziegler–Nichols (closed loop): with P only, raise Kp until the output oscillates steadily: you get the ultimate gain Ku and the period Tu. Then Kp = 0.6 Ku, Ti = Tu/2, Td = Tu/8, i.e. Ki = Kp/Ti and Kd = Kp Td. For Ku = 20 and Tu = 0.2 s: Kp = 12, Ki = 120, Kd = 0.3. It is a starting point, usually a bit aggressive.
  • Anti-windup: when the actuator saturates (maximum current), stop integrating, otherwise the integral grows and causes a big overshoot afterwards. Try the saturation switch in the widget.
  • Derivative on the measurement (not on the error) avoids a spike at each change of target; filter it to limit noise.
  • Feedforward: add to the output the torque that the model predicts (speed, acceleration, friction, gravity). The feedback then only has small errors to correct.

4.4 Three nested loops

A servo drive does not use a single loop but three, from the fastest to the slowest: the current loop (torque, 10 to 20 kHz), the velocity loop (1 to 4 kHz), the position loop (0.5 to 1 kHz). Each loop is about 5 to 10 times slower than the one inside it, so that the inner loop looks “instant” to the outer one. Tune from the inside to the outside.

Key terms

  • feedback
  • error
  • PID
  • overshoot
  • steady-state error
  • windup
  • cascaded loops
  • feedforward
Check yourself
  1. An arm under gravity is controlled by P only and stops 5° from the target. Which term removes this error?

    The integral term (or a gravity feedforward). It accumulates the error until the motor torque balances gravity.

  2. J = 2 kg·m². You want ωn = 5 rad/s and ζ = 1. What Kp and Kd?

    Kp = J ωn² = 50. Kd = 2 ζ √(Kp J) = 2 × √100 = 20.

  3. Why is the current loop the fastest of the three?

    The electrical dynamics are the fastest; and each outer loop needs the inner one to be much faster so that it behaves like an ideal torque source.

5

Controlling a whole robot: gravity compensation and computed torque

12 min
You will learn

why independent PIDs work on geared robots, and how the model makes the control much better.

5.1 Independent joint control

The simplest controller gives each joint its own PID and ignores the others. In the dynamic model the coupling between joints is in M(q) and C. With a large gear ratio the motor inertia (N² Jm) is much bigger than the variation of the arm inertia, so each joint almost behaves like an isolated one and the other joints are small disturbances for the feedback. This is how most industrial robots are controlled at moderate speed.

5.2 PD plus gravity compensation

τ = Kp (qd − q) − Kd q̇ + g(q)

The model is used only for the gravity term. This removes the steady-state error without any integral, and it can be proved that the robot converges to any target (Takegaki and Arimoto). The price: g(q) must be accurate (payload data!). This is the standard way to hold a robot still and to make a cobot light to hand-guide.

5.3 Computed torque (inverse dynamics control)

To follow a fast trajectory (qd, q̇d, q̈d) the model is used completely:

τ = M(q) [ q̈d + Kd (q̇d − q̇) + Kp (qd − q) ] + C(q, q̇) q̇ + g(q)

Put this torque in the robot equation: the terms C, g cancel exactly and M multiplies the bracket on both sides, leaving a linear error equation, the same for every joint and every pose:

ë + Kd ė + Kp e = 0

Worked example

Choose ωn = 20 rad/s and ζ = 1: Kp = ωn² = 400 and Kd = 2 ζ ωn = 40. The error dies out like e−20t (a time constant of 50 ms), reaching 2 % in about 0.3 s, whatever the pose and the speed. That is what independent PIDs cannot promise.

Watch out

The cancellation is perfect only if the model is perfect. Real masses, friction and gearbox elasticity are never exactly known, and the computation must run in the fast loop. In practice the model is used as a feedforward (computed from the desired trajectory) with PD/PID feedback on top: robust, and no problem if the model is 10 % wrong.

5.4 Beyond: robust, adaptive, optimal, learning

MethodIdea
Robust / sliding-mode controlAdd a term that dominates the worst-case model error; very robust, may chatter.
Adaptive controlEstimate the unknown parameters (payload) online and update the model.
Model predictive control (MPC)Optimise the next second of motion under limits (torque, joints, obstacles) at each step. Used for legged and fast robots.
Iterative learning controlFor a repeated task, correct the command a little after each cycle, using the previous errors.
Operational-space controlControl the tool directly with a Cartesian force F = Kp(xd − x) − Kd ẋ converted by τ = JT F (careful near singularities, lesson 5 of the previous course).

Key terms

  • independent joint control
  • gravity compensation
  • computed torque
  • inverse dynamics
  • adaptive control
  • MPC
  • operational space
Check yourself
  1. In the computed-torque law, what linear equation does the error obey?

    ë + Kd ė + Kp e = 0, the same for all joints and poses.

  2. Why can a high gear ratio make independent PID control good enough?

    The reflected motor inertia N²·Jm dominates the arm inertia changes, so joints are almost decoupled.

  3. Why do real controllers use the model as feedforward and not as a pure cancellation?

    Because the model is never exact: the feedback loop corrects what the feedforward gets wrong, so the result is robust.

6

Touching the world: force, compliance and impedance control

12 min
You will learn

why a robot that only controls position is dangerous in contact, and how force and impedance control solve it.

6.1 The problem of contact

Position control is a very stiff spring pulling towards the target. When the tool touches a rigid surface, a tiny position error becomes a huge force: with a surface of stiffness ke = 10⁶ N/m (steel), an error of only 0.1 mm gives F = 10⁶ × 0.0001 = 100 N. Polishing, inserting a part, screwing, working next to humans: all need to control the force, not just the position.

6.2 Passive and active compliance

  • Passive: soft pads, springs, a remote-centre-compliance (RCC) device for peg-in-hole, series elastic actuators. Fast, simple, but fixed.
  • Active: the controller makes the robot behave as if it had springs, by measuring forces (wrist sensor, joint torque sensors, or motor current) and modifying the motion. Flexible and tunable.

6.3 Impedance and admittance

Impedance control (Hogan) makes the tool behave like a virtual mass-spring-damper around the target xd:

Md ë + Dd ė + Kd e = Fext, e = x − xd

With Kd = 500 N/m, a push that moves the tool by 10 mm costs 5 N: soft and safe. With Kd = 50 000 N/m the same 10 mm costs 500 N: stiff, precise. You choose the stiffness in each direction by software.

Impedance controlAdmittance control
Input / outputMeasures motion, outputs a force (torque).Measures force, outputs a motion.
NeedsA torque-controlled robot (good back-drivability).A position-controlled robot with a force sensor (most industrial robots).
Good atSoft, fast contact, free motion, cobots.Stiff environments, hand guiding with a wrist sensor, precise assembly.

6.4 Hybrid position / force control

A task often has directions of motion and directions of contact. Wiping a table: force control along the normal (press with 10 N) and position control in the plane (follow the path). A selection matrix S (diagonal with 0 or 1) chooses, direction by direction, which law applies (Raibert and Craig). The force loop is slow and has a low gain, because with a stiff surface a fast force loop easily becomes unstable.

Link with singularities

The Cartesian stiffness of a robot with joint stiffness Kq is Kx = J−T Kq J−1. In a direction where the Jacobian is small (almost singular), the robot is very stiff and cannot be made soft by control: the structure carries the force (lesson 5 of the previous course). Compliant tasks are placed in well-conditioned poses.

Applications
  • Hand guiding: admittance with a wrist or joint sensors; you push, the arm follows (programming by demonstration).
  • Assembly: peg in hole with a spiral search while pushing with a small force, or insertion with compliance.
  • Polishing, sanding, deburring: constant normal force whatever the surface shape.
  • Collision reaction: if the measured torque differs from the model, stop or become soft.

Key terms

  • compliance
  • stiffness
  • impedance control
  • admittance control
  • hybrid position/force control
  • hand guiding
  • RCC
Check yourself
  1. A virtual stiffness of 2000 N/m is set. The tool is pushed 15 mm. What force does the robot oppose?

    F = K x = 2000 × 0.015 = 30 N.

  2. Why does pure position control fail when pressing on a steel plate?

    Steel is very stiff: a tiny position error gives a huge force (F = k e).

  3. In hybrid control of a robot wiping a table, which direction is force-controlled?

    The direction normal to the table; the two directions in the table plane are position-controlled.

7

Trajectories in practice: PTP, linear, circular, splines

13 min
You will learn

the motion types of a robot program, smooth polynomial profiles, and how to choose between them.

The speed laws (trapezoid) were seen in the other courses. Here is the practical side: what a robot programmer really chooses.

MotionPath of the toolComputed inUse
PTP / MoveJ (point to point)Not controlled: a curve, the result of the joint motion.Joint space. All joints start and stop together (synchronised).Free-space moves: fastest, no inverse kinematics along the way, crosses singularities.
LIN / MoveL (linear)A straight line, constant tool orientation change.Operational space; inverse kinematics at every cycle.Gluing, welding, approach and retract of a part. Sensitive to singularities.
CIRC / MoveC (circular)An arc through a via point.Operational space.Round welds, circles.
SplineA smooth curve through many points.Joint or operational space.Painting, sealing, scanning a freeform surface.

7.1 Corners: blending (zones)

Stopping exactly at every programmed point wastes time. With a blending radius (called zone, approximation, CNT or smoothing depending on the brand) the robot starts the next segment before reaching the corner and cuts it with a round curve. Large zone = faster and smoother, but the tool does not touch the point. “Fine / exact stop” means no blending.

7.2 Polynomial profiles

To go from q0 to qf in a time T with zero speed at both ends, with τ = t/T and Δq = qf − q0:

ProfileFormulaPeak speedPeak accelerationProperty
Cubicq0 + Δq (3τ² − 2τ³)1.5 Δq / T6 Δq / T²Acceleration jumps at the ends (a jerk, a shock).
Quinticq0 + Δq (10τ³ − 15τ⁴ + 6τ⁵)1.88 Δq / T5.77 Δq / T²Zero acceleration at the ends: smooth start and stop.
Trapezoidpiecewisechosen (Vmax)chosen (a)Fastest for given limits, but infinite jerk at the corners.
S-curve (jerk-limited)7 phaseschosenchosenLimits the jerk: less vibration, less wear. The industrial standard for fast, smooth moves.
Worked example

A joint turns by 90° (Δq = 1.571 rad) in 1 s. Cubic: peak speed 1.5 × 1.571 = 2.36 rad/s, peak acceleration 6 × 1.571 = 9.42 rad/s². Quintic: 1.88 × 1.571 = 2.95 rad/s and 5.77 × 1.571 = 9.06 rad/s². Make the move last 2 s instead of 1: all speeds are halved and accelerations divided by 4 (the torque follows acceleration, so the motor sees four times less).

7.3 Time-optimal and orientation

  • Time-optimal trajectory along a given path (TOPP): go as fast as the torque and speed limits allow at every point, using the dynamic model. Cycle-time winners in packaging use it.
  • Orientation: interpolate with quaternions (SLERP), never with Euler angles (lesson 6 of the course on singularities).
  • Synchronisation: in PTP the slowest joint decides the duration and the other joints are slowed to arrive together.
  • Speed override: the operator scales the speed by 10 %, 50 %, 100 %: the whole profile is stretched in time.

Key terms

  • PTP
  • linear / circular move
  • blending
  • spline
  • quintic
  • S-curve
  • jerk
  • time-optimal
Check yourself
  1. Which motion type can pass through a singularity: PTP or LIN?

    PTP: it works in joint space and does not invert the Jacobian.

  2. You double the duration of a cubic move. By what factor does the peak acceleration change?

    It is divided by 4 (6 Δq / T²).

  3. Why do S-curves reduce vibrations compared with trapezoids?

    The acceleration changes progressively, so there is no instantaneous jump of force to excite the elastic modes of the robot.

Speed laws in the Master-level course →

8

The control stack: from the program to the motor current

10 min
You will learn

the layers of a real robot controller, their speeds, and the vocabulary of the electronics around them.

LayerTypical periodRuns onReal time?
Program / planning10 ms to secondsController PC, cloud, PLCSoft
Interpolator + kinematics1 – 8 msReal-time OS on the controllerHard
Position / speed loops0.25 – 1 msServo drive (DSP, FPGA)Hard
Current loop and PWM50 – 100 µsDrive power stageHard
Why “real time” matters

Hard real time means that a late result is a wrong result: if the position loop is delayed by a few milliseconds the robot can vibrate or leave its path. That is why the controller uses a real-time operating system (RTOS, or Linux with PREEMPT_RT) and why a normal desktop computer is not enough to close fast loops.

8.1 Servo drive and fieldbus

  • Servo drive: converts the command to the three-phase current of a brushless motor (FOC, field-oriented control), reads the encoder, runs the current, speed and often position loops, and protects the motor (over-current, over-temperature).
  • Command modes: torque (current), velocity or position mode. A research robot or a cobot often uses torque mode; an industrial robot uses position mode with the controller closing the outer loop.
  • Fieldbus: the digital link between the controller and the drives: EtherCAT (very common, cycles of 250 µs to 1 ms, all axes synchronised), CANopen, PROFINET, Ethernet/IP. It replaces dozens of wires.
  • Safety layer: a separate, certified circuit (safe torque off, safe limited speed, emergency stop) that does not rely on the normal software.
Where the open source world fits

Research and education robots are often built with a PC running ROS 2 for the high layers (planning, perception), and a microcontroller or a drive running the fast loops, linked by CAN, USB or EtherCAT. The “ros2_control” framework gives a common interface between controllers and hardware (see the course “Robots in the real world”).

Key terms

  • interpolator
  • servo drive
  • FOC
  • fieldbus
  • EtherCAT
  • hard real time
  • safe torque off
Check yourself
  1. What is the role of the interpolator?

    It generates, every few milliseconds, the target position of each joint along the planned trajectory.

  2. Why is the current loop in the drive and not in the robot controller?

    It runs at 10-20 kHz and must be right next to the power electronics: a bus would be too slow.

  3. What does “hard real time” mean?

    A result that comes after its deadline is wrong, so the system must guarantee the deadline.

9

The imperfect robot: friction, backlash, flexibility, vibration

12 min
You will learn

the real-world effects that the rigid-body model ignores, and the usual cures.

EffectWhat happensCure
FrictionStatic friction holds the joint until the torque exceeds it, then the joint jumps (stick-slip). Visible as jerky very slow motion and as a small error that “sticks”.Friction feedforward (identify Coulomb + viscous), dither, integral term, torque sensors at the joint.
BacklashFree play in the gearbox: when the load reverses, the motor turns a little without moving the joint. The load can hit the teeth and oscillate.Zero-backlash gearboxes (harmonic, preloaded), dual encoders, always approach a point from the same side, reduce the gain near zero speed.
FlexibilityGearboxes, belts and links are springs. The robot is a set of masses and springs that vibrate at natural frequencies (a few to a few tens of Hz). The motor sees one position, the tool another.Limit jerk (S-curves), notch filters, input shaping, output-side measurement (dual encoder), lower the loop gain below the resonance.
Delay and samplingEach delay (sensor filter, bus, computation) removes stability margin: a gain that works in simulation oscillates on the real robot.Fast loops, short pipelines, compensate known delays, keep the bandwidth well below the sampling rate.
Thermal limitsMotors heat as I²: a robot can do a peak move once but not every second. Gearbox grease changes with temperature.Size with the RMS torque of the whole cycle, duty cycle, cooling, temperature monitoring.
Joint limits and saturationTorque, current and speed are limited; the integral can wind up; the arm can hit its end stops.Anti-windup, speed scaling, software limits before the mechanical stops.

9.1 A first look at vibration

Model a joint with a flexible gearbox as two masses linked by a spring: the motor mass Jm and the load mass Jl, with a stiffness k. It resonates at:

f = (1 / 2π) √( k (1/Jm + 1/Jl) )

For k = 10 000 N·m/rad, Jm = 0.2 and Jl = 0.5 kg·m² (both seen at the joint): f = (1/2π) √(10 000 × (5 + 2)) = (1/2π) √70 000 ≈ 42 Hz. The position loop bandwidth must stay well under this frequency, or the controller will excite the resonance. A trajectory whose acceleration changes abruptly every 24 ms (about 42 Hz) would excite it: this is what a jerk-limited profile avoids.

Input shaping

If you know the vibration frequency f, send each command as two half-size commands separated by half a period (1/(2f)). The vibrations created by the two halves cancel each other. This “zero-vibration shaper” is used on cranes, 3D printers and long robot arms, and costs only a delay of half a period.

9.2 Calibration of the dynamic parameters

To use the model of lesson 1 and 5, run an identification: move every joint with a rich, safe excitation trajectory, record positions and motor currents, and fit the parameters (masses, centres of mass, inertias, friction) by least squares. Also identify the payload: most controllers have a “load identification” routine. A wrong payload setting is a classic cause of poor tracking, protective stops on cobots, and shorter gearbox life.

Key terms

  • stick-slip
  • backlash
  • flexibility
  • resonance
  • notch filter
  • input shaping
  • identification
  • duty cycle
Check yourself
  1. A joint has k = 20 000 N·m/rad, Jm = 0.1 and Jl = 0.4 kg·m². What is its resonance frequency?

    f = (1/2π) √(20 000 × (10 + 2.5)) = (1/2π) √250 000 ≈ 80 Hz.

  2. Why does a robot sometimes jerk when moving very slowly?

    Stick-slip: static friction is higher than moving friction, so the joint alternately sticks and jumps.

  3. Why can a controller tuned in simulation oscillate on the real robot?

    The real robot has delays, flexibility and sensor filters that remove stability margin.

Glossary

All the words of the course in one place.

TermMeaning
DynamicsThe relation between joint torques and joint accelerations: M(q) q̈ + C(q, q̇) q̇ + g(q) = τ.
Inertia matrix M(q)How hard it is to accelerate each joint; it changes with the pose.
Coriolis and centrifugalTorques that appear because other joints are moving (velocity products).
Gear ratio NThe motor turns N times faster than the joint and has N times less torque.
Reflected inertiaThe motor inertia seen from the joint: N² · Jm.
BLDC / PMSMBrushless motor, the standard of modern robot joints.
Harmonic driveA strain-wave gearbox with no backlash and a high ratio, very common in robots.
EncoderA sensor that measures an angle: incremental (counts) or absolute (gives the angle at power on).
PIDProportional-Integral-Derivative controller.
WindupThe integral term grows without limit while the actuator is saturated.
FeedforwardA command computed from the model, before any error appears.
Computed torqueControl law that cancels the dynamics with the model, leaving a linear error equation.
Impedance controlThe robot behaves like a virtual mass-spring-damper when it touches something.
Hybrid position / force controlPosition control in some directions, force control in the others.
PTP / LIN / CIRCPoint-to-point (joint), linear and circular motions of a robot program.
JerkThe derivative of the acceleration; limiting it gives smooth S-curve profiles.
BacklashThe free play between the teeth of a gearbox.
Input shapingPre-filtering the command so that it does not excite a vibration mode.

You can now make a robot move for real!

Next step: perception, planning and AI, how the robot senses the world, finds a path and learns.

Go to perception, planning and AI → Back to the roadmap