Git Product home page Git Product logo

motorsmaract's Introduction

motorSmarAct

EPICS motor drivers for the following SmarAct controllers: MCS, MCS2, SCU

Build Status

motorSmarAct is a submodule of motor. When motorSmarAct is built in the motor/modules directory, no manual configuration is needed.

motorSmarAct can also be built outside of motor by copying it's EXAMPLE_RELEASE.local file to RELEASE.local and defining the paths to MOTOR and itself.

motorSmarAct contains an example IOC that is built if CONFIG_SITE.local sets BUILD_IOCS = YES. The example IOC can be built outside of driver module.

motorsmaract's People

Contributors

kmpeters avatar markrivers avatar zanmaticpratnemer avatar hxu-bnl avatar davidalexandershapiro avatar prjemian avatar keenanlang avatar chrschroeder avatar djvine avatar dirk-zimoch avatar julreinhardt avatar kivel avatar pi-srau avatar shadowguy avatar leeyanglblbcs avatar

Stargazers

Matvei avatar  avatar  avatar

Watchers

James Cloos avatar  avatar  avatar  avatar  avatar  avatar Kurt Goetze avatar  avatar

motorsmaract's Issues

MCS2 zeroes position on power cycle

When the MCS2 controller is power cycled it resets the position to zero.

Is there a way to have the motor record restore the position on a connect/reconnect event?

Alternatively, is there a flag that indicates a disconnect/reconnect cycle occurred and that the user should rehome the stages?

Allow specifying unused MCS2 channels

If there is an unused channel between used channels (channel 0 and 2 are connected to stages and channel 1 is not), it causes timeouts when querying the readback position of the unused channel. This can give the appearance that the driver is taking much longer to poll than the specified idle polling period.

One possible workaround for this problem is to add a way for the used/unused axes to be specified from the iocsh and then make the getAxis methods in the only return an axis pointer for used channels.

smaract scu on windows x86_64 error

I got this error when trying to start smarAct IOC on windows.
Does anyone know what the cause might be?

C:\epics\modules\synApps_6_1_epics7\support\motor-R7-2-1\modules\motorSmarAct\iocs\smarActIOC\iocBoot\iocSmarAct>..\..\bin\windows-x64\smarAct.exe st.cmd
#!../../bin/linux-x86_64/smarAct
< envPaths
epicsEnvSet("IOC","iocSmarAct")
epicsEnvSet("TOP","C:/epics/modules/synApps_6_1_epics7/support/motor-R7-2-1/modules/motorSmarAct/iocs/smarActIOC")
epicsEnvSet("AUTOSAVE","C:/epics/modules/synApps_6_1_epics7/support/autosave-R5-10")
epicsEnvSet("MOTOR","C:/epics/modules/synApps_6_1_epics7/support/motor-R7-2-1")
epicsEnvSet("ASYN","C:/epics/modules/synApps_6_1_epics7/support/asyn-R4-38")
epicsEnvSet("SNCSEQ","C:/epics/modules/synApps_6_1_epics7/support/seq-2-2-7")
epicsEnvSet("BUSY","C:/epics/modules/synApps_6_1_epics7/support/busy-R1-7-2")
epicsEnvSet("IPAC","C:/epics/modules/synApps_6_1_epics7/support/ipac-2-15")
epicsEnvSet("EPICS_BASE","C:/epics/base-7.0.4")
epicsEnvSet("SUPPORT","C:/epics/modules/synApps_6_1_epics7/support")
cd "C:/epics/modules/synApps_6_1_epics7/support/motor-R7-2-1/modules/motorSmarAct/iocs/smarActIOC"
## Register all support components
dbLoadDatabase "dbd/smarAct.dbd"
smarAct_registerRecordDeviceDriver pdbbase
cd "C:/epics/modules/synApps_6_1_epics7/support/motor-R7-2-1/modules/motorSmarAct/iocs/smarActIOC/iocBoot/iocSmarAct"
## motorUtil (allstop & alldone)
dbLoadRecords("C:/epics/modules/synApps_6_1_epics7/support/motor-R7-2-1/db/motorUtil.db", "P=smarAct:")
# Uncomment one of the following lines for MCS or MCS2 controller
#< smaractmcs.iocsh
#< smaractmcs2.iocsh
< smaractscu.iocsh
### Motors
# Motors substitutions, customize this for your motor
dbLoadTemplate "motor.substitutions.smaractscu"
# Configure each controller
drvAsynSerialPortConfigure("serial1","COM3")
asynOctetSetOutputEos("serial1",0,"\n")
asynOctetSetInputEos("serial1",0,"\n")
#asynSetTraceIOMask("serial1",0,2)
#asynSetTraceMask("serial1",0,9)
#drvAsynSerialPortConfigure("serial2","COM6")
#asynOctetSetOutputEos("serial2",0,"\n")
#asynOctetSetInputEos("serial2",0,"\n")
#asynSetTraceIOMask("serial2",0,2)
#asynSetTraceMask("serial2",0,9)
# Controller port, asyn port, number of axis, moving poll period, idle poll period
# smarActSCUCreateController(const char *motorPortName, const char *ioPortName, int numAxes, double movingPollPeriod, double idlePollPeriod);
smarActSCUCreateController("SCU1", "serial1", 2, .05, 1.0)
#smarActSCUCreateController("SCU2", "serial2", 3, .05, 1.0)
#asynSetTraceMask("SCU1", 0, 11)
#asynSetTraceMask("SCU1", 1, 11)
#asynSetTraceMask("SCU1", 2, 11)
#asynSetTraceMask("SCU2", 0, 11)
#asynSetTraceMask("SCU2", 1, 11)
#asynSetTraceMask("SCU2", 2, 11)
# Controller port, axis number, controller channel
# smarActSCUCreateAxis(const char *motorPortName, int axisNumber, int channel)
smarActSCUCreateAxis("SCU1", 0, 0);
2021/03/15 15:20:32.572 ERROR: sendCmd: status=1, sent: :GCLF0, received:
SmarActSCUAxis::SmarActSCUAxis -- channel 0 ASYN error 1
#smarActSCUCreateAxis("SCU1", 1, 1);
#smarActSCUCreateAxis("SCU1", 2, 2);
#smarActSCUCreateAxis("SCU2", 0, 0);
#smarActSCUCreateAxis("SCU2", 1, 1);
#smarActSCUCreateAxis("SCU2", 2, 2);
# Need to sleep for a second to allow poller to run.
# Without this the motors won't have their initial positions
epicsThreadSleep(1.0)
##
iocInit
Starting iocInit
############################################################################
## EPICS R7.0.4
## Rev. 2021-03-12T11:35
############################################################################
2021/03/15 15:20:34.587 ERROR: sendCmd: status=1, sent: :GA0, received:
2021/03/15 15:20:34.589 devMotorAsyn::init_record: smarAct:m2 pasynGenericPointer->read returned 2021/03/15 15:20:34.589 devMotorAsyn::asynCallback: smarAct:m2 pasyn{Float64,Int32}->write returned
2021/03/15 15:20:34.589 devMotorAsyn::asynCallback: smarAct:m2 pasyn{Float64,Int32}->write returned
2021/03/15 15:20:34.590 devMotorAsyn::asynCallback: smarAct:m2 pasyn{Float64,Int32}->write returned
iocRun: All initialization complete
## motorUtil (allstop & alldone)
motorUtilInit("smarAct:")
# Boot complete
epics> 2021/03/15 15:20:36.666 ERROR: sendCmd: status=1, sent: :GA0, received:
2021/03/15 15:20:36.666 smarAct:m2Offset devAsynFloat64::processCallbackOutput process write error
2021/03/15 15:20:36.668 smarAct:m2Resolution devAsynFloat64::processCallbackOutput process write error
2021/03/15 15:20:36.669 smarAct:m2Direction devAsynInt32::processCallbackOutput process write error
2021/03/15 15:20:38.742 ERROR: sendCmd: status=1, sent: :GA0, received:
2021/03/15 15:20:40.816 ERROR: sendCmd: status=1, sent: :GA0, received:
2021/03/15 15:20:42.888 ERROR: sendCmd: status=1, sent: :GA0, received:
2021/03/15 15:20:46.964 ERROR: sendCmd: status=1, sent: :GA0, received:
2021/03/15 15:20:49.046 ERROR: sendCmd: status=1, sent: :GA0, received:
2021/03/15 15:20:51.129 ERROR: sendCmd: status=1, sent: :GA0, received:
2021/03/15 15:20:53.206 ERROR: sendCmd: status=1, sent: :GA0, received:
2021/03/15 15:20:57.299 ERROR: sendCmd: status=1, sent: :GA0, received:
2021/03/15 15:20:59.391 ERROR: sendCmd: status=1, sent: :GA0, received:
2021/03/15 15:21:03.469 ERROR: sendCmd: status=1, sent: :GA0, received:
2021/03/15 15:21:05.549 ERROR: sendCmd: status=1, sent: :GA0, received:
2021/03/15 15:21:09.647 ERROR: sendCmd: status=1, sent: :GA0, received:
2021/03/15 15:21:13.735 ERROR: sendCmd: status=1, sent: :GA0, received:
2021/03/15 15:21:15.811 ERROR: sendCmd: status=1, sent: :GA0, received:
2021/03/15 15:21:19.905 ERROR: sendCmd: status=1, sent: :GA0, received:
2021/03/15 15:21:21.985 ERROR: sendCmd: status=1, sent: :GA0, received:

epics>
epics> 2021/03/15 15:21:24.063 ERROR: sendCmd: status=1, sent: :GA0, received:
e2021/03/15 15:21:26.139 ERROR: sendCmd: status=1, sent: :GA0, received:
xit

SmarAct releasing motors with new sensor types

The MCS driver, on creation, sends the command "GST" to get the axis' sensor type and then checks that value against a list of known values to see if it is dealing with a rotary motor or a linear one. Unfortunately, SmarAct is still releasing new motors that report new sensor types that aren't included in the list. Linear motors will default to correct operation, but new rotary motors don't work with the driver.

We could add the new sensor types to the list in the driver, but that would just be kicking the problem down the road a bit. I suggest switching the code to just send the command "GA" or "GP" and check which command sends a readable reply and which sends error code 143.

Making rint static breaks VxWorks builds

Commit e3ec0a9 breaks builds on VxWorks:

../smarActMCSMotorDriver.cpp: In function 'double rint(double)':
../smarActMCSMotorDriver.cpp:41: error: 'double rint(double)' was declared 'extern' and later 'static'
/APSshare/vw/vxWorks-6.9.4/vxworks-6.9.4/target/h/math.h:104: error: previous declaration of 'double rint(double)'
make[5]: *** [smarActMCSMotorDriver.o] Error 1
make[5]: Leaving directory `/net/s100dserv/xorApps/epics/motor-devel/support/motor-git/modules/motorSmarAct/smarActApp/src/O.vxWorks-ppc32'
make[4]: *** [install.vxWorks-ppc32] Error 2
make[4]: Leaving directory `/net/s100dserv/xorApps/epics/motor-devel/support/motor-git/modules/motorSmarAct/smarActApp/src'
make[3]: *** [src.install] Error 2
make[3]: Leaving directory `/net/s100dserv/xorApps/epics/motor-devel/support/motor-git/modules/motorSmarAct/smarActApp'
make[2]: *** [smarActApp.install] Error 2
make[2]: Leaving directory `/net/s100dserv/xorApps/epics/motor-devel/support/motor-git/modules/motorSmarAct'
make[1]: *** [motorSmarAct.install] Error 2
make[1]: Leaving directory `/net/s100dserv/xorApps/epics/motor-devel/support/motor-git/modules'
make: *** [modules.install] Error 2

SmartAct MCS failing at startup

Hi,
I'm trying to use the smarAct IOC with a gen1 MCS controller but it seems to be failing right after smartActMCSCreateAxis.
It looks like the GCLS command is waiting for a non-E response and this controller is returning E0,240 instead. I've attached the output with the asynSetTraceMask.
smarActIOC.txt

MCS2: unable to decode no-sensor-present error

If an axis is disconnected when the IOC starts, no-sensor-present errors occur during startup:

2022/04/06 16:32:00.198 MCS2Axis::clearErrors: Unable to decode 259
2022/04/06 16:32:00.199 MCS2Axis::clearErrors: Unable to decode 259
2022/04/06 16:32:00.199 MCS2Axis::clearErrors: Unable to decode 259
2022/04/06 16:32:00.200 MCS2Axis::clearErrors: Unable to decode 259
2022/04/06 16:32:00.201 MCS2Axis::clearErrors: Unable to decode 259
2022/04/06 16:32:00.202 MCS2Axis::clearErrors: Unable to decode 259
2022/04/06 16:32:00.203 MCS2Axis::clearErrors: Unable to decode 259
2022/04/06 16:32:00.204 MCS2Axis::clearErrors: Unable to decode 259
2022/04/06 16:32:00.205 MCS2Axis::clearErrors: Unable to decode 259
2022/04/06 16:32:00.205 MCS2Axis::clearErrors: Unable to decode 259
2022/04/06 16:32:00.206 MCS2Axis::clearErrors: Unable to decode 259
2022/04/06 16:32:00.207 MCS2Axis::clearErrors: Unable to decode 259
2022/04/06 16:32:00.208 MCS2Controller::MCS2Controller: Device Name: "MCS2-00000807"
259,"no sensor present"259,"no sensor present"259,"no sensor present"259,"no sensor present"259,"no sensor present"259,"no sensor present"259,"no sensor present"259,"no sensor present"259,"no sensor present"259,"no sensor present"259,"no sensor present"259,"no sensor present"

This error should be handled in the following switch statement:

switch (errorCode){
case 0: sprintf(errorMsg, "No error");
break;
case -101: sprintf(errorMsg, "Invalid character");
break;
case -103: sprintf(errorMsg, "Invalid seperator");
break;
case -104: sprintf(errorMsg, "Data type error");
break;
case -108: sprintf(errorMsg, "Parameter not allowed");
break;
case -109: sprintf(errorMsg, "Missing parameter");
break;
case -113: sprintf(errorMsg, "Command not exist");
break;
case -151: sprintf(errorMsg, "Invalid string");
break;
case -350: sprintf(errorMsg, "Queue overflow");
break;
case -363: sprintf(errorMsg, "Buffer overrun");
break;
default: sprintf(errorMsg, "Unable to decode %d", errorCode);
break;

It isn't obvious to me why the no-sensor-present error number is positive but the others are negative.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.