Learn / Practice
MuJoCo mass transfer: can the same gains still work?
EMBODIED-AI / EXPLORE · Engineering cases
Compare fixed and mass-scaled gains in 36 episodes, including lower mean error without a velocity-contract pass.
On this page 6
Reproduce from a clean checkout · this article’s revision
Windows PowerShell with Python 3.12. Copy and run the whole block. Clone, checkout, installation or execution failures stop the block before auditing the wrong revision. Use a new directory: each article pins its own revision, and the first revision does not contain later experiments.
& {
$ErrorActionPreference = 'Stop'
function Assert-StudyCommand {
if ($LASTEXITCODE -ne 0) { throw "Command failed ($LASTEXITCODE). Read the error before continuing." }
}
if (Test-Path -LiteralPath 'hohoo-embodied-agent-study-1d1faab5') { throw 'Study directory already exists. Choose a new location.' }
git clone https://github.com/VirtualSelect/hohoo-embodied-agent.git 'hohoo-embodied-agent-study-1d1faab5'; Assert-StudyCommand
Set-Location -LiteralPath 'hohoo-embodied-agent-study-1d1faab5'
git checkout --detach 1d1faab57e20b352761e9abc736c6d277b505e6b; Assert-StudyCommand
python -m venv .venv; Assert-StudyCommand
$py = '.\.venv\Scripts\python.exe'
& $py -m pip install -r requirements-lock.txt; Assert-StudyCommand
& $py experiments/planar_reliability/run.py --out outputs/my-run; Assert-StudyCommand
& $py experiments/planar_reliability/audit.py outputs/my-run; Assert-StudyCommand
}Expect raw trajectories, summaries and audit results. The study directory includes the revision; an existing directory stops setup without replacing it. Adjacent articles may share a runner; check the article before rerunning. No model calls are made. Video replay is separate. For later manual commands, specify the interpreter in .venv again: the block-local $py variable is not retained.
Troubleshooting: a missing experiment directory usually means the wrong revision; import failures require checking the interpreter and environment. OpenGL errors concern rendering steps. On Linux/macOS use .venv/bin/python; those platforms have not been retested.
Inspect the pinned code ↗Pinned code · Archived evidence · Study protocol
Parameters selected on a 1 kg actuator may not transfer directly to 0.5 or 2 kg. For an ideal point mass, scaling kp and kd with mass seems to preserve acceleration response. But the actuator clips force at ±5 N, and observations contain delay and noise.
This experiment compares fixed gains with gains scaled by known mass. It is a MuJoCo parameter-transfer study, not online identification or manipulator transfer learning.
State assumptions before simplifying equations
m*x'' = F
F = kp*(goal-x) - kd*x'
If kp=m*kp0 and kd=m*kd0, without saturation:
x'' = kp0*(goal-x) - kd0*x'Mass cancels in this ideal equation. The implementation clips force afterward, giving a maximum acceleration of 5/m. A heavier actuator may require an unavailable force, so identical normalized gains need not produce identical trajectories.
Scaling also changes the force generated by estimation noise. Delayed, noisy feedback cannot be treated as the ideal second-order system without verification.
Freeze what changes
Use kp=20, kd=8 and tau=20 ms selected on the earlier development set; do not select again on transfer results. Combine masses 0.5/1/2 kg, goals 0.6/1.0 m, two gain rules and three holdout seeds: 36 episodes. Delay remains 80 ms, noise 3 mm and the per-axis force limit 5 N.
Both body_mass and body_inertia are scaled, followed by mj_setConst to update derived constants. This changes the physical model, not just a label. See the MuJoCo API reference. Raw positions, velocities and forces independently satisfy delta_v=F*delta_t/m in the audited traces.
Lower position error is not full acceptance
Each row combines two goals and three seeds, six episodes per rule. Position values average per-episode terminal RMS:
| Mass | Fixed-gain error | Scaled-gain error | Fixed passes | Scaled passes |
|---|---|---|---|---|
| 0.5 kg | 73.96 mm | 2.51 mm | 0/6 | 0/6 |
| 1 kg | 2.50 mm | 2.50 mm | 0/6 | 0/6 |
| 2 kg | 1.45 mm | 2.52 mm | 6/6 | 0/6 |
At 1 kg, both rules are identical, providing a necessary control. At 0.5 kg, scaling improves position error substantially but does not satisfy the speed contract. At 2 kg, fixed gains pass all six episodes while scaling passes none. Across masses, scaling lowers mean position error but achieves 0/18 full passes versus 6/18 for fixed gains.
This does not establish that heavier systems are universally more stable or that mass scaling is inherently wrong. In this noisy, delayed, force-limited loop, ideal equations and average position error are insufficient selection criteria.
Do not invent a causal breakdown
Plausible hypotheses include changed closed-loop dynamics, a different noise-to-force path and saturation effects. The study does not isolate those factors, so it cannot assign their contributions.
Evidence directly supports tail error, maximum tail speed, saturated-step counts and acceptance per episode. Explaining the six successful episodes requires inspecting force/velocity trajectories and designing controlled ablations, not constructing a story from one average.
Exercises
Compare both rules at 1 kg for the same goal and seed, row by row: their trajectories should match. Then find a scaled 0.5 kg episode with position RMS below 15 mm and inspect why peak tail speed still causes rejection.
If force limits are made proportional to mass, use a new protocol and output directory. That changes actuator capability as well as the controller. Extending to an arm additionally requires joint inertia, coupling, gravity and contact; this planar model cannot certify those systems.
The three articles form a practical sequence: separate development selection from holdout evaluation, inspect the physical meaning of communication-loss actions, then test parameter transfer. Full VL01, M4/M5 and hardware work remain unfinished.
Reproduce the protocol
Run from a fresh checkout in PowerShell. The output directory must not exist. All three articles in this study share one frozen protocol; run it once and inspect the section relevant to each article.
git clone https://github.com/VirtualSelect/hohoo-embodied-agent.git hohoo-embodied-agent-study
cd hohoo-embodied-agent-study
git checkout 1d1faab57e20b352761e9abc736c6d277b505e6b
python -m venv .venv
$py = '.\.venv\Scripts\python.exe'
& $py -m pip install -r requirements-lock.txt
& $py -m unittest discover -s experiments/planar_reliability -p "test_*.py"
& $py experiments/planar_reliability/run.py --out outputs/reliability-my-run
& $py experiments/planar_reliability/audit.py outputs/reliability-my-runTested on Windows with Python 3.12.14 + MuJoCo 3.3.7 + NumPy 2.2.6; 3 unit tests, 153 episodes and 306000 rows. The independent audit should print PASS. Other operating systems have not been rechecked. To inspect the archived result without rerunning the experiment, pass evidence/planar-reliability-20261011 to the same audit command. Source hashes normalize LF; evidence hashes use original bytes. Do not rewrite the manifest to conceal a mismatch.
If an import fails, verify that installation and execution use the same $py. Preserve failed outputs and choose a new directory for reruns. Numeric comparisons use the frozen tolerances; timing is a local measurement, not a required speed threshold.
Code and writing are AI-assisted; the findings are limited to the archived, auditable runs. No new paid model requests were made, and this does not claim author-performed manual review.
A note to your future selfBefore you move on, keep one thought of your own.
Your private reading note stays in this browser; it is never uploaded or published. Clearing browser data removes it, so export a copy to keep. This article’s translations share the same note.
Related study material
EXPLORE / Getting started with embodied AI
Focused reading. Use the prerequisites and published follow-ups above to choose what to read next.
Related content
- LAB / 044
Planar control tuning, observation loss and transfer
153 episodes and 306000 physics steps. The selected controller passes 7/18 holdouts; zero force coasts, and mass scaling lowers mean error without passing the velocity contract.
- PROJECT / 003
Hohoo Embodied Experiments
Two MuJoCo teaching scenes—pick-and-place and planar force control—record contracts, tuning, clearance and delayed-feedback outcomes, including failures.
View count unavailable