epics-modules / motor

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

RHLM, RLLM and MRES < 0 doesn't work #205

Closed tboegi closed 1 year ago

tboegi commented 1 year ago

(Currently testing on commit d80b006a39de2853090a1d9574bb0297c2b92e0c)

The introduction of RHLM and RLLM did not consider the use case when MRES < 0: When commanded "forwards", the motor moves "backwards". The soft limits needs to be swapped, depending on the change, either RHLM vs RLLM or DHLM vs DLLM.

As a rule of thumb, RHLM should be updated when SET_HIGH_LIMIT is send to the driver:

if (command == SET_HIGH_LIMIT) { pmr->rhlm = tmp_raw;

I am preparing a patch @kmpeters, should be ready the next days

tboegi commented 1 year ago

https://github.com/epics-modules/motor/pull/206

The used test case is here: https://github.com/EuropeanSpallationSource/m-epics-ethercatmc/blob/master/test/pytests36/900_Simulator-Softlimits.py (But I don't expect anyone to understand all of it)

kmpeters commented 1 year ago

@tboegi, thanks for the pull request!

Fixed by #206

rerpha commented 1 year ago

Sorry @tboegi , was an oversight on my part! Thanks for fixing