epics-motor / motorSmarAct

EPICS motor drivers for SmarAct controllers
3 stars 13 forks source link

Move without encoder #7

Closed LeeYangLBLBCS closed 1 year ago

LeeYangLBLBCS commented 3 years ago

I added code to allow smarActMCS controller to work with motors without encoder. Any comments are welcome. (This is my first attempt to modify EPICS code).

This change is best described by Mark Rivers email (copied below):

Each axis object has a new flag indicating whether or not it has an encoder. Each axis object has a new variable to store the current position. If the axis has an encoder the current behavior is not changed and the new position variable is not used. If the axis does not have an encoder the new position variable is used to keep track of the position. Each time the axis is homed this position variable is set to 0. Each time the axis does a relative move the position variable is incremented accordingly Each time the axis does an absolute move it is converted to a relative move by comparing with the current position, and then the current position is updated. Do the axes without encoders have a way of saying when the move is in progress and then is complete? If yes then only update the motor readback to the new position when it is complete. If no then update the motor readback to the new position when the move starts.

LeeYangLBLBCS commented 3 years ago

Reviewer requested: @kmpeters @MarkRivers