pcdshub / lcls-twincat-optics

TwinCAT 3 Motion Control for LCLS Optics
https://pcdshub.github.io/lcls-twincat-optics/
Other
0 stars 6 forks source link

diEncPosLimHi/diEncPosLimLo don't seem to do anything #5

Open jsheppard95 opened 4 years ago

jsheppard95 commented 4 years ago

These are left over from the original pitch control mechanism used for FEE-M1/FEE-M2. They should correspond to encoder counts of pitch limit switch positions while diEncCnt gets linked to the encoder readback. I have found that nothing happens when diEncCnt exceeds diEncPosLimHi or diEncPosLimLo

https://github.com/jsheppard95/lcls-twincat-optics/blob/piezo-control/lcls-twincat-optics/lcls_twincat_optics_plc/DUTs/HOMS_PitchMechanism.TcDUT

Regardless, hitting the physical limit switch does halt motion. This almost always occurs in PC_State := PCM_CoarseMove, where the state machine halts (I.e the original move request which resulted in hitting the limit switch is still present, but the motor has lost its FeedFwd/FeedBwd Enable so no motion occurs). The state machine will remain in PCM_CoarseMove until receiving a new motion request away from the limit, at which point the state machine can resume.

This is not ideal, but we do still also have HOMS_PitchMechanism.ReqPosLimHi/ReqPosLimLo along with NC axis soft limits that are set within the hard limits, so moves to the physical limit switches should not occur.