The MMT Adaptive optics exoPlanet characterization System MAPS is currently in its engineering phase operating onsky at the MMT Telescope on Mt. Hopkins in southern Arizona. The MAPS Adaptive Secondary Mirrors actuators are controlled by a closed loop modified PID control law and an open loop feedforward law which in combination allows for faster actuator response time. An essential element of achieving the secondarys performance goals involves the process of PID gain tuning. To start we briefly discuss the design of the MAPS ASM and its actuators. We then describe the actuator positional control system and control law. Next we discuss a few of the issues that make ASM tuning difficult. We then outline our initial attempts at tuning the actuator controllers and discuss the use of actuator positional power spectra for both tuning and determining the health and failure states of individual actuators. We conclude by presenting the results of our latest round of tuning configuration trials which have been successful at decreasing mirror latency increasing operational mirror modes and improving image PSF.
['Astrophysics - Instrumentation and Methods for Astrophysics']
Tuning the MAPS Adaptive Secondary Mirror Actuator Control PID Tuning Power Spectra and Failure Diagnosis
{'Tuning the MAPS Adaptive Secondary Mirror: Actuator Control, PID Tuning, Power Spectra and Failure Diagnosis': 'Jess A. Johnson, 1 Amali Vaz, 1 Manny Montoya, 1 Katie M. Morzinski, 1 Jennifer Patience, 2 Suresh Sivanandam, 3, 4 Guido Brusa, 5 Olivier Durney, 1 Andrew Gardner, 1 Olivier Guyon, 1 Lori Harrison, 1 Ron Jones, 1 Jarron Leisenring, 1 Jared Males, 1 Bianca Payan, 1 Lauren Perez, 1 Yoav Rotman, 2 Jacob Taylor, 3, 4 Dan Vargas, 1 and Grant West 1  \n1  \nSteward Observatory, University of Arizona, 933 N. Cherry Ave., Tucson AZ 85721, USA School of Earth and Space Exploration, Arizona State University, Tempe, AZ 85281, USA 3 David A. Dunlap Department of Astronomy & Astrophysics, University of Toronto 4  \n2  \nDunlap Institute for Astronomy and Astrophysics, University of Toronto  \n5 Large Binocular Telescope, Steward Observatory, 933 N. Cherry Ave., Tucson, AZ 85721, USA', 'ABSTRACT': "The MMT Adaptive optics exoPlanet characterization System (MAPS) is currently in its engineering phase, operating on sky at the MMT Telescope on Mt. Hopkins in southern Arizona. The MAPS Adaptive Secondary Mirror's actuators are controlled by a closed loop modified PID control law and an open loop feed forward law, which in combination allows for faster actuator response time. An essential element of achieving the secondary's performance goals involves the process of PID gain tuning. To start, we briefly discuss the design of the MAPS ASM and its actuators. We then describe the actuator positional control system and control law. Next, we discuss a few of the issues that make ASM tuning difficult. We then outline our initial attempts at tuning the actuator controllers, and discuss the use of actuator positional power spectra for both tuning and determining the health and failure states of individual actuators. We conclude by presenting the results of our latest round of tuning configuration trials, which have been successful at decreasing mirror latency, increasing operational mirror modes and improving image PSF.  \nKeywords: adaptive optics, AO, adaptive secondary, ASM, MMT, PID, tuning", '1.1. History of the MAPS project': "The MMT Adaptive Optics Exoplanet Characterization System, or MAPS, is the evolutionary descendent of a long line of experimental prototypes and telescope adaptive optics systems. In 1998, the six mirrors of the Multi Mirror Telescope (MMT) were replaced by a single 6.5m monolithic mirror, and a unique adaptive optics system was designed to accompany the upgrade. The MMT Adaptive Optics system (MMTAO) was a first-of-its-kind design, as it introduced a revolutionary idea: wavefront correction by a large deformable mirror positioned at a telescope's secondary mirror position. The MMT's adaptive secondary mirror , or ASM, was a first generation device that introduced an entirely new system architecture for large telescope adaptive optics (Morzinski et al. 2020).  \nFurther author information:  \nJ.A.J.: jajohnson@arizona.edu, 1 520 621-9519  \nA.V.: amali@arizona.edu, 1 520 621-2288  \nThe development program for an AO system utilizing adaptive secondaries began in 1992 and was a cooperative effort between private companies and research institutions in both Italy (Arceti Observatory) and the United States (University of Arizona). Most of the theory and electronics design was done by Italian companies, of which perhaps Microgate is the most well-known, and the technology for developing thin-shell mirrors was done at the University of Arizona's Steward Observatory.  \nThe MMTAO, with its ground-breaking 336 voice coil actuator ASM (MMT336), was decommissioned in 2017. Its replacement, what was to become MAPS, was initially funded by an NSF Mid-Scale Innovations Program in Astronomical Sciences (MSIP) seed grant issued in August of 2018. Unlike the original MMT system, MAPS was to be both designed and built in-house at the University of Arizona's Steward Observatory.  \nDevelopment and fabrication proceeded on schedule, until the pandemic forced the closure of the University. Multiple departures and retirements among key personnel involved in the design of the ASM and its control systems resulted in the loss of first hand insight and experience, and interrupted the creation of operational  \ndocumentation. This resulted in the MAPS ASM going on-sky with its actuator control system (ACS) in its default state and with little knowledge about its operation or optimization. And because an adaptive secondary is a rather uncommon device (a magnetically levitated thin glass mirror controlled by hundreds of autonomous positional control actuators), standard industrial control theory and its tuning methods, which don't take into account considerations such as mirror modes and oscillatory fragility, have only limited applicability.  \nThe MAPS ASM tuning project starts with the ACS being, basically, a black box.", '1.2. Design of the MAPS ASM': "Most of the refinements and improvements in AO performance that distinguish MMTAO from MAPS relate directly to substantial changes in the design of the ASM. This paper is concerned with the adaptive secondary's actuators that control the surface figure of the mirror, and the positional systems that control them (ACS), and this is one of the many areas of substantial change. A brief overview of the structure of the ASM and the design of its actuators will be helpful in understanding what follows. For a complete discussion of the mechanical and electrical design of the ASM, refer to Johnson et al. (2023).", '1.2.1. Design criteria': 'MAPS was conceived of as an exoplanet characterization system, and science goals largely drove the design of the ASM. In comparison to the MMT336, MAPS requires higher spectral resolution, an increase in achievable contrast, improved image quality over a broader wavelength range, and increased throughput and operational efficiency. The following were the performance requirements that informed the design, given as comparisons to MMT336 (Hinz et al. 2018; Vaz et al. 2020):  \n- · An operating bandwidth of 1000 Hz.\n- · Positional calculations at 1kHz.\n- · Temporal lag reduction and a decrease in mirror settling time by a factor of 2-3.\n- · The implementation of an open loop feed-forward component to actuator control.\n- · A decrease in the system update rate from 2.7 ms lag to 1 ms.\n- · 120 corrected modes, up from 55.  \nWith these changes, it was estimated that residual wavefront error could be reduced from between 400 and 500 nms RMS for the old system to 200 nm RMS for the new system, with corresponding gains in Strehl ratio. The ability to achieve these goals was only partially  \nFigure 1. A blowup diagram of the MAPS adaptive secondary mirror, showing its major structural components. 1) Ring interface, 2) Central electronics hub, 3) Cold plate, 4) Reference body, and 5) Thin shell. (Vaz et al. 2020)  \n<!-- image -->  \nachieved by electronics and hardware changes; even more important were the changes to the actuator control law.', '1.2.2. Description of the MAPS ASM': "The MMT telescope is a Cassegrain design with a 6.5-m f/1.25 primary mirror. The adaptive secondary is an f/15 deformable convex mirror, which provides a 20 arcminute field of view (West et al. 1997). A blowup diagram of the ASM is shown in Figure 1.  \nThe five primary components of the ASM as indicated in the diagram are as follows:  \nThe reference body is composed of a monolithic 500 mm thick piece of Zerodur glass, through which 336 boreholes have been drilled to house actuators. It provides a stable reference surface for determining mirror position. The cold plate is a single piece of aluminum which serves as a surface to which the actuators attach and provides a passive thermal sink. The hexapod and telescope interface is a mounting system attached to the reference body through the cold plate; its other end is fixed to a metal electronics frame and ring interface which mounts to the telescope.  \nThe electronics hub holds the system's housekeeping board, control motherboard, and six daughterboards; each daughterboard is attached to 56 actuators via USBC cables. Commands, actuator status info, and monitoring flow between this architecture and a control computer via Ethernet. And the thin shell is the secondary mirror's reflective surface. It is 64 cm in diameter, made of Zerodur glass that ranges from 1.8 to 1.9 mm in thickness and weighs 2.6 kg. Attached to the upper surface of the thin shell are small, radially polarized rare earth magnets positioned directly above each of the boreholes. The  \nmagnetic field generated by the actuator coil interacts with these magnets to provide the force that moves the mirror.", '1.2.3. MAPS actuators': "The MAPS actuators represent a considerable upgrade in both electronics and functionality over their predecessors, but the basic procedure they accomplish is the same: the distance between the reference body and the portion of the mirror over an actuator (referred to in this discussion as a mirror segment ) embedded in a reference body borehole is measured by the capacitive sensing system, described in Sec. 1.2.4 below. The difference between the mirror segment's measured position and its desired position (provided by the AO system's reconstructor in response to measurements taken by the wavefront sensor) is then calculated, and the result is fed into the actuator's onboard ACS controller. The controller's output is converted to a current value, and the current is sent through the actuator's coil, creating the magnetic force which in turn moves the mirror.  \nThe MAPS actuator design consolidates almost every fundamental ASM function to its onboard electronics (Downey 2019), unlike its predecessor which relied on external electronics to do positional and current calculations. The functions performed at actuator level are:  \n- · Measurement of the capcitive decay voltage;\n- · Digitizing of the measurement;\n- · Calculation of the force required to move the mirror;\n- · Implementation of the modified PID control law;\n- · Production of the coil current required to produce the desired magnetic field;\n- · The execution of safety and status checks on the actuator..  \nThis concentration of functionality leads to a decentralized system of actuator control, in which all actuators act independently of each other, as opposed to being commanded by a centralized control computer (see Section 3.2.1).", '1.2.4. Capacitive sensing system': "A core component of the MAPS actuators is the capacitive sensing system. This system extracts a distance measurement by using the geometry of a parallel plate capacitor, where the bottom of the mirror acts as one plate and a metallic circular ring on the reference body encircling the actuator bore hole acts as the other (see Figure 2). As the mirror moves, the distance between the plates changes, altering the capacitance. The voltage between the plates is directly proportional to this distance and indirectly proportional to the capacitance.  \nFigure 2. Schematic of the MAPS actuator capacitive sensing system. A voltage pulse is sent through the conductive bottom of the thin shell mirror, which produces a voltage at the reference body ring surrounding each actuator. The RC circuit produces a decay curve which is read by the actuator electronics and converted to a distance measurement,  \n<!-- image -->  \nTo measure the displacement of the mirror from the reference body, a voltage pulse, called the 'Go' pulse, is sent across the conductive surface on the underside of the thin shell. This pulse flows across each actuator's associated thin-shell/reference-body capacitor and is then measured by the actuator. The voltage drops off as an RC decay curve, and by reading this voltage at two set times on the curve, the actuator can determine the equivalent displacement of the mirror. The system uses a 16-bit ADC which provides 3 nm resolution over a 197 µ m throw length.", '1.2.5. Fundamental quantities': 'This brief review of the ASM and its actuators gives us a overview of the quantities that we will be concerned about in this discussion. It also allows us to re-frame these components in the language of control theory :  \nThe thin shell mirror is the controlled object , or plant . The distance between the reference body and the thin shell, measured by the capacitive sensing system (the sensor ), is the quantity being controlled, called the process variable . The position we want the portion of the mirror over any individual actuator to be located at is called the set point . The difference between the desired set point and the momentary value of the process variable is the error . The calculated value of the current that creates the magnetic force applied by the actuator coil that moves the mirror and corrects the error is the process output . The device that applies the quantity that causes the change to the plant is called an actuator . And finally, the electronics that control this whole process is called the controller .', '2. ADAPTIVE SECONDARY MIRRORS & THE ACTUATOR CONTROL PROBLEM': "Before discussing the MAPS controller and the process of tuning the MAPS ASM, it is important to understand how mirror control is accomplished, and what constraints and considerations affect the process.  \nAdaptive secondary mirror systems cleverly solve one adaptive optics design issue, but in the process of doing so, create another, more difficult issue. Conventional AO systems, in the process of rerouting a portion of the telescope's beam to a small deformable mirror located on a breadboard-based system, introduce multiple optical surfaces into the light path, adding unwanted polarization, emissivity, and reflective loss to the light that is used to determine the AO system's correction. Adaptive secondaries solve this issue by placing the deformable mirror directly in the telescope beam.  \nHowever, these large and complicated mirrors are controlled by hundreds of actuators with more complex electronics and functionality than their smaller counterparts in traditional deformable mirrors. Limitations in both computational power and communication speed have, to this point, mandated control systems designs in which actuators behave largely independently of each other. A large number of autonomously acting actuators independently exerting force on the same fragile piece of glass creates what has come to be known in the literature as the actuator control problem .", '2.1. The actuator control problem': "This problem has two components. The first is: how to design an actuator control system capable of applying enough constrained force to a small region of fragile glass so that it can rapidly assume its desired position without substantially overshooting or threatening mirror integrity?  \nThis alone is a complex problem, given that the desired mirror position is constantly changing in response to the input from the wavefront sensor, and that actuator behavior, while driven by an autonomous process, is not truly independent but coupled through the mirror function.  \nThe second component concerns an issue unique to large magnetically levitated thin shell mirrors, and that is that they have oscillatory states, called Eigenmodes, which are similar to standing waves, resulting from there being no mechanical contact to the mirror to provide damping. Conventional deformable mirrors change their surface figures only in response to force applied by actuators (the quasi-static modeling assumption ). But levitated thin shell mirrors are free to change their surface figures in response to more than just actuator force  \n(the dynamic modeling assumption ). This complicates the control situation: ' ...[another] problem to solve is that posed by a system, the deformable mirror, that has a very high density of resonant frequencies over a very wide frequency range' (Salinari & Sandler 1998). For more on this, see Section 2.4.2.", '2.2. Dynamics and positional control': "To address the first part of the control problem, we consider the dynamics of the situation. The problem, at first glance, seems deceptively simple. We have an object that has to be moved to a predetermined position, either forward or backward from its current position, and a device that issues a force that can either push or pull on the object. The question becomes, what is the most appropriate way to apply the force?  \nTo move the mirror segment, we look at the displacement required to reach the desired position and calculate a current that, when applied to the mirror's magnet, accelerates the segment of the mirror in the desired direction. In theory we could determine exactly the amount of force required to accelerate the mirror to travel the appropriate distance, allow the restoring force supplied by the mirror to decelerate the motion, and let the segment come to a stop exactly where desired. We could then calculate exactly the amount of current required to produce this force. In real life, however, this is an incredibly complicated calculation due to the number and nature of the forces acting on the mirror. The mirror resists the motion with a type of spring force; the mirror may be in motion already from either previous motion or Eigenmode oscillation; air molecules resist the free motion of the mirror; and so on.  \nThis means that we have to give up on the idea of moving a mirror segment directly to its desired location, and instead create a form of damped oscillatory motion in which we apply a force that is greater than needed, sending the mirror past its desired position, then reverse the applied force, pulling the mirror in the opposite direction, then reverse the force again, and so on. Each time we do this, the mirror gets closer to its desired position, oscillating around it until it eventually stops, within a small margin of error, at its targeted position. This is illustrated in Figure 3. The device that controls this process is called a Proportional-Integral-Derivative controller , or PID.  \nThe figure shows a displacement vs time plot of a mirror segment's physical location. At t = 0 the mirror segment is at its initial location. The blue line indicates the displacement from its initial position required to reach its desired location, or set point . The bar across the bottom of the plot indicates the polarity of the current  \nFigure 3. Hypothetical plot of Proportional-Integral-Derivative action on a mirror segment. The red line indicates the mirror's displacement vs time. The blue line is the mirror's desired position. The bar across the bottom of the graph indicates the polarity of the current being applied to the actuator coil. The arrows and associated labels indicate fundamental PID quantities.  \n<!-- image -->  \nbeing applied to the coil, with '+' denoting the initial polarity creating motion towards the set point.  \nAt the start of the positional cycle, current is applied to the coil, creating a magnetic force that accelerates the mirror segment towards its set point. The amount of current that is applied is calculated by the PID controller. 10 µ s later, as the segment overshoots the set point, the next PID cycle begins with the set point in the opposite direction, and the controller again calculates the current required, and the segment decelerates, stops, reverses direction, and again overshoots the set point.  \nThe rise time is the amount of time it takes for the segment to move from 10% to 90% of the set point. The overshoot is the distance that the segment moves past the set point during its initial motion. This oscillatory behavior repeats until the segment eventually comes within an acceptable error margin from the set point called the steady state error . The settling time is the amount of time it takes to reach a defined error margin, which for MAPS is set at 10% of the desired position. Decreasing the settling time is the goal of optimization.  \nThis process happens simultaneously but independently for all 336 actuators on the mirror, and the current/force calculations are determined by the modified PID controller built into each actuator's electronics. The PID controller bases its calculations on the start-of-cycle segment position, the initial reconstructor command, and the values of control variables that have been determined and set during the process called tuning .", '2.3. Result of tuning: settling time and mirror modes': "Each cycle of mirror segment positioning requires the controller to move the mirror segment utilizing magnetic force, and the amount of time it takes for the mirror segment to reach its set point is that actuator's settling time . Each actuator's settling time is largely determined by its tuning. In the bigger picture, every actuator must position its corresponding mirror segment so that the overall surface figure of the mirror corresponds to the reconstructor's correction. The time it takes to accomplish this is the mirror settling time .  \nFor the MAPS ASM, the reconstructor, acting on input from the wavefront sensor, sends a complete set of 336 actuator position commands every 1 ms; this is the controller's outer loop timing . The PID controller operates at 100 times this speed; one PID cycle takes 10 µ s to complete. This is the controller's inner loop timing . If any particular actuator fails to settle its associated mirror segment before the next outer loop cycle begins, the ability of the entire mirror to effectively correct the wavefront is degraded; the more mirror segments that fail to settle, the worse the wavefront correction becomes.  \nThis also has ramifications on the number of mirror modes the mirror can produce. Mirror modes are similar to basis sets such as the Zernike polynomials, but are unique to each ASM; they are the fundamental components of wavefront correction. Lower order aberrations, such as tip/tilt and focus, which rely on modes composed of large groups of actuators acting similarly, can still be  \npartially corrected if some of those actuators miss their targets. Higher order aberrations, corrected by modes composed of higher spatial frequencies, require the independent positioning of actuators at widely varying locations and displacements to effectively apply a correction. If the actuators involved miss their set points, the mirror becomes ineffectual at higher order correction. MAPS running under default PID tuning produced a maximum of 50 modes. MAPS with modified tuning was able to correct up to 100 modes. We expect that MAPS will reach 120 modes safely under optimal tuning.", '2.4. Oscillation and mirror resonances': 'Tuning actuators that push and pull on a thin sheet of glass is an inherently fraught proposition, which goes to the first aspect of the actuator control dilemma (see the introduction to Section 2.1). Put simply, if we apply force to the mirror inappropriately, we can shatter it.  \nThis can happen in two ways. The first is by miscalculating the amount of overshoot needed at the first stage of the positional control cycle, i.e., we apply too much force, overcoming the material properties of the glass and cracking it. Since we basically determine the amount of overshoot during tuning, this is our first serious constraint. The second, and more subtle way we can threaten mirror integrity is through uncontrolled oscillation.', '2.4.1. PID oscillation': "The PID process is inherently oscillatory, and as long as the control variables are set correctly during tuning, the overshoot amplitude can be controlled and the oscillation dampens quickly. This behavior is not threatening and is indeed the way PID controllers are designed.  \nBut a PID can accidentally be tuned to cause uncontrolled oscillation, specifically by setting either the proportional gain (PG) too high, or by incorrect adjustment of the derivative gain (DG). This is called unstable tuning . This can become an issue if the operational range of these variables is not known in advance, as was the case with the MAPS controller. Because the values of these variables can range over seven orders of magnitude, even picking an incorrect starting value to experiment with can hinder discovering the correct values at best, or at worst cause the PID to go unstable as soon as the first cycle starts.  \nAdding to this issue is an inherent limitation in the design of the MAPS actuators. Certain tuning states can cause the actuator to exhibit a behavior called WildCoil, in which the H-bridge (an electronic component designed to switch the direction of current flow to the coil) begins to oscillate current polarities, forcing the magnetic field  \nto alternate rapidly back and forth. If the initial magnitude of the calculated current is too high, the mirror can shatter as a result. To counter this, the housekeeping circuitry of the actuator is designed to send a distress signal to the main control computer, 'safing' the mirror, the equivalent of system shutdown. But even here, the threshold for WildCoil detection is another variable to be configured. Set the WildCoil value too low, and the system shuts down in response to nominal H-bridge behavior. Set the value too high, and the actuator becomes blind to this potentially catastrophic behavior.", '2.4.2. Mirror Resonances': 'The thin shell mirror is essentially levitated in a magnetic field. Because of this, there is no physical damping and the mirror is free to vibrate. It does this in response to any force that is applied to it, from the action of the magnetic coil actuators, to the motion of air in the gap between it and the reference body, and to vibration emanating from the motion of the telescope or the movement of the dome. Dynamic modeling shows that this vibration produces a variety of standing wave patterns, known as mirror resonances or eigenmodes .  \nFinite element analysis of the MAPS mirror identifies thirty natural resonance modes ranging from 7 Hz to 1 kHz, of which the first fifteen are listed in Table 1, along with the frequency at which they occur. Each of these modes is a unique pattern of vibration, a few of which are illustrated in Figure 4.  \nTable 1. Resonance Modes of the MAPS Mirror, from Grocott (1997)  \n<!-- image -->  \n<!-- image -->  \n<!-- image -->  \nFigure 4. Mirror resonance modes of the MAPS thin-shell mirror. A) Mode 2: 31.3Hz [2 -θ ]; B) Mode 10: 458.3Hz [8 -θ ]; C) Mode 11: 460.2Hz [1 -r ]; D) Mode 15: 533.9 Hz [3 -θ, 1 -r ]. Graphics from Grocott (1997).  \n<!-- image -->', '2.4.3. Rigid vs non-rigid actuators': "Voice coil actuators, operating via applied magnetic force to a magnet affixed to the rear of a portion of a thin shell deformable mirror, are by nature non-rigid . In this usage, non-rigid means that the actuator itself is not physically affixed to the mirror. Rigid actuators act as a damping force that attenuates or eliminates resonant modes below a threshold frequency.  \nWithout the damping of rigid actuators, a voice coil actuated system requires another source of strong damping, and this is primarily provided by the viscous damping effect of air in the gap between the mirror's reference body and the thin shell, a clever solution known as air damping .  \nBecause higher frequency oscillatory modes are still present over the threshold provided by the air gap, additional damping methods must be provided to enable system frequencies over that threshold. MAPS addresses this by using a modified PID controller that includes a velocity-based damping control, which, if configured correctly, allows it to reach system frequencies of 1000 Hz.  \nHowever, the damping provided by the air gap has limitations. The outer three rings of actuators are close to the open edge of the air gap, and air damping becomes less effective at this edge. Therefore, resonance oscillation is still problematic in this region, and the mirror becomes hard to control in its outer regions. The velocity-based damping control was specifically designed to address this.  \nThese vibrational modes have implications affecting positional control. Uncontrolled oscillation can be problematic, and resonance modes introduce another set of oscillations that are not controlled by the system.  \nThe interaction of this external oscillation with the PID's attempt at creating controlled oscillation can, on one hand, cause constructive interference, increasing the amplitude of resonance oscillation, and potentially destabalize the actuator's PID. On the other hand, destructive interference can damp the PID's action, hindering its ability to reach the set point. And further, this unwanted oscillation can interfere with the process of tuning itself  \n(see Sec. 4.2.1). This is the nature of the second aspect of the actuator control dilemma.", '3.1. Introduction': "The MAPS actuator control system was designed by systems engineer Keith Powell, whose doctoral thesis Next Generation Wavefront Controller for the MMT Adaptive Optics System: Algorithms and Techniques for Mitigating Dynamic Wavefront Aberrations (Powell 2012) contains almost the complete blueprint for the reasoning and design of the MAPS actuator control system. The design is the logical evolution of a lineage that started with the first ASM prototype of what was to become the MMT336, called the P30.  \nAlthough voice coil magnetic field actuators with capacitive position sensors were first introduced in the literature in 1993 (Salinari et al. 1994), it wasn't until the P30 was fabricated in 1998 that their use in the control of a thin shell deformable mirror was successfully demonstrated. Many of the control concepts that are still in use in MAPS and the Large Binocular Telescope adaptive optics system were developed for, and tested on, this miniature ASM. Because this developmental process was largely the result of a collaboration between Italian academic and private sector business, the control concepts are often referred to as the Italian Methodology .  \nAny ASM that uses the Italian methodology has the following attributes:  \n- · Voice-coil type non-rigid magnetic field generating actuators with built-in capacitive sensing.\n- · Magnetically levitated thin-shell mirror with magnets and a reference body, with a gap which allows:\n- · Air gap velocity damping.\n- · APID-based controller, usually of the type PD + f + ∫ , (Proportional-Derivative controller with:\n- · Feed-forward loop and outer integrator loop.)\n- · Minimal use of the derivative function in recognition of positional noise.\n- · A system configuration of the SISO decentralized type.  \nWhereas ASMs of other design schools and their control systems may share some of these traits, all of them together are the hallmarks of this now dominate methodology. MAPS has inherited all of these attributes, and adds a few more.", '3.2. MAPS Control System': 'When discussing a control system, there are two aspects to consider. One is the overall structure of the system, and the other is the structure of the controller.', '3.2.1. Structure of the MAPS control system': "Because each of the MAPS actuator controllers has only one input and one output, the control system type is referred to as single input/single output , or SISO. The job of the actuator controllers is to take an input position and generate an output coil current. Controllers dedicated to this type of task fall into the category of motion controllers . Because the input to the controller is taken at the same spatial location on the controlled object that the output acts upon, it is further referred to as a coupled input-output pair .  \nA collection of SISO controllers each acting fully independently of each other is called a Fully Decentralized Control System . The individual controllers in a decentralized system each control processes and variables that are completely decoupled from other controllers.  \nASMs push the above definition, however, as the controlled variables (position and output current) of any actuator are not independent of other actuators. Each actuator is effectively coupled to other actuators through the mirror. A system whose SISO controllers are not fully independent is sometimes referred to simply as a Decentralized Control System .  \nMAPS is therefore a decentralized, coupled input-output SISO control system . Although beyond the scope of this paper, systems of this nature are prone to inherent oscillatory instability, for two reasons. First, coupled input-output pair SISOs that are tuned sub-optimally are prone to instabilities in their process variable (positional) calculations. Second, autonomous SISO systems that are coupled externally (via the mirror function in ASMs) are more easily destabalized because of the influence of one actuator's output on the input of a nearby actuator. Therefore, ASMs with ACS of this structure have an inherent tendency towards controller instability.", '3.2.2. MAPS controller': 'The MAPS ACS, which is embedded in the onboard electronics of every actuator, is a modified PID controller incorporating a feed-forward loop with a feed-forward bias component. It differs from the Italian methodology in one important aspect: it does not have an outer integrator  \nloop, but instead relies on the integrative term in the PID for this functionality. Integrative functionality is essential to the operation of an ASM because it is the correction term that protects against external influences to the mirror, such as wind and telescope vibration.  \nA few comments about feed-forward systems. Feedforward in a control system is a method of estimating the PID output without waiting for the PID to cycle. It pushes the controlled object towards its set point by a known quantity before the first PID calculation, and then allows the PID to complete the process. This greatly reduces the settling time as well as the error, and the PID requires fewer oscillatory cycles to reach its set point.  \nIn the MAPS system, the primary feed-forward component is the feed-forward matrix . This 336 by 336 matrix is basically a poke matrix, determined empirically during mirror characterization by poking each mirror segment and recording the response of all other mirror segments. In this way, it characterizes the mirror function , which is the tendency of the mirror to resist any action that wants to bend its surface out of shape. By knowing the resisting force generated by pushing a mirror segment against its neighbors, an estimated current value required to move a segment to any displacement can be calculated and quickly applied.  \nMAPS also implements a feed-forward bias correction, which counteracts the bias magnet in each actuator that is a part of the safety system of the thin shell. When the ASM is in its rest state, the bias magnets protect against shell detachment. The feed-forward bias, applied with the feed-forward correction term, automatically negates this retaining force.  \nThe MAPS control design incorporates feed-forward functionality as a required component, but incorporating it into the external control system code has been delayed to ensure that hard-coded safety mechanisms are in place, and the results discussed later in this paper do not incorporate its functionality. The effects of tuning values determined without feed-forward in place operating after feed-forward is in use are unclear. Because the effect of feed-forward is to quickly reduce the error, we expect that the response of the PID should be similar to a small displacement without feed-forward.  \nWe therefore expect that values determined by tuning without the feed forward loop will be applicable when feed forward is enabled. The end result is expected to be a substantially improved settling time over PID tuning alone.', '3.3. MAPS control law': "Any system controller is essentially a physical structure that houses and executes the system's control law.  \nFigure 5. MAPS actuator control law block diagram. From Downey (2019).  \n<!-- image -->  \nThe control law is a complicated algorithm with user determined gain variables that establish the relationship between the input and the output of the control actuators, as well as establishing the timing and interaction of the outer and inner control loops.", '3.3.1. Overview of the control law': 'Figure 5 is a block diagram of the MAPS Actuator Control Law. It is divided into four principle components, indicated by dotted rectangles. Red indicates the feed forward component. Grey indicates the central PID. Green indicates the capacitive sensing component. Blue indicates the output. A key to the symbols and abbreviations in the diagram is given in Table 2.  \nThe core of the controller is a parallel-form PID, with K I , K P and K D representing the standard integral, proportional and derivative gain terms. In addition to these standard terms is the Velocity damping function with its tunable gain term K V , and a Post PID Gain Variable, K G . f D (), the differentiation finite impulse response filter, is an additional set of variables for the derivative process.  \nOutside the core is the capacitive sensing position system, with its pulse shaping f C () settings, the feed forward loop with feed forward bias and feed forward smoothing, and the Run Coil operator controller override RC . The next subsection explain a few of these quantities.', '3.3.2. New control quantities': "The new controller implements a few new tuning quantities, discussed here in greater detail:  \nVelocity damping ( K V ): The velocity damping variable is a setting designed to compensate for resonance modes that occur at operational frequencies over 500 Hz and to correct for the reduced air gap damping in  \nTable 2. Key to the MAPS Control Law  \nFigure 6. Effect of the K G variable. A) With K G = 1, the MAPS PID is a parallel form controller. B) Setting K P = 1 and using K G as a scaled gain variable effectively switches the PID to a standard form PID.  \n<!-- image -->  \nthe outermost actuator rings. Although unclear in the control law diagram, Powell's notes on his MAPS simulator (more on this in Section 4) shows that it follows a differentiation filter in the capacitive sensing system. Presumably, then, the filter is determining velocity from successive positional readings, and K V is a proportional gain term that scales the result. Due to the fact that this correction is subtracted from the overall calculation at the controller's second summation point, it acts to reduce the magnitude of the calculated output current.  \nRun Coil (RC) : The Run Coil component of the controller is an open-loop override that allows direct actuator current values to be entered by the operator, essentially bypassing the controller. When the operator enters a value, the switch (indicated by the curved grey arrow in Figure 5) automatically routes the value directly to the actuator.  \nCapacitive, Differentiation Filters (f C () , f D ()): The capacitor finite impulse response filter allows shaping of the 'Go Pulse' voltage signal that is read by all actuators to determine position. We have not begun working with this setting; it is currently set to default. The differentiation finite impulse response filter is a time shaping control for the PID's derivative gain. Similarly, this is set at default.  \nPost PID Gain (K G ) : This final term in the central controller has two purposes. The first is to convert the positional values that are the output of the rest of the central controller to current units (the feed forward component's output is already calculated in current units). The second, more interesting use of this variable is that it allows the core PID controller, initially in parallel-form, to be switched to standard-form, as shown in Figure 6. The process of tuning for a standard-form PID is different then the process utilized here.", '3.3.3. A glimpse at full tuning': "The above discussion has highlighted the most important details about the MAPS actuator controller. There are more settings in MAPS then just the ones emphasized  \nhere, though. The complete interface for the actuator controller is shown in Figure 7.  \nEach rectangle in the image is either a variable setting or output value. The rectangles are color coded to represent the current state of our understanding. Rectangles in green are variables we fully understand, and are the quantities we've been working with in this first round of tuning. Rectangles shaded in yellow are quantities that we conceptually understand, but have been left for the next series of experiments and are set at default values. And rectangles shaded in red are quantities set at default values that we have limited understanding of their correct usage.", '3.3.4. Sequence of operations': "As a final step in understanding the MAPS controller, we list its sequence of operations. There are two control loops running simultaneously. The outer loop is the traditional adaptive optics process in which the wavefront sensor determines the shape of the incoming wavefront and the reconstructor calculates the phase conjugate needed to correct it. The inner loop is the PID control loop.  \nThe inner loop is required to run at a higher frequency then the outer loop, so that the inherently time consuming process of getting actuators to settle to their setpoint positions can complete before the next cycle of the outer loop. For MAPS, the design specifies that the outer loop maximum frequency is 1 kHz, and that the inner loop cycles at 100 kHz, giving 100 cycles of the inner loop for every one cycle of the outer loop. All of the actions listed below, then, take place in outer loop cycles of 1 ms length. During each 1 ms cycle, 100 cycles of 10 µ s inner loop passes occur. Actuators are being queried, sent commands, and move to positions 100,000 times per second.  \n- 1) Outer Loop Cycle: At the start of each outer loop cycle, the controller receives a vector of commanded mirror positions from the AO system. This is the controller  \nFigure 7. The operator interface for the MAPS actuator controller. Each rectangle represents a setting. Rectangles in green represent quantities used in the first round of tuning experiments. Rectangles in yellow represent quantities that we understand in concept, but have been left to a second round of tuning experiments and are currently set to default values. Rectangles in red are quantities of which we have limited understanding.  \n<!-- image -->  \ninput r , or ' RP ', and triggers the inner loop to start cycling to position the actuators.  \n- 2) Inner Loop Cycle: The inner loop starts, and repeats, following this sequence:\n- 1. In the first cycle of the inner loop, the controller receives a vector of current mirror positions as determined by the capacitive sensing system. This is input column vector V CAP . As part of this process, the system determines whether the CapSense input from any actuator is exhibiting rapid oscillation, or WildCoil. If it does, the system throws a 'WildCoil' alert to the operator, and, depending on safety settings in the system's housekeeping system, may also safe the mirror, shutting the process down. Also, position values fed out by the CapSense system are checked to see if they are exceeding the system's maximum and minimum positions. The capacitive filter values f C ( z ) are then applied, and the final measured mirror position vector V f is sent to the first branch point:  \nV f = f C ( z ) V CAP .  \n- 2. At the branch point the signal path splits. The first branch of the split goes to the summation point, where V f is subtracted from the incoming r vector, creating the delta position (error) vector ∆c :  \n∆c = r -V f .  \nThese are the positional change values that will eventually be converted by the controller to coil voltages to move the mirror to the position commanded by the outer loop.  \n- 3. Although not explicitly shown on the diagram due to clarity considerations, ∆c is also sent to the feed-forward loop, where it is acted on by the feedforward matrix to produce the feed-forward vector. The feed-forward bias is added to this, creating the feed forward term :  \nff = ∆c i K ij + f B .  \n- 4. Next, ∆c is sent through the PID controller. To do this, its path is split in three. It is important to realize that splitting the path does not split the signal ; each path carries the same signal. Each PID variable acts on the same ∆c . The proportional gain process is applied to the signal:  \nP = K P ∆c .  \nThe integral gain process integrates the cumulative error and applies the integral gain value. Note that τ is used here as the variable of integration, and the bounds are run from 0 to t. This indicates that the cumulative error from t=0 to the present moment is integrated:  \nI = K I ∫ t 0 ∆c ( τ ) dτ.  \nFigure 8. A control diagram representing a portion of the SPAM MAPS simulator. Reconstructing the simulator is being considered as a model-based tuning tool. From Powell (2017).  \n<!-- image -->  \nThe derivative process takes the time derivative of the error and applies the derivative gain and filter values:  \nD = f d () K D d dt ∆c .  \n- 5. At the second summation node, these values are all added together. If a value other than zero has been entered into the velocity damping loop, activating it, then V f is acted on by K V :  \nV = K V V f .  \n- 6. The result of the summation node is then:  \nΣ = P + I + D -V  \n- 7. At the third summation node, the K G gain is applied to this, converting positional commands to current values, and then summed with the feedforward term:  \nI COIL = K G Σ + FF  \n- 8. This final value is then sent to the actuator coil, and the inner loop repeats from step one of the inner loop cycle.  \nThe only exception to the above is if the operator has chosen one or more specific actuators and entered  \nRunCoil value(s) for them. This bypasses the actuator's controller output and sends the entered value directly to the coil.", '4. TUNING THE MAPS ASM': "This whole endeavor is about 'tuning the ASM' . So let's define more precisely what that means. The standard definition of 'tuning' a controller is:  \n...the process of determining the controller parameters which produce the desired output... [it] allows for optimization of a process and minimizes the error between the variable of the process and its set point.  \nWhen a mathematical model of a system is available, the parameters of the controller can be explicitly determined. However, when a mathematical model is unavailable, the parameters must be determined experimentally. (Bennett et al. 2024)  \nOne of the things that this definition hints at is the use of a mathematical model to determine the appropriate controller parameters.  \nIndeed, this seems to be the preferred way to tune complex control systems with many actuators and fragile controlled objects, at least in the industrial world. Doing so allows one to experiment with values for control gains without the possibility of unintended consequences.  \nSeveral authors, however, have written about the difficulty of modeling adaptive secondary mirror systems, due to mirror resonances, actuator coupling, and the stability issues with SISO systems. Intriguingly, however, there apparently was such a model for the MAPS ASM, called SPAM .  \nSPAM stands for SPAM: the PAlindromic Maps simulator , and was a MATLAB code designed to simulate the operation of the ASM. It was hinted at in a presentation Kieth Powell gave in 2017, but unfortunately seems to have been lost. However, the general control diagram representing the code does, and is shown in Figure 8.  \nWe are considering whether using the diagram as a basis for coding a simulator may be useful to provide a model based method of tuning. This is future work, however, and for now, MAPS must be tuned experimentally.", '4.1. Initial Performance': 'When the first MAPS engineering runs took place, the ASM was effectively running on a limited set of default tuning values. The ASM was also exhibiting a few problematic issues.', '4.1.1. Running on defaults': "All actuators were set to the same values, as follows:  \n- · Proportional Gain : K P = 100 . 00\n- · Integral Gain : K I = 0 . 05\n- · Derivative Gain : K D = 0 . 00\n- · Velocity Gain : K V = 0 . 00\n- · Post Gain : K G = 1 . 00  \nIt was not known whether these tuning values were appropriately set, or even whether or not they represented 'safe' values (providing minimal but non-destructive actuator response).", '4.1.2. Actuator failure': "At start, the ASM went on sky with twelve actuators disabled due to issues with their electronics. Actuators can fail due to a number of reasons, from non-responsive electronics to bad capacitive sensing systems. MAPS classifies these errors into several different types, as follows:  \n- · DEADBEEF : Actuator has failed internal checksum test; halts system start. Fatal error;\n- · DEADFEED : Actuator has electrically failed. Fatal error;\n- · CAPREAD : Actuator's capacitor's ADC has failed. Fatal Error;\n- · NOVAL : Actuator payload is all zeroes. Potentially fatal error if actuator can't reset itself;  \n- · EXCEEDS : Actuator persistently attempts to position itself beyond the system limitation for a single step. Non-fatal but annoying;\n- · BADCAP : Actuator is displaying bad positional information. Non-fatal but potentially serious.  \nThe ASM went live with 7 DEADFEED actuators, 4 DEADBEEF actuators, and 1 CAPREAD actuator.", '4.1.3. Actuator Noise': 'In addition, the ASM started life with with excessive levels of actuator positional noise. Actuators can become noisy for several reasons. Ground loops in the power supply contribute heavily to actuator noise, as do ground faults in the ASM central hub electronics. Background electric fields from heavy equipment interacting with the conductive surface of the underside of the thin shell can make the Go pulse voltage signal dirty, leading to errant positional values. We found that noise had dependence on telescope altitude, which reflects the shifting of the orientation of the secondary as it moves vertically.  \nThe MAPS design specification indicates an RMS noise value of ± 5 µ m. The initial noise characterization, carried out before the first engineering run, found an RMS level of ± 22 µ m, with individual actuators ranging as high as ± 50 µ m.', '4.1.4. Initial Performance': 'The ASM performed poorly under these conditions. The mirror continuously safed itself, the result of large numbers of individual actuators independently triggering WildCoil alerts (see Section 2.4.1.) Actuators exhibited power consumption at levels considerably over design specification, and actuators overheated, requiring frequent mirror down time for cooling. The system was limited to operating frequencies of less than 100 Hz.  \nSuspecting that the default actuator gain values may be partly responsible for these issues, the first round of experimental tuning was undertaken. As tuning under conditions of elevated noise levels and disabled actuators was expected to yield problematic results, considerable effort went into diagnosing actuator failure and to find the cause of the elevated noise, with little success.', '4.2. Tuning of the proportional gain': "After several engineering runs, we decided to begin by focusing on actuator proportional gain (PG); this is the primary tuning variable controlling the PID oscillatory process. The proportional term of the controller's correction is simply the product of the error and the PG value. The larger the PG, the larger the acceleration the mirror segment is subject to. If the value is set too high, the mirror is kicked too hard, and the resulting amplitude  \nFigure 9. Four frames taken while tuning an unconstrained actuator. Sequence goes from top left to top right to bottom left to bottom right.  \n<!-- image -->  \nof the oscillation is large, requiring more time to settle to its set point, or worse. If the PG value is set too low, oscillation can't start. The logical result of this is that the tuning value is set correctly at the point where the mirror segment just begins to oscillate.  \nThe reason that elevated actuator noise is problematic to the process of tuning is that tuning is fundamentally the adjustment of an oscillatory behavior, and actuator noise represents yet another kind of random oscillation. If we wish to discern the point at which changing the proportional variable results in oscillation, the existence of pre-existing random oscillation interferes, as does mirror resonance oscillation.", '4.2.1. Tuning by power spectra': "How do we determine when the mirror has just begun to oscillate? Elwood Downey, the software engineer of MAPS, left us with a powerful set of tools. The MAPS interface includes two real-time plots for every actuator controller: a position vs. time (PVT) plot, and a live Fast Fourier Transform of the PVT plot. The FFT plot essentially shows the power spectrum of mirror oscillation.  \nIn addition, MAPS provides a tuning mode, which samples the mirror position at a faster rate then during normal operation, which allows the FFT to show frequencies in the power spectrum up to 30 kHz.  \nThe procedure for tuning a single actuator's K P value is as follows. Starting with an actuator with its PG variable set to minimum, i.e., K P = 1, we load a system configuration file, load a flat, and then set the system to tuning mode and display the actuator's PS plot. We take careful note of what the power spectrum looks like, and then begin to increase K P in minimal steps, maybe 10 points at a time, and watch the PS plot. The goal is to find the point that the already existing oscillatory behavior begins to change.  \nThere are two types of distinct changes in the power spectrum that we find by doing this, depending on the actuator's physical position.", '4.2.2. Type I oscillators': 'The first type of behavior, which we call Type I, is observed in actuators that have little or no constraining factors ( unconstrained actuators). Actuators in the outer three rings are undamped (or less damped) by the air gap, and exhibit oscillation occurring over a broad frequency range, as can be seen in the sequence in Figure 9.  \nFor these actuators, increasing K P leads to oscillatory behavior across a large range of frequencies, generally starting around 1 kHz and extending to the end of the spectrum. The effect happens quickly at a threshold value of proportional gain, when the power spectrum rapidly broadens after a small increase in the PG. We take note of this threshold value, and use this value as the value of K P .', '4.2.3. Type II oscillators': "The second type, which we call Type II, is shown in the sequence in Figure 10, and is typical of a constrained actuator.  \nConstrained actuators are actuators in the center rings (rings 1-8), or actuators in the outer rings (rings 9-11) that are situated next to an actuator that has been disabled. These actuators are either damped by the air gap (inner rings) or by the coupling influence of the inactive actuators next to them (outer rings).  \nWhen we start increasing the value of the PG, we find that a particular region of the power spectrum begins to develop tightly packed peaks, as can be seen in the yellow highlighted areas. The effect is subtle at small increases, but can easily be pushed to the point where the area grows considerably. We call this effect the '2K Forest', because this form of oscillation generally centers  \nFigure 10. Four frames taken while tuning a constrained actuator. Sequence goes from top left to top right to bottom left to bottom right.  \n<!-- image -->  \nitself around 2 kHz on the PS. Since we want the point that oscillatory behavior begins, we take note of the PG value that triggers this response, and this becomes K P .", '4.2.4. First tuning configuration results': "By repeating this process for every active actuator, a process which takes roughly 15 minutes per actuator, we completed the first MAPS tuning configuration, and used it during the next engineering run. The immediate results were obvious in several ways.  \nFirst, the incidence of WildCoil events was drastically reduced. Actuator power consumption was also reduced, as were overheating events. However, rudimentary determination of system latency, a reflection of mirror latency, did not show significant improvement in settling time. Further, the maximum system operational frequency remained capped at 100 Hz. It was not immediately clear, however, as to whether this was a result of the tuning configuration, or was due to myriad other 'new system' issues.", '4.2.5. ASM rebuild': "After the first series of engineering runs, ending with the first application of the tuning configuration described above, the MAPS ASM went into the laboratory clean room to be serviced, to address the noise issue and the disabled actuators. By this time, more actuators had failed, giving a total of 35 disabled actuators, and a large number of actuators were exhibiting high levels of noise, 35 of which were consistently triggering WildCoil events.  \nDuring the rebuild, multiples issues were found affecting actuators. Several DEADBEEF actuators, for example, were found to have cable or connector issues. Many actuators were either not aligned co-axially with their bore holes, or were found to be at the wrong distance from their mirror magnet. During the ASM's period on the lab, actuators that were defective were  \nreplaced; the alignment of all actuators was checked and corrected, electrical connections were reseated, and cable was tested and replaced.  \nAs a result of this down period, the ASM went back to the mountain in substantially better operational condition. Preliminary noise characterization results of between 5 µ m and 8 µ m RMS indicated that positional noise had been reduced almost to its design specification. Disabled actuators had been reduced from 35 to 18; and functional actuators went from 262 (78%) before the rebuild to 319 (95%) after. Figure 11 shows the pre- and post-rebuild actuator maps.", '4.3. Attempts at Ziegler-Nichols': "The next substantial effort towards tuning came after the rebuild. We decided to attempt to implement Ziegler-Nichols (ZN) tuning methodology, using the FFT technique described in Section 4.2.1. ZN tuning is by far the most commonly used parallel-form PID tuning method, because of its intuitive procedure, relative simplicity of application, and its applicability to most PID situations. It is essentially heuristic, which goes a long way to explaining its simplicity and popularity. This is the method control engineers will typically use before attempting more difficult model-based methods.  \nWe went through the 336 actuators again, applying the PS process to determine the actuator's oscillation frequency. The values we gained by doing this were inconsistent with those found during initial proportional gain tuning, as had been expected, due to the reconfiguration of the ASM.", '4.3.1. Description of Ziegler-Nichols': "In ZN, we utilize these power spectra results to determine the value of the P, I, and D variables. ZN is essentially a series of empirically determined equations  \nFigure 11. Plots of the MAPS actuators, before (left) and after (right) the ASM rebuild. Black indicates a disabled actuator. Green indicates an actuator with a high noise level. Red indicates a 'floating' actuator with its CSS system disabled.  \n<!-- image -->  \nthat lead to optimal control tuning. For MAPS, the process goes like this:  \n- 1. Set K I and K D to zero.\n- 2. Set K P to 1.0.\n- 3. Increase K P until the loop output begins to oscillate. The gain value that causes this becomes K U , known as the 'ultimate' frequency.\n- 4. The frequency at which the oscillation occurs becomes the value of T U .\n- 5. Using these values, set the values of K P , K I , and K D as shown below:  \nK P = 0 . 60 K U  \nK I = 1 . 2 K U T U  \nK D = 3 K U T U 40  \nThese, then, are the gain values that are used to calculate the PID correction:  \nu ( t ) = K P e ( t ) + K I ∫ t 0 e ( τ ) dτ + K D de ( t ) dt  \nThe method is relatively straightforward, at least for most controllers, which is why the method is so commonly used. But with the MAPS controller, the method failed.", '4.3.2. Failure of Zeigler-Nichols': "The failure of Ziegler-Nichols was immediately obvious, as the values that it produced for the Integral and Derivative gain values were not reasonable. As an example, consider the tuning of actuator 125, shown in Figure 10.  \nAt the point that we determined oscillation had clearly begun (lower left plot), we had increased the proportional variable until K P = 250, so K U = 250. The central frequency of the oscillation is almost exactly 2 kHz, which gives a period value of 0.5 ms. We use this value then to find what our K P , K I and K D values should be:  \nK P = 0 . 60 K U = 150  \nK I = 1 . 2 ( 250 0 . 5ms ) = 6 x10 5  \nK D = 3 ( (250)(0 . 5ms) 40 ) = 9 . 4 x10 -3  \nA glance at the integral value shows that it cannot be correct, as can be seen by simple inspection.  \nLet's say that the system's first pass through the controller starts with the CSS determining that a particular actuator's mirror segment has a positional error of 5 µ m from its set point. Let's apply the error correction calculation using these PID variables with e 125 = 5 µ m.  \nThe first term, K P e ( t ) 125 gives 250(5 µ m) = 1 . 25 mm. Although this seems large, this is pretty typical value for the initial proportional term. The second term takes the sum of the error until the present moment, which, in  \nFigure 12. Mirror Latency (MLAT) measurement. This measurement was taken on the SCExAO sytem with a Pyramid WFS and a MEMS type deformable mirror, and shows a measured hardware latency of 985 µ s. From Guyon et al. (2018).  \n<!-- image -->  \nthe first cycle, is 5 µ m, and multiplies it by the integral variable, giving us 6 × 10 5 5 µ m = 3m. This is the type of unreasonable value mentioned previously. There is no third term, as the error is neither decreasing or increasing on the first pass, but this is enough to show the method fails.  \nThe integral term will immediately attempt to push the mirror too far. And on every subsequent pass, it will only explode further as the original pass has now driven the error into a value a thousand times too large.  \nThis exercise, along with the experience of attempting this method for hundreds of actuators, has shown that ZN cannot possibly work according to its cookbook recipe.  \nThere are three potential reasons for this. First, a glance at the upper left image in Figure 10 shows an actuator in its resting state with a minimal proportional gain variable set. Even in this state, the FFT plot shows oscillatory behavior at several frequencies, more than likely the result of positional noise or exterior vibration. This behavior can mask the start of oscillation when increasing the proportional gain, and all actuators display this behavior to differing degrees.  \nSecond, the inter-actuator coupling caused by the mirror function may be damping the range of frequencies in which the mirror begins to oscillate. And third, the constructive or destructive interference caused by mirror resonances described in Section 2.4.2 may be interfering with the mirrors oscillation in response to increasing the proportional gain.  \nIt would appear that Ziegler-Nichols is not appropriate for tuning the ASM's actuator control system.", '4.4.1. Modified tuning sets': "A further attempt at creating tuning configurations consisted of taking the values of the proportional gain determined in the previous PS experiments and modifying them by applying a multiplier evenly across all actuators, modified only by the determination that a specific actuator's gain should be kept at its current value, usually the result of a particular actuator being noted as excessively noisy or producing erratic positional output.  \nIn this way, three more tuning sets were created: MinTune (x2), ModTune (x5) and MaxTune (x10), with the multiplier affecting only the proportional variable. Note that all attempts at tuning to this point were modifications to the proportional gain only. Other tuning variables remained at default. For an unknown system, the optimal value of the proportional gain should be determined first and independent of modifications to other gain values. This has, indeed, been shown by experiments where modifying multiple variables in the same tuning set proved ineffective or counterproductive.  \nAlso, With the MAPS ASM, we have a good understanding of the range of magnitudes we can use for the proportional gain value; we have no such understanding of the range of magnitudes acceptable for the integral and derivative values. We assume the original default value for the integral gain is reasonable and safe.", '4.4.2. Ring tuning': "One of the important concepts that one eventually stumbles upon in reading the literature is the idea of  \nTable 3. First group tuning configuration files  \nring tuning . At the start of this process, we viewed actuator tuning as a single-actuator-at-a-time process. As each actuator takes approximately fifteen minutes to tune, the required time becomes on the order of weeks. The seeming necessity of this approach lay in its results: it appeared that many actuators displayed a different result when their controller's K P value were adjusted. Seeing this behavior gave credence to the idea that every actuator needed to be individually adjusted.  \nBut mathematically, this is not the case, and the Circulant Matrix mathematics presented in Grocott's work (Grocott 1997) makes this clear. The fundamental value, indeed the only value, which differentiates an actuator's tuning is their distance from the center of the mirror . Because of this, all actuators in any given ring can be tuned to the same values, which, as can be immediately seen, is a tremendous time saver when working out tuning regimes, dropping the number of tuning attempts from 336 to 12 and the time required from weeks to hours.", '4.4.3. Disabled actuators and coupling effects': "This leads to an obvious question: why do MAPS actuators in the same ring behave differently when they should behave the same? If all actuators are exact functional copies of each other, and assuming that the design of the actuator is sound, there is something else happening. And there is: the presence of disabled actuators.  \nActuators that are disabled put an increased load on the actuators that are functional, changing the interactuator coupling geometry. And actuators that are dysfunctional, usually with their capacitive sensing function disabled ('floaters'), create holes in the collocated SISO  \nTable 4. Second group tuning configuration files  \nscheme, causing those actuators to exhibit anomalous oscillatory behavior.  \nThis leads us to an important conclusion: tuning can only be as good as the number of fully functioning actuators. The more disabled or faulty actuators there are, the more the tuning process becomes degraded by non-functioning actuators effect on actuator coupling.", '4.5. MAPS Tuning Test Plan': 'With all of the above understanding and the knowledge gained from our initial attempts at tuning, the only reasonable plan remaining (before attempting to code an ASM simulator) was to approach the problem iteratively, starting with the results of the second round of individual actuator tuning and making incremental changes and noting their effect on system performance. To do this, however, we needed a quantitative method of determining the effects on settling time due to small changes made to tuning variables.', '4.5.1. MLAT: Measure Latency': "CACAO is the Swiss army knife of adaptive optics software. 'Compute and Control for Adaptive Optics (CACAO) is an open source software package providing a flexible framework for deploying real-time adaptive optics control.' Guyon et al. (2018). It is designed to be applicable to almost any AO system utilizing any form of hardware. MAPS, in its original laboratory testing period, had been relying on temporary control software and interfaces designed by its original software engineer. Recognizing that this initial software had limited usefulness for real-time operation, MAPS began integrating CACAO as its real-time controller software from the start of its engineering runs.  \nTable 5. Results of Group One and Group Two MLAT system latency trials  \nOne of the core routines in CACAO is the Mirror Latency (MLAT) code. MLAT measures latency by sending DM commands (in the form of a spiral checkerboard) and monitoring when the corresponding change is seen in the output from the wavefront sensor. The operator sets the number of iterations the commands are sent. The following description is from Guyon, 2018 (Guyon et al. 2018):  \nThe WFS change is measured by differentiating consecutive WFS frames, as shown in Figure 12. Latency is measured by finding the peak of the WFS change as a function of time delay between DM command and WFS arrival time. In order to fully sample the function, DM pokes are sent at time stamps uniformly distributed within a single WFS exposure. The peak of the function corresponds to a DM motion during the frame transfer of the WFS camera. With a frame transfer CCD and an instantaneous DM motion, the function plotted in Figure 12 should  \nbe a triangle of half-width equal to the WFS single frame exposure time.  \nIt should be noted that the MLAT code does not directly measure mirror latency , which is the time it takes the mirror's surface figure to settle to its commanded shape after the issuance of the outer loop command. Instead it measures system hardware latency , which includes many other factors aside from mirror latency itself.  \nBut all other things being equal, MLAT is a usable metric, as mirror settling time is one of the largest contributors to overall system latency. In order to assure that this is the case, we decided tuning configurations should be tested repetitively by MLAT to determine reproducability. The smaller the variance between trials, the greater we are confident that we are seeing the result of tuning changes on mirror latency, instead of other random computational or hardware effects.", '4.5.2. Method of testing': "Tuning variables are set in MAPS in one of three ways. The first is to access the control law through the operator interface and directly enter gain values. This is  \nFigure 13. MLAT latency plots for the lowest and highest latency value tuning configurations. Plot A represents tuning configuration G1F02; Plot B represents tuning configuration G2F04.  \n<!-- image -->  \nconfigured to either access a single actuator, or access all actuators simultaneously, either of which is useful in only a narrow range of situations. The second way is through the command line, using a number of inhouse commands to directly configure any combination of actuators required (say, all ring 6 actuators, numbers 90 through 125). And the third way, which is the most convenient for our purposes, is through modification of the start-up configuration files. The actuator control configuration file is a text file containing 30 settings each for 336 actuators that loads at start and determines defaults for all actuator controller settings.  \nTo create a tuning set, we create a configuration file with the appropriate values for the gains we wish to test. We then create multiple configuration files that incrementally change these values to determine their effect on latency. A group of these, designed to determine the optimal value for either a single or multiple tuning settings, is then tested consecutively, with the full sequence repeated multiple times.  \nTo test a configuration, we run a script that loops through these configuration files. Each loop loads a configuration file, and then loads a flat to test the file's basic functionality. If the flat executes with minimal actuator complaint (overheating, high current draw, etc.) or system complaint (WildCoil safing, actuator errors), MLAT is run. The cycle repeats with the next file, and then through the required number of repetitions. Each file in the group is tested under the same conditions of target, system settings, etc. The process is then repeated with another group of configuration files, using the values from the file in the previous group determined to have  \ndecreased latency the most as a starting point for the new group's modifications in gain values.  \nTelescope time is costly, and each MLAT execution takes between two and three minutes. We decided on five repetitions of each group, with groups containing around ten different configurations. Each group's script takes approximately 2.5 hours to run. Available time to this point had allowed two configuration groups to be tested. We will continue the process as telescope time allows.", '4.5.3. Description of first test groups': "The twenty-one initial configuration files were split into two test groups, arranged by the gain variables being tested:  \nTest Group One -Test group one contained eleven configuration files, as given in Table 3. These were designed to test the effects of changes to the proportional gain variable (01, 02, 03, 04, 07), the effect of changes to the integral variable (05, 06, 10, 11), and the comparison between individual actuator tuning and ring tuning (08-12). All eleven files were run consecutively, and the group was repeated five times. Date of testing was 14 August 2024. The amplitude of the command was 0 . 5 µ m and the number of iterations was set at 500. The target was FK5 672, Theta Herculis.  \nTest Group Two -Test group two contained nine configuration files, all modified from Group One's Ring MaxTune file, as given in Table 4. These were designed to test the effects of further changes to the proportional gain variable (01, 04), the effect of changes  \nFigure 14. Images of on-sky PSFs, with their corresponding pyramid pupil images. A & B are the results of tuning configuration G1F02, and C & D are the results of tuning configuration G1F11.  \n<!-- image -->  \nto the integral variable (02, 03, 05), the effect of changes to the derivative value (06, 07), and the effect of change to the velocity damping variable (08, 09). All nine files were run consecutively, and the group was repeated three times. Date of testing was 15 August 2024. The amplitude of the command was 0 . 5 µ m and the number of iterations was set at 500. The target was FK5 1525, 28 Cygni.", '5. RESULTS': 'These first twenty-one test configurations were, as a whole, designed to give us a feel for the magnitude of the proportional, integral and derivative gain values, as well as to test ring tuning, and to give us an idea of both the effect of tuning on mirror latency and the reproducability of the data.', '5.1. Latency improvement': 'The data from these two sets of tests consists of a file containing the output of each DM command iteration and a plot showing the latency curve (See Section 4.5.1.) The y-value of the peak point on the curve, determined by line fitting, gives the measured latency for the trial. For each set of trials for each configuration file, the mean, median and standard deviation of the latency was calculated.  \nThe results of all trials are shown in Table 5, ordered by the latency mean from lowest to highest. The latency is expressed in both seconds and in terms of frame rate.  \nAll first group tests were repeated five times. The standard deviation ranges from σ = 0 . 025 to σ = 0 . 134, with a deviation mean of 0.056 and an average deviation of 0.020. All second group tests were repeated three times, with standard deviation for this group ranging from σ = 0 . 021 to σ = 0 . 105, with a deviation mean of 0.046 and an average deviation of 0.023. If there were computational or hardware issue inconsistently affecting the latency calculations, we would expect a broader variance in latency results. We take these low values as  \nindicating that the results are replicatable and that the MLAT results are reflective of mirror latency.  \nThese first twenty-one test configurations were, as a whole, designed to give us a feel for the magnitude of the proportional, integral and derivative gain values, as well as to test ring tuning, and to give us an idea of both the effect on mirror latency and the reproducability of the data.  \nThe difference between the slowest settling time, which occurred with the original Elwood Default settings (G1F02), and the fastest settling time, which occurred with large proportional gain and ring tuning (G2F04), is ∆ t = 0 . 683ms. This represents an improvement of 20% in the time it takes for the mirror to settle into a commanded surface figure.  \nGiven the approach that we are using. i.e., incrementally increasing gain values and looking for improvement, this is a very encouraging result.  \nThe latency plots for two of the test trials are shown in Figure 13. As the mirror settling time reduces, the shape of the curve more closely resembles the isoceles shape of the curve in Figure 12. The broadening of the curve along the x-axis is due to timing jitter and mirror stiffness, and along the y-axis by WFS noise.', '5.2. Improvement in mirror modes': 'The reduced system latency, assumed to be reflective of a more rapid settling time of the mirror, could be expected to manifest in improvement in the ability of the mirror to produce higher order mirror modes, as discussed in Section 2.3.  \nThe standard operation configuration file (G1F01) allowed a maximum of 50 mirror modes. When one of the configuration files (G01F11) was used for closing the loop on sky, the mirror was able to produce up to 100 modes.  \nThis is to be expected, because in order to produce higher modes with higher spatial frequency corrections, the mirror must be able to push proximal segments to  \nFigure 15. The effect of actuator misalignment on power spectra. Left: a top down image of a misaligned actuator in the reference body. Center: representative positional plots. Right: representative power spectra.  \n<!-- image -->  \ndiffering positions with large delta displacement values between them, which requires rapid settling against large mirror function damping force. This is not the case with lower order corrections, however, when proximal segments have minimal delta displacement values.  \nWe take this as further evidence that tuning is indeed affecting mirror settling time.', '5.2.1. Improvement in Point Spread Function': 'Although these data were received to late to analyse quantitatively, the result is visible visually. Figure 14 shows two PSF images, along with their accompanying pyramid pupil images, from on-sky observing. The first set of images shows PSF from the G1F02 configuration. The second set of images show the PSF from the G1F11 configuration. The presence of a more complete Airy structure is visible.', '5.2.2. Contribution of Gain Variables': 'Another result from this first round of tests is insight into the contributions that adjusting the different gain values makes towards improving latency.  \nProportional Gain : In all cases, increasing the value of the proportional gain K P decreased the latency. A maximum value has not been determined yet, nor has the interaction of the variable with other gain variables.  \nIntegral Gain : In all cases, decreasing the value of the integral gain K I decreased the latency. A minimum value has not been determined yet, but it has been determined that the default value is not optimal. The interaction of the variable with other gain variables, particularly the derivative gain, has not been determined.  \nDerivative Gain : In all cases, increasing the value of the proportional gain K D decreased the latency. A maximum value has not been determined yet, but the safe starting magnitude has been. The interaction of the variable with other gain variables, particularly the integral gain, has not been determined.  \nVelocity Damping Gain : In all cases, increasing the value of the velocity damping gain K V decreased the latency. A maximum value has not been determined yet, but a safe starting magnitude has been. The interaction of the variable with other gain variables, and the variance of its effect with ring position, have not been determined.  \nRing Tuning : Ring tuning configurations have been determined to decrease settling time in comparison to both the individual actuator tuning configurations they were created from as well as all individual actuator tuning configurations in general.', '6. POSITION PLOTS AND POWER SPECTRA IN FAULT DIAGNOSIS': 'Concurrent with our work in understanding the tuning of the MAPS controllers, we have been investigating the use of FFT power spectra in diagnosing actuator fault states. Although this work is in its beginning stages, a few useful results have already been found.  \nWhen a MAPS actuator exhibits a fault state, we might expect that there would be changes in either its positional plot or FFT power spectra, and we have tentatively found a few of these differences.', '6.1. Actuator misalignment': "When an actuator is axially misaligned with its corresponding borehole, its magnetic force no longer is normal to the mirror surface, and pulls on the segment's magnet in ways that vary with the displacement of the mirror. The resulting positional plot exhibits a low frequency oscillation, and the lower end of the power spectrum exhibits a 'tail-whipping behavior. Figure 15 shows this behavior.  \nThe left side of the figure is an image of an actuator and a graphic showing an axially-misaligned actuator. The right side of the figure shows both power spectra and positional plots for the actuator under conditions  \nFigure 16. Position vs time plots of an actuator with suspected magnet detachment. A is a positional plot of an actuator with its corresponding mirror magnet attached responding to checkerboard motion. B is the positional plot of an actuator with a suspected detached mirror magnet.  \n<!-- image -->  \nof maintaining a flat. When in actuator is misaligned in this way, its positional plot will alternate between a normal looking plot (upper) and a plot that exhibits long period oscillation (lower). Its power spectrum will show its left tail whipping up and down.  \nRecognizing actuators that exhibit this behavior in the plots mark them for inspection during actuator maintenance, and for realignment and positioning. This correlation between alignment and plot behavior was confirmed during the rebuild discussed in Section 4.2.5.", '6.2. Detached magnet': "The adhesive that holds the magnets to the thin shell has a limited lifetime, and like other ASMs that have affixed magnets (LBT, for example), magnets begin to detach. This has been a slow process, with a few magnets failing after periods of heavy ASM use. The results of magnet failure are not as obvious as one might suspect, and so determining whether a magnet has detached by inspection of an actuator's plots would be ideal.  \nWe believe we have found indicators of magnet detachment in an actuator's positional plot. Figure 16 shows an example. In the left side of the figure is a positional plot showing the response of a healthy actuator when it checkerboards the mirror segment. The blue current line and the red position line are inverses of each other.  \nThe right side of the Figure shows the positional plot of a mirror segment suspected of having a detached magnet. Although this correlation must be proven by removing the thin shell and visually inspecting the actuator, there is little else that we know of that could cause this type of behavior in the positional plot.", '7. CONCLUSION': 'Starting with essentially an unknown actuator control system, we have begun to understand the magnitude ranges of tuning variables, and the effect of those variables on the overall performance of the MAPS ASM.  \nWe have devised an iterative system of testing configuration files which will eventually lead to optimizing mirror settling time. We will continue on-sky testing,  \nadding additional tuning variables as telescope time allows.  \nWe have begun to recognize the predictive ability of power spectra analysis to diagnose actuator failure.  \nThese efforts have already yielded a substantial increase in overall system performance, which has brought the MAPS project closer to realizing its design specifications.', '8. ACKNOWLEDGEMENTS': "The authors would like to acknowledge the substantial contributions to the MAPS adaptive secondary mirror made by control engineer Keith Powell and software engineer Elwood Downey.  \nThe MAPS project is primarily funded through the NSF Mid-Scale Innovations Program, programs AST1636647 and AST-1836008.  \nThis research has made use of NASA's Astrophysics Data System.  \nWe respectfully acknowledge the University of Arizona is on the land and territories of Indigenous peoples. Today, Arizona is home to 22 federally recognized tribes, with Tucson being home to the O'odham and the Yaqui. Committed to diversity and inclusion, the University strives to build sustainable relationships with sovereign Native Nations and Indigenous communities through education offerings, partnerships, and community service.)", 'REFERENCES': '- Bennett, J., Bhasin, A., Grant, J., & Chung Lin, W. 2024, PID Tunng via Classical Methods, https: //eng.libretexts.org/Bookshelves/Industrial and Systems Engineering/Chemical Process Dynamics and Controls (Woolf)\n- /09%3A Proportional-Integral-Derivative (PID) Control/9.03%3A PID Tuning via Classical Methods\n- Downey, E. 2019, CASC: The CAAO Adaptive Secondary Controller, 2nd edn. (Steward Observatory, University of Arizona) Grocott, S. C. O. 1997, PhD thesis, Massachusetts Institute of Technology\n- Guyon, O., Sevin, A., Gratadour, D., et al. 2018, in Society of Photo-Optical Instrumentation Engineers (SPIE) Conference\n- Series, Vol. 10703, Adaptive Optics Systems VI, ed. L. M. Close, L. Schreiber, & D. Schmidt, 107031E, doi: 10.1117/12.2314315 Hinz, P. M., Downey, E., Montoya, O. M., et al. 2018, in Society of Photo-Optical Instrumentation Engineers (SPIE) Conference Series, Vol. 10703, Adaptive Optics Systems VI, ed. L. M. Close, L. Schreiber, & D. Schmidt, 1070369, doi: 10.1117/12.2314278 Johnson, J. A., Vaz, A., Montoya, M., et al. 2023, in Unconventional Imaging, Sensing, and Adaptive Optics 2023, Society of Photo-Optical Instrumentation Engineers (SPIE) Conference Series, 107031E, doi: 10.1117/12.2677896\n- Morzinski, K. M., Montoya, M., Fellows, C., et al. 2020, in Society of Photo-Optical Instrumentation Engineers (SPIE) Conference Series, Vol. 11448, Adaptive Optics Systems VII, ed. L. Schreiber, D. Schmidt, & E. Vernet, 114481L, doi: 10.1117/12.2563178\n- Powell, K. 2017, SPAM: The MAPS Simulator, presentation\n- Powell, K. B. 2012, PhD thesis, University of Arizona\n- Salinari, P., Del Vecchio, C., & Biliotti, V. 1994, in Proceedings of the ICO-16 (International Commission for Optics), Vol. 48, European Southern Observatory Conference and Workshop Proceedings, ed. F. Merkle, 247\n- Salinari, P., & Sandler, D. G. 1998, in Society of Photo-Optical Instrumentation Engineers (SPIE) Conference Series, Vol. 3353, Adaptive Optical System Technologies, ed. D. Bonaccini & R. K. Tyson, 742-753, doi: 10.1117/12.321691\n- Vaz, A., Morzinski, K. M., Montoya, M., et al. 2020, in Society of Photo-Optical Instrumentation Engineers (SPIE) Conference Series, Vol. 11448, Society of Photo-Optical Instrumentation Engineers (SPIE) Conference Series, 114485L, doi: 10.1117/12.2576352  \nWest, S. C., Callahan, S., Chaffee, F. H., et al. 1997, in Society of Photo-Optical Instrumentation Engineers (SPIE) Conference Series, Vol. 2871, Optical Telescopes of Today and Tomorrow, ed. A. L. Ardeberg, 38-48, doi: 10.1117/12.269080'}