motor: changed the logic for setting the encoder ratio parameter so that it is always set if there is an encoder present. Previously the ratio was set if one was present AND we are using it, which didn't work when switching between different UEIP modes and setting the controller position at the same time.

This commit is contained in:
mp49
2011-05-20 16:11:06 +00:00
parent 942bb111d2
commit 3e7dec3a8d
+1 -1
View File
@@ -1775,7 +1775,7 @@ static RTN_STATUS do_work(motorRecord * pmr, CALLBACK_VALUE proc_ind)
/* Set the encoder ratio. Note this is blatantly device dependent. */
msta.All = pmr->msta;
if (msta.Bits.EA_PRESENT && pmr->ueip)
if (msta.Bits.EA_PRESENT)
{
/* defend against divide by zero */
if (fabs(pmr->mres) < 1.e-9)