Merge branch 'lift_axis_no_autoenable'

This commit is contained in:
2025-04-17 17:00:19 +02:00
5 changed files with 151 additions and 131 deletions

View File

@ -10,10 +10,10 @@ ARCH_FILTER=RHEL%
REQUIRED+=SynApps REQUIRED+=SynApps
REQUIRED+=stream REQUIRED+=stream
REQUIRED+=scaler REQUIRED+=scaler
REQUIRED+=asynMotor REQUIRED+=motorBase
# Release version # Release version
LIBVERSION=2024-dev LIBVERSION=2025
# DB files to include in the release # DB files to include in the release
TEMPLATES += sinqEPICSApp/Db/dimetix.db TEMPLATES += sinqEPICSApp/Db/dimetix.db
@ -32,9 +32,9 @@ SOURCES += sinqEPICSApp/src/NanotecDriver.cpp
SOURCES += sinqEPICSApp/src/stptok.cpp SOURCES += sinqEPICSApp/src/stptok.cpp
SOURCES += sinqEPICSApp/src/PhytronDriver.cpp SOURCES += sinqEPICSApp/src/PhytronDriver.cpp
SOURCES += sinqEPICSApp/src/EuroMoveDriver.cpp SOURCES += sinqEPICSApp/src/EuroMoveDriver.cpp
SOURCES += sinqEPICSApp/src/pmacAsynIPPort.c # SOURCES += sinqEPICSApp/src/pmacAsynIPPort.c
SOURCES += sinqEPICSApp/src/pmacAxis.cpp # SOURCES += sinqEPICSApp/src/pmacAxis.cpp
SOURCES += sinqEPICSApp/src/pmacController.cpp # SOURCES += sinqEPICSApp/src/pmacController.cpp
SOURCES += sinqEPICSApp/src/MasterMACSDriver.cpp SOURCES += sinqEPICSApp/src/MasterMACSDriver.cpp
SOURCES += sinqEPICSApp/src/C804Axis.cpp SOURCES += sinqEPICSApp/src/C804Axis.cpp
SOURCES += sinqEPICSApp/src/C804Controller.cpp SOURCES += sinqEPICSApp/src/C804Controller.cpp

View File

@ -143,6 +143,11 @@ asynStatus EL734Controller::transactController(int axisNo, char command[COMLEN],
pasynOctetSyncIO->flush(pasynUserController_); pasynOctetSyncIO->flush(pasynUserController_);
if (axis != NULL)
{
axis->updateMsgTxtFromDriver("");
}
status = pasynOctetSyncIO->writeRead(pasynUserController_, command, strlen(command), status = pasynOctetSyncIO->writeRead(pasynUserController_, command, strlen(command),
reply, COMLEN, 2., &out, &in, &reason); reply, COMLEN, 2., &out, &in, &reason);
if (status != asynSuccess) if (status != asynSuccess)

View File

@ -1186,6 +1186,8 @@ AmorDetectorAxis::AmorDetectorAxis(pmacController *pC, int axisNo, int function)
pC_->debugFlow(functionName); pC_->debugFlow(functionName);
_function = function; _function = function;
det_starting = false;
det_startTime = time(NULL);
callParamCallbacks(); callParamCallbacks();

View File

@ -1,169 +1,180 @@
/******************************************** /********************************************
* pmacAxis.cpp * pmacAxis.cpp
* *
* PMAC Asyn motor based on the * PMAC Asyn motor based on the
* asynMotorAxis class. * asynMotorAxis class.
* *
* Matthew Pearson * Matthew Pearson
* 23 May 2012 * 23 May 2012
* *
* Modified to use the MsgTxt field for SINQ * Modified to use the MsgTxt field for SINQ
* *
* Mark Koennecke, January 2019 * Mark Koennecke, January 2019
* *
* EXtended with special motor axis for the Selene * EXtended with special motor axis for the Selene
* guide, Mark Koennecke, February 2020 * guide, Mark Koennecke, February 2020
********************************************/ ********************************************/
#ifndef pmacAxis_H #ifndef pmacAxis_H
#define pmacAxis_H #define pmacAxis_H
#include "SINQController.h"
#include "SINQAxis.h" #include "SINQAxis.h"
#include "SINQController.h"
class pmacController; class pmacController;
class SeleneController; class SeleneController;
class pmacAxis : public SINQAxis class pmacAxis : public SINQAxis {
{
public: public:
/* These are the methods we override from the base class */ /* These are the methods we override from the base class */
pmacAxis(pmacController *pController, int axisNo, bool enable=true); pmacAxis(pmacController *pController, int axisNo, bool enable = true);
virtual ~pmacAxis(); virtual ~pmacAxis();
asynStatus move(double position, int relative, double min_velocity, double max_velocity, double acceleration); asynStatus move(double position, int relative, double min_velocity,
asynStatus moveVelocity(double min_velocity, double max_velocity, double acceleration); double max_velocity, double acceleration);
asynStatus home(double min_velocity, double max_velocity, double acceleration, int forwards); asynStatus moveVelocity(double min_velocity, double max_velocity,
asynStatus stop(double acceleration); double acceleration);
asynStatus poll(bool *moving); asynStatus home(double min_velocity, double max_velocity,
asynStatus setPosition(double position); double acceleration, int forwards);
asynStatus enable(int on); asynStatus stop(double acceleration);
asynStatus poll(bool *moving);
asynStatus setPosition(double position);
asynStatus enable(int on);
protected: protected:
pmacController *pC_; pmacController *pC_;
asynStatus getAxisStatus(bool *moving);
asynStatus getAxisInitialStatus(void);
double setpointPosition_; asynStatus getAxisStatus(bool *moving);
double encoderPosition_; asynStatus getAxisInitialStatus(void);
double currentVelocity_;
double velocity_;
double accel_;
double highLimit_;
double lowLimit_;
double scale_;
double previous_position_;
int previous_direction_;
int encoder_axis_;
int axisErrorCount;
time_t startTime; double setpointPosition_;
time_t status6Time; double encoderPosition_;
int starting; double currentVelocity_;
int homing; double velocity_;
double statusPos; double accel_;
double highLimit_;
double lowLimit_;
double scale_;
double previous_position_;
int previous_direction_;
int encoder_axis_;
int axisErrorCount;
time_t next_poll; time_t startTime;
time_t status6Time;
int starting;
int homing;
double statusPos;
bool autoEnable; time_t next_poll;
friend class pmacController; bool autoEnable;
friend class pmacV3Controller;
friend class pmacController;
friend class pmacV3Controller;
}; };
/*--------------------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------------------*/
class SeleneAxis : public pmacAxis class SeleneAxis : public pmacAxis {
{
public: public:
SeleneAxis(SeleneController *pController, int axisNo, double limitTarget); SeleneAxis(SeleneController *pController, int axisNo, double limitTarget);
asynStatus move(double position, int relative, double min_velocity, double max_velocity, double acceleration); asynStatus move(double position, int relative, double min_velocity,
asynStatus setPosition(double position); double max_velocity, double acceleration);
asynStatus home(double min_velocity, double max_velocity, double acceleration, int forwards); asynStatus setPosition(double position);
asynStatus home(double min_velocity, double max_velocity,
double acceleration, int forwards);
protected: protected:
friend class SeleneController; friend class SeleneController;
friend class pmacController; friend class pmacController;
private:
double limitTarget;
asynStatus getSeleneAxisInitialStatus(void);
private:
double limitTarget;
asynStatus getSeleneAxisInitialStatus(void);
}; };
/* /*
Yet another special set of motors for the Selene Guide at AMOR. Each segment can be lifted or tilted. This is Yet another special set of motors for the Selene Guide at AMOR. Each segment
two motors. One acts as a slave and only writes a new target, the other also sets a new target and sends the can be lifted or tilted. This is two motors. One acts as a slave and only
actual movement command. Both motors are coordianted in the motor controller in order to avoid tension on writes a new target, the other also sets a new target and sends the actual
the guide elements. This gaves rise to the function code LIFTSLAVE and LIFTMASTER. movement command. Both motors are coordianted in the motor controller in order
to avoid tension on the guide elements. This gaves rise to the function code
LIFTSLAVE and LIFTMASTER.
In another mode the whole guide can be lifted or tilted. Then motor 1 and 6 get new values and one of them In another mode the whole guide can be lifted or tilted. Then motor 1 and 6
sends the drive command. This causes all 6 motors to drive synchronously to their new targets. This is get new values and one of them sends the drive command. This causes all 6
implemented through the LIFTSEGMENT function code. motors to drive synchronously to their new targets. This is implemented
through the LIFTSEGMENT function code.
Mark Koennecke, February 2020 Mark Koennecke, February 2020
The axis should not be enabled automatically The axis should not be enabled automatically
Michele Brambilla, February 2020 Michele Brambilla, February 2020
*/ */
class LiftAxis : public pmacAxis class LiftAxis : public pmacAxis {
{ public:
public: /*
LiftAxis(pmacController *pController, int axisNo) : pmacAxis((pmacController *)pController,axisNo) {}; The default constructor of LiftAxis just forwards to the pmacAxis
asynStatus move(double position, int relative, double min_velocity, double max_velocity, double acceleration); constructor, which has an optional argument "autoenable" with the default
asynStatus poll(bool *moving); value "true". However, we want that argument to be false, hence we provide
asynStatus stop(double acceleration); an explicit constructor.
private: */
int waitStart; LiftAxis(pmacController *pController, int axisNo)
: pmacAxis((pmacController *)pController, axisNo, false) {};
asynStatus move(double position, int relative, double min_velocity,
double max_velocity, double acceleration);
asynStatus poll(bool *moving);
asynStatus stop(double acceleration);
private:
int waitStart;
}; };
/******************************************** /********************************************
* Protocol version 3 requires just some minor change * Protocol version 3 requires just some minor change
* *
* Michele Brambilla, February 2022 * Michele Brambilla, February 2022
********************************************/ ********************************************/
class pmacV3Axis : public pmacAxis { class pmacV3Axis : public pmacAxis {
public: public:
pmacV3Axis(pmacController *pController, int axisNo);
pmacV3Axis(pmacController *pController, int axisNo); asynStatus move(double position, int relative, double min_velocity,
double max_velocity, double acceleration);
asynStatus poll(bool *moving);
asynStatus move(double position, int relative, double min_velocity, protected:
double max_velocity, double acceleration); int IsEnable;
asynStatus poll(bool *moving); double Speed;
protected:
int IsEnable;
double Speed;
asynStatus getAxisStatus(bool *moving); asynStatus getAxisStatus(bool *moving);
friend class pmacController; friend class pmacController;
friend class pmacV3Controller; friend class pmacV3Controller;
};
/*----------------------------------------------------------------------------------------------*/
class pmacHRPTAxis : public pmacV3Axis
{
public:
pmacHRPTAxis(pmacController *pController, int axisNo) : pmacV3Axis(pController,axisNo) {};
/**
* Override getAxisStatus in order to read the special parameter indicating a
* slit blade crash at HRPT
*/
asynStatus getAxisStatus(bool *moving);
protected:
friend class pmacController;
}; };
/*----------------------------------------------------------------------------------------------*/
class pmacHRPTAxis : public pmacV3Axis {
public:
pmacHRPTAxis(pmacController *pController, int axisNo)
: pmacV3Axis(pController, axisNo) {};
/**
* Override getAxisStatus in order to read the special parameter indicating
* a slit blade crash at HRPT
*/
asynStatus getAxisStatus(bool *moving);
protected:
friend class pmacController;
};
/* /*
* Special motors for the AMOR detector movement. The whole * Special motors for the AMOR detector movement. The whole
* command set is different but on a pmac controller. This implements * command set is different but on a pmac controller. This implements
* a coordinated movement of cox, coz and ftz in order not to break * a coordinated movement of cox, coz and ftz in order not to break
* the flight tube which may have been mounted. This is mapped to three * the flight tube which may have been mounted. This is mapped to three
* motors selected via the function code: com, the detector omega, coz, * motors selected via the function code: com, the detector omega, coz,
* the detector z offset and park, for parking the flightpath. * the detector z offset and park, for parking the flightpath.
*/ */
@ -171,39 +182,41 @@ class pmacHRPTAxis : public pmacV3Axis
#define ADCOZ 2 #define ADCOZ 2
#define ADPARK 3 #define ADPARK 3
class AmorDetectorAxis: public pmacAxis { class AmorDetectorAxis : public pmacAxis {
public: public:
AmorDetectorAxis(pmacController *pController, int axisNo, int function); AmorDetectorAxis(pmacController *pController, int axisNo, int function);
asynStatus move(double position, int relative, double min_velocity, asynStatus move(double position, int relative, double min_velocity,
double max_velocity, double acceleration); double max_velocity, double acceleration);
asynStatus poll(bool *moving); asynStatus poll(bool *moving);
asynStatus moveVelocity(double min_velocity, double max_velocity, double acceleration); asynStatus moveVelocity(double min_velocity, double max_velocity,
asynStatus home(double min_velocity, double max_velocity, double acceleration, int forwards); double acceleration);
asynStatus stop(double acceleration); asynStatus home(double min_velocity, double max_velocity,
asynStatus setPosition(double position); double acceleration, int forwards);
asynStatus stop(double acceleration);
asynStatus setPosition(double position);
protected: protected:
int _function; int _function;
int det_starting; int det_starting;
time_t det_startTime; time_t det_startTime;
}; };
/*----------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------*/
class GirderAxis : public pmacV3Axis {
class GirderAxis: public pmacV3Axis {
public: public:
GirderAxis(pmacController *pController, int axisNo); GirderAxis(pmacController *pController, int axisNo);
asynStatus move(double position, int relative, double min_velocity, double max_velocity, double acceleration); asynStatus move(double position, int relative, double min_velocity,
double max_velocity, double acceleration);
asynStatus stop(double acceleration); asynStatus stop(double acceleration);
asynStatus poll(bool *moving); asynStatus poll(bool *moving);
protected: protected:
int IsEnable; int IsEnable;
friend class pmacController; friend class pmacController;
friend class pmacV3Controller; friend class pmacV3Controller;
}; };
#endif /* pmacAxis_H */ #endif /* pmacAxis_H */

View File

@ -5,9 +5,9 @@ registrar(EL734Register)
registrar(PhytronRegister) registrar(PhytronRegister)
registrar(EuroMoveRegister) registrar(EuroMoveRegister)
registrar(NanotecRegister) registrar(NanotecRegister)
registrar(pmacControllerRegister) # registrar(pmacControllerRegister)
registrar(C804ControllerRegister) registrar(C804ControllerRegister)
registrar(pmacAsynIPPortRegister) # registrar(pmacAsynIPPortRegister)
registrar(MasterMACSRegister) registrar(MasterMACSRegister)
registrar(SINQControllerRegister) registrar(SINQControllerRegister)