Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a1110a3aa4 | |||
| 4930b2bfeb | |||
| eea8ea48e9 | |||
| 817b1a2b8d | |||
| 876ddb1d4a | |||
| 7550551cc4 | |||
| 0c5f9a4091 |
@@ -16,8 +16,7 @@ OPT_CXXFLAGS_YES = -O3
|
||||
|
||||
# dependencies
|
||||
ECmasterECMC_VERSION = v1.1.0
|
||||
# ecmc_VERSION = 9.2.0
|
||||
ecmc_VERSION = safety3
|
||||
ecmc_VERSION = 9
|
||||
|
||||
################################################################################
|
||||
# THIS RELATES TO THE EtherCAT MASTER LIBRARY
|
||||
|
||||
@@ -24,7 +24,7 @@ For initiation of new movements, the target velocity will be limited to 95% of t
|
||||
## Interface
|
||||
Basically the safey system is interfaced with three binary signals (ethercat I/O):
|
||||
* Ramp down command (from safety system to ecmc). 0 means ramp down command is active.
|
||||
* Axis stand still status (to safety system from ecmc). 1 means that all axes are at rest
|
||||
* Axis stand still status (to safety system from ecmc). 1 means that all axes are at rest _AND_ disabled
|
||||
* Limitation of velocity (optional). 0 means limitation of velocity is acrive
|
||||
|
||||
If, for instance, an safety event is triggerd by the safety system, it will immediately command this plugin to rampdown velocity of all axes (that a configured to stop). When all axes, that are configured to rampdown, have stopped then this plugin will disable the axes and set an ethercat output informing the safety system that the axes are standstill. After a certain timout the safety system will make sure power is removed from the motion axes by triggering an STO or removing power. The removal of power or triggering of STO will made regardless if the axes are at rest or not. A reset of the safety system, allowing power to the drives, will only be possible once the safety system gets a confirmation that all axes are at rest.
|
||||
|
||||
@@ -50,7 +50,7 @@ drive:
|
||||
- 14 # Error 2 (if no drive error bit then leave empty)
|
||||
|
||||
encoder:
|
||||
numerator: 720 # Scaling numerator example 360 deg/rev
|
||||
numerator: 720 # 2mm Scaling numerator example 360 deg/rev
|
||||
denominator: 8192 # Scaling denominator example 4096 ticks per 360 degree
|
||||
# type: 0 # Type: 0=Incremental, 1=Absolute
|
||||
bits: 16 # Total bit count of encoder raw data
|
||||
@@ -100,6 +100,10 @@ controller:
|
||||
Kp: 1 # Kp proportinal gain
|
||||
Ki: 0.02 # Ki integral gain
|
||||
Kd: 0 # Kd derivative gain
|
||||
limits:
|
||||
minIntegral: -10000
|
||||
maxIntegral: 10000
|
||||
|
||||
# Kff: 1 # Feed forward gain
|
||||
# deadband:
|
||||
# tol: 0.01 # Stop control if within this distance from target for the below time
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
##
|
||||
|
||||
#epicsEnvSet(IOC,c6025a)
|
||||
require ecmccfg sandst_a,"ECMC_VER=sandst_a,ENG_MODE=1,MASTER_ID=1"
|
||||
require ecmccfg "ENG_MODE=1,MASTER_ID=1"
|
||||
|
||||
##############################################################################
|
||||
## Load components lib
|
||||
@@ -28,7 +28,8 @@ ${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Motor-Generic-2Phase-Stepp
|
||||
|
||||
epicsEnvSet("ENC_SLAVE", "2")
|
||||
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=$(ENC_SLAVE), HW_DESC=EL5042"
|
||||
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Encoder-RLS-LA11-24bit-BISS-C"
|
||||
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Encoder-RLS-LA11-26bit-BISS-C,CH_ID=1"
|
||||
${SCRIPTEXEC} ${ecmccomp_DIR}applyComponent.cmd "COMP=Encoder-RLS-LA11-26bit-SSI,CH_ID=2"
|
||||
|
||||
epicsEnvSet("BO_SLAVE", "5")
|
||||
${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=$(BO_SLAVE), HW_DESC=EL2008"
|
||||
|
||||
@@ -92,6 +92,7 @@ ecmcSS1SafetyGroup::ecmcSS1SafetyGroup(const char *name,
|
||||
printEnableStatus_ = 1;
|
||||
limitVeloCmdOld_ = 0;
|
||||
limitVeloCmd_ = 0;
|
||||
axesDisabled_ = 0;
|
||||
cfgDbgMode_ = 0;
|
||||
memset(&status_,0,sizeof(status_));
|
||||
|
||||
@@ -401,9 +402,12 @@ void ecmcSS1SafetyGroup::exeRampDown() {
|
||||
|
||||
// set safety interlock in ecmc
|
||||
setAxesSafetyInterlocks(rampDownCmd_);
|
||||
|
||||
axesDisabled_ = checkAxesDisabled();
|
||||
|
||||
// check if axes are standstill to safety PLC
|
||||
axesAreStandstill_ = checkAxesStandstillAndDisableIfNeeded();
|
||||
|
||||
setAxesStandstillStatus(axesAreStandstill_);
|
||||
|
||||
// Disable
|
||||
@@ -483,9 +487,10 @@ void ecmcSS1SafetyGroup::setAxesStandstillStatus(int standstill) {
|
||||
status_.axesAtStandstill = standstill;
|
||||
refreshAsyn();
|
||||
}
|
||||
|
||||
|
||||
// Only write axis standstill bit if all axes are disabled
|
||||
if(ecEntryStandstill_->writeBit(bitStandStill_,
|
||||
standstill > 0)) {
|
||||
((standstill > 0) && axesDisabled_) )) {
|
||||
throw std::out_of_range("Safety: Read rampdown cmd failed");
|
||||
}
|
||||
axesAreStandstillOld_ = standstill;
|
||||
@@ -500,6 +505,17 @@ bool ecmcSS1SafetyGroup::checkAxesStandstill() {
|
||||
return standstill;
|
||||
}
|
||||
|
||||
// Check axes disabled
|
||||
bool ecmcSS1SafetyGroup::checkAxesDisabled() {
|
||||
bool enabledsum = 1;
|
||||
int enabled = 0;
|
||||
for(std::vector<safetyAxis*>::iterator saxis = axes_.begin(); saxis != axes_.end(); ++saxis) {
|
||||
getAxisEnabled((*saxis)->axisId_,&enabled);
|
||||
enabledsum = enabledsum && enabled;
|
||||
}
|
||||
return !enabledsum;
|
||||
}
|
||||
|
||||
// Check max velo violation
|
||||
void ecmcSS1SafetyGroup::checkAxesMaxVeloAndDisableIfNeeded() {
|
||||
if(!limitVeloCmd_) {
|
||||
|
||||
@@ -100,6 +100,7 @@ class ecmcSS1SafetyGroup : public asynPortDriver {
|
||||
void setAxesDisable();
|
||||
void setAxesStandstillStatus(int standstill);
|
||||
bool checkAxesStandstill();
|
||||
bool checkAxesDisabled();
|
||||
bool checkAxisStandstill(safetyAxis* axis);
|
||||
bool checkAxisStandstillAndDisableIfNeeded(safetyAxis* axis);
|
||||
bool checkAxesStandstillAndDisableIfNeeded();
|
||||
@@ -148,7 +149,7 @@ class ecmcSS1SafetyGroup : public asynPortDriver {
|
||||
int bitLimitVelo_;
|
||||
|
||||
int limitMaxVeloEnable_;
|
||||
|
||||
int axesDisabled_;
|
||||
int axesAreStandstill_;
|
||||
int axesAreStandstillOld_;
|
||||
int printEnableStatus_;
|
||||
|
||||
Reference in New Issue
Block a user