Skip to content

Add START_ELEVATION to move to a start height after calibration - #28

Merged
kou merged 4 commits into
enactic:mainfrom
shokubutsuu:main
Nov 18, 2026
Merged

kou merged 4 commits into
enactic:mainfrom
shokubutsuu:main

Conversation

@shokubutsuu

@shokubutsuu shokubutsuu commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Add START_ELEVATION (--start-elevation): a height in mm to move to after calibration and hold until the first lifter command, like the arms' start pose. It defaults to off, which holds where calibration ends. Drop the move toward the top after calibration, which the next tick overrode and whose target lacked the calibration offset.

shokubutsuu and others added 2 commits November 18, 2026 16:24
The motor starts in whatever control mode was last saved to its flash
(MIT from the factory) and ignores position/velocity commands in any
other mode, so the lifter never moved, never finished calibration and
never sent elevation_observation. Set POS_VEL before enabling, on every
start, without saving it.

Add START_ELEVATION (--start-elevation): a height in mm to move to after
calibration and hold until the first lifter command, like the arms' start
pose. It defaults to off, which holds where calibration ends. Drop the
move toward the top after calibration, which the next tick overrode and
whose target lacked the calibration offset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Set the motor's mode on start and optionally move to a start elevation
@kou

kou commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR! Moving to a start height after calibration makes sense, and dropping the old move toward pos_max is right.

Two things I'd like to sort out before merging:

  1. Control mode: init_arm_motors(..., control_modes) already sends the set-control-mode command in openarm-can 1.2.9 and later, so the motor should already be in POS_VEL at this point. Which openarm-can version did you see the problem with? If it was an older one, I'd rather add a lower bound to pyproject.toml than send the mode again. If it was a recent one, something else is making the difference (the resend, or draining the reply), and the comment should say that.

  2. Start move can be cancelled by jam detection: the tick that finishes calibration sends no new command, so the motor keeps pushing into the bottom until the next tick. If the torque is above TORQUE_LIMIT (1.5) on that tick, the jam detection overwrites hold_pos with the current position, _reached() becomes true, and the lifter stays at the bottom without any message. Could you send the hold command right when calibration finishes, or skip that overwrite while moving_to_start is set? Have you seen the start move work reliably on the real lifter?

shokubutsuu and others added 2 commits November 18, 2026 17:10
init_arm_motors already sends the set-control-mode command (openarm-can
1.4.0 here), and the lifter calibrates without the second one, so remove
it.

The tick that ended calibration sent no command, so the motor kept
pushing into the bottom; if that torque read as a jam on the next tick,
it replaced the start target with the current position and the lifter
stayed at the bottom. Send the start move on that tick instead.

Checked on the Cell: calibrates and holds at 0 mm with the launcher, and
rises to 50 mm with LIFTER_START_ELEVATION=50.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the mode resend and start moving when calibration ends
@shokubutsuu

Copy link
Copy Markdown
Contributor Author

makes sense.

  1. We’re on openarm-can 1.4.0, so init_arm_motors already sends the mode. I’ve removed the second send. The lifter calibrates fine without it on the Cell.
  2. Fixed as you suggested: the tick that finishes calibration now sends the start-move command, so the motor stops pushing into the bottom before the next jam check. Tested on the Cell with a 50 mm start height, and it rises to 50.3 mm after calibration.

@kou kou changed the title lifter start action change Add START_ELEVATION to move to a start height after calibration Nov 18, 2026
@kou
kou merged commit 4d17a80 into enactic:main Nov 18, 2026
5 checks passed
@kou

kou commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants