Compare commits

...

2 Commits

Author SHA1 Message Date
mathis_s ce23d261be Fixed wrong limits after power cycle
Test And Build / Build (push) Failing after 2s
Test And Build / Lint (push) Failing after 4s
2026-06-09 15:12:22 +02:00
mathis_s 89740d3956 Update to sinqMotor 1.6.1 2026-06-09 14:28:39 +02:00
2 changed files with 17 additions and 4 deletions
+16 -3
View File
@@ -788,9 +788,22 @@ asynStatus masterMacsAxis::doPoll(bool *moving) {
}
}
// Update the enable PV
setAxisParamChecked(this, motorEnableRBV,
readyToBeSwitchedOn() && switchedOn());
/*
If the motor just got enabled, we need to initialize it, because some
parameters like the limits on the motor controllers are lost during a power
cycle and are rewritten from the masterMacs "meta-controller" when enabling.
*/
int wasEnabled = 0;
int isEnabled = readyToBeSwitchedOn() && switchedOn();
getAxisParamChecked(this, motorEnableRBV, &wasEnabled);
if (isEnabled && !wasEnabled) {
rwStatus = init();
if (rwStatus != asynSuccess) {
return rwStatus;
}
}
setAxisParamChecked(this, motorEnableRBV, isEnabled);
if (*moving) {
// If the axis is moving, evaluate the movement direction