-
Notifications
You must be signed in to change notification settings - Fork 2
Zero field controller
Wiki > The Backend System > Specific Device IOC > Other > Zero field controller
This page describes our understanding of the requirements for the MUON zero-field controller.
On a muon instrument, the purpose of the MUON zero-field controller is to maintain a constant (not necessarily zero) magnetic field in the region surrounding the sample. The field should be maintained as external magnetic fields change (i.e. another instrument switches on their magnet). This is achieved by measuring the magnetic field at a fixed sample point. The field should be stable at around the mG level and needs updating at a frequency of ~1Hz.
The magnetic field in the sample region is generated by electromagnets (except on HIFI where they are shims to superconducting magnets). The magnetic field is generated by 3 coils perpendicular to each other, so there are 3 different currents that need controlling. A magnetometer is used to measure the magnetic field (in mG) in the sample region; this is called the fixed sensor. The magnetometer provides 3 magnetic field readings; one for the z component (along the beam), one for the y component (vertical and perpendicular to the beam) and x (parallel to the floor). The fixed sensor is close to but not at the sample position.
On different instruments there is slightly different equipment:
- EMU, MuSR, ARGUS, CHRONUS
- Magnetometer: flux gate (has lower maximum field than the hall probes) connected to a NI 9125 cDAQ
- Magnets: Conventional magnets attached to Kepco power supplies
- which model of Kepco?
- Manual probe: ? not sure but we are not converting this now
- HIFI
- Magnetometer: Group 3 hall probes connected to a DTM161
- Magnets: Superconducting, shim values set from 0 field are used as offsets in these magnets
- Manual probe: LS201 hall probe
All five muon instruments: ARGUS, CHRONUS, EMU, HIFI and MuSR use a zero-field controller, implemented as a collection of LabVIEW VIs.
There appear to be 3 variants of the MUON zero-field controller:
- EMU and MuSR both use one variant of the MUON zero-field controller. This variant can be found in the folder
C:\LabVIEW Modules\Muon Magnets\Zero Field Controller. - ARGUS and CHRONUS both use a second variant of the MUON zero-field controller. This variant can be found in the folder
C:\LabVIEW Modules\Instruments\ARGUS\Zero Field Controller. This variant is similar to the one used by EMU and MuSR. - HIFI has its own unique MUON zero-field controller. This variant is included in the Group 3 Hall probe VI at
C:\LabVIEW Modules\Instruments\HIFI\Group3 Hall probe. The behaviour of this VI needs to be validated. Note that this includes extra coefficients to allow for the shape of the gradients between the two sets of hall probes.
The zero-field controller operates in one of two required modes, manual and auto-feedback (dead reckoning will not be required).
In Manual mode, the user must adjust the currents manually to achieve the desired magnetic field. The typical procedure is:
- Set Auto feedback mode
- Take muon measurements in zero field
- Set Manual mode – this maintains the same currents as have just been used in auto, so the field remains zero (for now)
- Apply a moderate field with the instrument’s main magnet (this could be above the maximum of the flux gate magnetometer, but small enough that the stray field we’ve compensated off would be significant)
- Take muon measurements in this exact applied field.
- Turn off the main magnet. The field will be back to near zero (possible offsets due to the external interfering fields having changed recently, or remnant magnetisation somewhere)
- Re-set Auto Mode. The feedback resumes starting with the currents that were in use in Manual, and smoothly reaches a good zero value.
- Take more zero field measurements.
In Auto-Feedback mode, the user specifies the desired field (in mG) and a feedback loop continually adjusts the current supplied by the PSUs to achieve and maintain the desired magnetic field.
- Calibrate the system (to relate current to field, undertaken via the
Test Zero Field.viwithin SECI):- Check for a huge stray field
- Ensure that the absolute maximum of the fields are < 4000 mG 2 seconds after setting a 0, if it isn't the magnet is not in range, and there is a huge stray field
- Calculate the magnitude of the field at this point (square root of the sum of the squared fields)
- For each magnet and for a range of currents
- Measure the magnetic field at the fixed sample position
- Plot field against the current
- 21 steps of
((iteration number - 10)/10) * PSmax, with a 2-second wait before taking the field reading in all three dimensions
- 21 steps of
- Perform linear regression to work out the calibration coefficients (1 per coil per axis).
- If the result is linear these values should be autosaved because they are the same for every config
- If not linear the user should be warned, warnings still to be defined from the VI
- The calibration values should be under manager mode
- Check that the noise ratios are acceptable at 0 in manual mode (3-second delay for settling)
- 20 readings a second apart
- Calculate the variance for each field
- Calculate the manual RMS value (
square root of the sum of the variance for each field) - The system is noisy if the RMS value > 5
- Check that the noise ratios are acceptable at 0 in auto feedback mode (6-second delay for settling)
- 20 readings a second apart
- Calculate the variance for each field
- Calculate the manual RMS value (
square root of the sum of the variance for each field) - The system is noisy if the RMS value > 5
- Plot the noise fields against time
- This is performed once or twice a cycle
- NB Coefficients should not be set automatically; scientists will take these numbers and save them later.
- Check for a huge stray field
- Measure offsets (to compensate for the stray field gradients):
- Place a portable probe at the sample position
- Set the field to 0
- Update the offsets so that the portable probe measures 0.
- It is OK to auto save these values they are the same for every config
- The offset values should be under manager mode
- This is performed regularly
The zero-field controller feedback loop uses the following inputs:
-
M – measured magnetic field (it has three components: longitudinal (L), transverse (T) & vertical (V))
- in IBEX this should use X, Y, Z, with Z being along the beam
- O – Offset (to compensate for sensor placement)
- C – orientation matrix, derived from engineering drawing, this the direction of the field produced by each coil and because the coils are at right angles has +1, -1 and 0 as its components.
- S – setpoints requested
-
P – magnetic field produced by a coil for a current. Measured in
A/mGusing the calibration procedure. - p – proportional value (feedback fiddle factor)
- I – current on magnets
- I' - new current to send
Quantities in bold are vector quantities. Quantities in italic, bold are matrix quantities.
The new current to send is calculated as:
I' = (S - (M - O) . C) . P * p + I
The following quantities are:
- Mc = (M - O) . C is the corrected field - turns measured field in the basis of the magnetometer into fields produced by the magnet in the basis of the magnets.
- Mc - S is the difference between the current field and required field
- (Mc - S) . P * p is the change required in the current for this iteration (in current version may need to multiply through by time between samples).
The process enforces maximum limits on the currents. These are set by the instrument scientist based on
- the current likely to be needed to compensate any feasible stray field
- the current that would hit the voltage limit on the Kepco before its current limit, if the coils have high enough resistance
- the maximum desired power dissipation of the coils
- not wanting to exceed the magnetometer full scale. Each axis has its own limit.
Higher currents are clamped to this maximum with the appropriate polarity and ARE then sent to the PSU! But there should be a warning as well. In Auto, the clamped value is used as the basis for calculations next time.
When overloaded by a high field, the fluxgate magnetometer can read any random value on all three axes which might look like it's in range and may have the opposite sign to the actual field. Moderate overloads leave the reading close to the limit. The VI attempts to detect fields at or close to the limits and says sensor overload if this happens: typically the main magnet coil is still on or there’s a fault with the sensor.
Notes:
- ARGUS appears to use different magnetic field components, labelled LR (left-right), UD (up-down) and FB (forwards-backwards). How do these differ from L, T and V?
- A single set would be good X, Y, Z as described above.
- The offset value, O, appears to be a constant. Why is this?
- It is an approximation
- Are there limits on the input & output values? If so, what are they? If these limits are breached, what should happen?
- The maximum current and voltage values are set as part of the initialisation file, and values beyond those limits are not sent to the PSU
- Is the above expression guaranteed to converge? What if it doesn't? How does the current zero-field controller guard against non-convergence?
- No, we expect to get noise but at the 1 mG level. The signal is declared stable at the 10mG level
- There is a requirement that Zero field system control needs to be continuous, in the mathematical function sense of not having steps in, when configurations change or control is interrupted.". How is this requirement currently achieved? (It may better to run the zero-field controller on a separate device (e.g. a Raspberry Pi). This approach would eliminate the risk of interruption should IBEX be halted or the control PC re-booted.) What is this requirement in practice?
- Preserving the zero on restart: the usual use-case for this is switching (either way) between a dilution fridge configuration and a cryostat configuration which happens to use the dilution insert as a centre stick. The sample remains in position and cold (1.4K to 10K) throughout and we want to avoid a spike in the applied field which might upset a sensitive magnetic or superconducting state. Being able to preserve zero field through an IBEX crash or computer reboot, and thus avoid having to repeat a time consuming sequence of field/temperature steps to prepare a sample, is also useful assuming everything else in IBEX can be got running.
- Presumably, magnetic fields should not change too rapidly. Which implies that the currents should not change too rapidly. Is there maximum (or even minimum) permissible rate of change for the currents? Is there a maximum permissible change (i.e. step size), positive or negative, in the value of the current? How frequently should currents be updated?
- There is no enforced maximum rate of change. The calculated new currents are applied immediately – the field change itself may be limited by the inductance of the coils and the Kepcos briefly hitting the voltage limits as a result. Similarly in manual, a new current entered should be applied immediately. In practice in a real experiment there might be a large step on initially zeroing the field for a new sample/cryostat but subsequently going back into Auto will only be a small change.
- The system should be monitored for the currents overloading and this should be fed back to the user
We will test on the instrument. This needs to be placed on the shutdown work list (Peter will sort this out when needed).
Suggested operation of auto-feedback IOC:
- On a regular timescale the IOC will read the three axes of the magnetometer. It should then fill in PVs for the raw field and corrected field Mc = (M-O) * C.
- The magnetometer values should be checked for overload, if so the PVs should go into an alarm state and the feedback is (temporarily) disabled. [Separate IOC for reading magnetometer and calculating fields]
- If in Auto mode and the field is “good” it should then calculate the new currents based on the previous current setpoints, the corrected field and the setpoint. Then check the currents against the limits and if so, clamp the current to the limit value and put the PV into alarm state. It then writes these to the Kepcos (regardless of limit status).
- In Auto mode the field is declared “stable” if the corrected field is within some value (e.g. 10mG: perhaps set as a macro) of the setpoint, otherwise “Changing”. (PV for this status)
- In either mode and regardless of any alarms above, it then reads back the actual output current and voltage from the Kepcos and fills more PVs. (Option – put the output current PVs into alarm if the actual current is not close to the setpoint)
Further thoughts:
- The calibration step may be best implemented as a script that the scientists can then own.
- Thoughts on implementing offsets from James: In “manual” offset calibration we need a simple way to vary the offsets and have the already-running zero field IOC take them into account (it will be in Auto Feedback mode). Perhaps this will be numbers we can adjust on an OPI. Typing g.set_pv(‘IN:MUONZF:OFFSET_X’,123.4) each time would be way too tedious. We then might want to save these values for future use perhaps by editing a .ini file, editing IOC macros, or similar (managers only). Or just press a “Save offsets” button?