Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simultaneous ramping of magnetic field in all 3 axes #3233

Merged
merged 56 commits into from
Sep 20, 2021

Conversation

astafan8
Copy link
Contributor

@astafan8 astafan8 commented Jul 29, 2021

Sweep AMI 3D magnet to (x,y,z) in time T or at vector ramp rate R, ramping all 3 axes together (in parallel), making a linear/vector trajectory from current field to the setpoint in 3D magnetic field space.

For working with ramp duration, see:

i3d.ramp_simultaneously(setpoint=FieldVector(0.5, 1.0, 0.01), duration=2)
# See the docstring of this method for details

For working with the new vector ramp rate, see:

i3d.ramp_mode("simultaneous")
i3d.vector_ramp_rate(0.05)  # requires all axes to have same units!!!
i3d.cartesian(x,y,z)  # or any other parameter call that initiates a ramp

Note that actually simultaneous ramping is already supported with the current driver, one just needs to set the block_during_ramp parameter to False, so that the driver does not wait for one axis to finish ramping before starting ramping next one, and then manually/explicitly wait until the ramping is done. However, the benefit of the new simultaneous ramp mode and the ramp_simultaneously method is that it automatically calculates and adjusts the ramp rates of the axes.

ToDos:

  • ensure that if the requested field change is 0 for one/two/all-three axes, so ramping "simply works" (e.g. the instrument attempts to ramp, find that it's already in the right place, and stops ramping)
  • handle the case when the requested field change for a given axis results in a ramp rate that is less than minimal ramp rate - i hope that the instrument will just use whatever the minimum ramp rate is
  • example notebook
  • test on instruments

@codecov
Copy link

codecov bot commented Jul 29, 2021

Codecov Report

Merging #3233 (0cab6e4) into master (6913e75) will decrease coverage by 0.11%.
The diff coverage is 45.04%.

@@            Coverage Diff             @@
##           master    #3233      +/-   ##
==========================================
- Coverage   66.23%   66.12%   -0.12%     
==========================================
  Files         220      220              
  Lines       29272    29356      +84     
==========================================
+ Hits        19388    19411      +23     
- Misses       9884     9945      +61     

Copy link

@dbwz8 dbwz8 left a comment

Choose a reason for hiding this comment

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

Did a quick look. Didn't see anything obviously wrong.

@astafan8 astafan8 changed the title Linear magnetic field sweep Simultaneous ramping of magnetic field in all 3 axes Aug 3, 2021
@astafan8 astafan8 added the driver label Aug 9, 2021
@astafan8 astafan8 added this to the 0.28.0 milestone Aug 9, 2021
astafan8 and others added 22 commits September 6, 2021 14:16
@astafan8 astafan8 marked this pull request as ready for review September 20, 2021 14:08
@astafan8 astafan8 merged commit c322a3a into microsoft:master Sep 20, 2021
@astafan8 astafan8 deleted the linear-magnetic-field-sweep branch September 20, 2021 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants