Hej Tine,
this smells a little bit like the
"done before even started" phenomenon.
The controller is commanded to move, execute is set, but it hasn't
started yet.
If this the case: We have added the
"waitNumPollsBeforeReady" feature, in the EPICS driver.
This may help:
<https://github.com/EuropeanSpallationSource/m-epics-ethercatmc/blob/master/ethercatmcApp/src/ethercatmcAxis.cpp>
(And today, we are using a different approach, with a bi-directional
state machine inside the PLC-code. But that is a longer story)
BR
/Torsten
On 2022-09-28 16:57, Celcer Tine (PSI) via Tech-talk wrote:
addendum: The delay is actually on the TwinCAT PLC between issuing the
EXECUTE command and the time of setting the DONE flag to “ACTIVE”.
--
Dr. Tine Celcer
Controls Section
Group Leader Integration and Support – Photon Science
Group Leader a.i. Integration and Support – Large Research Facilities
WBGB/013
Phone: +41 56 310 46 29
tine.celcer at psi.ch <mailto:tine.celcer at psi.ch>
Paul Scherrer Institut
CH-5232 Villigen PSI
On 28 Sep 2022, at 16:32, Celcer Tine (PSI) <Tine.Celcer at psi.ch
<mailto:Tine.Celcer at psi.ch>> wrote:
Hi all,
We use a Beckhoff TwinCAT controller to move 3 independent axes, and
it is integrated into EPICS via the s7 driver. Now I am trying to add
the soft motor record support on top of that. Everything works fine
except for a problem with the .DMOV field. The .DINP filed is linked
to the DONE flag of the TwinCAT controller.
When initiating the motion from “s7” EPICS PVs, the soft motor DMOV
field behaves as expected, however when the move is initiated by the
motor record I get the 1/0/1/0/1 pulse form the DMOV instead of the
desired 1/0/1 (of course any user script monitoring the DMOV would
capture that additional pulse). I notice that the first 1/0/1 pulse
happens before the DONE flag changes to 0, and the remaining /0/1 part
is in accordance with the processing of the DONE flag (as expected via
ca link).
I suspect that the reason is in the way the Twincat motion is
implemented - one has to set the position first and then execute the
“GO” command. I handle this with a sequence record that is linked to
the OUT filed of the motor record. Could the fact that there is a
delay between the time of writing to the motor record .VAL field and
the time that the “GO” command is issued on the PLC and the DONE flag
processes, cause the initial 1/0/1 pulse on the motor record .DMOV
field (thinking there is no move - analog to sending it to the current
position)?
And if this is the case, is there a “timeout” I could set for that? Or
any other ideas how to overcome this issue?
——
record(motor, "$(P):$(AXIS)") {
field(DESC, "$(AXIS) soft motor")
field(DTYP, "Soft Channel")
field(OUT, "$(P):$(AXIS)_SETANDGO PP")
field(RDBL, "$(P):$(AXIS)_RBVCALC NPP")
field(MRES, "1")
field(RRES, "1")
field(URIP, "Yes")
field(PREC, "2")
field(EGU, "mm")
field(TWV, "1")
field(DINP, "$(P):$(AXIS)_DONE NPP")
field(RTRY, "0")
field(NTM, "NO")
}
record(seq, "$(P):$(AXIS)_SETANDGO") {
field(DOL1, "$(P):$(AXIS).DVAL")
field(LNK1, "$(P):$(AXIS)_SETPOS PP")
field(DOL2, "1")
field(LNK2, "$(P):$(AXIS)_EXECUTE PP")
}
---------
Thanks,
Tine
--
Dr. Tine Celcer
Controls Section
Group Leader Integration and Support – Photon Science
Group Leader a.i. Integration and Support – Large Research Facilities
WBGB/013
Phone: +41 56 310 46 29
tine.celcer at psi.ch <mailto:tine.celcer at psi.ch>
Paul Scherrer Institut
CH-5232 Villigen PSI
- Replies:
- Re: DMOV flag problem with soft motor Kevin Peterson via Tech-talk
- References:
- DMOV flag problem with soft motor Celcer Tine (PSI) via Tech-talk
- Re: DMOV flag problem with soft motor Celcer Tine (PSI) via Tech-talk
- Navigate by Date:
- Prev:
Re: DMOV flag problem with soft motor Celcer Tine (PSI) via Tech-talk
- Next:
Change PVA structure dynamically during IOC operation Alnajjar, Dawood 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
<2022>
2023
2024
- Navigate by Thread:
- Prev:
Re: DMOV flag problem with soft motor Celcer Tine (PSI) via Tech-talk
- Next:
Re: DMOV flag problem with soft motor 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
<2022>
2023
2024
|