GubiLabsAcademy

MODULE 13 / MOTION & INTELLIGENCE

Make a joint follow a target

Use the teaching hinge to feel the difference between asking for an angle and applying torque. Build intuition for the low-level controller beneath BDX-R’s learned policy.

90–150 min6 lab steps3 knowledge checks In progress

By the end, you can…

  • Calculate a PD controller output
  • Recognize overshoot, damping and saturation
  • Explain why simulation gains are not physical motor settings
BRING WITH YOU

Your first physics laboratory

Torque and units

INTERACTIVE BENCH / FEEDBACKA joint tries to close the gap.
ANGLE ERROR 0.262 radREQUESTED TORQUE 1.05 N·mτ = Kp(qtarget − q) − Kd·velocity
A static PD calculation with zero desired velocity, without gravity compensation, current limits or saturation. Drag the actual angle past the target: the spring term changes sign. These teaching gains are not BDX-R motor settings.
01

Feedback closes the loop

You request a position and measure the actual position. Their difference is the error. A controller converts that error into an action, the machine moves, and the next measurement closes the loop. If you never measure again, a disturbance can push the joint away without the controller knowing. BDX-R’s learned policy operates above another control layer that makes individual joints respond to targets.

For the teaching hinge, proportional gain Kp turns position error into torque. Derivative gain Kd opposes measured angular velocity when the target velocity is zero. It behaves a little like a spring plus a damper. This analogy helps intuition, but the software controller is sampling measurements and commanding a motor; it is not a literal mechanical spring.

torque = Kp × (target angle − measured angle) − Kd × measured angular velocity
02

Work one decision by hand

Let the target be 0.5 rad, measured angle 0.2 rad, velocity 0.4 rad/s, Kp = 2 N·m/rad and Kd = 0.15 N·m·s/rad. Position error is 0.3 rad. The proportional contribution is 0.6 N·m; damping subtracts 0.06 N·m. Requested torque is 0.54 N·m. Check the units in each term; numbers without units can conceal a degree-versus-radian mistake.

Our teaching actuator can apply only ±1 N·m. A request of 4 N·m therefore becomes 1 N·m. This is saturation. Increasing gain does not create unlimited force; it can simply keep the controller at its limit longer. The CSV records requested and applied torque separately so you can see that difference.

03

Learn the response, not a magic gain

Low damping can allow repeated swings around the target. More damping can reduce oscillation, while excessive damping can make the motion slow. Higher proportional gain usually corrects error more strongly, but its effect depends on inertia, delay, torque limits, sampling and contact. There is no universally good pair of numbers that can be copied from a little hinge to an entire robot.

Our hanging arm settles slightly below the target because gravity creates a sustained load and this controller has no integral term or gravity compensation. At equilibrium, a remaining position error produces the torque that balances the load. The default numerical lesson settles near 0.457 rad while asking for 0.5 rad. That is a useful physical result, not necessarily a coding bug.

04

Use three observations for each run

Record rise time informally as how quickly the arm approaches the target, overshoot as how far it crosses beyond it, and steady error after motion settles. Also inspect applied torque. A fast response that bangs against a limit is not automatically better than a slower response. In the full robot, energy, temperature, contact stability and structural loads matter too.

Keep the BDX-R policy’s exported gains and scales together with its model while reproducing the baseline. Changing gains changes the system seen by the policy. The hinge exercise teaches reasoning; it does not select safe gains or current limits for real RobStride hardware.

WORDS YOU NOW KNOW

Feedback
Using a new measurement to influence the next control decision.
Saturation
A requested command being clipped to a supported limit.
Steady-state error
The difference that remains after the transient motion has settled.

YOUR CALL

Finished with this module?

0 of 6 lab steps checked. 0 of 3 questions answered. You decide when the module is complete. Revisiting or editing it will not change your decision.

You can reopen it later. Checking every box will not automatically complete it.

Go to the source

Primary references for this module. Use the version and hardware revision named in the lesson.

MuJoCo actuator referenceBDX-R gain loadingDownload hinge experiment