Compare commits

...

9 Commits

4 changed files with 28 additions and 15 deletions

View File

@ -4,7 +4,7 @@
## Overview
This is a driver for the Turbo PMAC motion controller with the SINQ communication protocol. It is based on the sinqMotor shared library (https://git.psi.ch/sinq-epics-modules/sinqmotor). The header files contain detailed documentation for all public functions. The headers themselves are exported when building the library to allow other drivers to depend on this one.
This is a driver for the Turbo PMAC motion controller with the SINQ communication protocol. It is based on the sinqMotor shared library (https://gitea.psi.ch/lin-epics-modules/sinqMotor). The header files contain detailed documentation for all public functions. The headers themselves are exported when building the library to allow other drivers to depend on this one.
## User guide
@ -14,8 +14,6 @@ The folder "utils" contains utility scripts for working with pmac motor controll
- writeRead.py: Allows sending commands to and receiving commands from a pmac controller over an ethernet connection.
- analyzeTcpDump.py: Parse the TCP communication between an IOC and a MCU and format it into a dictionary. "demo.py" shows how this data can be easily visualized for analysis.
### IOC startup script
turboPmac exports the following IOC shell functions:

View File

@ -71,6 +71,20 @@ turboPmacAxis::turboPmacAxis(turboPmacController *pC, int axisNo,
exit(-1);
}
// Even though this happens already in sinqAxis, a default value for
// motorMessageText is set here again, because apparently the sinqAxis
// constructor is not run before the string is accessed?
status = setStringParam(pC_->motorMessageText(), "");
if (status != asynSuccess) {
asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line %d:\nFATAL ERROR "
"(setting a parameter value failed "
"with %s)\n. Terminating IOC",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->stringifyAsynStatus(status));
exit(-1);
}
// turboPmac motors can always be disabled
status = pC_->setIntegerParam(axisNo_, pC_->motorCanDisable(), 1);
if (status != asynSuccess) {

View File

@ -31,7 +31,7 @@ class turboPmacAxis : public sinqAxis {
* value is currently not used.
* @return asynStatus
*/
asynStatus stop(double acceleration);
virtual asynStatus stop(double acceleration);
/**
* @brief Implementation of the `doHome` function from sinqAxis. The
@ -43,8 +43,8 @@ class turboPmacAxis : public sinqAxis {
* @param forwards
* @return asynStatus
*/
asynStatus doHome(double minVelocity, double maxVelocity,
double acceleration, int forwards);
virtual asynStatus doHome(double minVelocity, double maxVelocity,
double acceleration, int forwards);
/**
* @brief Implementation of the `doPoll` function from sinqAxis. The
@ -53,7 +53,7 @@ class turboPmacAxis : public sinqAxis {
* @param moving
* @return asynStatus
*/
asynStatus doPoll(bool *moving);
virtual asynStatus doPoll(bool *moving);
/**
* @brief Implementation of the `doMove` function from sinqAxis. The
@ -66,8 +66,9 @@ class turboPmacAxis : public sinqAxis {
* @param acceleration
* @return asynStatus
*/
asynStatus doMove(double position, int relative, double min_velocity,
double max_velocity, double acceleration);
virtual asynStatus doMove(double position, int relative,
double min_velocity, double max_velocity,
double acceleration);
/**
* @brief Readout of some values from the controller at IOC startup
@ -79,7 +80,7 @@ class turboPmacAxis : public sinqAxis {
*
* @return asynStatus
*/
asynStatus init();
virtual asynStatus init();
/**
* @brief Implementation of the `doReset` function from sinqAxis.
@ -87,7 +88,7 @@ class turboPmacAxis : public sinqAxis {
* @param on
* @return asynStatus
*/
asynStatus doReset();
virtual asynStatus doReset();
/**
* @brief Enable / disable the axis.
@ -95,7 +96,7 @@ class turboPmacAxis : public sinqAxis {
* @param on
* @return asynStatus
*/
asynStatus enable(bool on);
virtual asynStatus enable(bool on);
/**
* @brief Read the encoder type (incremental or absolute) for this axis from
@ -103,14 +104,14 @@ class turboPmacAxis : public sinqAxis {
*
* @return asynStatus
*/
asynStatus readEncoderType();
virtual asynStatus readEncoderType();
/**
* @brief Trigger a rereading of the encoder position.
*
* @return asynStatus
*/
asynStatus rereadEncoder();
virtual asynStatus rereadEncoder();
/**
* @brief Interpret the error code and populate the user message accordingly