epics-modules / motor

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

Infinite encoder ratio in devMotorAsyn.c if ERES undefined #213

Closed kmpeters closed 10 months ago

kmpeters commented 10 months ago

If ERES is not defined in a database or autosave it defaults to zero, which results in an infinite encoder ratio:

https://github.com/epics-modules/motor/blob/f8a3239f0678f8f3d75fd5cf2f9c717dc3db9426/motorApp/MotorSrc/devMotorAsyn.c#L177

The problem was discovered by @MarkRivers and reported on tech-talk:

https://epics.anl.gov/tech-talk/2024/msg00121.php

The fix:

Set the encoder ratio to one if ERES is zero.