DiamondLightSource / pmac

Driver for the Delta Tau PMAC motion controller family.
Apache License 2.0
25 stars 17 forks source link

PPMAC - Disable limits not supported #122

Open LeandroMartinsdS opened 8 months ago

LeandroMartinsdS commented 8 months ago

In TurboPMAC, the limits are monitored by examining the ix24 variables. However, in PowerPMAC, ix24 represents the address of the servo-loop being used. PowerPMAC also includes protection against writing to invalid addresses. The element Motor[%d].pLimits should be used instead.

This difference makes operations like i%d24=i%d24&$FDFFFF and i%d24=i%d24|$20000 invalid in PowerPMAC. Moreover, these operations do not disable or enable the limits as one might expect. The correct operation should be something like Motor[%d].pLimits=0 for disabing, and Motor[%d].pLimits=Gate3[%d].Chan[%d].Status.a for enabling (preferably that address should be stored when disabling the limits).

When checking ix24, the response formats differ between TurboPMAC and PowerPMAC:

Ultimately, these differences might lead to undesired behavior in two scenarios: