refactor: merge motor sysid into unified sysid module

Unified the two separate sysid codepaths (motor-only and full-system)
into a single module that optimizes all 28 parameters jointly:

- 13 motor params (asymmetric gear, damping, friction, deadzone,
  Stribeck boost, action bias, filter tau, armature, ctrl_limit)
- 15 pendulum/arm params (mass, CoM, inertia, joint dynamics)

Key changes:
- Added stribeck_friction_boost, stribeck_vel, action_bias to
  ActuatorConfig (robot.py) and MJX runner
- Created shared src/sysid/preprocess.py (SG velocity recomputation)
- Rewrote src/sysid/rollout.py with unified MOTOR_PARAMS + PENDULUM_PARAMS
  spec and PARAM_SETS dict for flexible subset optimization
- Updated optimize.py, export.py, visualize.py to use unified params
  (removed all LOCKED_MOTOR_PARAMS references)
- Removed src/sysid/motor/ module and scripts/motor_sysid.py

Net: -1383 lines, zero code duplication between motor and full-system sysid.
This commit is contained in:
2026-03-28 16:48:22 +01:00
parent ca0e7b8b03
commit 5880997786
20 changed files with 700 additions and 2083 deletions

View File

@@ -1,21 +1,21 @@
# Tuned robot config — generated by src.sysid.optimize
# Tuned robot config — generated by src.sysid (2026-03-28)
# Motor params: motor-only sysid cost 0.2117
# Full-system params: sysid cost 1.216 (0.2s windows, amplitude 200)
urdf: rotary_cartpole.urdf
actuators:
- joint: motor_joint
type: motor
gear: [0.424182, 0.425031] # torque constant [pos, neg] (motor sysid)
ctrl_range: [-0.592, 0.592] # effective control bound (sysid-tuned)
deadzone: [0.141291, 0.078015] # L298N min |ctrl| for torque [pos, neg]
damping: [0.002027, 0.014665] # viscous damping [pos, neg]
frictionloss: [0.057328, 0.053355] # Coulomb friction [pos, neg]
filter_tau: 0.005035 # 1st-order actuator filter (motor sysid)
viscous_quadratic: 0.000285 # velocity² drag
back_emf_gain: 0.006758 # back-EMF torque reduction
gear: [0.371194, 0.428143] # torque constant [pos, neg] (motor sysid)
ctrl_range: [-0.611479, 0.611479] # effective control bound (full sysid)
deadzone: [0.141820, 0.031454] # L298N min |ctrl| for torque [pos, neg]
damping: [0.001384, 0.005196] # viscous damping [pos, neg]
frictionloss: [0.036744, 0.069082] # Coulomb friction [pos, neg]
filter_tau: 0.022301 # 1st-order actuator filter (motor sysid)
joints:
motor_joint:
armature: 0.002773 # reflected rotor inertia (motor sysid)
armature: 0.002753 # reflected rotor inertia (motor sysid)
frictionloss: 0.0 # handled by motor model via qfrc_applied
pendulum_joint:
damping: 0.000119
frictionloss: 1.0e-05
damping: 1.3e-06 # full sysid (was 0.000119)
frictionloss: 3.7e-06 # full sysid (was 1.0e-05)