Fixed halt bug.
Cause: The DC command is invalid with PA moves. r1213 | ffr | 2006-11-01 15:58:44 +1100 (Wed, 01 Nov 2006) | 3 lines
This commit is contained in:
committed by
Douglas Clowes
parent
dc695a75b2
commit
6e3fc65d92
@@ -615,10 +615,10 @@ static void DMC2280Error(void *pData, int *iCode, char *error, int errLen){
|
||||
strncpy(error,"Begin not possible due to limit switch",(size_t)errLen);
|
||||
break;
|
||||
case RVRSLIM:
|
||||
strncpy(error,"Crashed into reverse limit switch",(size_t)errLen);
|
||||
strncpy(error,"Crashed into limit switch",(size_t)errLen);
|
||||
break;
|
||||
case FWDLIM:
|
||||
strncpy(error,"Crashed into forward limit switch",(size_t)errLen);
|
||||
strncpy(error,"Crashed into limit switch",(size_t)errLen);
|
||||
break;
|
||||
case POSFAULT:
|
||||
strncpy(error,"Positioning fault detected",(size_t)errLen);
|
||||
@@ -677,7 +677,9 @@ static int DMC2280Fix(void *pData, int iCode,/*@unused@*/ float fValue){
|
||||
/** \brief Emergency halt. Implements the Halt
|
||||
* method in the MotorDriver interface.
|
||||
*
|
||||
* Uses maximum deceleration
|
||||
* Cannot set maximum deceleration because the DC command
|
||||
* is not valid for absolute (ie PA) moves. See DC description
|
||||
* in DMC-2xxx command ref (ie manc2xxx.pdf)
|
||||
* \param *pData provides access to a motor's data
|
||||
*
|
||||
* XXX Does abstract motor use the return values?
|
||||
@@ -688,20 +690,12 @@ static int DMC2280Halt(void *pData){
|
||||
|
||||
self = (pDMC2280Driv)pData;
|
||||
assert(self != NULL);
|
||||
/* Set maximum deceleration to stop motor */
|
||||
snprintf(cmd, CMDLEN, "DC%c", motDecel(self, self->maxDecel));
|
||||
if (FAILURE == DMC2280Send(self, cmd))
|
||||
return HWFault;
|
||||
/* Stop motor */
|
||||
snprintf(cmd, CMDLEN, "ST%c", self->axisLabel);
|
||||
if (FAILURE == DMC2280Send(self, cmd))
|
||||
return HWFault;
|
||||
/* Restore deceleration */
|
||||
snprintf(cmd, CMDLEN, "DC%c", motDecel(self, self->decel));
|
||||
if (FAILURE == DMC2280Send(self, cmd))
|
||||
return HWFault;
|
||||
|
||||
return 1;
|
||||
return HWFault;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
/** \brief Fetches the value of the named parameter,
|
||||
|
||||
Reference in New Issue
Block a user