Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing HIGH_LIM specification in motors.iocsh #46

Closed
prjemian opened this issue Feb 8, 2021 · 4 comments · May be fixed by #47
Closed

Missing HIGH_LIM specification in motors.iocsh #46

prjemian opened this issue Feb 8, 2021 · 4 comments · May be fixed by #47

Comments

@prjemian
Copy link
Contributor

prjemian commented Feb 8, 2021

When choosing a smaller MRES value than the default 0.01 in motorSim.substitutions, encountered that with MRES=1.0e-5, the high limit switch for a soft asynMotor was unexpectedly at 0.32.

{N, M, ADDR, DESC, EGU, DIR, VELO, VBAS, ACCL, BDST, BVEL, BACC, MRES, PREC, INIT}
{1, "m$(N)", 0, "motor $(N)", degrees, Pos, 1, .1, .2, 0, 1, .2, 0.01, 5, ""}

I note this is a coincidence with the values of HLM=32000 and MRES=1e-5.

This happens when using motorSim.iocsh from motorSim.iocsh:

#iocshLoad("$(MOTOR)/modules/motorMotorSim/iocsh/motorSim.iocsh", "INSTANCE=motorSim, HOME_POS=0, NUM_AXES=16, LOW_LIM=-32000, SUB=substitutions/motorSim.substitutions")

@prjemian
Copy link
Contributor Author

prjemian commented Feb 8, 2021

As noted elsewhere, the high limit switch value can be controlled by adding HIGH_LIM=32000, to motors.iocsh, such as with this sed patch:

sed -i s:'LOW_LIM=':'HIGH_LIM=32000, LOW_LIM=':g ./motors.iocsh

@prjemian
Copy link
Contributor Author

prjemian commented Feb 8, 2021

This change is not necessary since a default value of 32000 is supplied if HIGH_LIM is not defined:

root@poof:.../xxx-R6-2/iocBoot/iocxxx# more $MOTOR/iocsh/motorSim.iocsh
# ### motorSim.iocsh ###

#- ###################################################
#- PREFIX           - IOC Prefix
#- INSTANCE         - Instance name, used to create the low-level driver drvet name
#-                    Combined with the controller number to create the asyn port name
#-
#- SUB              - Optional: Subsitutions file (asyn_motor.db), Macros P, DTYP, PORT, 
#-                              DHLM, DLLM, and INIT will be predefined.
#-                    Default: $(MOTOR)/iocsh/EXAMPLE_motorSim.substitutions
#-
#- CONTROLLER       - Optional: Which controller is being configured
#-                    Default: 0
#-
#- NUM_AXES         - Optional: Number of axes on this controller
#-                    Default: 1
#-
#- LOW_LIM          - Optional: Low Limit
#-                    Default: -32000
#-
#- HIGH_LIM         - Optional: High Limit
#-                    Default: 32000
#- 
#- HOME_POS         - Optional: Home position
#-                    Default: 0
#- ###################################################

# Create simulated motors: ( start card , start axis , low limit, high limit, home posn, # cards, # axes to setup)
motorSimCreate($(CONTROLLER=0), 0, $(LOW_LIM=-32000), $(HIGH_LIM=32000), $(HOME_POS=0), 1, $(NUM_AXES=1))

# Setup the Asyn layer (portname, low-level driver drvet name, card, number of axes on card)
drvAsynMotorConfigure("$(INSTANCE)$(CONTROLLER=0)", "$(INSTANCE)", $(CONTROLLER=0), $(NUM_AXES=1))

dbLoadTemplate("$(SUB=$(MOTOR)/iocsh/EXAMPLE_motorSim.substitutions)", "P=$(PREFIX), DTYP='asynMotor', PORT=$(INSTANCE)$(CONTROLLER=0), DHLM=$(HIGH_LIM=32000), DLLM=$(LOW_LIM=-3
2000)")

@prjemian
Copy link
Contributor Author

prjemian commented Feb 8, 2021

What imposes the high limit switch value for this soft asynMotor?

@prjemian
Copy link
Contributor Author

prjemian commented Apr 3, 2023

The HIGH_LIM symbol is now in the substitutions file. Moved the second question to a new issue.

@prjemian prjemian closed this as completed Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant