Skip to content

I19: Set up devices for beam centre move - #2227

Merged
noemifrisina merged 31 commits into
mainfrom
i19-166-ad-plugin-chain
Oct 20, 2026
Merged

noemifrisina merged 31 commits into
mainfrom
i19-166-ad-plugin-chain

Conversation

@noemifrisina

@noemifrisina noemifrisina commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Closes i19-bluesky#179
Needed for i19-blueasky#180

  • Updates access controlled piezo device to have a readable setpoint, ad they are not in a closed loop and the rbv is drifting a lot
  • Adds a device that sets up the CAM->CC->STAT plugin chain on the OAV to read the centroid position

Instructions to reviewer on how to test:

  1. Run dodal connect i19-1 and verify all devices connect
  2. Run tests

Checks for reviewer

  • Would the PR title make sense to a scientist on a set of release notes
  • If a new device has been added does it follow the standards
  • If changing the API for a pre-existing device, ensure that any beamlines using this device have updated their Bluesky plans accordingly
  • Have the connection tests for the relevant beamline(s) been run via dodal connect ${BEAMLINE}

@noemifrisina noemifrisina changed the title I19 166 ad plugin chain I19: Set up devices for beam centre move Oct 1, 2026
@codecov

codecov Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.29%. Comparing base (f0c45d3) to head (582c4d6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2227   +/-   ##
=======================================
  Coverage   99.29%   99.29%           
=======================================
  Files         371      372    +1     
  Lines       14583    14630   +47     
=======================================
+ Hits        14480    14527   +47     
  Misses        103      103           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DominicOram DominicOram left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, couple of comments but no showstoppers

):
with self.add_children_as_readables(StandardReadableFormat.HINTED_SIGNAL):
self.setpoint = epics_signal_r(float, f"{prefix}AOFPITCH")
# Piezo not in a closed loop so readback drifting

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could: Is this still true? Comments in other issues say it's now closed loop? I think we can just remove the comment and maybe read the setpoint as a CONFIG_SIGNAL signal as it's still good to know

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm afraid the original comment I put in wasn't entirely correct - While now we're in a closed loop for both piezos, the RBV value is still drifting a little bit (just not nearly as much as before) so we still should use the setpoint to get the current voltage

(Just to give an idea:

camonitor BL19I-OP-HFM-01:AOFPITCH BL19I-OP-HFM-01:AOFPITCH:RBV
BL19I-OP-HFM-01:AOFPITCH       2026-10-13 11:33:58.135582 1.265  
BL19I-OP-HFM-01:AOFPITCH:RBV   2026-10-13 14:38:40.714331 1.32877  
BL19I-OP-HFM-01:AOFPITCH:RBV   2026-10-13 14:38:40.814331 1.32938  
BL19I-OP-HFM-01:AOFPITCH:RBV   2026-10-13 14:38:40.914331 1.3303  
BL19I-OP-HFM-01:AOFPITCH:RBV   2026-10-13 14:38:41.014331 1.32755  
BL19I-OP-HFM-01:AOFPITCH:RBV   2026-10-13 14:38:41.114331 1.32816  
BL19I-OP-HFM-01:AOFPITCH:RBV   2026-10-13 14:38:41.214331 1.32755 

I'll put in a better one

Comment on lines +17 to +18
CAM_PLUGIN_NAME = "OAV1.cam"
CC_PLUGIN_NAME = "OAV1.cc"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should: We should be able to read these from PVs as e.g. BL19I-EA-OAV-02:CAM:PortName_RBV



class CentroidFromEpics(StandardReadable, Preparable, Triggerable):
"""Device to set up the CAM -> CC -> STAT plugin chain and get the centroid."""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could: Can we add a few more docs on what it's doing e.g. why do we need the CC?

@DominicOram DominicOram left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, apologies I missed something

)

@AsyncStatus.wrap
async def trigger(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should: Sorry, only really thought about this after reviewing the other PR but feels like this might be better as a stage/unstage? See https://github.com/DiamondLightSource/i19-bluesky/pull/186/changes#r4269245530

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough - tbh I briefly wondered the same when I got to the plan bit but wasn't totally sure it was worth it... and I just decided to leave it up to the review at that point

@DominicOram DominicOram left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you!

@noemifrisina
noemifrisina merged commit b28dedd into main Oct 20, 2026
11 checks passed
@noemifrisina
noemifrisina deleted the i19-166-ad-plugin-chain branch October 20, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use AD plugin chain for centroid

2 participants