Skip to content

fix: AZ ALT drivers staying energized on 0 length moves - #311

Merged
ClutchplateDude merged 1 commit into
developfrom
fix/azalt-disable-on-zero-move
Oct 13, 2026
Merged

ClutchplateDude merged 1 commit into
developfrom
fix/azalt-disable-on-zero-move

Conversation

@intercipere

Copy link
Copy Markdown
Member

Problem

When "Move AZ/ALT to home" is used in OATControl (:MAAH#) while both AZ and ALT are already at home, the AZ/ALT drivers are enabled but never disabled again. They stay powered at full hold current until the next real AZ/ALT move, and the motors overheat.

The same happens with any other zero-length AZ/ALT move, e.g. :MAZ0# / :MAL0#.

Cause

moveAZALTToHome(), moveBy() and moveStepperBy() call enableAzMotor() / enableAltMotor() (EN LOW) and then queue the move. The drivers are only disabled again in Mount::loop(), when _azAltWasRunning is set and neither stepper is running anymore. _azAltWasRunning is only set once a stepper is actually seen running. For a zero-step move that never happens, so disableAzAltMotors() is never called.

Fix

enableAzMotor() / enableAltMotor() now set _azAltWasRunning = true. On its next pass, Mount::loop() disables the drivers (still respecting AZ_ALWAYS_ON / ALT_ALWAYS_ON) and stores the AZ/ALT positions to EEPROM, whether or not the move had any steps.

All callers enable the driver and queue the move in the same call, with no loop() in between, so a real move can't be disabled before it starts. The only side effect is one EEPROM position write per zero-length move.

Tested on hardware.

🤖 Generated with Claude Code

@intercipere intercipere changed the title Fix: AZ ALT drivers staying energized on 0 length moves fix: AZ ALT drivers staying energized on 0 length moves Oct 13, 2026
@ClutchplateDude
ClutchplateDude merged commit 42d2982 into develop Oct 13, 2026
8 of 9 checks passed
@ClutchplateDude
ClutchplateDude deleted the fix/azalt-disable-on-zero-move branch October 13, 2026 22:14
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