EPICS Home

Experimental Physics and Industrial Control System


 
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  <20202021  2022  2023  2024  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  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: asynMotorAxis
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: "'Koennecke Mark (PSI)'" <mark.koennecke at psi.ch>
Cc: "tech-talk at aps.anl.gov >> EPICS Tech Talk" <tech-talk at aps.anl.gov>
Date: Wed, 12 Feb 2020 10:27:33 +0000
Mark

motorApp/Db/asyn_motor.db contains these 3 records (in addition to others).  These are all you need to get the motor record resolution, offset, and direction fields into your driver.

# Motor direction for this axis
record(longout,"$(P)$(M)Direction") {
    field(DESC, "$(M) direction")
    field(DOL,  "$(P)$(M).DIR CP MS")
    field(OMSL, "closed_loop")
    field(DTYP, "asynInt32")
    field(OUT,  "@asyn($(PORT),$(ADDR))MOTOR_REC_DIRECTION")
}


# Motor offset for this axis
record(ao,"$(P)$(M)Offset") {
    field(DESC, "$(M) offset")
    field(DOL,  "$(P)$(M).OFF CP MS")
    field(OMSL, "closed_loop")
    field(DTYP, "asynFloat64")
    field(OUT,  "@asyn($(PORT),$(ADDR))MOTOR_REC_OFFSET")
    field(PREC, "$(PREC)")
}


# Motor resolution for this axis
record(ao,"$(P)$(M)Resolution") {
    field(DESC, "$(M) resolution")
    field(DOL,  "$(P)$(M).MRES CP MS")
    field(OMSL, "closed_loop")
    field(DTYP, "asynFloat64")
    field(OUT,  "@asyn($(PORT),$(ADDR))MOTOR_REC_RESOLUTION")
    field(PREC, "$(PREC)")
}

This is how the Newport XPS driver gets these values.

> And even there: MOTOR_REC_RESOLUTION was unknown, I had to change it to MOTOR_RESOLUTION in the OUT field. Probably a version issue.

No, it is not a version issue.  MOTOR_REC_RESOLUTION is defined in asynMotorController.h.  It is different from MOTOR_RESOLUTION.  MOTOR_REC_RESOLUTION is the MRES field of the motor record.

corvette:~/devel/motor/include>find . -name '*.h' -exec grep -H -i motorrecresolution {} \;
./asynMotorController.h:#define motorRecResolutionString        "MOTOR_REC_RESOLUTION"
./asynMotorController.h:  int motorRecResolution_;

> This exhibited some surprising (to me) features. Or shall I call it bugs?

Please load that provided database and see if you have problems.  I am not convinced there are bugs, just a lack of documentation.

Mark


-----Original Message-----
From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Koennecke Mark (PSI) via Tech-talk
Sent: Wednesday, February 12, 2020 4:06 AM
To: tech-talk at aps.anl.gov
Subject: asynMotorAxis

Hi,

I finally managed to get the resolution down into my my motor driver. It was an interesting experience. It was NOT enough to implement writeFloat64(). The resolution did not arrive. 
I had it print to me what it was doing and this was interesting:

- On initialization I got a code motorEncResolution_ with infinity value. Obviously not yet initialized. 
- No motorResolution_
- When I tried to manually set MRES, I received motorPosition_ function codes with a newly calculated
  position. No motorResolution_. 

I had to use Giles Knap suggestion with the additional DB field too in order to achieve success. And even
there: MOTOR_REC_RESOLUTION was unknown, I had to change it to MOTOR_RESOLUTION in the OUT field. Probably a version issue. 

This exhibited some surprising (to me) features. Or shall I call it bugs? 

Thanks and Best Regards,

     Mark Koennecke





References:
asynMotorAxis Koennecke Mark (PSI) via Tech-talk

Navigate by Date:
Prev: asynMotorAxis Koennecke Mark (PSI) via Tech-talk
Next: RE: send/receive waveform over network. Mark Rivers via Tech-talk
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  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: asynMotorAxis Koennecke Mark (PSI) via Tech-talk
Next: Real-time IOC and systemd Konrad, Martin via Tech-talk
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  <20202021  2022  2023  2024