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  2020  2021  2022  2023  2024  <2025 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  <2025
<== Date ==> <== Thread ==>

Subject: Re: I implemented the Model 3 of EPICS motor driver support, but the VAL and RBV of motor record are zero after IOC reboot.
From: LiangChih Chiang via Tech-talk <tech-talk at aps.anl.gov>
To: Mark Rivers <rivers at cars.uchicago.edu>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Thu, 2 Jan 2025 11:26:31 +0800
Hi,

>To explain a little more, it is important that the driver has completed the first poll cycle for the position and status of each axis before iocInit.  
>This is because the motor record looks at those positions during iocInit, and if there are non-zero it uses those values as the current position.  
>You can add the following to your startup script after you create the controller and axes to sleep for 1 second.
>epicsThreadSleep(1.0)

I did add epicsThreadSleep(1.0).

There are 5 motors(axis 1 to 5) connected to the motor controller.

After epicsThreadSleep(1.0) added, it seems that the VAL/RBV of motor records of axis 2 to 5 can be successfully loaded back from the controller after IOC reboot.
But the behavior of axis 0 (this axis is the most important) is strange.

After IOC reboot, the motor record of axis 0 will move.
It seems that the VAL field is set to a new value
and I can't figure out the relationship between the new and old values.

The axis 0 is the main axis(Bragg angle) of a double crystal monochromator,
and it has corresponding pseudo motor to represent the Energy of x-ray beam.









On Wed, Nov 20, 2024 at 11:04 PM Mark Rivers <rivers at cars.uchicago.edu> wrote:
To explain a little more, it is important that the driver has completed the first poll cycle for the position and status of each axis before iocInit.  This is because the motor record looks at those positions during iocInit, and if there are non-zero it uses those values as the current position.  You can add the following to your startup script after you create the controller and axes to sleep for 1 second.

epicsThreadSleep(1.0)

Let us know if this does not fix the problem.

Mark



From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Torsten Bögershausen via Tech-talk <tech-talk at aps.anl.gov>
Sent: Wednesday, November 20, 2024 5:15 AM
To: LiangChih Chiang <yehnan174 at gmail.com>; tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: Re: I implemented the Model 3 of EPICS motor driver support, but the VAL and RBV of motor record are zero after IOC reboot.
 
Hej,

without having seen ypur code, I would speculate that you run
into a not-unknown issue using Model 3 motors, connected via
a serial cable, USB or Ethernet?

The value that the motorRecord needs is read from the driver,
wich must have been able to read it from your hardware.
Here are ESS we have a patched motor, which can handle this.
If you use the upstream version, the easist workaround may be
to add a sleep() after the createController() line in your st.cmd

HTH
/Torsten


On 2024-11-20 09:47, LiangChih Chiang via Tech-talk wrote:
> Hello, EPICS mates.
>
> I implemented the Model 3 of EPICS motor driver support for some motor
> controller,
> but the VAL and RBV of the motor record are zero after IOC reboot.
>
> I think the motor record doesn't restore the values of motor pulse and
> encoder count from the motor controller after IOC reboot.
>
> What member functions of asynMotorController and asynMotorAxis classes
> should I implement?
>
>
> Best regards.
>


Replies:
Re: I implemented the Model 3 of EPICS motor driver support, but the VAL and RBV of motor record are zero after IOC reboot. LiangChih Chiang via Tech-talk

Navigate by Date:
Next: Using Aerotech Automation1 motor controller with EPICS - controller initialization John Dobbins 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  2020  2021  2022  2023  2024  <2025
Navigate by Thread:
Next: Re: I implemented the Model 3 of EPICS motor driver support, but the VAL and RBV of motor record are zero after IOC reboot. LiangChih Chiang 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  2020  2021  2022  2023  2024  <2025