EPICS Controls Argonne National Laboratory

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  <20152016  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  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: motor record DLY and STOP problem
From: Mark Rivers <[email protected]>
To: Torsten Bögershausen <[email protected]>, "Pearson, Matthew R." <[email protected]>, "[email protected] list" <[email protected]>
Date: Mon, 16 Nov 2015 14:21:56 +0000
I think this is a problem with the logic of motor record, not with the driver.  I think it is a bad idea to not filter the callbacks.  We don't want the motor record to process every time the driver does a poll, which could be at 60 Hz or higher.  It should only process due to callbacks from the driver when there is a change in status.

If a driver wants to force a callback there is a method that does not require any changes to the base classes, e.g. exposing statusChanged_ as protected or adding a new isMotorRecordnowFilterButAlwaysProcess_ flag.  The driver simply needs to set a parameter to a different value from present and then back to its current value, for example
  setDoubleParam(pC_->motorPosition_(position+1.);
  setDoubleParam(pC_->motorPosition_(position);
  callParamCallbacks();

Mark
________________________________________
From: [email protected] [[email protected]] on behalf of Torsten Bögershausen [[email protected]]
Sent: Monday, November 16, 2015 2:54 AM
To: Pearson, Matthew R.; [email protected] list
Subject: Re: motor record DLY and STOP problem

On 11/11/15 16:18, Pearson, Matthew R. wrote:
>
> Hi,
>
> There seems to be a problem with issuing a motor record STOP while we are waiting for a DLY settling time to expire. I can lock up the motor record if I issue a STOP after MOVN has gone to zero and before DMOV goes to 1. This only seems to be a problem if there are no further updates from the driver (so we have already stopped moving). It’s easy to reproduce using a simulation driver.

Now I can reproduce it.
Are you using a model 3 driver ?

If yes, then one reason is, that the poll() updates are "filtered" here, and
the motorRecord is not processed,
when the encoder/motor is not moving at all in the DLY phase:

asynStatus asynMotorAxis::callParamCallbacks()
{
   if (statusChanged_) {
     statusChanged_ = 0;
     pC_->doCallbacksGenericPointer((void *)&status_, pC_->motorStatus_, axisNo_);
   }
   return pC_->callParamCallbacks(axisNo_);
}
----------------------
A "first aid help" quickfix can look like this:
Expose the statusChanged_ (move it out from private to protected in
asynMotorAxis.h)


diff --git a/motorApp/MotorSrc/asynMotorAxis.h b/motorApp/MotorSrc/asynMotorAxis.h
index 4b22e85..1342b20 100644
--- a/motorApp/MotorSrc/asynMotorAxis.h
+++ b/motorApp/MotorSrc/asynMotorAxis.h
@@ -63,10 +63,10 @@ class epicsShareFunc asynMotorAxis {
    double *profileReadbacks_;         /**< Array of readback positions for
profile moves */
    double *profileFollowingErrors_;   /**< Array of following errors for
profile moves */
    int referencingMode_;
+  int statusChanged_;

    private:
    MotorStatus status_;
-  int statusChanged_;
    int referencingModeMove_;

    friend class asynMotorController;


-----------------
The change the driver to set statusChanged_ = 1 in the poll() function:
+  statusChanged_ = 1;


----------------------
This will make the motorRecord to be processed and get out of the DLY phase.

A better handling may be to have a flag that does not filter the callbacks,
whenever the motor record is used with a model 3 driver.

asynStatus asynMotorAxis::callParamCallbacks()
{
   if (statusChanged_ || isMotorRecordnowFilterButAlwaysProcess_) {
     statusChanged_ = 0;
     pC_->doCallbacksGenericPointer((void *)&status_, pC_->motorStatus_, axisNo_);
   }
   return pC_->callParamCallbacks(axisNo_);
}

Any thoughts ?


References:
motor record DLY and STOP problem Pearson, Matthew R.
Re: motor record DLY and STOP problem Torsten Bögershausen

Navigate by Date:
Prev: CAENels TetraMM Quad picoammeter nick.rees
Next: RE: CAENels TetraMM Quad picoammeter Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: motor record DLY and STOP problem Torsten Bögershausen
Next: CSS migration and problem with linking container widget Maurizio Montis
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·