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 | 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 |
<== Date ==> | <== Thread ==> |
---|
Subject: | questions about the motor homing sequence |
From: | "Sintschuk, Michael via Tech-talk" <tech-talk at aps.anl.gov> |
To: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Tue, 29 Jun 2021 15:13:26 +0000 |
Hello EPICS-community, I'm trying to write an EPICS-motor device support for the PEGASUS Rotation- and Linear-Stages from Micos. I'm using the Hydra and Corvus motor-support
from the main EPICS-motor module as a template. I have the following problem when writing the homing sequence for the Rotation-stages: after sending the homing-command string sprintf(pC_->outString_, "1 0 %i setsw 1 1 %i setsw 1 0 %i sncal", (axisNo_ + 1), (axisNo_ + 1), (axisNo_ + 1)); I need to wait until reference-drive finished aka. the motor stopped, so I can switch off the Limit-switches with the following command: sprintf(pC_->outString_, "2 0 %i setsw 2 1 %i setsw", (axisNo_ + 1), (axisNo_ + 1)); pC_->writeController(); So far I could resolve this problem by implementing a while loop with an epicsThreadSleep(1.) asking the controller about its moving bit and once it
set to 1 (done), execute the desired command. Here is my complete code of the homing function: asynStatus SMCpegasusAxis::home(double baseVelocity, double slewVelocity, double acceleration, int forwards) Having a while-loop with an threadSleep is kind of bad coding I think, so I'm wondering if someone knows a better solution? PS: I'm also trying to update the motor position during the while-loop (it is the "// Read the current motor position" passage). I see the correct position
in the asyn communication but the .RBV value of the motor record won't update. I guess, this can only be done from the poll-function? Best regards Michael Michael Sintschuk
P: +49 30 8104-4065 (BAM, Steglitz) |