MODULE 1 · LESSON 3 OF 6 · 35 MIN

What Asimov does

23 joint targets, the motor controller that turns them into torque, and why you cannot balance by hand.

The policy’s output is 23 numbers, one per motor. This lesson follows them from the policy to the joints, then hands them to you.

SIMULATOR

Asimov 1 simulated with MuJoCo and driven by a trained policy, on your own computer.

Upright · 0.00 s

An action is a target, not a force

Each of the 23 numbers is an action. cyclotron does not send it to the motor as a force. It turns it into a target angle for one joint:

qi∗=qidefault+si×ai
SymbolMeaningUnitAsimov’s left knee, standing still (measured)
qi∗the target angle for joint i: where its motor should turn itrad0.409
qidefaultjoint i’s angle in the default pose, a slight crouchrad0.450
sithe action scale: how far one unit of action moves the target. 0.25 for every joint in the built-in policy; in cyclotron’s walking task 0.25 except ankle roll, 0.08rad0.25
aithe policy’s action for joint i, usually between about −1 and 1–−0.166
iwhich joint, one of the 23–left knee
q∗=0.45+0.25×(−0.166)
=0.409 rad

The policy aims the knee 0.04 rad straighter than its default pose.

An action of 0 means “hold the default pose”; an action of 1 moves that joint’s target 0.25 rad, about 14°, away from it. cyclotron’s walking task also clips the ankle-roll target to ±0.09 rad.

Asking for angles rather than forces keeps the policy’s job manageable. Small mistakes in an angle produce small mistakes in the pose. Small mistakes in a force, on a 32 kg robot, accelerate it the wrong way until something else stops it.

The motor controller

Something still has to turn a target angle into a torque. That is a PD controller, one per joint, each with its own two gains. In the simulators it runs on every physics step, 200 times a second, and computes:

τi=kp,i×(qi∗−qi)−kd,i×q˙i
SymbolMeaningUnitAsimov’s left knee, standing still (measured)
τithe torque the motor applies to joint i, before it is capped at the motor’s limitN·m−7.1 (limit ±45)
kp,ithe stiffness: torque per radian between target and joint. It pulls the joint towards its target like a springN·m/rad150
qi∗the joint’s target angle, from the policyrad0.409
qiwhere the joint is, from its encoderrad0.456
kd,ithe damping: torque per rad/s of speed. It resists motion like a shock absorber, so the joint does not overshootN·m·s/rad5
q˙ihow fast the joint movesrad/s0.00
τ=150×(0.409−0.456)−5×0.00
=−7.1 N⋅m

The target is a little straighter than the knee, so the motor pushes to straighten the leg: that is the torque that holds Asimov up.

The P stands for proportional, the stiffness term; the D for derivative, the damping term, which acts on the joint’s speed, the derivative of its angle.

Motor group Stiffness kp (N·m/rad) Damping kd (N·m·s/rad) Torque limit (N·m)
Hip pitch, hip roll 150 5 45
Hip yaw 150 5 28
Knee 150 5 45
Ankle pitch 224.42 10.201 72
Ankle roll 35.20 1.600 18
Waist 65 5 40
Shoulder pitch / roll / yaw 57 / 86 / 96 5 30 / 25 / 20
Elbow, wrist 40 2 12

The ankles look odd because each ankle is driven by two motors through a linkage; the numbers here are what the two motors add up to at the joint. Module 2 opens that up.

Where the controller lives on Asimov

On the real robot the policy does not drive the motors directly either. Asimov’s 25 motors are chained along each limb on CAN buses, a wiring standard common in cars and robots, and are run by the robot’s motion-control computer, a Radxa CM5 on its motion control board. A program that drives Asimov, such as a trained policy, sends every joint’s target angle, and can send that joint’s gains kp and kd with it; without them the robot uses its own gain table. Menlo’s documentation calls this mode “direct PD control of joints”: one PD law per joint, each with its own gains, not one controller for the whole body. It does not say how often the PD law itself runs, or whether it is evaluated on the control board or inside each motor.

One joint at a time

Try the formula on one joint. Turn on Explore this joint, or just use any control in the panel: Asimov hangs in the air, in the 3D view, and every other joint holds its default pose. Move the target: the green needle is the joint, the orange dot its target, and the orange arc between them the error the stiffness pulls on. The formula fills in with the numbers the controller used, and the plot shows the joint following its target. Turn it off and Asimov is back on its feet, under the policy.

One joint’s controller

This panel drives the 3D view once the simulator is running.

–
–
–

The controller, this step

–

–
Joint angle q (solid) and target q* (dashed), rad, last 5 s

Exercise 3.1 · On paper

From target to torque

  1. The knee’s target is 0.2 rad ahead of where the knee is, and the knee is already moving towards it at 1 rad/s. What torque does the knee motor apply?
  2. The hip pitch target is 0.4 rad away from the hip and the hip is still. What torque does it apply?
Hint 1
The damping term opposes the joint’s velocity.
Hint 2
Compare each answer with the torque limit in the table.
Checkpoint: answers only
1. 25 N·m. 2. 45 N·m, the limit (the formula gives 60 N·m).
Solution
  1. 150×0.2−5×1=30−5=25 N·m, below the knee’s limit of 45 N·m.
  2. 150×0.4=60 N·m, but the hip pitch motor is capped at 45 N·m, so it applies 45 N·m. A target far from the joint does not make the joint move faster than the motor allows.

Exercise 3.2 · In the simulator

Stiffness and damping by feel

In One joint’s controller, pick the left knee and turn on Explore this joint.

  1. With the trained gains, press Jump the target by 0.3 rad and watch the plot. How does the knee get to its new target?
  2. Set the damping kd to 0 and jump again. What changes?
  3. Put kd back, set the stiffness kp to 20 and move the target. Where does the knee settle compared with its target, and why?
Hint 1
Watch the torque bar while the knee moves: which term of the formula is largest?
Hint 2
In 3, the lower leg’s weight pulls on the knee all the time. How big must the error be for 20 N·m/rad to hold it?
Checkpoint: answers only
1. Quickly, with little or no overshoot. 2. It overshoots and swings around the target before settling. 3. It settles short of the target, held there by the leg’s weight.
Solution
  1. The jump creates a 0.3 rad error, so the stiffness asks for a large torque at once; as the knee speeds up, the damping term grows and brakes it, and it arrives without swinging past.
  2. With no damping nothing brakes the knee. It reaches the target still moving, overshoots, and the stiffness pulls it back: it oscillates until friction in the joint wears the swing down.
  3. Gravity pulls the lower leg with a roughly constant torque. The controller only pushes back in proportion to the error, so the knee settles where kp× error equals that pull. With kp=20 instead of 150 the same pull needs an error 7.5 times larger. This is why a stiff controller holds its pose better, and also why lesson 2’s policy aimed the loaded knee a little past where it was.

The whole loop

Every block of the loop from lesson 1 now has a name. Here it is in full. Press Next stage to pause Asimov and walk through one turn, stage by stage, for the joint you pick, with the numbers the simulator actually used. After the last stage, the next press runs the following turn, 20 ms later.

The loop, one stage at a time

This panel drives the 3D view once the simulator is running.

  1. 1 Sense

    The IMU and the joint encoders measure the robot. The page turns the readings into the 78 numbers of lesson 2.

    once every 20 ms (50 Hz)

  2. 2 Decide

    The policy, a neural network, turns the 78 numbers into 23 actions, one per joint.

    once every 20 ms (50 Hz)

  3. 3 Target

    Each action becomes a target angle: the default pose plus the action times a scale.

    once every 20 ms (50 Hz)

  4. 4 Control

    A PD controller per joint turns the gap between target and joint into a torque, capped at the motor’s limit.

    4 times every 20 ms, once per 5 ms physics step (200 Hz)

  5. 5 Physics

    The motors apply their torques and the body moves for 5 ms. In this page that is MuJoCo; on Asimov it is the real robot.

    4 times every 20 ms, once per 5 ms physics step (200 Hz)

  6. Back to 1: the next turn of the loop, 20 ms later.

Be the policy

The panel below switches the policy off and gives you its job: one slider per joint target, sent 50 times a second through the same controller. Turn on Control the joints myself.

Be the policy

This panel drives the 3D view once the simulator is running.

With all sliders at the default pose, nothing moves the targets, and the PD controllers simply hold the default pose. Asimov stands. In the measured run, holding the default pose this way stood for 20 s without falling, with the pelvis at 0.608 m.

So standing still is easy, as long as nothing happens. Now push it, at the pelvis, for 0.15 s. Holding the default pose fell at 75 N forward; it stood at 50 N. The built-in policy, which reacts to what it senses 50 times a second, did not fall up to 400 N forward and fell at 250 N backward; Push goes up to 400 N.

Exercise 3.3 · In the simulator

Catch a push by hand

Turn on Control the joints myself with all sliders at the default pose. Push the robot forward with 75 N. Then reset, push again, and this time try to keep it standing by moving the leg sliders while it tips.

Hint 1
Which joints would you move to step forward, or to lean back against the push?
Hint 2
Count how long the robot takes to tip over, then count how long it takes you to move one slider.
Checkpoint: answers only
Almost nobody keeps it up. In the measured run, holding the default pose fell at 75 N; the built-in policy did not fall up to 400 N.
Solution

A push tips Asimov over in a fraction of a second. Catching it takes coordinated changes to several joints at once, hips, knees and ankles on both legs, chosen from how fast and which way the robot is tipping, and adjusted every 20 ms as the robot moves. You can move one slider at a time, a few times a second, while looking at a picture. The policy reads 78 numbers and sets all 23 targets 50 times a second.

That is why the policy is learned. Nobody can write down, joint by joint, what to do for every way the robot can be pushed. Reinforcement learning finds it by trying.

Optional Why the hold in the air?

Hold the pelvis in the air welds the pelvis to the world, so the legs hang free. It is a good way to see what a single target does: move the knee slider and watch the knee, and the torque, without the robot falling.

Recap

  • An action is a joint target: q∗=qdefault+0.25 a.
  • A PD controller per joint turns each target into torque, τ=kp(q∗−q)−kdq˙, capped at the motor’s limit. On Asimov it runs on the robot’s motion-control side, with the gains sent alongside each target.
  • The loop: sense, decide, set targets once every 20 ms; control and physics every 5 ms.
  • Holding the default pose stands, but only until something pushes it.
  • Recovering from a push takes coordinated, fast changes to many joints at once: that is the policy’s job.

Sources

  1. cyclotron, the action: 23 joint position targets, scale 0.25, offset from the default posesource/cyclotron/cyclotron/tasks/locomotion/velocity_env_cfg.py, lines 165–177 (commit d71390f)
  2. cyclotron, Asimov 1's motor groups: stiffness, damping, torque limits, delaysource/cyclotron/cyclotron/assets/robots/asimov_1.py, lines 21–23 and 53–164
  3. The built-in policy's training settings: scale 0.25 on every joint, no clipsite/learn-sim/policies/menlo-reference/env.yaml, actions.joint_pos
  4. Menlo Research, Asimov 1 electrical system tour: the Radxa CM5 on the motion control board runs locomotion and actuator control; actuators are daisy-chained on CAN buses
  5. Menlo Research, Asimov 1 robot control: MOVE/TRAJECTORY is “direct PD control of joints”; each setpoint is applied as an instantaneous PD target
  6. menlo-sdk: setpoints carry optional kp and kd; without them Asimov Edge applies its own per-joint gain tabledocs/REFERENCE.md, “trajectory() and set_joints()” (menlo-sdk commit 7683801)
  7. This simulator's controller: PD on every 5 ms physics step with the policy's trained gains, torque capped at the model's actuator rangesite/src/sim/core/main.js, the substep loop (from humanoid-policy-viewer)
  8. Asimov 1's mass: the simulator's model weighs the robot at 32 kgrobots/asimov-1/sim-model/xmls/asimov_1.xml, total body mass
  9. Measurement: holding the default pose with no policy, and the pushes it takesmeasurements.json, results.manualDefaultPose and results.manualPush (scripts/measure-module-1.mjs)
  10. Measurement: the pushes the built-in policy takes when standingmeasurements.json, results.policyPush