mirror of
https://github.com/Binary-Coalescence/motorDSM.git
synced 2025-08-04 21:55:40 -05:00
Added setIGain method.
This commit is contained in:
@@ -248,6 +248,22 @@ asynStatus MD90Axis::setClosedLoop(bool closedLoop)
|
|||||||
return status;
|
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.
|
/** Polls the axis.
|
||||||
* This function reads the motor position, the limit status, the home status, the moving status,
|
* This function reads the motor position, the limit status, the home status, the moving status,
|
||||||
* and the drive power-on status.
|
* and the drive power-on status.
|
||||||
|
@@ -27,6 +27,7 @@ public:
|
|||||||
asynStatus stop(double acceleration);
|
asynStatus stop(double acceleration);
|
||||||
asynStatus poll(bool *moving);
|
asynStatus poll(bool *moving);
|
||||||
asynStatus setClosedLoop(bool closedLoop);
|
asynStatus setClosedLoop(bool closedLoop);
|
||||||
|
asynStatus setIGain(double iGain);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MD90Controller *pC_; /**< Pointer to the asynMotorController to which this axis belongs.
|
MD90Controller *pC_; /**< Pointer to the asynMotorController to which this axis belongs.
|
||||||
|
Reference in New Issue
Block a user