Calc emerg decelartion depending on actual traj velo
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>315</width>
|
<width>315</width>
|
||||||
<height>150</height>
|
<height>143</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>20</x>
|
<x>20</x>
|
||||||
<y>45</y>
|
<y>98</y>
|
||||||
<width>30</width>
|
<width>30</width>
|
||||||
<height>30</height>
|
<height>30</height>
|
||||||
</rect>
|
</rect>
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>55</x>
|
<x>55</x>
|
||||||
<y>47</y>
|
<y>100</y>
|
||||||
<width>251</width>
|
<width>251</width>
|
||||||
<height>26</height>
|
<height>26</height>
|
||||||
</rect>
|
</rect>
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>55</x>
|
<x>55</x>
|
||||||
<y>75</y>
|
<y>40</y>
|
||||||
<width>246</width>
|
<width>246</width>
|
||||||
<height>28</height>
|
<height>28</height>
|
||||||
</rect>
|
</rect>
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>20</x>
|
<x>20</x>
|
||||||
<y>75</y>
|
<y>40</y>
|
||||||
<width>30</width>
|
<width>30</width>
|
||||||
<height>30</height>
|
<height>30</height>
|
||||||
</rect>
|
</rect>
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>55</x>
|
<x>55</x>
|
||||||
<y>105</y>
|
<y>70</y>
|
||||||
<width>206</width>
|
<width>206</width>
|
||||||
<height>28</height>
|
<height>28</height>
|
||||||
</rect>
|
</rect>
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>20</x>
|
<x>20</x>
|
||||||
<y>105</y>
|
<y>70</y>
|
||||||
<width>30</width>
|
<width>30</width>
|
||||||
<height>30</height>
|
<height>30</height>
|
||||||
</rect>
|
</rect>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>364</width>
|
<width>341</width>
|
||||||
<height>312</height>
|
<height>312</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@@ -120,12 +120,15 @@
|
|||||||
<widget class="caTextEntry" name="catextentry">
|
<widget class="caTextEntry" name="catextentry">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>170</x>
|
<x>54</x>
|
||||||
<y>280</y>
|
<y>280</y>
|
||||||
<width>100</width>
|
<width>41</width>
|
||||||
<height>22</height>
|
<height>22</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
<property name="channel" stdset="0">
|
<property name="channel" stdset="0">
|
||||||
<string notr="true">$(IOC):m$(M_ID=0)s$(BI_S_ID)-One</string>
|
<string notr="true">$(IOC):m$(M_ID=0)s$(BI_S_ID)-One</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -133,7 +136,7 @@
|
|||||||
<widget class="caLabel" name="calabel_4">
|
<widget class="caLabel" name="calabel_4">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>30</x>
|
<x>20</x>
|
||||||
<y>10</y>
|
<y>10</y>
|
||||||
<width>301</width>
|
<width>301</width>
|
||||||
<height>28</height>
|
<height>28</height>
|
||||||
@@ -179,6 +182,38 @@
|
|||||||
<enum>EPushButton::None</enum>
|
<enum>EPushButton::None</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="caLabel" name="calabel_5">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>135</x>
|
||||||
|
<y>85</y>
|
||||||
|
<width>131</width>
|
||||||
|
<height>28</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>(Ramp down command)</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="caLabel" name="calabel_6">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>120</x>
|
||||||
|
<y>275</y>
|
||||||
|
<width>171</width>
|
||||||
|
<height>28</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Command PV (ONE)</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ ecmcSS1SafetyGroup::ecmcSS1SafetyGroup(const char *name,
|
|||||||
limitVeloCmd_ = 0;
|
limitVeloCmd_ = 0;
|
||||||
axesDisabled_ = 0;
|
axesDisabled_ = 0;
|
||||||
cfgDbgMode_ = 0;
|
cfgDbgMode_ = 0;
|
||||||
|
oldStop_ = 0;
|
||||||
memset(&status_,0,sizeof(status_));
|
memset(&status_,0,sizeof(status_));
|
||||||
|
|
||||||
parseConfigStr(cfg_string);
|
parseConfigStr(cfg_string);
|
||||||
@@ -621,8 +622,24 @@ void ecmcSS1SafetyGroup::setAxesSafetyInterlocks(int stop) {
|
|||||||
if(!*saxis) {
|
if(!*saxis) {
|
||||||
throw std::runtime_error( "Safety: Axis object NULL.");
|
throw std::runtime_error( "Safety: Axis object NULL.");
|
||||||
}
|
}
|
||||||
setAxisEmergencyStopInterlock((*saxis)->axisId_,stop);
|
|
||||||
|
setAxisEmergencyStopInterlock((*saxis)->axisId_,stop);
|
||||||
|
|
||||||
|
if(!oldStop_ && stop) {
|
||||||
|
//Calcualte new deceleration if delay is defined and abs(velo) > 0
|
||||||
|
if(delayMs_ > 0) {
|
||||||
|
double velo = 0;
|
||||||
|
getAxisTrajVelo((*saxis)->axisId_,&velo);
|
||||||
|
velo = std::abs(velo);
|
||||||
|
if(velo > 0) {
|
||||||
|
double newEmergDec = velo / (ECMC_PLUGIN_RAMP_DOWN_TIME_RATIO * delayMs_ / 1000.0);
|
||||||
|
setAxisEmergDeceleration((*saxis)->axisId_,newEmergDec);
|
||||||
|
printf("Safety %s: Set new emergency deceleration %lf \n",sName_,newEmergDec);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
oldStop_ = stop;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ecmcSS1SafetyGroup::addAxis(int axisId,
|
void ecmcSS1SafetyGroup::addAxis(int axisId,
|
||||||
|
|||||||
@@ -162,8 +162,9 @@ class ecmcSS1SafetyGroup : public asynPortDriver {
|
|||||||
ecmcEcEntry *ecEntryRampDown_;
|
ecmcEcEntry *ecEntryRampDown_;
|
||||||
ecmcEcEntry *ecEntryStandstill_;
|
ecmcEcEntry *ecEntryStandstill_;
|
||||||
ecmcEcEntry *ecEntryLimitVelo_;
|
ecmcEcEntry *ecEntryLimitVelo_;
|
||||||
|
bool oldStop_;
|
||||||
static std::string to_string(int value);
|
static std::string to_string(int value);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* ECMC_SAFETY_GROUP_PLG_H_ */
|
#endif /* ECMC_SAFETY_GROUP_PLG_H_ */
|
||||||
|
|||||||
@@ -25,4 +25,7 @@
|
|||||||
#define ECMC_PLUGIN_SAFETY_ERROR_CODE 1
|
#define ECMC_PLUGIN_SAFETY_ERROR_CODE 1
|
||||||
#define ECMC_PLUGIN_ALREADY_LOADED_ERROR_CODE 2
|
#define ECMC_PLUGIN_ALREADY_LOADED_ERROR_CODE 2
|
||||||
|
|
||||||
|
// How big part of delay is used for rampdown
|
||||||
|
#define ECMC_PLUGIN_RAMP_DOWN_TIME_RATIO 0.9
|
||||||
|
|
||||||
#endif /* ECMC_MOTION_PLG_DEFS_H_ */
|
#endif /* ECMC_MOTION_PLG_DEFS_H_ */
|
||||||
|
|||||||
Reference in New Issue
Block a user