Skip to content

Add i06-1 magnets - #2115

Merged
Relm-Arrowny merged 96 commits into
mainfrom
add_i06_magnets
Aug 7, 2026
Merged

Add i06-1 magnets#2115
Relm-Arrowny merged 96 commits into
mainfrom
add_i06_magnets

Conversation

@oliwenmandiamond

@oliwenmandiamond oliwenmandiamond commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #2120
This add the basic device layer and control structures for the I06-1 superconducting vector magnet. It implements coordinate transformations, safe coordinated multi-axis moves, and support single axis x, y, z flyscan.

Changes

  • Magnet Controller: Adds SuperConductingMagnetController to execute coordinated step by step movements based on the active MovementStrategy mode.
  • Coordinate Systems: Adds MagnetCartesianCoordinates ($X, Y, Z$) and MagnetSphericalCoordinates ($\rho, \theta, \phi$) with automated coordinate conversion.
  • Fly Scanning: Implements Flyable and Preparable protocols on MagnetAxis to handle single axis flying.
  • Hardware Mocking: Adds MockSuperConductingMagnetController to simulate IOC ramp state transitions and setpoint behavior during testing.

Instructions to reviewer on how to test:

  1. Check implementations make sense
  2. Check tests coverage is sufficient
  3. Check doc strings for devices make sense
  4. Check dodal connect i06-1

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}

@oliwenmandiamond oliwenmandiamond changed the title Add i06 magnets Add i06-1 magnets Jul 9, 2026
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.18%. Comparing base (090b778) to head (bc1bba4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2115      +/-   ##
==========================================
+ Coverage   99.16%   99.18%   +0.02%     
==========================================
  Files         353      360       +7     
  Lines       13877    14296     +419     
==========================================
+ Hits        13761    14180     +419     
  Misses        116      116              

☔ 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.

@Relm-Arrowny Relm-Arrowny 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.

I gone through it roughly, I have a few questions

Comment thread src/dodal/beamlines/i06_1.py Outdated
Comment thread src/dodal/beamlines/i06_1.py Outdated
Comment thread src/dodal/devices/beamlines/i06_1/magnet/ramp_controller.py
Comment thread src/dodal/devices/beamlines/i06_1/magnets/ramp_controller.py Outdated
Comment thread src/dodal/devices/beamlines/i06_1/magnet/ramp_controller.py
Comment thread src/dodal/devices/beamlines/i06_1/magnets/superconducting_magnet.py
Comment thread src/dodal/devices/beamlines/i06_1/magnets/superconducting_magnet.py Outdated
Comment thread src/dodal/devices/beamlines/i06_1/magnets/superconducting_magnet.py Outdated
Comment thread src/dodal/devices/beamlines/i06_1/magnets/superconducting_magnet.py Outdated
Comment thread src/dodal/devices/beamlines/i06_1/magnets/superconducting_magnet.py Outdated
Comment thread src/dodal/devices/beamlines/i06_1/magnet/movement.py

@Relm-Arrowny Relm-Arrowny 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.

The core logic for movement strategies and mode boundary enforcement looks great! I still feel we should make MagnetAxis a pure StandardReadable so we do not bypass the controller's safety logic and eliminates the need to inject mag_within_boundary callbacks into MagnetAxis.

I know you might not be fully convinced t about keeping MagnetAxis read-only and I probably did not explain it well. If you're busy or would prefer, I'm happy to take a stab at the branch to refactor MagnetAxis, and the controller to show you what I had in mind!

Comment thread src/dodal/devices/beamlines/i06_1/magnets/movement.py Outdated
Comment thread src/dodal/devices/beamlines/i06_1/magnet/movement.py
Comment thread src/dodal/devices/beamlines/i06_1/magnet/movement.py
Comment thread src/dodal/devices/beamlines/i06_1/magnets/movement.py Outdated
Comment thread src/dodal/devices/beamlines/i06_1/magnet/movement.py
Comment thread src/dodal/devices/beamlines/i06_1/magnet/movement.py Outdated
Comment thread src/dodal/devices/beamlines/i06_1/magnet/ramp_controller.py Outdated
Comment thread src/dodal/devices/beamlines/i06_1/magnet/superconducting_magnet.py
Comment thread src/dodal/devices/beamlines/i06_1/magnet/superconducting_magnet.py
Comment thread src/dodal/devices/beamlines/i06_1/magnet/superconducting_magnet.py
@Relm-Arrowny Relm-Arrowny removed their assignment Aug 3, 2026
@Relm-Arrowny
Relm-Arrowny dismissed their stale review August 3, 2026 11:42

Removing review block due to unresolved design impasse around coupling and hardcoded safety limits.

@Relm-Arrowny Relm-Arrowny 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.

Looks great! Thanks for pushing this update—the multi-axis movement strategy delegation and fly-scan protocols look super clean and well-structured.

Before hitting merge, I went ahead and added a quick minor safety tweaks:
Default Timeout on _trigger_ramp(): Added a fallback safety timeout (timeout=500.0) when waiting for RAMP_MADE so Bluesky plans won't hang indefinitely if the IOC stalls.

Comment thread src/dodal/devices/beamlines/i06_1/magnet/movement.py
Comment thread src/dodal/devices/beamlines/i06_1/magnet/movement.py
@Relm-Arrowny

Copy link
Copy Markdown
Contributor

DiamondLightSource/sm-bluesky#356
#2166
#2166 is more important than the other.

@Relm-Arrowny
Relm-Arrowny merged commit b4b38f1 into main Aug 7, 2026
11 checks passed
@Relm-Arrowny
Relm-Arrowny deleted the add_i06_magnets branch August 7, 2026 10:44
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.

Create i06 vector magnet device in dodal

4 participants