Repository navigation
Description
Goals
Acceptance criteria : What journeys should the user be able to complete to consider your feature done
Be as specific as you can, check them off once they work. Add more if you find more requirements during development. Issue should only be considered done after all of them are checked
- A user can instantiate the 4-magnet Halbach array controller as an Device and connect to all four underlying motors.
- Field Control (
set): A Bluesky plan (e.g.,bps.mvorbp.scan) can command a target signed magnetic field strength (Hwithin[-180, +180]mT) and target field angle relative to the$z$ -axis (Field_Anglewithin[-90°, +90°]), and the controller moves all four motors simultaneously to the interpolated positions. - Smooth Trajectory: A user can scan smoothly across
$0\text{ mT}$ (from$-180\text{ mT}$ to$+180\text{ mT}$ ) at any fixed angle in[-90°, +90°], or sweep angles at fixed field amplitude, without motor wrap-around jumps.
Tasks
base on the goals, deduce the tasks required. check them off once they're done
- Define Lookup Table for halbach array mmg_toolbox#81
- Implement fast 2D bilinear interpolation over the
(Field_Angle_Z)grid using them1_unwrapped_deg–m4_unwrapped_degcolumns to guaranteecontinuous motor paths across 0/360 boundaries. - Implement Controller with the lookup table:
- Create a composite
Device(e.g.,HalbachMagnetArray(StandardReadable)) containing the 4 underlying motorMovable/StandardReadablesub-devices (m1,m2,m3,m4). - Expose
field_strength(H_mT) andfield_angle(Field_Angle_Z_deg) asStandardReadable&Movablemethods. - Implement synchronized multi-axis motion (
asyncio.gather) when a new(H, angle)setpoint is commanded, including shortest-path / unwrapped target calculation relative to current motor positions.
- Create a composite
- Implement Trajectory / Continuous Scan Support(optional):
- Support multi-step waypoint interpolation for large field excursions (e.g., sweeping from
$-180\text{ mT}$ to$+180\text{ mT}$ in fine increments) so the motors follow the calibrated non-linear$\sin(\alpha)$ curve rather than cutting across chords in motor space.
- Support multi-step waypoint interpolation for large field excursions (e.g., sweeping from
Activity
Relm-Arrowny commentedon Nov 17, 2026
The data in t rows 8–11 and 23 of fine_optimize_results_inSP.csv appears to jump. alos the data is incomplete it shown the -34 to 34 but we required -180 to 180.
Current solution is to drop those data and create a interoperated lut.
Relm-Arrowny commentedon Nov 17, 2026
The game plan:
The field at the centre is roughlyt:
And each rotating magnet is a simple dipole and can be express in:
Taking the perturbation to the 3rd order and taking advantage of each magnet is roughly symmetric we can remove the 2nd order so the field is roughly:
All we needed to do than is to fit the model with the data to extract the a,b,c, We could also add some correction to match the model closely with the data.