Hi Will,
I don't know the state of Kunal's repository that you referenced. I think the more "official" simulated motor repository is this one:
https://github.com/epics-motor/motorMotorSim
There are actually 2 drivers in that source code, a "Model 2" driver (drvMotorSim.c) and a new "Model 3" driver (motorSimDriver.cpp). I recommend only using motorSimDriver.cpp since that is the current standard framework.
The example IOC loads 8 motors. The first 4 are the old Model 2 driver, and the last 4 are the new Model 3 driver.
I just tested homing with both drivers.
With the Model 2 driver when the homing is complete MSTA is 0xa. This is bits 1 and 3 which mean
unsigned int RA_HOME :1; /* The home signal is on */
unsigned int RA_DONE :1; /* a motion is complete */
With the Model 3 driver when the homing is complete the MSTA is 0x82. This is bits 1 and 7 which mean
unsigned int EA_HOME :1; /* encoder home signal on */
unsigned int RA_DONE :1; /* a motion is complete */
So one driver sets RA_HOME (not encoder home) while the other set EA_HOME (encoder home).
Note that neither of them set bit 14 which is
unsigned int RA_HOMED :1; /* Axis has been homed.*/
This is probably an bug in these drivers, they should be setting that bit as well.
Mark
________________________________
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of William Cork via Tech-talk <tech-talk at aps.anl.gov>
Sent: Friday, April 10, 2020 10:25 AM
To: tech-talk at aps.anl.gov
Subject: Home motorSim Device
Playing around with the motor and asyn modules to get more familiar with EPICS motion control.
I'm using an example motorSim found here: https://github.com/shroffk/motorsim.git
Using:
asyn-R4-37
motor-R7-1
calc-R3-7-3
Having an issue where I tell an sioc using motorSim to home but, the MSTA record never updates the HOMED bit.
Startup deck has these lines to configure motorSim device:
```
motorSimCreate( 0, 0, -32000, 32000, 0, 1, 6 )
drvAsynMotorConfigure("motorSim1", "motorSim", 0, 6)
```
fakemotor.db:
```
record(ao, "$(Sys)$(Dev)-SP") {
field(FLNK, "$(Sys)$(Dev)-SP_")
}
record(seq, "$(Sys)$(Dev)-SP_") {
#disable mtr rec processing
field(DOL1, "1")
field(LNK1, "$(Mtr).DISA")
# write setpoint to mtr rec
field(DLY2, "0.1")
field(DOL2, "$(Sys)$(Dev)-SP")
field(LNK2, "$(Mtr).VAL CP")
# to re-enable mtr rec processing, write or process "$(Sys)$(Dev)Cmd:Go-Cmd"
}
record(ai, "$(Sys)$(Dev)-I") {
field(INP, "$(Mtr).RBV CPP")
}
record(bo, "$(Sys)$(Dev)Cmd:Go-Cmd") {
field(DOL, "0")
field(OUT, "$(Mtr).DISA CPP")
}
record(bo, "$(Sys)$(Dev)Cmd:Stop-Cmd") {
field(VAL, "1")
field(OUT, "$(Mtr).STOP CPP")
}
record(bi, "$(Sys)$(Dev)Sts:Moving-Sts") {
field(INP, "$(Mtr).DMOV CPP")
field(ZNAM, "Moving")
field(ONAM, "Done")
}
```
Does motorSim have support for homing?
Is it broken from the seq record in fakemotor.db?
Your help is appreciated,
Will
- Replies:
- Re: Home motorSim Device William Cork via Tech-talk
- Re: Home motorSim Device Peterson, Kevin M. via Tech-talk
- References:
- Home motorSim Device William Cork via Tech-talk
- Navigate by Date:
- Prev:
Home motorSim Device William Cork via Tech-talk
- Next:
RE: Filtering messages print on the IOC shell console Freddie Akeroyd - UKRI STFC 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:
Home motorSim Device William Cork via Tech-talk
- Next:
Re: Home motorSim Device William Cork 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
|