Send the motor settings before enabling the drivers at startup

This commit is contained in:
pgdalmeida 2026-09-28 11:33:46 +02:00
parent 740eb1bd00
commit 93f47bd142
Signed by: pedro.almeida
GPG Key ID: D4A6C394DF13F1D7
1 changed files with 8 additions and 5 deletions

View File

@ -1088,17 +1088,20 @@ struct Application::Impl {
~ClearHoming() { flag = false; } ~ClearHoming() { flag = false; }
} clear_homing{homing_active_}; } clear_homing{homing_active_};
// Tell the firmware where to anchor the homed midpoint and how much
// clearance to keep from each endstop, BEFORE homing: finishHoming() uses
// the centre count to re-origin, so a late send would apply to the next
// home, not this one. And before ENABLE: this also carries the drivetrain,
// and a board that has just lost its settings (power-up, fresh flash)
// refuses ENABLE with "ERR need config" until it has them.
sendAnchorConfig();
motor->sendCommand("ENABLE Y"); motor->sendCommand("ENABLE Y");
// Only address axes this tower actually has. A yaw-only rig answers // Only address axes this tower actually has. A yaw-only rig answers
// "ERR axis not present" to every pitch command, which arrives in the log // "ERR axis not present" to every pitch command, which arrives in the log
// as a row of warnings at every startup - noise that trains an operator to // as a row of warnings at every startup - noise that trains an operator to
// ignore exactly the channel that reports real faults. // ignore exactly the channel that reports real faults.
if (cfg.hardware.hasAxis("pitch")) motor->sendCommand("ENABLE P"); if (cfg.hardware.hasAxis("pitch")) motor->sendCommand("ENABLE P");
// Tell the firmware where to anchor the homed midpoint and how much
// clearance to keep from each endstop, BEFORE homing: finishHoming() uses
// the centre count to re-origin, so a late send would apply to the next
// home, not this one.
sendAnchorConfig();
// Confirm the current landed BEFORE driving into anything. This is the // Confirm the current landed BEFORE driving into anything. This is the
// only check standing between a stale firmware and an endstop that cannot // only check standing between a stale firmware and an endstop that cannot