epics-modules / motor

APS BCDA synApps module: motor
https://epics-modules.github.io/motor/
20 stars 47 forks source link

soft motor default LLM same as HLM #123

Closed prjemian closed 5 years ago

prjemian commented 5 years ago

With motor-R6-10-1 and using the motorSim soft motors, both LLM and HLM come up as identical. Since they are non-zero and the motor is at zero, the soft motor cannot move until the lower limit is changed. All 16 soft motors created from an XXX IOC have this problem. (See https://github.com/epics-modules/xxx/issues/18)

The problem seems to be when a symbol is not defined and a default value is provided. In the source of the motorSim.iocsh:

motorSimCreate($(CONTROLLER=0), 0, $(LOW_LIM=-32000), $(HIGH_LIM=32000), $(HOME_POS=0), 1, $(NUM_AXES=1))

The default value for LOW_LIM, when the symbol is not defined, becomes positive.

kmpeters commented 5 years ago

I don't see any problems with the motorSimCreate line in motorSim.iocsh. I do, however, see that the DHLM and DLLM values are the same in the dbLoadTemplates line:

https://github.com/epics-modules/motor/blob/6f2f42305a30e92ab81a34a9bc583bf0f543cb3e/iocsh/motorSim.iocsh#L34

I will correct that now.

kmpeters commented 5 years ago

@prjemian, does commit df11f3e153e2aa6c6cb605cbc1392e0a9e663d93 resolve this issue and eliminate the need to define LOW_LIM in the iocshLoad call in motors.cmd?

prjemian commented 5 years ago

@kmpeters - I confirm that is the fix. Thanks!