Hi Joon Woo,
This is the
MMC200Axis::move function.
asynStatus MMC200Axis::move(double position, int relative, double minVelocity, double maxVelocity, double acceleration)
{
asynStatus status;
// static const char *functionName = "MMC200Axis::move";
status = sendAccelAndVelocity(acceleration, maxVelocity);
if (relative) {
sprintf(pC_->outString_, "%dMVR%.6f", axisIndex_, position * resolution_);
} else {
sprintf(pC_->outString_, "%dMVA%.6f", axisIndex_, position * resolution_);
}
status = pC_->writeController();
return status;
}
The "position" argument is of type double, but it will in fact always have an integer value, which is distance/MRES. So if you tell it to move 1 mm and MRES is 0.001 then position will be 1000. If MRES is 0.0001 then position will be 10000. This is done
in the motor record, and is the same for all motor types.
Note that the MMC driver multiplies position by resolution_, which is a driver-specific value.
This is how resolution_ is computed in the axis constructor:
// Read the axis resolution (units = tens of picometers per full step)
sprintf(pC_->outString_, "%dREZ?", axisIndex_);
status = pC_->writeReadController();
if (status != asynSuccess)
errorFlag = 1;
rez_ = atoi(&pC_->inString_[1]);
// Read the number of microsteps
if ( model_ == 200 )
{
// The MMC-200 has a variable number of microsteps
sprintf(pC_->outString_, "%dUST?", axisIndex_);
status = pC_->writeReadController();
if (status != asynSuccess)
errorFlag = 1;
microSteps_ = atoi(&pC_->inString_[1]);
}
else
{
// The MMC-100 has a fixed number of microsteps
microSteps_ = 100;
}
// Calculate motor resolution (mm / microstep)
resolution_ = rez_ * 1e-8 / microSteps_;
So it reads the resolution in units of tens of picometers per full step, and divides that by microsteps, and multiplies by 1e-8 to get resolution in mm.
Please send the output of the report() function for this axis by typing this command
asynReport driver_name axis_number 1
where driver_name is the name of the Micronix asyn port, and axis_number is the number of this axis.
What value of MRES are you using?
Please turn on asynTrace on the underlying TCP asyn driver and send the output when you move the motor by 1 EGU unit with your normal value of MRES, and with MRES 10 times larger than that.
Mark
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Jong Woo Kim via Tech-talk <tech-talk at aps.anl.gov>
Sent: Wednesday, August 24, 2022 3:12 PM
To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: Calibration for rotation motor of Micronix
Dear EPICS community:
I have a question about Micronix.
Controller: MMC100
Motor: PR-50, Analog encoder, rotation motor
When I edit MRES, it is changed correctly and UREV is also changed accordingly. [UREV = MRES * SREV]
The problem is that changes to motor-resolution fields have no effect on the actual motion of the motor.
* I am using motor-R7-1 in EPICS 3.15.6.
Is there any PV that prevents the above PVs from applying to the motor?
Best,
Jong Woo
|