To elaborate, in the motor record the code to process the encoder or controller readback is:
if (msta.Bits.EA_PRESENT && pmr->ueip)
{
/* An encoder is present and the user wants us to use it. */
pmr->rrbv = pmr->rep;
pmr->drbv = pmr->rrbv * pmr->eres;
}
else
{
pmr->rrbv = pmr->rmp;
if (pmr->urip == motorUEIP_No || initcall == true)
pmr->drbv = pmr->rrbv * pmr->mres;
}
The rrbv (Raw Readback Value), rmp (Raw Motor Position), and rep (Raw Encoder Position) fields in the motor record are all defined as DBF_LONG. These values get converted to drbv (Dial Readback Value) by multiplying by eres (Encoder Resolution) or mres (Motor Resolution). drbv is DBF_DOUBLE.
Mark
-----Original Message-----
From: Alan Greer [mailto:[email protected]]
Sent: Tuesday, March 26, 2013 10:47 AM
To: Mark Rivers
Cc: [email protected]
Subject: Re: Motor Record precision
OK thanks for the clarification.
Kind regards, Alan
On 03/26/2013 03:32 PM, Mark Rivers wrote:
> 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
>
>
- References:
- Motor Record precision Alan Greer
- RE: Motor Record precision Mark Rivers
- Re: Motor Record precision Alan Greer
- Navigate by Date:
- Prev:
Re: Motor Record precision Alan Greer
- Next:
alarm handler silence one hour button James F Ross
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
<2013>
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: Motor Record precision Alan Greer
- Next:
alarm handler silence one hour button James F Ross
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
<2013>
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|