Compare commits
7 Commits
0.1.0
...
static-dep
Author | SHA1 | Date | |
---|---|---|---|
af5d349254 | |||
d71c80fcb3 | |||
78257dc618 | |||
b8c9a58baa | |||
0f68160c16 | |||
5b4210cf4e | |||
d2ccc28a08 |
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[submodule "turboPmac"]
|
||||||
|
path = turboPmac
|
||||||
|
url = https://gitea.psi.ch/lin-epics-modules/turboPmac
|
18
Makefile
18
Makefile
@ -12,12 +12,6 @@ REQUIRED+=motorBase
|
|||||||
# Specify the version of motorBase we want to build against
|
# Specify the version of motorBase we want to build against
|
||||||
motorBase_VERSION=7.2.2
|
motorBase_VERSION=7.2.2
|
||||||
|
|
||||||
# Specify the version of sinqMotor we want to build against
|
|
||||||
sinqMotor_VERSION=0.11.0
|
|
||||||
|
|
||||||
# Specify the version of turboPmac we want to build against
|
|
||||||
turboPmac_VERSION=0.10.0
|
|
||||||
|
|
||||||
# These headers allow to depend on this library for derived drivers.
|
# These headers allow to depend on this library for derived drivers.
|
||||||
HEADERS += src/seleneGuideController.h
|
HEADERS += src/seleneGuideController.h
|
||||||
HEADERS += src/seleneLiftAxis.h
|
HEADERS += src/seleneLiftAxis.h
|
||||||
@ -25,15 +19,27 @@ HEADERS += src/seleneAngleAxis.h
|
|||||||
HEADERS += src/seleneOffsetAxis.h
|
HEADERS += src/seleneOffsetAxis.h
|
||||||
|
|
||||||
# Source files to build
|
# Source files to build
|
||||||
|
SOURCES += turboPmac/sinqMotor/src/msgPrintControl.cpp
|
||||||
|
SOURCES += turboPmac/sinqMotor/src/sinqAxis.cpp
|
||||||
|
SOURCES += turboPmac/sinqMotor/src/sinqController.cpp
|
||||||
|
SOURCES += turboPmac/src/pmacAsynIPPort.c
|
||||||
|
SOURCES += turboPmac/src/turboPmacAxis.cpp
|
||||||
|
SOURCES += turboPmac/src/turboPmacController.cpp
|
||||||
|
SOURCES += turboPmac/src/pmacAsynIPPort.c
|
||||||
SOURCES += src/seleneGuideController.cpp
|
SOURCES += src/seleneGuideController.cpp
|
||||||
SOURCES += src/seleneLiftAxis.cpp
|
SOURCES += src/seleneLiftAxis.cpp
|
||||||
SOURCES += src/seleneAngleAxis.cpp
|
SOURCES += src/seleneAngleAxis.cpp
|
||||||
SOURCES += src/seleneOffsetAxis.cpp
|
SOURCES += src/seleneOffsetAxis.cpp
|
||||||
|
|
||||||
# Store the record files
|
# Store the record files
|
||||||
|
TEMPLATES += turboPmac/sinqMotor/db/asynRecord.db
|
||||||
|
TEMPLATES += turboPmac/sinqMotor/db/sinqMotor.db
|
||||||
|
TEMPLATES += turboPmac/db/turboPmac.db
|
||||||
TEMPLATES += db/seleneGuide.db
|
TEMPLATES += db/seleneGuide.db
|
||||||
|
|
||||||
# This file registers the motor-specific functions in the IOC shell.
|
# This file registers the motor-specific functions in the IOC shell.
|
||||||
|
DBDS += turboPmac/sinqMotor/src/sinqMotor.dbd
|
||||||
|
DBDS += turboPmac/src/turboPmac.dbd
|
||||||
DBDS += src/seleneGuide.dbd
|
DBDS += src/seleneGuide.dbd
|
||||||
|
|
||||||
USR_CFLAGS += -Wall -Wextra -Weffc++ -Wunused-result -Wextra -Werror # -Wpedantic // Does not work because EPICS macros trigger warnings
|
USR_CFLAGS += -Wall -Wextra -Weffc++ -Wunused-result -Wextra -Werror # -Wpedantic // Does not work because EPICS macros trigger warnings
|
||||||
|
@ -90,13 +90,13 @@ seleneVirtualAxes("$(NAME)", 1, 2, 3, 4, 5, 6, 9, 10);
|
|||||||
# Parametrize the EPICS record database with the substitution file named after the motor controller.
|
# Parametrize the EPICS record database with the substitution file named after the motor controller.
|
||||||
# In order to provide the PVs for absolute position and normalization, the
|
# In order to provide the PVs for absolute position and normalization, the
|
||||||
# corresponding `seleneGuide.db` file is loaded here as well.
|
# corresponding `seleneGuide.db` file is loaded here as well.
|
||||||
epicsEnvSet("SINQDBPATH","$(sinqMotor_DB)/sinqMotor.db")
|
epicsEnvSet("SINQDBPATH","$(seleneGuide_DB)/sinqMotor.db")
|
||||||
dbLoadTemplate("$(TOP)/motors/$(NAME).substitutions", "INSTR=$(INSTR)$(NAME):,CONTROLLER=$(NAME)")
|
dbLoadTemplate("$(TOP)/motors/$(NAME).substitutions", "INSTR=$(INSTR)$(NAME):,CONTROLLER=$(NAME)")
|
||||||
epicsEnvSet("SINQDBPATH","$(turboPmac_DB)/turboPmac.db")
|
epicsEnvSet("SINQDBPATH","$(seleneGuide_DB)/turboPmac.db")
|
||||||
dbLoadTemplate("$(TOP)/motors/$(NAME).substitutions", "INSTR=$(INSTR)$(NAME):,CONTROLLER=$(NAME)")
|
dbLoadTemplate("$(TOP)/motors/$(NAME).substitutions", "INSTR=$(INSTR)$(NAME):,CONTROLLER=$(NAME)")
|
||||||
epicsEnvSet("SINQDBPATH","$(seleneGuide_DB)/seleneGuide.db")
|
epicsEnvSet("SINQDBPATH","$(seleneGuide_DB)/seleneGuide.db")
|
||||||
dbLoadTemplate("$(TOP)/motors/$(NAME).substitutions", "INSTR=$(INSTR)$(NAME):,CONTROLLER=$(NAME)")
|
dbLoadTemplate("$(TOP)/motors/$(NAME).substitutions", "INSTR=$(INSTR)$(NAME):,CONTROLLER=$(NAME)")
|
||||||
dbLoadRecords("$(sinqMotor_DB)/asynRecord.db","P=$(INSTR)$(NAME),PORT=$(ASYN_PORT)")
|
dbLoadRecords("$(seleneGuide_DB)/asynRecord.db","P=$(INSTR)$(NAME),PORT=$(ASYN_PORT)")
|
||||||
```
|
```
|
||||||
|
|
||||||
### Substitution file
|
### Substitution file
|
||||||
@ -243,7 +243,7 @@ $z_{iH} = z_i + \mathrm{DHLM}_i$
|
|||||||
|
|
||||||
$z_{iL} = z_i + \mathrm{DLLM}_i$
|
$z_{iL} = z_i + \mathrm{DLLM}_i$
|
||||||
|
|
||||||
If $z_{iH} would exceed the corresponding absolute high limit $z_{iH,abs}$, it is set to $z_{iH,abs}$. The same holds true for the lower limits.
|
If $z_{iH}$ would exceed the corresponding absolute high limit $z_{iH,abs}$, it is set to $z_{iH,abs}$. The same holds true for the lower limits.
|
||||||
|
|
||||||
#### Lift axis
|
#### Lift axis
|
||||||
|
|
||||||
@ -277,6 +277,7 @@ For axes which are located behind the center of rotation (lever arm $x_i - x_{gu
|
|||||||
|
|
||||||
$\alpha_{6H} = -\arctan((z_{6L} - z_{guide} - \Delta z_6) / (x_6 - x_{guide}))$
|
$\alpha_{6H} = -\arctan((z_{6L} - z_{guide} - \Delta z_6) / (x_6 - x_{guide}))$
|
||||||
|
|
||||||
|
|
||||||
$\alpha_{6L} = -\arctan((z_{6H} - z_{guide} - \Delta z_6) / (x_6 - x_{guide}))$
|
$\alpha_{6L} = -\arctan((z_{6H} - z_{guide} - \Delta z_6) / (x_6 - x_{guide}))$
|
||||||
|
|
||||||
### Versioning
|
### Versioning
|
||||||
|
@ -60,7 +60,7 @@ seleneLiftAxis::seleneLiftAxis(seleneGuideController *pC, int axis1No,
|
|||||||
for (int i = 0; i < numAxes_; i++) {
|
for (int i = 0; i < numAxes_; i++) {
|
||||||
oAxis = dynamic_cast<seleneOffsetAxis *>(pC->getAxis(axisNos[i]));
|
oAxis = dynamic_cast<seleneOffsetAxis *>(pC->getAxis(axisNos[i]));
|
||||||
if (oAxis == nullptr) {
|
if (oAxis == nullptr) {
|
||||||
asynPrint(pC_->asynUserSelf(), ASYN_TRACE_ERROR,
|
asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR,
|
||||||
"Controller \"%s\", axis %d => %s, line %d\nFATAL ERROR "
|
"Controller \"%s\", axis %d => %s, line %d\nFATAL ERROR "
|
||||||
"(given axis number %d is not an instance of "
|
"(given axis number %d is not an instance of "
|
||||||
"seleneOffsetAxis).\nTerminating IOC.\n",
|
"seleneOffsetAxis).\nTerminating IOC.\n",
|
||||||
@ -118,7 +118,7 @@ asynStatus seleneLiftAxis::init() {
|
|||||||
&motorRecResolution);
|
&motorRecResolution);
|
||||||
if (status == asynParamUndefined) {
|
if (status == asynParamUndefined) {
|
||||||
if (now + maxInitTime < time(NULL)) {
|
if (now + maxInitTime < time(NULL)) {
|
||||||
asynPrint(pC_->asynUserSelf(), ASYN_TRACE_ERROR,
|
asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR,
|
||||||
"Controller \"%s\", axis %d => %s, line "
|
"Controller \"%s\", axis %d => %s, line "
|
||||||
"%d\nInitializing the parameter library failed.\n",
|
"%d\nInitializing the parameter library failed.\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__,
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__,
|
||||||
@ -191,7 +191,7 @@ asynStatus seleneLiftAxis::normalizePositions() {
|
|||||||
double lift = 0.0;
|
double lift = 0.0;
|
||||||
double angle = 0.0;
|
double angle = 0.0;
|
||||||
asynStatus status = asynSuccess;
|
asynStatus status = asynSuccess;
|
||||||
char response[pC_->MAXBUF_];
|
char response[pC_->MAXBUF_] = {0};
|
||||||
double encoderPositions[6] = {0.0};
|
double encoderPositions[6] = {0.0};
|
||||||
double absolutePositions[6] = {0.0};
|
double absolutePositions[6] = {0.0};
|
||||||
int nvals = 0;
|
int nvals = 0;
|
||||||
@ -268,7 +268,8 @@ asynStatus seleneLiftAxis::doPoll(bool *moving) {
|
|||||||
// Status of parameter library operations
|
// Status of parameter library operations
|
||||||
asynStatus pl_status = asynSuccess;
|
asynStatus pl_status = asynSuccess;
|
||||||
|
|
||||||
char response[pC_->MAXBUF_], userMessage[pC_->MAXBUF_] = {0};
|
char response[pC_->MAXBUF_] = {0};
|
||||||
|
char userMessage[pC_->MAXBUF_] = {0};
|
||||||
|
|
||||||
int nvals = 0;
|
int nvals = 0;
|
||||||
int axStatus = 0;
|
int axStatus = 0;
|
||||||
@ -475,7 +476,8 @@ asynStatus seleneLiftAxis::targetPosition(double *targetPosition) {
|
|||||||
|
|
||||||
asynStatus seleneLiftAxis::startCombinedMove() {
|
asynStatus seleneLiftAxis::startCombinedMove() {
|
||||||
|
|
||||||
char command[pC_->MAXBUF_], response[pC_->MAXBUF_];
|
char command[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;
|
asynStatus status = asynSuccess;
|
||||||
@ -527,7 +529,7 @@ asynStatus seleneLiftAxis::stop(double acceleration) {
|
|||||||
// Status of parameter library operations
|
// Status of parameter library operations
|
||||||
asynStatus pl_status = asynSuccess;
|
asynStatus pl_status = asynSuccess;
|
||||||
|
|
||||||
char response[pC_->MAXBUF_];
|
char response[pC_->MAXBUF_] = {0};
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|
||||||
@ -536,7 +538,7 @@ asynStatus seleneLiftAxis::stop(double acceleration) {
|
|||||||
|
|
||||||
if (rw_status != asynSuccess) {
|
if (rw_status != asynSuccess) {
|
||||||
asynPrint(
|
asynPrint(
|
||||||
pC_->asynUserSelf(), ASYN_TRACE_ERROR,
|
pC_->pasynUser(), ASYN_TRACE_ERROR,
|
||||||
"Controller \"%s\", axis %d => %s, line %d\nStopping the movement "
|
"Controller \"%s\", axis %d => %s, line %d\nStopping the movement "
|
||||||
"failed.\n",
|
"failed.\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__);
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__);
|
||||||
@ -586,7 +588,7 @@ asynStatus seleneLiftAxis::readEncoderType() {
|
|||||||
asynStatus seleneLiftAxis::doHome(double minVelocity, double maxVelocity,
|
asynStatus seleneLiftAxis::doHome(double minVelocity, double maxVelocity,
|
||||||
double acceleration, int forwards) {
|
double acceleration, int forwards) {
|
||||||
|
|
||||||
char response[pC_->MAXBUF_];
|
char response[pC_->MAXBUF_] = {0};
|
||||||
|
|
||||||
// No answer expected
|
// No answer expected
|
||||||
return pC_->writeRead(axisNo_,
|
return pC_->writeRead(axisNo_,
|
||||||
|
@ -99,7 +99,7 @@ asynStatus seleneOffsetAxis::init() {
|
|||||||
&motorRecResolution);
|
&motorRecResolution);
|
||||||
if (status == asynParamUndefined) {
|
if (status == asynParamUndefined) {
|
||||||
if (now + maxInitTime < time(NULL)) {
|
if (now + maxInitTime < time(NULL)) {
|
||||||
asynPrint(pC_->asynUserSelf(), ASYN_TRACE_ERROR,
|
asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR,
|
||||||
"Controller \"%s\", axis %d => %s, line "
|
"Controller \"%s\", axis %d => %s, line "
|
||||||
"%d\nInitializing the parameter library failed.\n",
|
"%d\nInitializing the parameter library failed.\n",
|
||||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__,
|
pC_->portName, axisNo_, __PRETTY_FUNCTION__,
|
||||||
@ -156,8 +156,9 @@ asynStatus seleneOffsetAxis::doPoll(bool *moving) {
|
|||||||
int error = 0;
|
int error = 0;
|
||||||
int nvals = 0;
|
int nvals = 0;
|
||||||
|
|
||||||
char command[pC_->MAXBUF_], response[pC_->MAXBUF_],
|
char command[pC_->MAXBUF_] = {0};
|
||||||
userMessage[pC_->MAXBUF_];
|
char response[pC_->MAXBUF_] = {0};
|
||||||
|
char userMessage[pC_->MAXBUF_] = {0};
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|
||||||
@ -207,8 +208,8 @@ asynStatus seleneOffsetAxis::doPoll(bool *moving) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: To be removed, once the real limits are derived
|
// TODO: To be removed, once the real limits are derived
|
||||||
//highLimit = 10.0;
|
// highLimit = 10.0;
|
||||||
//lowLimit = -10.0;
|
// lowLimit = -10.0;
|
||||||
|
|
||||||
// Convert into lift coordinate system
|
// Convert into lift coordinate system
|
||||||
absoluteHighLimitLiftCS_ = highLimit - zOffset_;
|
absoluteHighLimitLiftCS_ = highLimit - zOffset_;
|
||||||
@ -368,7 +369,6 @@ asynStatus seleneOffsetAxisCreateAxis(const char *portName, int axisNo,
|
|||||||
portName, __PRETTY_FUNCTION__, __LINE__);
|
portName, __PRETTY_FUNCTION__, __LINE__);
|
||||||
return asynError;
|
return asynError;
|
||||||
}
|
}
|
||||||
// Unsafe cast of the pointer to an asynPortDriver
|
|
||||||
asynPortDriver *apd = (asynPortDriver *)(ptr);
|
asynPortDriver *apd = (asynPortDriver *)(ptr);
|
||||||
|
|
||||||
// Safe downcast
|
// Safe downcast
|
||||||
|
1
turboPmac
Submodule
1
turboPmac
Submodule
Submodule turboPmac added at 2f83060ec1
Reference in New Issue
Block a user