Conflicts: .gitignore sinqEPICSApp/src/pmacAxis.cpp sinqEPICSApp/src/pmacAxis.h sinqEPICSApp/src/pmacController.cpp sinqEPICSApp/src/pmacController.h
135 lines
3.9 KiB
C++
135 lines
3.9 KiB
C++
/********************************************
|
|
* pmacAxis.cpp
|
|
*
|
|
* PMAC Asyn motor based on the
|
|
* asynMotorAxis class.
|
|
*
|
|
* Matthew Pearson
|
|
* 23 May 2012
|
|
*
|
|
* Modified to use the MsgTxt field for SINQ
|
|
*
|
|
* Mark Koennecke, January 2019
|
|
*
|
|
* EXtended with special motor axis for the Selene
|
|
* guide, Mark Koennecke, February 2020
|
|
********************************************/
|
|
|
|
#ifndef pmacAxis_H
|
|
#define pmacAxis_H
|
|
|
|
#include "SINQController.h"
|
|
#include "SINQAxis.h"
|
|
|
|
class pmacController;
|
|
class SeleneController;
|
|
|
|
class pmacAxis : public SINQAxis
|
|
{
|
|
public:
|
|
/* These are the methods we override from the base class */
|
|
pmacAxis(pmacController *pController, int axisNo, bool enable=true);
|
|
virtual ~pmacAxis();
|
|
asynStatus move(double position, int relative, double min_velocity, double max_velocity, double acceleration);
|
|
asynStatus moveVelocity(double min_velocity, double max_velocity, double acceleration);
|
|
asynStatus home(double min_velocity, double max_velocity, double acceleration, int forwards);
|
|
asynStatus stop(double acceleration);
|
|
asynStatus poll(bool *moving);
|
|
asynStatus setPosition(double position);
|
|
|
|
protected:
|
|
pmacController *pC_;
|
|
|
|
asynStatus getAxisStatus(bool *moving);
|
|
asynStatus getAxisInitialStatus(void);
|
|
|
|
double setpointPosition_;
|
|
double encoderPosition_;
|
|
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;
|
|
time_t status6Time;
|
|
int starting;
|
|
int homing;
|
|
double statusPos;
|
|
|
|
time_t next_poll;
|
|
|
|
bool autoEnable;
|
|
|
|
friend class pmacController;
|
|
};
|
|
/*----------------------------------------------------------------------------------------------*/
|
|
class pmacHRPTAxis : public pmacAxis
|
|
{
|
|
public:
|
|
pmacHRPTAxis(pmacController *pController, int axisNo) : pmacAxis(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 SeleneAxis : public pmacAxis
|
|
{
|
|
public:
|
|
SeleneAxis(SeleneController *pController, int axisNo, double limitTarget);
|
|
asynStatus move(double position, int relative, double min_velocity, double max_velocity, double acceleration);
|
|
asynStatus setPosition(double position);
|
|
asynStatus home(double min_velocity, double max_velocity, double acceleration, int forwards);
|
|
|
|
protected:
|
|
friend class SeleneController;
|
|
friend class pmacController;
|
|
|
|
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
|
|
two motors. One acts as a slave and only writes a new target, the other also sets a new target and sends the
|
|
actual 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
|
|
sends the drive command. This causes all 6 motors to drive synchronously to their new targets. This is
|
|
implemented through the LIFTSEGMENT function code.
|
|
|
|
Mark Koennecke, February 2020
|
|
|
|
The axis should not be enabled automatically
|
|
|
|
Michele Brambilla, February 2020
|
|
|
|
*/
|
|
class LiftAxis : public pmacAxis
|
|
{
|
|
public:
|
|
LiftAxis(pmacController *pController, int axisNo) : pmacAxis((pmacController *)pController,axisNo) {};
|
|
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;
|
|
};
|
|
|
|
#endif /* pmacAxis_H */
|