The units that the motor record uses to talk to the driver are always integer steps, in spite of the fact that they are passed as doubles. The same is true for the readback.
So if your controller talks in doubles you need to scale the number in the driver to an integer (multiply by a number large enough to not lose encoder precision) and set MRES to the inverse of that number. That is what we do with the Newport XPS, for example.
Mark
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Alan Greer
Sent: Tuesday, March 26, 2013 10:23 AM
To: [email protected]
Subject: Motor Record precision
Hi, I have a question regarding motor record precision that I would like
clarified.
Setup
OS - Debian 6
EPICS base - R3.14.12.3
ASYN - R4.18
MOTOR - R6.7.1
I have sub-classed asynMotorController.cpp and when I read the position
of an axis I use the following lines to store the position values.
position and enc_position are both doubles.
setDoubleParam(pC_->motorPosition_, position);
setDoubleParam(pC_->motorEncoderPosition_, enc_position);
In the motor record instance the .RBV value appears to come back as an
integer, despite placing a double value into a double param.
eg.
Actual position = 106.501000390592
.RRBV = 106
.RBV = 106
Could someone give me some advice on setting up the precision that
doesn't involve me scaling the value up and then setting .MRES and .ERES?
Does .PREC do what I want?
Or have I missed something else?
Any help appreciated.
Kind regards, Alan Greer