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  2015  2016  <20172018  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  <20172018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Coordinated motion with EPICS motor record
From: Mark Rivers <[email protected]>
To: "'So, Sung-Leung'" <[email protected]>, "[email protected]" <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Mon, 25 Sep 2017 21:43:57 +0000
Hi Ivan,

> I have just started today the testing of Mark's XPS_trajectoryScan from motor-R6-9 on our Newport XPS-Q8.  
> Is your "ProfileMove API" a better fit for the XPS trajectory scan?  

Yes, the ProfileMove is intended to replace the old trajectoryScan code.  trajectoryScan is based on a SNL program that talks directory to the XPS controller, without going through the same driver that the motor record is talking to.  This is a bad architecture, because the motor record driver has no idea that other software is talking to the controller at the same time, and so it is not possible to prevent conflicts.

The ProfileMove API uses very similar PVs to the trajectoryScan, but it moves the software into the same driver that is being used with the motor record.  It also defines an API, and not just a set of records, which the trajectoryScan SNL code does.

We switched from trajectoryScan to ProfileMove on our APS beamlines back in 2011 and have been very happy with it.  It required only minor changes to the SPEC macros from those we were using with trajectoryScan.

> If so, could we have the code for testing?

The code is on Github.  The base classes are in motorApp/MotorSrc, and the derived classes for the APS are in motorApp/NewportSrc.

motor/iocBoot/iocWithAsyn/st.cmd.xps4 and motors.template.xps4 contain an example of how to load the ProfileMove database and configure the XPS.

Here is a link to a SPEC macro that does scanning using the ProfileMove API on the XPS.  Note that for historical reasons it is still called trajectoryscan, but it is using the new API and database.

https://subversion.xray.aps.anl.gov/spec/common/aps/trajectoryscan_xps.mac

I have some IDL test programs here:
https://github.com/CARS-UChicago/IDL_EPICS_scans

This is the documentation at the top of profile_move.pro 

****************************************************
function profile_move, profile, positions, groupName=groupName, useAxes=useAxes, $
                       maxAxes=maxAxes, time=time, acceleration=acceleration, npulses=npulses, $
                       pulseRange=pulseRange, build=build, execute=execute, readback=readback, $
                       actual=actual, errors=errors

;+
; NAME:
;   profile_move
;
; PURPOSE:
;     This IDL function loads and execute a profile move
;     using the EPICS asyn motor driver and its profile move functions.
;
;
; CATEGORY:
;     EPICS profile moves
;
; CALLING SEQUENCE:
;     Result = PROFILE_MOVE(Profile, Positions)
;
; INPUTS:
;     PROFILE: The EPICS record name for thisprofile, for example '13BMC:Prof1:'.
;
;     POSITIONS: [NPOINTS, NMOTORS]. The positions of the motors at each point in the profile move
;
;
; KEYWORD PARAMETERS:
;     GROUPNAME:    If this keyword is specified it controls the group name of the XPS profile
;     USEAXES:    An with list of axes to move
;     TIME:     If this keyword is a scaler, then it specifies the fixed time per point
;               in the profile.  If it is an array then it specifies the time per point.
;               Default=1 second per point.
;     ACCELERATION:    The acceleration time for the profile.  Default=1 second.
;     NPULSES:  The number of output pulses during the profile.  Default=NPOINTS, the number
;               of points in the input Positions array.
;     PULSERANGE:  The range of points over which to output pulses.  Default=[1,NPOINTS]
;     BUILD:    Set this keyword to build and verify the profile.  This is the default.
;
;     EXECUTE:  Set this keyword to execute the profile.  This is the default.
;
;     READBACK: Set this keyword to read back the profile into ACTUAL and ERROR.
;               The default is to not read back.
;
;     NOTE: Any or all of these keywords can be set.  If none is set then the
;         function does not do anything.
;
; OUTPUTS:
;       Result:     This function returns a status indicating whether the
;                   selected operations were successful or not. 0=success,
;                   anything else is a failure.
;       ACTUAL:     An array of [Nactual, NMOTORS] containing the actual positions of
;                   each axis.
;       ERRORS:     An array of [Nactual, NMOTORS] containing the following errors of
;                   each axis.
;       NOTE: The ACTUAL and ERROR outputs are only returned if the READBACK keyword it set.
;
; SIDE EFFECTS:
;       This procedure can move the motors.  Be careful!
;
; EXAMPLE:
;       positions = [[1,2,3],[.1, .2, .3], [0,3,4]]
;       status = PROFILE_MOVE('13IDC:Prof1:', positions, /readback, actual, errors)
;       plot, actual[*,0]
;       oplot, errors[*,0]
;
; MODIFICATION HISTORY:
;       Written by:     Mark Rivers, April 5, 2011
;-
****************************************************

There are 4 test programs, profile_move_test[1-4].pro that I used to test the software.

It would be trivial to translate these IDL functions into Python if that is the language you would like to work in.

Mark



-----Original Message-----
From: So, Sung-Leung [mailto:[email protected]] 
Sent: Monday, September 25, 2017 12:43 PM
To: [email protected]
Cc: Mark Rivers; [email protected]
Subject: Re: Coordinated motion with EPICS motor record

Hi Mark (both Rivers and Clift),

I have just started today the testing of Mark's XPS_trajectoryScan from motor-R6-9 on our Newport XPS-Q8.  

Is your "ProfileMove API" a better fit for the XPS trajectory scan?  If so, could we have the code for testing?

Thanks.

Ivan
[email protected]

References:
Re: Coordinated motion with EPICS motor record So, Sung-Leung

Navigate by Date:
Prev: Re: Archiver: Problems with disconnected PVs Andrew Johnson
Next: AD: save array of floats into HDF5 as attribute Hinko Kocevar
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Coordinated motion with EPICS motor record So, Sung-Leung
Next: RE: Coordinated motion with EPICS motor record So, Sung-Leung
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
ANJ, 21 Dec 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·