Microsoft Word - 407-2746-1-LE-rev ACTA IMEKO  ISSN: 2221‐870X  July 2017, Volume 6, Number 2, 75‐79    ACTA IMEKO | www.imeko.org  July 2017 | Volume 6 | Number 2 | 75  The control system for the magnetic suspension comparator  system for vacuum‐to‐air mass dissemination  Corey Stambaugh   Mass and Force Group, National Institute of Standards and Technology, Gaithersburg, MD U.S.A 20899, U.S.A.      Section: RESEARCH PAPER   Keywords: SI; magnetic suspension; PID; FPGA; mass metrology  Citation: Corey Stambaugh, The control system for the magnetic suspension comparator system for vacuum‐to‐air mass dissemination, Acta IMEKO, vol. 6,  no. 2, article 13, July 2017, identifier: IMEKO‐ACTA‐06 (2017)‐02‐13  Section Editor: Min‐Seok Kim, Research Institute of Standards and Science, Korea   Received June 30, 2016; In final form October 20, 2016; Published July 2017  Copyright: © 2017 IMEKO. This is an open‐access article distributed under the terms of the Creative Commons Attribution 3.0 License, which permits  unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited  Corresponding author: Corey Stambaugh, e‐mail: corey.stambaugh@nist.gov    1. INTRODUCTION  The redefinition of the kilogram will cut the tie to a physical artifact by using, for example, the watt balance to define the kilogram in terms of Planck's constant [1]. To realize this definition, the magnitude of Planck's constant will be fixed [2]. Overall, mass dissemination will remain the same after redefinition and mass comparators and artifacts will still be used. However, in the new definition the kilogram will be realized in vacuum, unlike the international prototype kilogram which is kept in air. Below the national metrology level, mass calibration will still be carried out in air. As such, a reliable method is required for accounting for mass changes from sorption effects when moving from vacuum-to-air. To date, the primary method for vacuum-to-air transfer involves developing a model for the sorption effects [3]. In this procedure, the mass comparison is carried out in vacuum and then the test mass is brought to air. At that time, a correction based on the sorption model would be added to the calibrated mass value. In this indirect way, mass calibration can be performed between vacuum and air. At the National Institute of Standards and Technology (NIST) we are implementing an alternative, direct approach [4]. Here, the standard artifact is kept in vacuum while the test mass is kept in air. The mass comparison, performed using a single, precision comparator, is carried out by coupling an upper assembly (mass comparator and mass pan in vacuum) to a lower assembly (mass pan in air) through magnetic suspension [5], [6]. Through this direct vacuum-to-air comparison the need to adjust measurements post hoc to account for mass changes resulting from sorption effects is eliminated. To aid in characterizing and improving the overall performance of the magnetic suspension mass comparator system (MSMC) for vacuum-to-air mass dissemination, a proof of concept (POC) system was built. This testing bed allows us to focus on just the magnetic suspension system (MSS). The MSS can further be broken down into several key components: (1) the actuator, (2) the sensor, and (3) the control loop. In this paper we will focus on the control loop and its implementation using a field programmable gate array (FPGA). ABSTRACT  High  precision  mass  comparisons  are  typically  performed  such  that  both  masses  are  measured  under  nearly  identical  conditions.  However,  there  are  situations  where  an  artefact  needs  to  be  calibrated  against  a  standard  kept  under  different  conditions.  For  example, the new realization of the kilogram will be carried out in vacuum but the majority of calibration services are performed at  atmospheric pressure. At the National Institute of Standards and Technology, we have developed an apparatus to perform direct mass  comparison under such a condition using magnetic suspension. The stability of the magnetically suspended portion of the system plays  a large role in the overall uncertainty of a measurement. Here, the control system for the magnetic suspension and the improvements  that have been made to improve stability are described.  ACTA IMEKO | www.imeko.org  July 2017 | Volume 6 | Number 2 | 76  2. PRINCIPLES  2.1. Vacuum‐to‐air Mass Dissemination   Before delving deeply into the control system, a brief description of the operating principle for vacuum-to-air mass dissemination and for the magnetic suspension is warranted. For any standard mass comparison, an unknown mass is compared to a known reference mass of nominally the same mass. In the case of mass comparators, this is done by first weighing one of the two masses on a mass comparator. The result is recorded and then the other mass is weighed using the same comparator. The difference in the two readings is used to determine the actual mass of the unknown with respect to the known reference mass. Vacuum-to-air mass dissemination works the same, in principle, except one of the two masses is kept in vacuum while the other is kept in air. As shown in Figure 1, the mass comparator is placed in an upper chamber, and the upper magnetic assembly (UMA) is hung from it. Below the upper chamber is a second chamber, which houses the lower magnetic assembly (LMA). To couple the LMA to the mass comparator in the upper chamber, magnetic suspension is utilized. When the magnetic suspension is engaged, the suspended LMA is coupled to the UMA and the mass comparator. Thus, its mass can effectively be removed from the measurement. The measurement sequence is now straightforward. Place the known mass on the UMA and ensure the LMA is suspended. Take a reading. Remove the mass from the UMA and turn off the suspension. Load the unknown mass on to the LMA and re-engage the suspension. The difference between this reading and the prior one is the difference between the masses less corrections for air buoyancy and the gravitational difference resulting from the masses being placed at different heights. For the proposed vacuum-to-air comparisons the upper chamber would be held at vacuum, while the lower is at atmospheric pressure. 2.2. Magnetic Suspension   In the above measurement, magnetic suspension plays the crucial role of coupling the suspended LMA to the UMA and subsequently the mass comparator. The basic principle behind the suspension is as follows [5]. Attached to the lower and upper mass pans are two permanent magnets. These provide the majority of the necessary lifting force. Additionally, an electromagnetic coil is wound around the upper magnet. A Hall sensor is placed between the two permanent magnets and used to monitor the separation between the suspended LMA and the UMA. The Hall sensor provides a proportional voltage which is fed to the control system. The control system outputs a voltage that provides the necessary current to the coil to counteract the motion of the suspended LMA, thus keeping it suspended. 3. CONTROL SYSTEM  The implementation of a control loop to sustain suspension of the LMA is paramount to achieving stability in the mass readings. To aid in understanding the control system, we construct the closed-loop system as shown in Figure 2. By calculating or measuring the values of the different components, a complete model can be developed. This model can then be simulated using tools like MathWorks Simulink. Different parameters for the proportional-integrator-derivative (PID) controller can then be tested for stability. The results can then be verified in the POC. The accurate realization of the POC in the model is vital for several reasons: (1) it provides a means to assess which parameters provide the most stable response, (2) it allows for an assessment of our knowledge of the magnetic suspension system, (3) it provides a convenient viewpoint to identify the major sources of instability, and (4) it helps ensure that when the final system is built we do not waste time determining the stable operation point. In this section, we describe each component in the closed-loop, state how their values were determined and compare the model’s operation to actual suspension in the POC. 3.1. Closed‐Loop  To the right of the controller block in Figure 2 is the i/v block. This block converts the applied voltage to a current and consists of an amplifier and the electrical side of the electromagnetic coil. The amplifier takes the controller output Figure 2. Schematic of the closed‐loop control. SP, the setpoint, is chosen to be the magnetic field value (converted to voltage) measured by the probe when  the relation   holds. The PID controller is implemented on a FPGA chip to eliminate latency and time jitter.   Figure 1. Illustration of essential components of proof of concept used for testing  magnetic  suspension.  The  POC  is  housed  in  a  single  box,  here  an upper and lower chamber is shown to illustrate how the system would be  segregated  in an actual system. The diagram on the  lower  left shows the main two forces acting on the suspended lower magnetic assembly (LMA). ACTA IMEKO | www.imeko.org  July 2017 | Volume 6 | Number 2 | 77  and amplifies by a gain, A. For simplicity, we take the coil to be an RL filter. The resistance, R, is the resistance of the coil wire and the leads. The inductance of the coil is . Their values are 45 Ω and 160 mH. All together they form a low-pass filter with gain A, whose transfer function is , (1) the RL filter has a cut-off frequency of 45 Hz. The current now works, as described by the plant, to produce a force that will act upon the LMA. The plant operation is determined by solving the equation of motion, assuming negligible damping, for the LMA, under the influence of gravity, , and the total magnetic field, , : , . (2) Here, , is the sum of the force generated by the permanent magnets at a separation and the force generated by the electromagnet with a current and is the total mass of the LMA (this can be with or without the test mass). For small motion (2) can be linearized by expanding , : . (3) The parameters and represent the change in force with respect to for the permanent magnet and for the coil. By choosing such that we can take the Laplace transform of (3) to get where and are and , respectively. Therefore, the transfer function of the plant is . (4) The values of the parameters and are approximately 3.0 N/A and 1.6 10 N/m, respectively. Both values were determined through finite element modelling (FEM) simulations and experiment which will be discussed in more detail in a future publication. The motion of the LMA changes the separation distance between the LMA and the UMA, which changes the magnetic field between them. A Hall sensor, placed between the two magnets, is used to monitor the changing magnetic field. The block / represents the conversion between the changes in separation to the change in the magnetic field as measured at the position of the Hall sensor and has a value of about 30 T/m. Now, it is important to recognize that there is another contributing factor to the magnetic field change; namely the magnetic field generated by the electromagnetic coil, denoted as / in Figure 2. Its value is approximately 0.026 T/A. Both values depend on , here 11.5 mm, and the probe position relative to the UMA (~6 mm). In subsection 3.2, the importance of the probe position is examined more closely. These two magnetic field changes are summed to provide the total magnetic field measured at the Hall sensor. The Hall sensor has a sensitivity of 5V T⁄ and provides some low-pass filtering at 5 kHz. Finally, an additional low-pass filter (~300 Hz) is used before the signal is passed to the PID controller. The PID transfer function for closed-loop control is 1 / . (5) Here , , and are the proportional, integral, and derivative gain terms and N is the filtering coefficient. The filtering coefficient helps smooth the derivative term to avoid sudden changes in the response. The closed-loop transfer function is then , (6) where is the open-loop response composed of all the blocks in Figure 2 except for the controller. As will be discussed in Section 4, the PID is implemented on a digital system so a discrete version of is employed. However, given that are control loop is run at 100 kHz and the frequency response of is 100 Hz, we can effectively treat the system as continuous. 3.2. Simulation  To test the closed-loop operation and to verify that the PID parameters provide a stable control loop, we converted the closed-loop system described above into a Simulink model. In this program the known values for the open-loop system as described in the previous section are entered. The simulation can be used to determine test PID parameters for stable operation. Also, different test functions can be applied to determine how stable the loop is in the presence of noise and other external perturbations. In Figure 3 we show results from a test run where we compare the system response of our model (orange, solid lines) to that of the actual POC (blue, dashed lines). Identical PID parameters were used for both systems: P=50, I=1.5, D=0.5, and N=10. The white noise injected into the model is chosen so that the standard deviation of the controller output in the steady-state for both the model and the POC are approximately the same. We applied a step change, equivalent to a change in B-Field of 0.2 mT (0.001 V), at t = 0 s and measured the output at the three monitor points in Figure 2: Control Out [V], Z [m], and B-Field [V]. The agreement in both magnitude and temporal response for the B-Field and Controller Out is excellent. The Z response, which was measured independently using an interferometer, shows good agreement as well. The mass readings were taken using a mass comparator with a resolution of 0.1 mg. The reading before and after the disturbance is 0.1 mg apart; such a change is expected for the comparator over the time scale shown and is not a result of the Figure 3. Comparison of step response of Simulink model (orange, solid) and  real magnetic suspension on POC (blue, dashed). The bottom graph shows the deviations of the measured value of the mass.  ACTA IMEKO | www.imeko.org  July 2017 | Volume 6 | Number 2 | 78  magnetic suspension. The probe position between the two magnets has an overall effect on the stability of the feedback loop. To investigate this effect, we utilized the simulation of the closed-loop response as a function of the proportional gain and the distance along the z- axis of the probe from the upper magnet. As the probe is moved, increasing the distance between the probe and upper magnet, the values of / and / change; this in turn alters the dynamics of the closed-loop response. Simulations were run holding I and D fixed. The standard deviation from t=75 s to t=90 s was then computed. A contour plot of the result, where log10 was taken of the computed standard deviation, is shown in Figure 4. The y-axis is the probe position and the x-axis is the gain, P. The yellow patches are regions where the simulation did not finish due to instabilities. A probe position of approximately 6 mm, which is roughly half way between the two magnets, provides a robust region where a stable response is found for a wide range of gains. The simulation also indicates that moving the probe closer to the upper magnet leads to a larger instability; a fact that we have observed experimentally. The instability results because ( / / / decreases as the probe approaches the UMA. The / , which does not provide information on the motion of the suspended object, tends to overwhelm / in this case. 4. IMPLEMENTATION OF THE CONTROL SYSTEM  In the previous section, the model for the magnetic suspension was described and results from an actual magnetic suspension test were compared to it. Here we describe how the PID controller was realized in the POC. The implementation of the control loop marks a major upgrade in our magnetic suspension comparator system. The prior realization utilized a standard desktop computer and was implemented using LabVIEW1. While suspension was achieved, the level of stability was insufficient to meet our needs. Standard computer operations like a mouse click would occasionally lead to jumps in the feedback control. The primary reason for this lies in the time jitter and latency introduced by the operating system. For example, our initial control loop was set to update at a rate of 30 kHz, however, while the actual achieved rate peaked at this frequency it deviated around this point by several kilohertz, as shown in Figure 5. Additionally, occasional delays occurred in the loop that led to peaks at several lower frequencies. These problems occurred because the control loop was sharing resources with the non-real time operating system. To completely eliminate this issue, we migrated the control loop to a field programmable gate array (FPGA) using LabVIEW FPGA, the red line shows the control loop rate (100 kHz) when running on the FPGA. An FPGA allows for programmatically hard-wiring the code through the reconfiguring of gate arrays on an integrated circuit. Because the FPGA uses dedicated hardware to process the control logic, no operating system is involved nor is overhead incurred; this provides real-time determinism. Additionally, the logic gates can be set independently, yet synchronized to the same master clock. In this way, true parallelism can be realized by allowing multiple control loops to be run simultaneously. Again, since there is no overhead the control loops update rate is fixed and time jitter and latency occur at levels below the inverse of the loop rate. Furthermore, digital filters and real-time monitoring can be added. The FPGA is directly wired to analog-to-digital (ADC) and digital- to-analog convertors (DAC) and data stream exists between the FPGA and host computer. This allows real-time monitoring and adjustment of the PID parameters. The trade-offs when using FPGA include increased complexity in programming, limited physical space on-chip for implementing code, and limited hardware for both ADC and DAC. Since our execution rate is 100 kHz and the master clock of the FPGA is 40 MHz we have plenty of time to accomplish all required tasks within a single cycle of the control loop. While limited space on the FPGA constrains the size of the overall code, we found that we are still able to fit 3 controls loops, multiple filters, and several ‘FPGA to Host’ transfer lines on a single chip; this far exceeds our base needs. The hardware issue, while currently not a limitation, could be an impediment in the future. The issue lies in the limited resolution of the hardware available for the ADC and DAC on the FPGA. From our experience, the FPGA has greatly improved the performance of the magnetic suspension. As shown in Figure 3, the system is stable and sudden changes in setpoint do not cause the magnetic suspension to fail. Interestingly, the best evidence of its benefit comes from direct interaction with the system. Before implementing the FPGA, manually positioning the suspended mass at a point where stable suspension could occur was difficult. Fluctuations induced by imprecise positioning of the LMA and unsteadiness of the operator’s hands when placing the LMA into the proper position for Figure 4. Contour plot of standard deviation of B‐Field closed loop response from t=75 s to t=90 s. The color mapping is log10.  Figure 5. Histogram of frequency distribution of loop‐rate for control system  implemented on desktop computer (grey bars) and FPGA (red  line at 100  kHz).  ACTA IMEKO | www.imeko.org  July 2017 | Volume 6 | Number 2 | 79  magnet suspension induced large field changes to which, when coupled with the non-deterministic nature of the non-FPGA control loop, quickly lead to instability. Such instability has been effectively eliminated by the new FPGA based control system. 5. CONCLUSION  In this paper we described a method for performing direct mass comparison of two masses where one is kept under vacuum and the other in air. Of course the exact environment is of little consequence, but rather the ability to couple the gravitational force acting on the mass in one chamber to the mass comparator in the other is of great utility. This work is primarily focused on dissemination of the standard kilogram in light of the new realization of the kilogram which will occur under vacuum. A further application would include cross checking sorption studies that aim to model the mass added when changing environments. The goal here was to analyze the model used for the control system, compare it to the magnetic suspension observed in the POC and discuss how moving to an FPGA system provides increased stability. The strong agreement in Figure 3 indicates that we are now properly modelling the system; an advancement over previous work [7]. The incorporation of the FPGA was a key step in acquiring this stable system as it eliminated the time-jitter and latency in the previous system. With this work, we are well posed to continue improving the magnetic suspension system stability for use in vacuum-to-air mass dissemination. ACKNOWLEDGEMENT  The author would like to acknowledge valuable conversations with N. Vlajic. Certain commercial equipment, instruments, or materials are identified in this paper in order to specify the experimental procedure adequately. Such identification is not intended to imply recommendation or endorsement by the National Institute of Standards and Technology, nor is it intended to imply that the materials or equipment identified are necessarily the best available for the purpose. REFERENCES  [1] D. B. Newell, “A more fundamental International System of Units”, Physics Today 67, 7 (2014), pp. 35-41. [2] Comptes Rendus de la 24e CGPM (2011), 2013, p.532. [3] A. Picard, H. Fang, “Methods to determine water vapour sorption on mass standards”, Metrologia 41, 333-9 (2004). [4] Z. J. Jabbour, P. Abbott, E. Williams, R. Liu and V. Lee, “Linking air and vacuum mass measurement by magnetic levitation”, Metrologia, 46, 3 (2009), pp. 339-344. [5] N. A. Shirazee and A. Basak, “Electropermanent suspension system for acquiring large air-gaps to suspend loads”, IEEE Trans. Mag., 31, 6 (1995), pp. 4193-4195. [6] Clark, John W., “An electronic analytical balance”, Rev., Sci. Instr. 18 (12), (1947) 915-918. [7] P. Abbott, R. C. Dove, E. C. Benck, and Z. J. Kubarych, “Progress on a Vacuum-To-Air Mass Calibration System Using Magnetic Suspension to Disseminate the Planck constant Realized Kilogram”, Proc. Of IMEKO 22nd TC3, 12th TC5 and 3rd TC22 International Conferences, Feb. 3-5, 2014, Cape Town, RSA.