11 Commits
0.2.0 ... 1.0.0

Author SHA1 Message Date
f745af48fe Added destructor for detectorTowerController 2025-06-10 15:04:34 +02:00
0fd312b672 Updated dependency turboPmac to 1.1.1 2025-06-10 15:01:42 +02:00
c15e513b2e Updated turboPmac to 1.1.1 2025-06-10 15:00:33 +02:00
6f9b890374 Updated turboPmac to 1.1 2025-06-10 14:44:59 +02:00
fbbe8c4553 Updated turboPmac to 1.1 2025-06-10 14:22:15 +02:00
675819741b Updated turboPmac version 2025-06-10 13:57:57 +02:00
eb3826ec35 Stop or reset now also resets the deferred movement flags 2025-06-10 11:15:40 +02:00
5dd5a26243 Removed unnecessary code (bug in sinqMotor has been found) 2025-05-16 16:33:49 +02:00
832884179c Updated dependencies sinqMotor and turboPmac both to 0.15.2 2025-05-16 16:17:36 +02:00
94edef6cd8 New error message always results in status problem
Previously, a new error message did not automatically result in a status
problem being shown. This patch fixes that.
2025-05-16 11:29:38 +02:00
afdd66a648 Adjusted link to turboPmac repository 2025-05-15 17:18:39 +02:00
9 changed files with 25 additions and 74 deletions

View File

@ -6,7 +6,7 @@
![Coordinate systems](images/CoordinateSystems.svg)
This is a driver for the detector tower which is based on the Turbo PMAC driver (https://git.psi.ch/sinq-epics-modules/turboPmac). It consists of the following four objects:
This is a driver for the detector tower which is based on the Turbo PMAC driver (https://gitea.psi.ch/lin-epics-modules/turboPmac). It consists of the following four objects:
- `detectorTowerController`: This is an expanded variant of `turboPmacController` provided by the Turbo PMAC library linked above.It is needed to operate a `detectorTowerAngleAxis`, but it can also be used to operate a "normal" `turboPmacAxis`.
- `detectorTowerAngleAxis`: This is a virtual axis which controls multiple physical motors ($x$ and $z$) in order to provide a combined movement. Moving it results in a rotation of the entire beam around the support axis position ($\alpha$).
- `detectorTowerLiftAxis`: This is a virtual axis which controls multiple physical motors in order to provide a combined movement. Moving it results in a vertical lift ($z_{lift}$).

View File

@ -189,7 +189,7 @@ asynStatus detectorTowerAngleAxis::poll(bool *moving) {
__LINE__);
}
}
wasMoving_ = *moving;
setWasMoving(*moving);
return status;
}
@ -216,7 +216,7 @@ asynStatus detectorTowerAngleAxis::doMove(double position, int relative,
// Signal to the deferredMovementCollectorLoop that a movement should be
// started to the defined target position.
targetPosition_ = position * motorRecResolution;
setTargetPosition(position * motorRecResolution);
receivedTarget_ = true;
return asynSuccess;
@ -282,7 +282,7 @@ asynStatus detectorTowerAngleAxis::startCombinedMove() {
// Set the target positions for beam tilt, detector tilt offset and lift
// offset
snprintf(command, sizeof(command), "Q451=%lf Q454=%lf P350=1",
targetPosition_, liftAxis_->targetPosition_);
targetPosition(), liftAxis_->targetPosition());
// Lock the access to the controller since this function runs in another
// thread than the poll method.
@ -343,6 +343,10 @@ asynStatus detectorTowerAngleAxis::stop(double acceleration) {
return asynError;
}
// Reset the deferred movement flags
startingDeferredMovement_ = false;
deferredMovementWait_ = false;
return rwStatus;
}
@ -526,6 +530,10 @@ asynStatus detectorTowerAngleAxis::doReset() {
__PRETTY_FUNCTION__, __LINE__);
}
// Reset the deferred movement flags
startingDeferredMovement_ = false;
deferredMovementWait_ = false;
/*
Check which action should be performed:
- If error_ == 10 or 11 (FTZ motor error): P352 = 3 (Recover FTZ)

View File

@ -106,11 +106,13 @@ detectorTowerController::detectorTowerController(
}
}
detectorTowerController::~detectorTowerController() {}
asynStatus detectorTowerController::readInt32(asynUser *pasynUser,
epicsInt32 *value) {
// The detector axes cannot be disabled
if (pasynUser->reason == motorCanDisable_) {
if (pasynUser->reason == motorCanDisable()) {
detectorTowerAngleAxis *aAxis = getDetectorTowerAngleAxis(pasynUser);
if (aAxis != nullptr) {
*value = 0;
@ -150,31 +152,6 @@ asynStatus detectorTowerController::writeInt32(asynUser *pasynUser,
}
}
/*
Due to a bug which is currently not understood, the reset has to be handled
here rather than using the default implementation in sinqController. Piping
the motor reset request to sinqController causes segfaults. It might be due
to the fact that the default `reset` implementation of sinqAxis locks the
controller in order to perform some fast polls and that for some reason this
behaviour cannot be overwritten even by providing custom `reset` methods for
all three axes.
*/
if (pasynUser->reason == motorReset_) {
detectorTowerAngleAxis *aAxis = getDetectorTowerAngleAxis(pasynUser);
if (aAxis != nullptr) {
return aAxis->reset();
}
detectorTowerLiftAxis *lAxis = getDetectorTowerLiftAxis(pasynUser);
if (lAxis != nullptr) {
return lAxis->reset();
}
detectorTowerSupportAxis *sAxis =
getDetectorTowerSupportAxis(pasynUser);
if (sAxis != nullptr) {
return sAxis->reset();
}
}
return turboPmacController::writeInt32(pasynUser, value);
}
@ -838,7 +815,8 @@ asynStatus detectorTowerController::pollDetectorAxes(
getStringParam(angleAxisNo, motorMessageText(), sizeof(waitingErrorMessage),
waitingErrorMessage);
if (error != 0 || waitingErrorMessage[0] != '\0') {
if (error != 0 || errorMessage[0] != '\0' ||
waitingErrorMessage[0] != '\0') {
plStatus = angleAxis->setIntegerParam(motorStatusProblem(), true);
if (plStatus != asynSuccess) {

View File

@ -35,6 +35,8 @@ class detectorTowerController : public turboPmacController {
int numAxes, double movingPollPeriod,
double idlePollPeriod, double comTimeout);
virtual ~detectorTowerController();
/**
* @brief Overloaded function of turboPmacController
*

View File

@ -154,7 +154,7 @@ asynStatus detectorTowerLiftAxis::poll(bool *moving) {
__LINE__);
}
}
wasMoving_ = *moving;
setWasMoving(*moving);
return status;
}
@ -183,7 +183,7 @@ asynStatus detectorTowerLiftAxis::doMove(double position, int relative,
// Signal to the deferredMovementCollectorLoop (of the
// detectorTowerAngleAxis) that a movement should be started to the
// defined target position.
targetPosition_ = position * motorRecResolution;
setTargetPosition(position * motorRecResolution);
angleAxis_->receivedTarget_ = true;
return asynSuccess;
@ -192,37 +192,8 @@ asynStatus detectorTowerLiftAxis::doMove(double position, int relative,
asynStatus detectorTowerLiftAxis::reset() { return angleAxis()->reset(); };
asynStatus detectorTowerLiftAxis::stop(double acceleration) {
// Status of read-write-operations of ASCII commands to the controller
asynStatus rwStatus = asynSuccess;
// Status of parameter library operations
asynStatus plStatus = asynSuccess;
char response[pC_->MAXBUF_] = {0};
// =========================================================================
rwStatus = pC_->writeRead(axisNo_, "P350=8", response, 0);
if (rwStatus != asynSuccess) {
asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d\nStopping "
"the movement "
"failed.\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__);
plStatus = setIntegerParam(pC_->motorStatusProblem(), true);
if (plStatus != asynSuccess) {
return pC_->paramLibAccessFailed(plStatus, "motorStatusProblem_",
axisNo_, __PRETTY_FUNCTION__,
__LINE__);
}
return asynError;
}
return rwStatus;
}
return angleAxis()->stop(acceleration);
};
asynStatus detectorTowerLiftAxis::readEncoderType() {
return angleAxis()->readEncoderType();

View File

@ -19,10 +19,6 @@ class detectorTowerLiftAxis : public turboPmacAxis {
detectorTowerLiftAxis(detectorTowerController *pController, int axisNo,
detectorTowerAngleAxis *angleAxis);
/**
* @brief Destroy the turboPmacAxis
*
*/
virtual ~detectorTowerLiftAxis();
/**

View File

@ -155,7 +155,7 @@ asynStatus detectorTowerSupportAxis::poll(bool *moving) {
__LINE__);
}
}
wasMoving_ = *moving;
setWasMoving(*moving);
return status;
}

View File

@ -24,10 +24,6 @@ class detectorTowerSupportAxis : public turboPmacAxis {
detectorTowerSupportAxis(detectorTowerController *pController, int axisNo,
detectorTowerAngleAxis *angleAxis);
/**
* @brief Destroy the detectorTowerSupportAxis
*
*/
virtual ~detectorTowerSupportAxis();
/**