APS-4ID-POLAR / ipython-polar

4-ID-Polar ipython configuration for bluesky (and other)
1 stars 3 forks source link

Tweak PVPositionerSoftDone and convert monochromator to PVPositioner #132

Closed gfabbris closed 2 years ago

gfabbris commented 3 years ago

Realize one last issue with the implementation. The fix actually made the code a bit simpler. @prjemian : I think this is ready for apstools.

gfabbris commented 3 years ago

We found a problem with this today while setting up a lakeshore: the device thinks that it's done right away. The issue seem to come from the lag between self.setpoint.put and the actual change in the value of the PV, so then, when the line below runs, it thinks that the motion is done when it actually hasn't started.

https://github.com/APS-4ID-POLAR/ipython-polar/blob/3f554e9d92e8e8004f4156ea8ac5c4809feb7278/profile_bluesky/startup/instrument/devices/util_components.py#L158

gfabbris commented 3 years ago

I think the issue with PVPositionerSoftDone is fixed, and it looks like it was as described above. The solution was to ensure that the self.setpoint.put waits for completion. Then then the self.cb_readback() runs, it sees that the positioner is in motion.

gfabbris commented 3 years ago

Now, in this process, I realized that there exists a "done" signal for the monochromator. So I switched it to a PVPositioner. For some reason, the EPICS logic seems to be reversed at 4-ID-D. The "stopped" is 1, while "moving" is 0. We have seen a similar thing with the filters, I don't remember what was the issue. I think @CrI3 knows.

lgtm-com[bot] commented 3 years ago

This pull request introduces 1 alert when merging 1bcb212668217c1b40126875733f3bc99ca1558a into e9ac549a33e158efc2f321b2333a76a1c0de0c1c - view on LGTM.com

new alerts:

timmmooney commented 3 years ago

I think KohzuThetaDmovBI is just a copy of .DMOV, which the kohzuSeq software uses to show the user which monochromator motors are moving. The strings given to the state names (0:Stopped; 1:Moving) are wrong, but they are not used. The MEDM display acts on the numeric value, and nobody ever sees the string value. Are you looking for a PV that indicates the monochromator is done moving? If so, I think you want KohzuMoving (: Done; 1: Busy), because the Y and Z motors could still be moving when Theta stops.

Tim Mooney @.***) (630)252-5417 Beamline Controls Group (www.aps.anl.gov) Advanced Photon Source, Argonne National Lab


From: Pete R Jemian @.> Sent: Wednesday, August 18, 2021 1:30 PM To: APS-4ID-POLAR/ipython-polar @.> Cc: Mooney, Tim M. @.>; Mention @.> Subject: Re: [APS-4ID-POLAR/ipython-polar] Tweak PVPositionerSoftDone and convert monochromator to PVPositioner (#132)

@prjemian commented on this pull request.


In profile_bluesky/startup/instrument/devices/monochromator.pyhttps://github.com/APS-4ID-POLAR/ipython-polar/pull/132#discussion_r691505393:

 actuate_value = 1

@timmmooneyhttps://github.com/timmmooney Can you resolve this KohzuThetaDmovBI value question we are having?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/APS-4ID-POLAR/ipython-polar/pull/132#discussion_r691505393, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABT6PFY4US3HWF6DXJT77YLT5P323ANCNFSM5CEO2ZOQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email.