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

Piezo control #3

Closed jsheppard95 closed 4 years ago

jsheppard95 commented 4 years ago

PR to begin discussion/obtain feedback on Pitch Control function block necessary for stepper/piezo combination

Summary of Changes

Current Usage

Current Issues

IF (NOT Pitch.Stepper.bAllForwardEnable OR NOT Pitch.Stepper.bAllBackwardEnable) AND (Pitch.Stepper.Axis.Status.MotionState = MC_AXISSTATE_STANDSTILL) THEN
    // Not a good way of doing things - can't move off limit switch as setpoint will stick at limit switch position
    Pitch.Stepper.fPosition := lrActPos;
    lrCurrentSetpoint := Pitch.Stepper.fPosition;
    lrLastSetpoint := lrCurrentSetpoint;
END_IF

TODO

klauer commented 4 years ago

(Closing/re-opening to kick travis + get a code summary)

klauer commented 4 years ago

Looking back, the linter error was caught by CI, but it didn't fail the build: https://travis-ci.com/pcdshub/lcls-twincat-optics/jobs/287061871 (known issue https://github.com/pcdshub/pcds-ci-helpers/issues/7). I'll get on that to try and save this from happening again...

jsheppard95 commented 4 years ago

Anyone against merging this? I haven't noticed any major issues from working with the real hardware.

klauer commented 4 years ago

Most important thing is that it works on your end. I haven't managed to find time for a full review, sadly, but am very curious to see your results with the piezo.