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  2017  2018  <20192020  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  <20192020 
<== Date ==> <== Thread ==>

Subject: Re: Multi-axis sequenced move using asynMotor pseudo axis
From: "Pearson, Matthew R. via Tech-talk" <tech-talk@aps.anl.gov>
To: "Engbretson, Mark S." <engbretson@anl.gov>
Cc: David Vine <dvine@sigray.com>, "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Thu, 7 Mar 2019 18:05:38 +0000
Hi,

Sure. In fact, I’ve been thinking of publishing these routines on GitHub as I’ve been slowly developing them over several years for different controllers. The current version I did for the Galil controller, but it would work for any axis with a motor record interface. In the high level sequence I posted it actually uses two different types of underlying homing sequence:

* Home to low limit
* Home to Galil home (which just triggers HOMF or HOMR in the motor record)

Before I put it on GitHub I wanted to change some PV names, tidy it up and test the latest version with multiple controllers. However, I’ve attached it for now. It’s a large template file involving 3 main sequence records:

* Home to low limit
* Home to high limit
* Home using HOMF/HOMR

And there’s several other sections, which in addition do:

* Pre-home moves (to a defined preset position)
* Post-home moves (to a defined preset position, or the saved pre-home position)
* Auto widening of software limits
* Homing status (Idle, Running, Error, Aborted)
* Reporting the change in position after the home has finished

I’ve attached a screenshot showing the interface for the limit switch method. Each of my Galil based motors has this interface, wether it’s used or not.

Having each motor be able to home using these sequences makes it fairly easy to setup high level synchronized homing routines, as each method supports the use of put_callback.

I find it a big advantage to do it in the database, rather than in drivers or in controller programs. The main one being a consistent user interface for homing, but also not having to deal with homing in different ways for each controller type (aside from possibly configuring the controller to home on a home switch or encoder index, which is then run via the motor record HOMF/HOMR field).

Cheers,
Matt











Data Acquisition and Controls Engineer
Spallation Neutron Source
Oak Ridge National Lab







> On Mar 7, 2019, at 12:08 PM, Engbretson, Mark S. <engbretson@anl.gov> wrote:
>
> Can you post the entire solution with the other sseq records?  This is actually a rather burning demand for a lot of people who have worries about collisions or are dealing with a mix of very fast and very slow motors.
>
> -----Original Message-----
> From: tech-talk-bounces@aps.anl.gov <tech-talk-bounces@aps.anl.gov> On Behalf Of Pearson, Matthew R. via Tech-talk
> Sent: Thursday, March 7, 2019 11:03 AM
> To: David Vine <dvine@sigray.com>
> Cc: tech-talk@aps.anl.gov
> Subject: Re: Multi-axis sequenced move using asynMotor pseudo axis
>
> Hi David,
>
> I do similar things using the sseq record, and calcout records to do checks that everything got to where it should do before progressing the sseq.
>
> If you set WAITN to be ‘Wait’ for each sseq output, and use a CA link, it will do a put_callback and wait for the motor to finish moving.
>
> I’ve pasted one example below, complete with comments explaining what each record does. It uses other sseq records to actually do the home for each motor, which I’ve not included, but it does show the high level sequencing, as well as the safety checks at each step.
>
> Cheers,
> Matt
>
> # ///
> # /// Home the optics motors in the correct order.
> # /// 1) Home DOY.
> # /// 2) Move DOY to -240. This is sufficiently 'out' to safely home DOR and DOX.
> # /// 3) Check DOY is OK and at safe position # /// 4) Home DOR and DOX together.
> # /// 5) Check DOR is OK and at safe position # /// 6) Check DOX is OK and at safe position # /// 7) Move DOY back to what it was originally # /// record(sseq, "$(S):Mot:DO:Home") {
>  field(WAIT1, "Wait")
>  field(WAIT2, "Wait")
>  field(WAIT3, "Wait")
>  field(WAIT4, "Wait")
>  field(WAIT5, "Wait")
>  field(WAIT6, "Wait")
>  field(WAIT7, "Wait")
>  field(WAIT8, "Wait")
>  field(DLY1, "0.0")
>  field(DOL1, "1")
>  field(LNK1, "$(S):Mot:DO:HomeStatus PP")
>  field(DLY2, "1.0")
>  field(DOL2, "1")
>  field(LNK2, "$(S):Mot:DOY:HomeToLowLimit.PROC CA")
>  field(DLY3, "1.0")
>  field(DOL3, "-240.0")
>  field(LNK3, "$(S):Mot:DOY CA")
>  field(DLY4, "1.0")
>  field(DOL4, "1")
>  field(LNK4, "$(S):Mot:DOY:Home:Check.PROC CA")
>  field(DLY5, "1.0")
>  field(DOL5, "1")
>  field(LNK5, "$(S):Mot:DO:HomeDORAndDOX.PROC CA")
>  field(DLY6, "1.0")
>  field(DOL6, "1")
>  field(LNK6, "$(S):Mot:DOR:Home:Check.PROC CA")
>  field(DLY7, "1.0")
>  field(DOL7, "1")
>  field(LNK7, "$(S):Mot:DOX:Home:Check.PROC CA")
>  field(DLY8, "1.0")
>  field(DOL8, "1")
>  field(LNK8, "$(S):Mot:DOY:HomeMBMoveManDef.PROC CA")
>  field(FLNK, "$(S):Mot:DO:Home:Cleanup") } record(seq, "$(S):Mot:DO:HomeDORAndDOX") {
>  field(DLY1, "0.0")
>  field(DOL1, "1")
>  field(LNK1, "$(S):Mot:DOR:HomeToGalilHome.PROC PP")
>  field(DLY2, "1.0")
>  field(DOL2, "1")
>  field(LNK2, "$(S):Mot:DOX:HomeToLowLimit.PROC PP") }
>
> record(seq, "$(S):Mot:DO:Home:Cleanup") {
>  field(DLY1, "0.0")
>  field(DOL1, "0")
>  field(LNK1, "$(S):Mot:DO:HomeStatus PP") }
>
> # ///
> # /// Homing status flag (for OPI feedback) # /// record(mbbo, "$(S):Mot:DO:HomeStatus") {
>   field(VAL,  "0")
>   field(PINI, "YES")
>   field(ZRST, "Idle")
>   field(ONST, "Running")
>   field(ZRSV, "NO_ALARM")
>   field(ONSV, "NO_ALARM")
>   info(archive, "Monitor, 00:00:01, VAL")     
> }
>
> # ///
> # /// Check homing worked for DOY and it's at a safe position # /// record(calcout, "$(S):Mot:DOY:Home:Check") {
>  field(INPA, "$(S):Mot:DOY:HomeToLowLimit:Status")
>  field(INPB, "$(S):Mot:DOY:StatusOPI")
>  field(INPC, "$(S):Mot:DOY.RBV")
>  field(CALC, "(A!=0)||(B!=0)||(C>-100.0)")
>  field(OOPT, "When Non-zero")
>  field(DOPT, "Use CALC")
>  field(OUT, "$(S):Mot:DO:Home.ABORT PP") }
>
> # ///
> # /// Check homing worked for DOR and it's at a safe position # /// record(calcout, "$(S):Mot:DOR:Home:Check") {
>  field(INPA, "$(S):Mot:DOR:HomeToGalilHome:Status")
>  field(INPB, "$(S):Mot:DOR:HomeBit")
>  field(INPC, "$(S):Mot:DOR:StatusOPI")
>  field(INPD, "$(S):Mot:DOR.RBV")
>  field(CALC, "(A!=0)||(B!=1)||(C!=0)||(D<-1)||(D>1)")
>  field(OOPT, "When Non-zero")
>  field(DOPT, "Use CALC")
>  field(OUT, "$(S):Mot:DO:Home.ABORT PP") }
>
> # ///
> # /// Check homing worked for DOX and it's at a safe position # /// record(calcout, "$(S):Mot:DOX:Home:Check") {
>  field(INPA, "$(S):Mot:DOX:HomeToLowLimit:Status")
>  field(INPB, "$(S):Mot:DOX:StatusOPI")
>  field(INPC, "$(S):Mot:DOX.RBV")
>  field(CALC, "(A!=0)||(B!=0)||(C<-1)||(C>1)")
>  field(OOPT, "When Non-zero")
>  field(DOPT, "Use CALC")
>  field(OUT, "$(S):Mot:DO:Home.ABORT PP") }
>
> # ///
> # /// Abort the above home sequence
> # ///
> record(dfanout, "$(S):Mot:DO:HomeAbort") {
>  field(DOL, "1")
>  field(OUTA, "$(S):Mot:DO:Home.ABORT PP")
>  field(OUTB, "$(S):Mot:DOY:Home:Abort.PROC PP")
>  field(OUTC, "$(S):Mot:DOX:Home:Abort.PROC PP")
>  field(OUTD, "$(S):Mot:DOR:Home:Abort.PROC PP")
>  field(OUTE, "$(S):Mot:DOY.STOP PP")
>  field(OUTF, "$(S):Mot:DOX.STOP PP")
>  field(OUTG, "$(S):Mot:DOR.STOP PP")
> }
>
>
>
>
>
> Data Acquisition and Controls Engineer
> Spallation Neutron Source
> Oak Ridge National Lab
>
>
>
>
>
>
>
>> On Mar 7, 2019, at 11:49 AM, David Vine via Tech-talk <tech-talk@aps.anl.gov> wrote:
>>
>> Hi all,
>>
>> I'm looking for the cleanest way to implement a sequence of moves of between different physical axes but hide it from the user so it appears as just a single pseudo motor axis.
>>
>> For example, I want to home axis A but to avoid a collision I need to move axes XYZ to a particular location first, then home A, and then move XYZ back to their original position at the end of the homing procedure. And that sequence should occur just clicking the home PV of A.
>>
>> I would like to set up a pseudo motor driver using an asynMotor driver and implement the logic there. Is it possible to do channel access calls from within an asynMotor driver? I couldn't find any examples. The physical axes are connected across three galil controllers.
>>
>> Implementing the logic within an SNL program would work but it seemed simpler to do it within the motor driver.
>>
>> Thanks,
>> David
>> --
>> Best regards,
>> David Vine
>> (925) 326 7503
>> dvine@sigray.com
>>
>>
>> 5750 Imhoff Drive, Suite I  |  Concord, CA 94520  |  USA
>>
>> http://www.Sigray.com
>>
>>
>> This e-mail and any attachments are provided for the sole use of the intended recipient(s), and may contain information that is confidential, privileged, proprietary or otherwise protected by law. If you are not the intended recipient of this message, you are not authorized to read, print, retain, copy, forward or otherwise disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by reply e-mail and delete the original message from your mail system. Thank you.
>>
>>
>> <image001.png>
>
>

Attachment: galil_motor_home_sns.template
Description: galil_motor_home_sns.template


Replies:
RE: Multi-axis sequenced move using asynMotor pseudo axis Engbretson, Mark S. via Tech-talk
References:
Multi-axis sequenced move using asynMotor pseudo axis David Vine via Tech-talk
Re: Multi-axis sequenced move using asynMotor pseudo axis Pearson, Matthew R. via Tech-talk
RE: Multi-axis sequenced move using asynMotor pseudo axis Engbretson, Mark S. via Tech-talk

Navigate by Date:
Prev: RE: Multi-axis sequenced move using asynMotor pseudo axis Engbretson, Mark S. via Tech-talk
Next: RE: Multi-axis sequenced move using asynMotor pseudo axis Engbretson, Mark S. 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  <20192020 
Navigate by Thread:
Prev: RE: Multi-axis sequenced move using asynMotor pseudo axis Engbretson, Mark S. via Tech-talk
Next: RE: Multi-axis sequenced move using asynMotor pseudo axis Engbretson, Mark S. 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  <20192020 
ANJ, 07 Mar 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·