ECMC is a motion control and data acquisition module for use with EPICS system.
git submodule update --init --reference ./
- Motion Control
- Motor record support
- Absolute Positioning
- Relative Positioning
- Constant velocity
- Evaluation of limit and reference switches
- Homing (several different sequences available)
- Low limit (refId = 1)
- High limit (refId = 2)
- Ref. sensor via low limit (refId = 3)
- Ref. sensor via high limit (refId = 4)
- Ref. sensor center via low limit (refId = 5)
- Ref. sensor center via high limit (refId = 6)
- Encoder index via low limit (refId = 11)
- Encoder index via high limit (refId = 12)
- Set position dedicated for auto restore (refId = 15)
- Single turn abs encoder (resolver) ref via low limit (refId = 21)
- Single turn abs encoder (resolver) ref via high limit (refId = 22)
- Set position (refId = 25)
- Interlocks
- Following error
- Max speed
- Ethercat I/O
- Ethercat bus health
- Trajectories:
- Trapetzoidal
- Jerk limited (ruckig, see below)
- Custom:
- Calculated in ecmc plc
- Buffered positions from array (data storage)
- Advanced features
- Virtuel and normal axis
- Modulo movements
- Syncronization (to axis or any I/O) Handled through expressions
- Example slaving "ax2.traj.setpos:=ax1.enc.actpos;"
- Example sync "ax2.traj.setpos:=ax1.traj.setpos;"
- Example phasing "ax2.traj.setpos:=ax1.traj.setpos+100;"
- Example phasing "ax2.traj.setpos:=ax1.traj.setpos+ax3.traj.setpos;"
- Advanced "ax2.traj.setpos:=ax1.traj.setpos*sin(ax3.traj.setpos/100)+ec0.s2.VALUE;"
- Enable amps "ax2.drv.enable:=ax1.drv.enable;"
- Interlocks "ax2.mon.ilockfwd:=ec0.s1.INPUT_1 or ax1.enc.actpos < 100;"
- Data acquisition
- Supoort of many different analog and digital slaves
- Up to 100kHz analog and 1Mhz digital (oversampling slaves)
- Control
- PLC objects can be created with custom sample rate where logic (including motion) can be handled in realtime. (see examples in ecmccfg repository: https://gitlab.esss.lu.se/epics-modules/ecmccfg/-/tree/master/examples/test
- Same syntax as for synchronization:
- "ec0.s45.VALUE:=static.gain*77+ax2.traj.setpos/10;"
- PLC variables can be accessed from EPICS.
- Hardware support:
- Drives: stepper, servo, pulse direction and analog
- I/O: Several analog and digital terminals
- Other: bus-couplers, system terminals
- Current list: https://gitlab.esss.lu.se/epics-modules/ecmccfg/-/tree/master/hardware
- Motor record support
Fastest and easiest way to get started is by using the configuration scripts accessible in ecmccfg repository: https://github.com/paulscherrerinstitute/ecmccfg (or ESS fork https://github.com/icshwi/ecmccfg)
ECMC is configured via EPICS-iocsh:
-
iocsh commands:
- Create an ECMC application:
- ecmcAsynPortDriverConfigure ,, , ,
- Configure ECMC application. Exit ECMC if returns error:
- ecmcConfigOrDie
- Configure ECMC application.
- ecmcConfig
- Print availabe asyn parameters and other info:
- ecmcReport
- asynReport . Same as ecmcReport but also calls asynReport in other modules.
- Create an ECMC application:
-
ASCII-cmds (see doxygen documentation for more information):
- Motion configs. Example:
- ecmcConfigOrDie "Cfg.CreateAxis(,1,)"
- ecmcConfigOrDie "Cfg.SetAxisCntrlKp(,)"
- ...
- Ethercat bus configs. Example:
- ecmcConfigOrDie "Cfg.EcAddEntryComplete(,,,,,,,,,)"
- ...
- Ethercat slave configs (SDO,SoE). Example set max motor current for EL7037 to 1500mA:
- ecmcConfigOrDie "Cfg.EcAddSdo(,0x8010,0x1,1500,2)"
- PLC configuration:
- ecmcConfigOrDie "Cfg.CreatePLC(,)"
- ecmcConfigOrDie "Cfg.LoadPLCFile(,)"
- ecmcConfigOrDie "Cfg.AppendPLCExpr()=ax1.enc.homepos:=25#"
- ...
- Motion configs. Example:
ECMC runs best under certain conditions:
- E3 (ESS EPICS Environment)
- RT-patch
- Settings found in https://github.com/icshwi/realtime-config
- configuration by ecmccfg:
- Open source ethercat master: https://etherlab.org/, https://github.com/icshwi/etherlabmaster
- ExprTK: https://github.com/icshwi/e3-exprtk (https://github.com/ArashPartow/exprtk)
- E3 (ESS EPICS Environment): https://github.com/icshwi/e3
- Real-time configuration: https://github.com/icshwi/realtime-config
- Motor: https://github.com/icshwi/e3-motor (https://github.com/EuropeanSpallationSource/motor)
- Asyn driver: https://github.com/icshwi/e3-asyn
- ecmccfg https://github.com/paulscherrerinstitute/ecmccfg or https://gitlab.esss.lu.se/epics-modules/ecmccfg
- ruckig https://github.com/anderssandstrom/e3-ruckig, https://github.com/anderssandstrom/ruckig Optional modules:
- EthercatMC (motor record driver): https://github.com/icshwi/e3-ethercatmc
Plugins with extra functionality that can be loaded during startup:
- CNC g-code support by grbl: https://github.com/anderssandstrom/ecmc_plugin_grbl
- SocketCAN support (inc. reduced CANOpen support): https://github.com/anderssandstrom/e3-ecmc_plugin_socketcan
- FFTs by kissfft: https://github.com/anderssandstrom/e3-ecmc_plugin_fft
- Raspi wiringPi support: https://github.com/anderssandstrom/e3-ecmc_plugin_raspi
- PVA support from ecmc-plc: https://github.com/anderssandstrom/e3-ecmc_plugin_pva
- Simple scope for ethercat dc slaves): https://github.com/anderssandstrom/e3-ecmc_plugin_scope
https://github.com/epics-modules/ecmc/issues
- ECMC : Anders Sandström, anders.sandstrom@esss.se
- Motor Record : Torsten Bögershausen, torsten.bogershausen@esss.se
- ecmcMotorRecord driver (preferred) : Anders Sandström, anders.sandstrom@esss.se
- (EthercatMC driver : Torsten Bögershausen, torsten.bogershausen@esss.se)