Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
588ca158c1 | |||
3780dee24f | |||
c736c191d0 | |||
42784c2bff |
@ -38,6 +38,8 @@ seleneAngleAxis::seleneAngleAxis(seleneGuideController *pController, int axisNo,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
seleneAngleAxis::~seleneAngleAxis() {}
|
||||||
|
|
||||||
asynStatus seleneAngleAxis::stop(double acceleration) {
|
asynStatus seleneAngleAxis::stop(double acceleration) {
|
||||||
return liftAxis_->stop(acceleration);
|
return liftAxis_->stop(acceleration);
|
||||||
}
|
}
|
||||||
@ -54,21 +56,20 @@ asynStatus seleneAngleAxis::doMove(double position, int relative,
|
|||||||
axisNo_, __PRETTY_FUNCTION__,
|
axisNo_, __PRETTY_FUNCTION__,
|
||||||
__LINE__);
|
__LINE__);
|
||||||
}
|
}
|
||||||
targetPosition_ = position * motorRecResolution;
|
setTargetPosition(position * motorRecResolution);
|
||||||
targetSet_ = true;
|
targetSet_ = true;
|
||||||
return liftAxis_->startCombinedMoveFromVirtualAxis();
|
return liftAxis_->startCombinedMoveFromVirtualAxis();
|
||||||
targetSet_ = false;
|
targetSet_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
asynStatus seleneAngleAxis::targetPosition(double *targetPosition) {
|
double seleneAngleAxis::targetPosition() {
|
||||||
asynStatus status = asynSuccess;
|
|
||||||
|
|
||||||
if (targetSet_) {
|
if (targetSet_) {
|
||||||
*targetPosition = targetPosition_;
|
return turboPmacAxis::targetPosition();
|
||||||
} else {
|
} else {
|
||||||
status = motorPosition(targetPosition);
|
double targetPos = 0;
|
||||||
|
motorPosition(&targetPos);
|
||||||
|
return targetPos;
|
||||||
}
|
}
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
asynStatus seleneAngleAxis::doPoll(bool *moving) {
|
asynStatus seleneAngleAxis::doPoll(bool *moving) {
|
||||||
|
@ -32,6 +32,8 @@ class seleneAngleAxis : public turboPmacAxis {
|
|||||||
seleneAngleAxis(seleneGuideController *pController, int axisNo,
|
seleneAngleAxis(seleneGuideController *pController, int axisNo,
|
||||||
seleneLiftAxis *liftAxis);
|
seleneLiftAxis *liftAxis);
|
||||||
|
|
||||||
|
virtual ~seleneAngleAxis();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Implementation of the `stop` function from asynMotorAxis
|
* @brief Implementation of the `stop` function from asynMotorAxis
|
||||||
*
|
*
|
||||||
@ -100,13 +102,11 @@ class seleneAngleAxis : public turboPmacAxis {
|
|||||||
double acceleration, int forwards);
|
double acceleration, int forwards);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Read the target position from the axis and write it into the
|
* @brief Override of the superclass method
|
||||||
* provided pointer.
|
|
||||||
*
|
*
|
||||||
* @param targetPosition
|
* @return double
|
||||||
* @return asynStatus
|
|
||||||
*/
|
*/
|
||||||
asynStatus targetPosition(double *targetPosition);
|
double targetPosition();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the offsets of axis 3 and 4 to zero and recalculate all other
|
* @brief Set the offsets of axis 3 and 4 to zero and recalculate all other
|
||||||
|
@ -48,6 +48,8 @@ seleneGuideController::seleneGuideController(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
seleneGuideController::~seleneGuideController() {}
|
||||||
|
|
||||||
asynStatus seleneGuideController::writeInt32(asynUser *pasynUser,
|
asynStatus seleneGuideController::writeInt32(asynUser *pasynUser,
|
||||||
epicsInt32 value) {
|
epicsInt32 value) {
|
||||||
int function = pasynUser->reason;
|
int function = pasynUser->reason;
|
||||||
|
@ -34,6 +34,8 @@ class seleneGuideController : public turboPmacController {
|
|||||||
int numAxes, double movingPollPeriod,
|
int numAxes, double movingPollPeriod,
|
||||||
double idlePollPeriod, double comTimeout);
|
double idlePollPeriod, double comTimeout);
|
||||||
|
|
||||||
|
virtual ~seleneGuideController();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Overloaded function of turboPmacController
|
* @brief Overloaded function of turboPmacController
|
||||||
*
|
*
|
||||||
|
@ -115,6 +115,8 @@ seleneLiftAxis::seleneLiftAxis(seleneGuideController *pC, int axis1No,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
seleneLiftAxis::~seleneLiftAxis() {}
|
||||||
|
|
||||||
asynStatus seleneLiftAxis::init() {
|
asynStatus seleneLiftAxis::init() {
|
||||||
|
|
||||||
// Local variable declaration
|
// Local variable declaration
|
||||||
@ -470,22 +472,21 @@ asynStatus seleneLiftAxis::doMove(double position, int relative,
|
|||||||
return pC_->paramLibAccessFailed(status, "motorRecResolution_", axisNo_,
|
return pC_->paramLibAccessFailed(status, "motorRecResolution_", axisNo_,
|
||||||
__PRETTY_FUNCTION__, __LINE__);
|
__PRETTY_FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
targetPosition_ = position * motorRecResolution;
|
setTargetPosition(position * motorRecResolution);
|
||||||
targetSet_ = true;
|
targetSet_ = true;
|
||||||
status = startCombinedMoveFromVirtualAxis();
|
status = startCombinedMoveFromVirtualAxis();
|
||||||
targetSet_ = false;
|
targetSet_ = false;
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
asynStatus seleneLiftAxis::targetPosition(double *targetPosition) {
|
double seleneLiftAxis::targetPosition() {
|
||||||
asynStatus status = asynSuccess;
|
|
||||||
|
|
||||||
if (targetSet_) {
|
if (targetSet_) {
|
||||||
*targetPosition = targetPosition_;
|
return turboPmacAxis::targetPosition();
|
||||||
} else {
|
} else {
|
||||||
status = motorPosition(targetPosition);
|
double targetPos = 0;
|
||||||
|
motorPosition(&targetPos);
|
||||||
|
return targetPos;
|
||||||
}
|
}
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
asynStatus seleneLiftAxis::startCombinedMove() {
|
asynStatus seleneLiftAxis::startCombinedMove() {
|
||||||
@ -494,30 +495,18 @@ asynStatus seleneLiftAxis::startCombinedMove() {
|
|||||||
char response[pC_->MAXBUF_] = {0};
|
char response[pC_->MAXBUF_] = {0};
|
||||||
double liftTargetPosition = 0.0;
|
double liftTargetPosition = 0.0;
|
||||||
double angleTargetPosition = 0.0;
|
double angleTargetPosition = 0.0;
|
||||||
asynStatus status = asynSuccess;
|
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|
||||||
status = targetPosition(&liftTargetPosition);
|
liftTargetPosition = targetPosition();
|
||||||
if (status != asynSuccess) {
|
angleTargetPosition = angleAxis_->targetPosition();
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
status = angleAxis_->targetPosition(&angleTargetPosition);
|
|
||||||
if (status != asynSuccess) {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
auto targetPositions =
|
auto targetPositions =
|
||||||
positionsFromLiftAndAngle(liftTargetPosition, angleTargetPosition);
|
positionsFromLiftAndAngle(liftTargetPosition, angleTargetPosition);
|
||||||
|
|
||||||
// Apply the offsets of the individual offset axes
|
// Apply the offsets of the individual offset axes
|
||||||
for (int i = 0; i < numAxes_; i++) {
|
for (int i = 0; i < numAxes_; i++) {
|
||||||
double offsetTargetPosition = 0.0;
|
targetPositions[i] =
|
||||||
status = offsetAxes_[i]->targetPosition(&offsetTargetPosition);
|
targetPositions[i] + offsetAxes_[i]->targetPosition();
|
||||||
if (status != asynSuccess) {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
targetPositions[i] = targetPositions[i] + offsetTargetPosition;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set all target positions and send the move command
|
// Set all target positions and send the move command
|
||||||
|
@ -39,6 +39,8 @@ class seleneLiftAxis : public turboPmacAxis {
|
|||||||
int axis3No, int axis4No, int axis5No, int axis6No,
|
int axis3No, int axis4No, int axis5No, int axis6No,
|
||||||
int liftAxisNo, int angleAxisNo);
|
int liftAxisNo, int angleAxisNo);
|
||||||
|
|
||||||
|
virtual ~seleneLiftAxis();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Implementation of the `stop` function from asynMotorAxis
|
* @brief Implementation of the `stop` function from asynMotorAxis
|
||||||
*
|
*
|
||||||
@ -254,13 +256,11 @@ class seleneLiftAxis : public turboPmacAxis {
|
|||||||
bool virtualAxisMovement() { return virtualAxisMovement_; }
|
bool virtualAxisMovement() { return virtualAxisMovement_; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Read the target position from the axis and write it into the
|
* @brief Override of the superclass method
|
||||||
* provided pointer.
|
|
||||||
*
|
*
|
||||||
* @param targetPosition
|
* @return double
|
||||||
* @return asynStatus
|
|
||||||
*/
|
*/
|
||||||
asynStatus targetPosition(double *targetPosition);
|
double targetPosition();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Access the position of the lift axis
|
* @brief Access the position of the lift axis
|
||||||
|
@ -96,6 +96,8 @@ seleneOffsetAxis::seleneOffsetAxis(seleneGuideController *pController,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
seleneOffsetAxis::~seleneOffsetAxis() {}
|
||||||
|
|
||||||
asynStatus seleneOffsetAxis::init() {
|
asynStatus seleneOffsetAxis::init() {
|
||||||
|
|
||||||
// Local variable declaration
|
// Local variable declaration
|
||||||
@ -149,15 +151,14 @@ asynStatus seleneOffsetAxis::init() {
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
asynStatus seleneOffsetAxis::targetPosition(double *targetPosition) {
|
double seleneOffsetAxis::targetPosition() {
|
||||||
asynStatus status = asynSuccess;
|
|
||||||
|
|
||||||
if (targetSet_) {
|
if (targetSet_) {
|
||||||
*targetPosition = targetPosition_;
|
return turboPmacAxis::targetPosition();
|
||||||
} else {
|
} else {
|
||||||
status = motorPosition(targetPosition);
|
double targetPos = 0;
|
||||||
|
motorPosition(&targetPos);
|
||||||
|
return targetPos;
|
||||||
}
|
}
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
asynStatus seleneOffsetAxis::doPoll(bool *moving) {
|
asynStatus seleneOffsetAxis::doPoll(bool *moving) {
|
||||||
@ -330,7 +331,7 @@ asynStatus seleneOffsetAxis::doMove(double position, int relative,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set the target position
|
// Set the target position
|
||||||
targetPosition_ = position * motorRecResolution;
|
setTargetPosition(position * motorRecResolution);
|
||||||
targetSet_ = true;
|
targetSet_ = true;
|
||||||
asynStatus status = liftAxis_->startCombinedMoveFromOffsetAxis();
|
asynStatus status = liftAxis_->startCombinedMoveFromOffsetAxis();
|
||||||
targetSet_ = false;
|
targetSet_ = false;
|
||||||
|
@ -30,6 +30,8 @@ class seleneOffsetAxis : public turboPmacAxis {
|
|||||||
seleneOffsetAxis(seleneGuideController *pController, int axisNo,
|
seleneOffsetAxis(seleneGuideController *pController, int axisNo,
|
||||||
double xPos, double zPos);
|
double xPos, double zPos);
|
||||||
|
|
||||||
|
virtual ~seleneOffsetAxis();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initialize this offset axis
|
* @brief Initialize this offset axis
|
||||||
*
|
*
|
||||||
@ -79,13 +81,11 @@ class seleneOffsetAxis : public turboPmacAxis {
|
|||||||
asynStatus setPositionsFromEncoderPosition(double encoderPosition);
|
asynStatus setPositionsFromEncoderPosition(double encoderPosition);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Read the target position from the axis and write it into the
|
* @brief Override of the superclass method
|
||||||
* provided pointer.
|
|
||||||
*
|
*
|
||||||
* @param targetPosition
|
* @return double
|
||||||
* @return asynStatus
|
|
||||||
*/
|
*/
|
||||||
asynStatus targetPosition(double *targetPosition);
|
double targetPosition();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the offsets of axis 3 and 4 to zero and recalculate all other
|
* @brief Set the offsets of axis 3 and 4 to zero and recalculate all other
|
||||||
|
Submodule turboPmac updated: 75292a6a9c...4bc3388bc6
Reference in New Issue
Block a user