Teaching an SO-101 arm with supervised learning

Dun Li Chan

I trained a simulated SO-101 arm to reach around an obstacle, inspect a shelf and fit a square nut onto a peg. For the first two tasks it learns which path to take. For the last one it learns where the nut and peg are from an overhead image. [1]

Starting with a reach

I started by moving the arm between two points with a fence, a post or a bar in the way. On some layouts the gripper cleared the obstacle but another part of the arm clipped it. I gave the arm 13 possible routes and trained a network to estimate the chance of a collision on each one.

MuJoCo checked the whole arm at 81 positions along each route. If any position hit the obstacle, the label was 1. A clear route got a 0. Running all 13 routes on 4,096 layouts gave me 53,248 labeled paths. I trained the network on these labels using binary cross-entropy.

L=−1N∑i=1N[yilog⁡pi+(1−yi)log⁡(1−pi)]\mathcal L=-\frac{1}{N}\sum_{i=1}^{N}\big[y_i\log p_i+(1-y_i)\log(1-p_i)\big]

For each path, yᵢ is the simulator label and pᵢ is the model’s predicted probability of a collision. A confident prediction that misses a collision gets a large loss.

Obstacle reach training curve

Update 1,000
Training 0.0358
Validation 0.0718
Collision loss (BCE)
0.0
0.2
0.4
0.6
02505007501000
Optimizer update

Most of the drop came in the first 100 updates. After 1,000 updates, training loss was 0.036 and validation loss was 0.072. To choose a route, I also wanted to account for how far the joints had to move.

r∗=arg⁡min⁡r[pr+(1−pr) ℓr]r^*=\arg\min_r\left[p_r+(1-p_r)\,\ell_r\right]

The arm picks the route with the lowest score. When the predicted risk pᵣ is low, the joint travel penalty ℓᵣ favors a shorter movement. I capped that penalty at 0.45.

Obstacle reach results

I ran both methods on the same 96 held-out layouts. A reach counted if the arm settled within 8 mm of the target without hitting the obstacle.

MethodReached targetHit obstacle
Direct reach18/96 (18.8%)78
Learned route87/96 (90.6%)9

Reaching into a shelf

The shelf gave the arm less room to turn. It had to reach inside, hold the gripper tip within 8 mm of the target for 0.4 seconds, then come back out. I added six routes that fold the elbow before the gripper goes in and trained a second scorer on shelf layouts.

Training the two path scorers

SettingObstacle reachShelf inspection
Candidate routes1319
Train / validation layouts4,096 / 6401,600 / 240
Selected network2 × 96 hidden units, ReLU2 × 48 hidden units, ReLU
AdamW learning rate0.0020.0015
Updates × batch size1,000 × 256 layouts1,100 × 128 layouts
GPUOne NVIDIA A100, 40 GB

I compared six versions of the obstacle model on the same validation layouts. Sharing one network across the candidate routes brought the average cost down from 0.1779 in the first run to 0.1421. For the shelf, 48 units per hidden layer worked better on validation than 96.

I tested three ways into the shelf. The arm could reach straight in, always use the route with the lowest average validation cost, or let the model choose for each layout. All three got the same 96 layouts at each opening width, following the matched comparisons in MotionBenchMaker. [3]

OpeningDirect reachBest fixed routeLearned route
180 mm0/9675/9681/96
125 mm0/9675/9673/96
90 mm0/9674/9674/96

Choosing a route for each layout helped at the widest opening. At 90 mm the fixed route and the learned scorer finished exactly the same 74 inspections. In the shelf replay, the moving jaw clears the roof by 0.75 mm.

Fitting the nut onto a peg

For peg placement, I moved a square nut and a matching peg around the bench and varied their angles. The arm has to grip the handle, carry the nut over the peg and lower it. The square hole leaves just 2 mm of clearance on each side. MuJoCo simulates friction between the fingers and the handle. [2]

The camera input was a 96 × 96 image with a silhouette for each part. Each silhouette’s center of mass gives a rough position, and the way its pixels spread around that center helps recover the angle. I fit separate ridge regressions for the nut and peg on CPU using their true positions and angles from MuJoCo. I used 1,024 layouts for training and 256 to choose the regularization strength.

p^=W ϕ(M)+b,p=(x,y,θ)\hat{\mathbf p}=W\,\phi(M)+\mathbf b,\qquad \mathbf p=(x,y,\theta)

The regression maps the image features φ(M) to a position and angle. The handle is a known distance from the center of the nut, so the controller can work out where to close the jaws. Both arms use this same grasp. I changed only where they put the nut down. One aims at the average peg pose from training. The other uses the pose predicted from the peg’s silhouette. A placement counts if the board supports the nut around the peg for half a second after the fingers open.

TaskTraining-mean posePredicted poseMean XY error of prediction
Peg placement2/3232/320.22 mm

A fixed aim seated only 2 of 32 nuts. Predicting the peg pose seated all 32. I repeated the test with 48 × 48 images. Mean peg position error went up from 0.22 to 0.61 mm, but all 32 nuts still seated. The simulator supplies a clean silhouette from a fixed overhead view. For a real arm I’d also need to find the nut and peg when the gripper blocks part of the camera image.

References

  1. TheRobotStudio. SO-101 follower simulation model. I used its arm geometry and actuator settings.

  2. MuJoCo. Contact parameters. How friction and contact settings work when the fingers meet the handle and the nut settles on the board.

  3. Constantinos Chamzas and colleagues. MotionBenchMaker: A Tool to Generate and Benchmark Motion Planning Datasets. I used the idea of comparing planners on matched layouts.

Cite this post

@misc{chan2026so101paths,
  title = {Teaching an {SO-101} arm with supervised learning},
  author = {Chan, Dun Li},
  year = {2026},
  month = {nov},
  url = {https://dunlichan.com/writings/so101-path-learning/}
}