forked from epics_driver_modules/motorBase
Merge pull request #114 from EuropeanSpallationSource/add_SPDB_v1
Add field SPDB, "Set Point Dead Band"
This commit is contained in:
@@ -867,6 +867,14 @@ below.
|
||||
<td><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="#Fields_motion">SPBD</a></td>
|
||||
<td>R/W</td>
|
||||
<td>Set Point Deadband (EGU)</td>
|
||||
<td>DOUBLE</td>
|
||||
<td><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="#Fields_link">RDBL</a></td>
|
||||
<td>R</td>
|
||||
@@ -1830,6 +1838,16 @@ below.
|
||||
performed (see RTRY). </td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td>SPBD</td>
|
||||
<td>R/W</td>
|
||||
<td>Set Point Deadband (EGU)</td>
|
||||
<td>DOUBLE</td>
|
||||
<td>Before the motor is commanded a move, a check is done if the move is to small.
|
||||
It is to small when the distance is less the the step size defined in MRES.
|
||||
When a bigger deadband is wanted than MRES, set the value into SPDB.
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td>RTRY</td>
|
||||
<td>R/W</td>
|
||||
<td>Max retry count</td>
|
||||
|
||||
@@ -2234,6 +2234,18 @@ static RTN_STATUS do_work(motorRecord * pmr, CALLBACK_VALUE proc_ind)
|
||||
{
|
||||
if (abs(npos - rpos) < 1)
|
||||
too_small = true;
|
||||
if (!too_small)
|
||||
{
|
||||
double spdb = pmr->spdb;
|
||||
if (spdb > 0) {
|
||||
/* Don't move if new setpoint is within SPDB of DRBV */
|
||||
double drbv = pmr->drbv;
|
||||
double dval = pmr->dval;
|
||||
if (((dval - spdb) < drbv) && ((dval + spdb) > drbv)) {
|
||||
too_small = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (abs(npos - rpos) < rdbdpos)
|
||||
too_small = true;
|
||||
|
||||
@@ -415,6 +415,12 @@ recordtype(motor) {
|
||||
special(SPC_MOD)
|
||||
interest(1)
|
||||
}
|
||||
field(SPDB,DBF_DOUBLE) {
|
||||
prompt("Setpoint Deadband (EGU)")
|
||||
promptgroup(GUI_COMMON)
|
||||
special(SPC_MOD)
|
||||
interest(1)
|
||||
}
|
||||
field(RCNT,DBF_SHORT) {
|
||||
prompt("Retry count")
|
||||
special(SPC_NOMOD)
|
||||
|
||||
Reference in New Issue
Block a user