Skip to main content
Tunes the firmware position loop of one joint. This is the controller a joint runs when its wire_mode is a4 (see the config reference). The tool streams a sine or a constant-speed triangle to the joint with the firmware gains, speed cap and planner acceleration you choose. It scores how well the joint tracks and how smoothly it creeps, and saves the run for the diagnostics dashboard (Tuning → Firmware loop). You can also run it from the dashboard (axol serve). tune.pid tunes the impedance (MIT) controller instead. Under 0xA4 the motor runs its own cascade of position, speed and current loops, so the settings here are:
  • the firmware gains (position_kp, position_ki, position_kd, speed_kp, speed_ki, current_kp, current_ki)
  • the speed cap (--cap)
  • the position planner’s acceleration (--accel)
Bring-up sets each MyActuator motor’s current-loop gains back to the values its firmware ships with. A current_kp or current_ki you save with --persist lasts until the arm next starts from disabled.

Planner acceleration

Use one of two values for --accel. Try both and compare. Any value in between re-plans every streamed target, and the joint will not follow the wave.

Reading the results

The triangle runs every pass at one slow speed, so it shows stick-slip along the whole pass and not only at the turnarounds. Compare runs on these scores:
  • Velocity ripple: the spread of measured minus commanded velocity, divided by the commanded speed. Under 0.2 is smooth. Stick-slip reads near 0.8.
  • Stuck windows: the share of 50 ms windows in which the joint stayed put while the target moved.
  • 1–4 Hz error band: tracking error in the band where stick-slip shows up.
  • Lag: how far the joint trails the target.
  • >10 Hz buzz: fast vibration.

Safety

  • Gains are written to RAM unless you pass --persist. When the run ends, the tool writes back the values the motor had before. Pass --keep to leave the run’s values in place.
  • A buzz guard stops the run on fast position motion or high current and restores the previous gains. Start each sweep from the stock values and change them in small steps. Large steps can make the joint vibrate.
  • In this mode the joint holds position stiffly and pushes back against contact with full motor torque. Keep the workspace clear and the E-Stop within reach.

Tuning in the working pose

A firmware loop that is well damped with the arm hanging can oscillate with the arm extended. Use --pose to hold the other joints in the worst-case pose you will run. The tool samples every held joint during the wave and reports how far it drifted and how much it shook (metrics.held in the saved run).

Damiao wrists

wrist_2 and wrist_3 run the same kind of cascade, with fewer gains: position_kp, position_ki, speed_kp and speed_ki. Their position is 16-bit, and the current columns show torque in Nm. Their profiler always shapes the target. The stock profiler setting, 2 rad/s² (about 115°/s²), is too slow to follow a streamed target, so set a higher one with --dm-acc.

Rated current probe

--tf-probe PCT holds the joint at --center on 0x73 (position control with torque feed-forward). It then steps the feed-forward between 0, +PCT, 0 and −PCT percent of rated current, 0.25 s each, for 8 s. From the current jump at each step it prints the motor’s rated current. Enter that value as firmware.tf_rated_current_a in the config. 5 is a gentle setting, about 1 Nm on a shoulder. The probe needs MyActuator V4.4 firmware. Run it with --accel 0.
You don’t have to persist a winning set from here. The robot config carries per-joint firmware.* gains (see the config reference), and the robot writes any that differ to the motor when it enables the joint. Every joint’s firmware block is empty by default, because the arms run impedance control. To try gains in an a4 run, use tune.motion --gain SIDE.JOINT.firmware.FIELD=VALUE or set them in your config.
A joint left with planner acceleration 0 moves to any stored position target at the speed cap as soon as it wakes. tune.a4 restores the stored acceleration unless you pass --keep. If you keep it, don’t send that joint any other position command until you have set it back.