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

Subject: motorRecord with phytron support: record send goto 0 command before reference is done
From: Bernhard Kuner via Tech-talk <tech-talk at aps.anl.gov>
To: <tech-talk at aps.anl.gov>
Date: Thu, 24 Mar 2022 11:52:42 +0100

We have motorRecord 7.1 and the motorPhytron support. This works fine with the phyMotion module I1AM01, controler with power stage. Now we want to use the indexer module I1EM01 and find that the motorRecord send its go to 0 position before the reference on the limit switch is finished by the motor controller.

The limit switch is reached but before the motor controller sends its HALT signal, set its position to 0 and its DONE status, the motorRecord send a go to 0-Posiion command. this will end up in a undefined position. The phyMotion reference to a switch will hit the switch, slow down and leave it. Than the reference is done and the position set to 0

The Question is, how does the motorRecord recognise a finished reference. In the phytronMotor driver there are following status bits processed in the ::poll(*moving) function:

- *moving:  phyMotion command "Mn.m==H" response shows halt or move

- Status bits for limit switches to the according axis controller variables and bit for initialised for motor status home

- INITIALISED -> pC_->motorStatusHomed_

- INITIALISED -> pC_->motorStatusHome_

- setIntegerParam(pC_->axisStatus_, axisStatus);

I suppose INITIALISED is used to flag the record home is done. At last, the whole axisStatus will be set to the axis controller. This controler status is not the motorRecord.MSTA What I found in the sources is that it is there compared to the old status to recognise changes, but not any processing of single bits. Each controler would have its own bits, so it wouldn't make sense to process it in the motorRecord.

Relay strange is, that it works with the other module. There are some other status bits set e.g. the PositioningMode bit, but all these is not used by the phytronMotor support.

The following beautified log of the IP-Port shows that the motorRecord sends a move command before this is done:

M1.1P20R reads the position 
M1.1==H  checks for motor running
M1.1SE   read the motor status. The strings show "isInit DONE" if motor is idle and bits that change while performing any action
M1.1R+   The reference command
M1.1An   move to absolute position


* Motor is idle
15:20:08.052	wr	M1.1==H
15:20:08.063	rd	E
15:20:08.063	wr	M1.1SE
15:20:08.072	rd	1573384, 0x180208 STAT:0x180208 STAT: isInit DONE 

* HOMF command: set move parameters and home command: M1.1R
15:20:08.382	wr	M1.1P08=1000.000000
15:20:08.393	rd	
15:20:08.393	wr	M1.1P10=180.000000
15:20:08.402	rd	
15:20:08.403	wr	M1.1P09=4000.000000
15:20:08.412	rd	
15:20:08.412	wr	M1.1R+
15:20:08.422	rd	
15:20:08.422	wr	M1.1P20R
15:20:08.432	rd	1
15:20:08.443	wr	M1.1==H
15:20:08.452	rd	N
15:20:08.452	wr	M1.1SE
15:20:08.462	rd	1050113, 0x100601 STAT:0x100601 STAT: busy Ramp
15:20:08.933	wr	M1.1P20R
15:20:08.942	rd	416
15:20:08.952	wr	M1.1==H
15:20:08.962	rd	N
15:20:08.962	wr	M1.1SE
15:20:08.972	rd	1049089, 0x100201 STAT:0x100201 STAT: busy
15:20:09.432	wr	M1.1P20R
15:20:09.442	rd	917
Motor moves forward
15:20:47.016	wr	M1.1==H
15:20:47.036	rd	N
15:20:47.036	wr	M1.1SE
15:20:47.046	rd	1049089, 0x100201 STAT:0x100201 STAT: busy
15:20:47.496	wr	M1.1P20R
15:20:47.507	rd	38969
15:20:47.516	wr	M1.1==H
15:20:47.526	rd	N
15:20:47.526	wr	M1.1SE

* Motor hit LS+ switch, ramp down and try to leave the LS+ switch slowly. If this is done, 
  it will reset the position to 0 and set halt and isInit bit, but....
15:20:47.536	rd	1050129, 0x100611 STAT:0x100611 STAT: busy LS+ Ramp
15:20:47.736	wr	M1.1P20R
15:20:47.746	rd	39031
15:20:47.756	wr	M1.1==H
15:20:47.766	rd	N
15:20:47.766	wr	M1.1SE
15:20:47.776	rd	1049105, 0x100211 STAT:0x100211 STAT: busy LS+
15:20:47.776	wr	M1.1SE
15:20:47.786	rd	1049105, 0x100211 STAT:0x100211 STAT: busy LS+

... before this is done there is the go to 0 command from the motorRecord!
15:20:47.786	wr	M1.1P14=1000.000000
15:20:47.796	rd	
15:20:47.796	wr	M1.1P04=180.000000
15:20:47.806	rd	
15:20:47.806	wr	M1.1P15=4000.000000
15:20:47.816	rd	

* because the motorRecord.OFF field is 0 here, the command is go to 0
15:20:47.816	wr	M1.1A0
15:20:47.851	rd	
15:20:47.860	wr	M1.1P20R
15:20:47.866	rd	39019
15:20:47.876	wr	M1.1==H
15:20:47.886	rd	N
15:20:47.886	wr	M1.1SE
15:20:47.897	rd	1050129, 0x100611 STAT:0x100611 STAT: busy LS+ Ramp
15:20:48.356	wr	M1.1P20R
15:20:48.366	rd	38609
15:20:48.376	wr	M1.1==H
15:20:48.386	rd	N
15:20:48.386	wr	M1.1SE
15:20:48.396	rd	1049089, 0x100201 STAT:0x100201 STAT: busy
15:20:48.846	wr	M1.1P20R
15:20:48.856	rd	38118
15:20:48.866	wr	M1.1==H
15:20:48.876	rd	N
15:20:48.886	rd	1049089, 0x100201 STAT:0x100201 STAT: busy
15:20:49.336	wr	M1.1P20R
15:20:49.347	rd	37628




Helmholtz-Zentrum Berlin für Materialien und Energie GmbH

Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.

Aufsichtsrat: Vorsitzender Dr. Volkmar Dietz, stv. Vorsitzende Dr. Jutta Koch-Unterseher
Geschäftsführung: Prof. Dr. Bernd Rech, Thomas Frederking

Sitz Berlin, AG Charlottenburg, 89 HRB 5583

Postadresse:
Hahn-Meitner-Platz 1
14109 Berlin
Deutschland

Replies:
Re: motorRecord with phytron support: record send goto 0 command before reference is done Kevin Peterson via Tech-talk

Navigate by Date:
Prev: ScrollBar in Phoebus - cannot set $(pv_value) in script Amien Crombie via Tech-talk
Next: Re: [EXTERNAL] ScrollBar in Phoebus - cannot set $(pv_value) in script Kasemir, Kay 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  <20222023  2024 
Navigate by Thread:
Prev: Re: [EXTERNAL] ScrollBar in Phoebus - cannot set $(pv_value) in script Kasemir, Kay via Tech-talk
Next: Re: motorRecord with phytron support: record send goto 0 command before reference is done Kevin Peterson 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  <20222023  2024 
ANJ, 14 Sep 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·