Added setIGain method.

This commit is contained in:
2024-06-05 16:04:30 -05:00
parent 341bbb5980
commit c5eebd9597
2 changed files with 17 additions and 0 deletions

View File

@@ -248,6 +248,22 @@ asynStatus MD90Axis::setClosedLoop(bool closedLoop)
return status;
}
/** Set the I Gain of the motor control loop. The motor is an I- controller
* and has no P or D terms.
* \param[in] iGain The current I gain in the control loop */
asynStatus MD90Axis::setIGain(double iGain)
{
asynStatus status;
//static const char *functionName = "MD90Axis::setIGain";
iGain = iGain * 100;
if (iGain < 1) iGain = 1.0;
if (iGain > 100) iGain = 100.0;
sprintf(pC_->outString_, "SGN %d", NINT(iGain));
status = pC_->writeReadController();
return status;
}
/** Polls the axis.
* This function reads the motor position, the limit status, the home status, the moving status,
* and the drive power-on status.

View File

@@ -27,6 +27,7 @@ public:
asynStatus stop(double acceleration);
asynStatus poll(bool *moving);
asynStatus setClosedLoop(bool closedLoop);
asynStatus setIGain(double iGain);
private:
MD90Controller *pC_; /**< Pointer to the asynMotorController to which this axis belongs.