Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cff64f5ecf | |||
| 7a0de4e9d9 | |||
| 566728c57c |
@@ -257,7 +257,7 @@ This method should not be called in the driver code itself if a poll is needed -
|
|||||||
- `startMovTimeoutWatchdog`: Starts a watchdog for the movement time. This watchdog compares the actual time spent in a movement operation with an expected time, which is calculated based on the distance of the current and the target position.
|
- `startMovTimeoutWatchdog`: Starts a watchdog for the movement time. This watchdog compares the actual time spent in a movement operation with an expected time, which is calculated based on the distance of the current and the target position.
|
||||||
- `checkMovTimeoutWatchdog`: Check if the watchdog timed out.
|
- `checkMovTimeoutWatchdog`: Check if the watchdog timed out.
|
||||||
- `setWatchdogEnabled`: Enables / disables the watchdog. This function is also available in the IOC shell.
|
- `setWatchdogEnabled`: Enables / disables the watchdog. This function is also available in the IOC shell.
|
||||||
- `setOffsetMovTimeout`: Set a linear offset for the expected movement time. This function is also available in the IOC shell.
|
- `setOffsetMovTimeout`: Set a constant offset for the expected movement time. This function is also available in the IOC shell.
|
||||||
- `setScaleMovTimeout`: Set a scaling factor for the expected movement time. This function is also available in the IOC shell.
|
- `setScaleMovTimeout`: Set a scaling factor for the expected movement time. This function is also available in the IOC shell.
|
||||||
|
|
||||||
#### msgPrintControl.h
|
#### msgPrintControl.h
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ record(motor,"$(INSTR)$(M)")
|
|||||||
field(PINI,"NO")
|
field(PINI,"NO")
|
||||||
field(DHLM, "$(DHLM=0)")
|
field(DHLM, "$(DHLM=0)")
|
||||||
field(DLLM, "$(DLLM=0)")
|
field(DLLM, "$(DLLM=0)")
|
||||||
|
field(SPDB, "$(SPDB=0)")
|
||||||
field(TWV,"1")
|
field(TWV,"1")
|
||||||
field(RTRY,"0")
|
field(RTRY,"0")
|
||||||
field(RDBD, "$(RDBD=10e300)") # Suppress retries and overshoot stop commands
|
field(RDBD, "$(RDBD=10e300)") # Suppress retries and overshoot stop commands
|
||||||
@@ -238,6 +239,27 @@ record(ao, "$(INSTR)$(M):PushDLLM2Field") {
|
|||||||
field(PINI, "NO")
|
field(PINI, "NO")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# This record pair reads the parameter library value for "motorPositionDeadband"
|
||||||
|
# and pushes it to the motor record field "SPDP". This can be used to the position
|
||||||
|
# deadband from the hardware
|
||||||
|
# The implementation strategy is taken from https://epics.anl.gov/tech-talk/2022/msg00464.php.
|
||||||
|
# This record is coupled to the parameter library via motorPositionDeadband -> MOTOR_POSITION_DEADBAND.
|
||||||
|
record(ai, "$(INSTR)$(M):SPDB_RBV")
|
||||||
|
{
|
||||||
|
field(DTYP, "asynFloat64")
|
||||||
|
field(VAL, "$(SPDP=0)")
|
||||||
|
field(INP, "@asyn($(CONTROLLER),$(AXIS)) MOTOR_POSITION_DEADBAND")
|
||||||
|
field(SCAN, "I/O Intr")
|
||||||
|
field(FLNK, "$(INSTR)$(M):PushSPDB2Field")
|
||||||
|
field(PINI, "NO")
|
||||||
|
}
|
||||||
|
record(ao, "$(INSTR)$(M):PushSPDB2Field") {
|
||||||
|
field(DOL, "$(INSTR)$(M):SPDB_RBV NPP")
|
||||||
|
field(OUT, "$(INSTR)$(M).SPDB")
|
||||||
|
field(OMSL, "closed_loop")
|
||||||
|
field(PINI, "NO")
|
||||||
|
}
|
||||||
|
|
||||||
# This record pair reads the parameter library value for "motorVeloFromDriver_"
|
# This record pair reads the parameter library value for "motorVeloFromDriver_"
|
||||||
# and pushes it to the motor record field "VELO". This can be used to read the speed value
|
# and pushes it to the motor record field "VELO". This can be used to read the speed value
|
||||||
# from the hardware and correspondingly update the motor record from the driver.
|
# from the hardware and correspondingly update the motor record from the driver.
|
||||||
|
|||||||
@@ -283,9 +283,12 @@ asynStatus sinqAxis::forcedPoll(bool *moving) {
|
|||||||
pSinqA_->wasMoving = *moving;
|
pSinqA_->wasMoving = *moving;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check and update the watchdog
|
// Check and update the watchdog as well as the general poll status IF the
|
||||||
if (checkMovTimeoutWatchdog(*moving) != asynSuccess) {
|
// poll did not fail already.
|
||||||
return asynError;
|
if (poll_status == asynSuccess) {
|
||||||
|
if (checkMovTimeoutWatchdog(*moving) != asynSuccess) {
|
||||||
|
poll_status = asynError;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// According to the function documentation of asynMotorAxis::poll, this
|
// According to the function documentation of asynMotorAxis::poll, this
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ struct sinqControllerImpl {
|
|||||||
int motorAcclFromDriver;
|
int motorAcclFromDriver;
|
||||||
int motorHighLimitFromDriver;
|
int motorHighLimitFromDriver;
|
||||||
int motorLowLimitFromDriver;
|
int motorLowLimitFromDriver;
|
||||||
|
int motorPositionDeadband;
|
||||||
int adaptivePolling;
|
int adaptivePolling;
|
||||||
int encoderType;
|
int encoderType;
|
||||||
};
|
};
|
||||||
@@ -267,6 +268,17 @@ sinqController::sinqController(const char *portName,
|
|||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
status = createParam("MOTOR_POSITION_DEADBAND", asynParamFloat64,
|
||||||
|
&pSinqC_->motorPositionDeadband);
|
||||||
|
if (status != asynSuccess) {
|
||||||
|
asynPrint(this->pasynUser(), ASYN_TRACE_ERROR,
|
||||||
|
"Controller \"%s\" => %s, line %d\nFATAL ERROR (creating a "
|
||||||
|
"parameter failed with %s).\nTerminating IOC",
|
||||||
|
portName, __PRETTY_FUNCTION__, __LINE__,
|
||||||
|
stringifyAsynStatus(status));
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
status = createParam("MOTOR_ENABLE_MOV_WATCHDOG", asynParamInt32,
|
status = createParam("MOTOR_ENABLE_MOV_WATCHDOG", asynParamInt32,
|
||||||
&pSinqC_->motorEnableMovWatchdog);
|
&pSinqC_->motorEnableMovWatchdog);
|
||||||
if (status != asynSuccess) {
|
if (status != asynSuccess) {
|
||||||
@@ -699,6 +711,9 @@ int sinqController::motorHighLimitFromDriver() {
|
|||||||
int sinqController::motorLowLimitFromDriver() {
|
int sinqController::motorLowLimitFromDriver() {
|
||||||
return pSinqC_->motorLowLimitFromDriver;
|
return pSinqC_->motorLowLimitFromDriver;
|
||||||
}
|
}
|
||||||
|
int sinqController::motorPositionDeadband() {
|
||||||
|
return pSinqC_->motorPositionDeadband;
|
||||||
|
}
|
||||||
int sinqController::adaptivePolling() { return pSinqC_->adaptivePolling; }
|
int sinqController::adaptivePolling() { return pSinqC_->adaptivePolling; }
|
||||||
int sinqController::encoderType() { return pSinqC_->encoderType; }
|
int sinqController::encoderType() { return pSinqC_->encoderType; }
|
||||||
|
|
||||||
|
|||||||
@@ -315,6 +315,7 @@ class HIDDEN sinqController : public asynMotorController {
|
|||||||
int motorAcclFromDriver();
|
int motorAcclFromDriver();
|
||||||
int motorHighLimitFromDriver();
|
int motorHighLimitFromDriver();
|
||||||
int motorLowLimitFromDriver();
|
int motorLowLimitFromDriver();
|
||||||
|
int motorPositionDeadband();
|
||||||
int adaptivePolling();
|
int adaptivePolling();
|
||||||
int encoderType();
|
int encoderType();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user