CARA / W.M. Keck Observatory LGS AO Focus Manager Requirements Keck Adaptive Optics Note #____ LGS AO Focus Manager Design Book Version 1.2 March 13, 2003 Doug Summers W.M Keck Observatory California Association for Research in Astronomy 65-1120 Mamalahoa Highway Kamuela, Hawaii 96743 808-885-7887 Updated 2/12/2016 at 9:31 PM by D. Summers *** D R A F T *** CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements Preface This document provides technical design information for the Focus Manager portion of the K2 LGS AO integration effort. Refer to other documents for additional information; in particular, see “Low Bandwidth Wavefront Sensor Software Design” for LBWFS software description, and “Keck II Adaptive Optics Subsystem Action Plan” for scheduling and responsibilities. Updated 2/12/2016 at 9:31 PM by D. Summers Page ii CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements Table of Contents (NB: Please note that section numbers will change as the document evolves). Section 1 2 3 4 5 6 Page INTRODUCTION ....................................................................................................................... 4 1.1 Purpose ........................................................................................................................... 4 1.2 Focus ............................................................................................................................... 4 1.2.1 Definitions .............................................................................................................................. 4 1.3 Overview of focus calculations ........................................................................................ 7 1.4 Focus Manager ............................................................................................................... 7 OVERALL REQUIREMENTS AND CONSTRAINTS .............................................................................11 2.1 Focus .............................................................................................................................11 2.1.1 Requirement...........................................................................................................................11 2.1.2 Equations ...............................................................................................................................11 2.1.3 LGS Focus Conclusions ........................................................................................................13 DESIGN .....................................................................................................................................13 TESTING NOTES ........................................................................................................................20 4.1 Unit test environment ....................................................................................................20 4.2 Integration test strategy .................................................................................................20 4.3 Focus Error Budget .......................................................................................................26 RELEASE NOTES .......................................................................................................................26 REFERENCES AND FURTHER READING .......................................................................................26 6.1 Keck Adaptive Optics Notes (KAON) ............................................................................26 6.2 Other Documents ..........................................................................................................27 Updated 2/12/2016 at 9:31 PM by D. Summers Page iii CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements 1 INTRODUCTION 1.1 Purpose When observing with the Keck II telescope in laser guide star (LGS) mode, the fast Wave Front Sensor (WFS) is used to correct high order atmospheric aberrations seen in the LGS wavefront. However, the fast WFS introduces unintentional focus errors into the system as the sodium altitude drifts and the telescope tracks in elevation. The fast WFS sends focus commands to the Deformable Mirror (DM) to keep the artificial reference in focus. A second, low bandwidth wavefront sensor (LBWFS) will be used to sense focus and tip/tilt terms from a dim, Natural Guide Star (NGS). As time averaged, accumulated focus errors are added to the DM by the fast WFS, the LBWFS will command conjugate corrective terms into the FCS to keep the science target focused on the instrument. The end result is equilibrium in both the fast WFS and LBWFS control loops. The Focus Manager (FM) will be used to coordinate focus compensations for multiple modes of operation. During NGS mode, the FM will ignore inputs from the LBWFS, and processing will be as it is currently except that C0 configuration parameters will be set based upon the instrument in use. During LGS, additional inputs will be used from the DCS, and LBWFS. A calculated offset will be generated at 40hz to the FCS based upon these parameters. The following paragraphs further describe Focus Manager (FM) details. 1.2 Focus Ref: Section 6.2 LBWFS Technical Requirements Doc--The Strehl ratio and measured FWHM on the science instrument are a function of the focus of everything in the optical path to the science instrument. The dynamic focus contributors include the atmosphere, telescope and deformable mirror (DM). There are also some fixed focus terms due to the AO and science instrument optics. There are also some fixed, but changing focus terms such as when science instrument filters or plate scale are changed or an atmospheric dispersion corrector is installed. Here we will only deal with the dynamic focus contributors. 1.2.1 Definitions The following quantities are focus shifts, along the optical axis, with respect to the science instrument’s focal plane. The effect on FSCI is positive when the individual focus terms are positive (positive is away from the telescope = into the science instrument): ZSCI = focus shift on science instrument away from optimal position. ZATM = focus shift due to ATMospheric & dome seeing. ZTEL = focus shift due to the TELescope. ZSOD = focus shift due to the SODium layer being at a different distance from the telescope than the distance we assumed for positioning the FCS. ZFCS = position along the optical axis of the Focus Camera Stage (FCS) that supports the WFS. ZFCS = 0 when the DM is flat and the FCS is conjugate to the science instrument focal plane. ZTSS = position along the optical axis of the Tilt Sensor Stage (TSS) that supports the LBWFS. ZTSS = 0 when the DM is flat and the TSS is conjugate to the science instrument focal plane. The following quantities are focus terms. There is a one-to-one relationship assumed in these equations between focus terms and focus shifts: FDM = focus term on Deformable Mirror (DM). FWFS = focus term measured on high bandwidth WaveFront Sensor (WFS). FLBWFS = focus term measured on Low Bandwidth WaveFront Sensor (LBWFS). Figures 1 and 2 are graphical representations of the focus terms within the Adaptive Optics system under NGS and LGS modes (respectively, ref-Chris Neyman). The lines with arrows mark the feedback loops of the system. The WFC software uses the wavefront sensor measurement to determine the new shape of the deformable mirror. The AO system drives changes to make the wave front sensor measurement zero, i.e. it Updated 2/12/2016 at 9:31 PM by D. Summers Page 4 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements is a null seeking servo. Likewise the WFC software averages the deformable mirror shape and offloads to the secondary as needed. Solid lines denote the optical path between the subsystems. Focus off load ZATM Tel.Sec. ZTEL AODM FDM FCS ZFCS WFS FWFS Instrument ZSCI AO Loop System is calibrated with fiber source so that ZFCS =0 when ZSCI = 0 and FDM =0 (i.e. flat mirror). When loop is closed FWFS=ZATM+ZTEL + FDM + ZFCS. The calibration makes ZFCS =0. Therefore FWFS = ZATM+ZTEL + FDM. The AO Loop makes FDM = –( ZATM+ZTEL ) so that FWFS = 0. Figure 1 – NGS Focus Terms/Operation Updated 2/12/2016 at 9:31 PM by D. Summers Page 5 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements Off Load NA LGS ZSOD ZATM Tel.Sec. ZTEL AODM FDM Instrument ZSCI FCS ZFCS WFS FWFS TSS ZTSS LBWFS FLBWFS AO loop System is calibrated with fiber source so that ZTTS = 0 when ZSCI = 0 and FDM = 0 (i.e. flat mirror). ZFCS is chosen to be at the nominal Na focus, ZFCS = -ZSOD. This could also be checked on the sky with wavefront sensor measurement. When loop is closed FWFS=ZSOD + ZATM+ZTEL + FDM + ZFCS = ZATM+ZTEL + FDM. The WFC makes FDM = –( ZATM+ZTEL ) so that FWFS = 0. If ZFCS in not equal to ZSOD then high bandwidth wavefront sensor sees the difference FCS= ZSOD + ZFCS. Therefore FWFS = FCS + ZATM + ZTEL + FDM . The WFC makes FDM= -( FCS + ZATM+ZTEL). Now the LBWFS sees FLBWFS = ZATM+ZTEL+FDM+ZTSS. Using the above expression for FDM and the fact that ZTSS is calibrated to be zero. The results is FLBWFS = -FCS . This correction should now be applied to ZFCS resulting in the sodium layer being back in focus. Figure 2 – LGS Focus Terms/Operation Updated 2/12/2016 at 9:31 PM by D. Summers Page 6 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements 1.3 Overview of focus calculations The preexisting NGS FCS focus calculation employs a 3rd order polynomial function (F2F) using a set of constants (C0-C6), Xim, Yim, FSM terms, and enable/slew control flags built into epics. The C0 constant is currently set by support astronomers depending on the selected instrument and filters in use, and C1-C6 parameters are preset in EPICS .parameter files. The constants are mapped to epics channels read by the F2F function. This function produces fcs position (a distance offset) used for maintaining focus on the science instrument. The preexisting code is implemented within CAPFAST in the diagram /kroot/kss/ao/sc/capfast/scObsFsmFcs.sch. The equation is: FCS Focus(Meters)=(C0+C1x+C2y+C3x2+C4y2+C5x3+C6y3)/1000 1.4 Focus Manager The Focus Manager will be inserted into the current processing stream and used to augment the existing f2f logic. The focus manager shall use the existing focus parameters, and process additional new parameters to support different modes. There are 3 operational modes of interest, and these modes will be based upon a keyword/EPICS channel identifying the mode (AO_mode currently supports OBS, NGS, LGS modes...we may just use this keyword). The three modes to be supported will include: a. NGS mode (maps to the current functionality) b. LGS mode c. Simulation mode The three modes are discussed below: a. NGS Mode The NGS mode is the current mode for F2F. This mode will be used when the laser is not operating. F2F function processing will remain the same under NGS mode, except that an identification of the correct C0 keyword (now one per instrument) must be selected prior to function execution. The current NGS mode input parameters include: 1. C0 2. Xim 3. Yim The current NGS focus output is event driven (based on CO or Xim/Yim change). The focus manager will use these controls and implement new controls for NGS and simulation modes. b. LGS Mode When in LGS mode, the focus manager must act upon existing NGS mode input parameters, and factor in additional parameters to address nuances of the LGS operational concept. These parameters will be available in the form of keywords/EPICS channels, and will be used to calculate the output FCS offset value. New inputs will include: 1. Elevation Angle 2. LBWFS NGS focus (time averaged) 3. Atmospheric Dispersion Compensations (ADC). These include IR and VIS, but the changes will just be placeholders for future capabities. The calculated FCS output value is provided at a rate that is driven by request (currently 40Hz). Updated 2/12/2016 at 9:31 PM by D. Summers Page 7 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements c. Simulation Mode With the separation of C0 parameters into multiple parameters (one per instrument), a capability to disable the selection of any particular C0 parameter is needed. A simulation C0 value is included for test and calibration setup purposes. This simulation mode and C0 parameter are available to be set by support astronomers via keyword. A significant set of simulation controls are available. These include (in addition to the C0 selection described above), simulated triggers for internal model processing, simulated demand source (for setting one-shot vs. tracking mode), and mode terms for NGS, LGS, and hardware components (LBWFS, IR ADC, VIS ADC) CO parameter changes. The C0 parameter will be changed to be based upon current instrument. It was agreed that new C0 keyword would be created for each of the following instruments: K1 KCAM IF SHARC K2 NIRC2 IF NIRSPEC OSIRIS ISSUES. The following issues were noted: a. ADC. The exact operational details of ADC are not well understood. Whether ADC will need to act with other keywords or can be driven alone is a TBD. Because of this, it was decided that an ADC input would be provided as a hook (but left unimplemented). [Peter Wizinowich] We have the components for an IR ADC. This will eventually be implemented just in front of NIRC2. The ADC can be in or out of the beam. It will shift the focus in the +z direction when it is installed. Therefore an offset to C0 would be needed for the IR ADC. b. TSS. How TSSz motion will be handled is outside of the scope of the focus manager. However, this detail needs to have some separate thought to determine how to drive the motion correctly under the LGS mode. [Peter Wizinowich] TSS will need to be positioned to stay conjugate to the science instrument focus. That means that its position will be a function of the science instrument and potentially science filters. c. Telescope nodding. How telescope nodding will be accomplished in LGS mode needs to have some thought as well. [Peter Wizinowich] When the telescope is nodded the LGS pointing needs to be changed to keep the LGS on the science object. So, the FSMs will move the same way they normally do, and the TSS will move in an identical fashion to stay on the NGS. d. Gains. It would be desirable to add gain parameters (multiplicative) within the F2F function to help during tests, configuration, and calibrations. Updated 2/12/2016 at 9:31 PM by D. Summers Page 8 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements e. WFS filters. There may be focus impacts due to filter elements in the light path within wavefront sensor optics component (item 14 on the AO bench drawings). This should be investigated. f. NIRC2 alignment camera....are there implications for focus due to this camera? [Peter Wizinowich] Yes. If it were installed it would monitor if/how NIRC2 moves with respect to the AO bench. Any measured z-moves would need to be matched with the same z move of the FCS. g. FCS Hardware. Is this hardware capable of handling smooth 40Hz inputs? This should be tested. Requirements references: The following references for requirements are noted: [Peter Wizinowich] I wrote a section in the LBWFS requirements document on focus. This section (6.2) includes a requirement in section 6.2.2 for the FCS focus of 0.17 mm at zenith and 0.37 mm at a zenith angle of 60 deg. Table 7 shows the sensitivity of FCS focus to zenith angle and sodium layer altitude. [Peter Wizinowich] Chris drew a diagram to show the focus control loop from the LBWFS to the FCS that corresponds to section 6.2 of the LBWFS requirements doc. You should get it from him. Updated 2/12/2016 at 9:31 PM by D. Summers Page 9 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements ... Constant Parameters - CO (one per instrument) - C1 - C6 (precalibration parameters) Current Instrument AO Mode Xim, Yim Telescope Elevation Angle Focus Manager FCS Commands (40 hz) Sodium Altitude Focus Zernike IR, Vis ADC Terms LBWFS Updated 2/12/2016 at 9:31 PM by D. Summers Page 10 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements Sodium Altitude ... IR, Vis ADC Terms AO Mode C0 Constants - (one per instrument) C1-C6 constants Current Instrument C0 C0 Selector AO Mode Focus Calculator FCS commands (40hz) Xim, Yim Telescope Elevation Angle Focus Zernike 2 Overall requirements and constraints Need to work how these requirements flow into the other categories. 2.1 Focus 2.1.1 Requirement We want to maintain the focus on the science instrument so that it does not significantly degrade the diffraction-limited image quality. At H-band the diffraction-limit is 0.034 arcsec. If we say that defocus, due to all contributing sources, cannot degrade the image by more than 10% then the allowable contribution is [(1.1*0.034)2 – (0.034)2]1/2 = 0.016 arcsec * 0.727 mm/arcsec = 0.0113 mm. This is converted to an allowable shift in the focal plane by multiplying by the telescope f/# = 15, so Z = 0.17 mm. This should be the requirement at zenith. It would be acceptable to allow the defocus contribution to grow as a function of zenith angle. If we allowed the defocus to match the diffraction-limited image size at a zenith angle of 60, then Z = 0.034 arcsec * 0.727 mm/arcsec * 15 = 0.37 mm. 2.1.2 Equations With the AO DM loop off: ZSCI = ZATM + ZTEL + FDM. With the AO DM loop off and the DM flattened: ZSCI = ZATM + ZTEL. 2.1.2.1 NGS Mode With the AO DM loop on: ZSCI = ZATM + ZTEL + FDM. Updated 2/12/2016 at 9:31 PM by D. Summers Page 11 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements Ideally the time averaged <ZSCI> = 0, because the control system tries to drive the wavefront sensor measured focus FWFS = ZATM + ZTEL + FDM - ZFCS to zero by driving FDM = -(ZATM + ZTEL) + ZFCS. Since the AO system was calibrated at the ideal FCS position, ZFCS = 0; this position should not have changed, except to correct for a change requested to compensate for a science instrument change. If the FCS position has changed since calibration, then <ZSCI>= ZFCS. 2.1.2.2 LGS Mode With the AO DM loop on and in the absence of any LBWFS information: ZSCI = ZATM + ZTEL + FDM. The control system drives the wavefront sensor measured focus FWFS = ZATM + ZTEL + ZSOD + FDM - ZFCS to zero by driving FDM = -(ZATM + ZTEL+ ZSOD) + ZFCS. Since the distance to the sodium layer varies as a function of the zenith angle, , the FCS stage should be driven as a function of zenith angle: ZFCS(h,) = f h / (h - f cos) - f = f2cos / (h-fcos), where h is the height of the sodium layer above the telescope at zenith and f is the focal length of the telescope (150 m). Table 1 provides some examples, and gives a feel for the magnitude and sensitivity of the FCS positioning. Table 1: FCS positions for various LGS altitudes and zenith angles. () 0 0 0 0 1 59 59.95 60 H (km) Infinity (NGS) 85 89.95 90 90 90 90 90 ZFCS (mm) 0 265.17 250.56 250.42 250.38 128.87 125.29 125.10 The following figure shows a graph of several sets of zenith angles and sodium altitude functions for FCS FCS Positions for LGS Zenith Angle and Sodium Layer Height (Instrument Co not included in FCS position) 80 km 300 82.5 km 85 km 280 87.5 km 260 90 km 92.5 km FCS position (mm) 240 95 km 97.5 km 220 100 km FCS limit 200 180 160 140 120 100 0 5 10 15 20 25 30 35 40 45 50 55 60 65 Zenith Angle (deg) Updated 2/12/2016 at 9:31 PM by D. Summers Page 12 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements The LBWFS measures FLBWFS = <ZATM> + <ZTEL> + <FDM> - ZTSS. Here, “<>” indicates the time-average over the LBWFS integration. If we set the TSS position with the DM flat, so that the LBWFS measured focus is zero when the fiber image is at best focus on the science instrument, then ZTSS = 0 (this will be assumed from now on). Inserting the WFS driven <FDM> equation from above, then we get FLBWFS = -<ZSOD> + <ZFCS>. This is just the error in how accurately we have managed to drive the FCS to match the distance to the sodium layer. Note that this requires time-averaging the FDM term during the LBWFS integration. 2.1.3 LGS Focus Conclusions FCS tracking as a function of zenith angle needs to be done to a fairly high accuracy. The LBWFS measured focus should be directly offloaded to the FCS position. The LBWFS measures the error in conjugation between the FCS position and the sodium layer. 3 Design The focus manager has been implemented in EPICS using capfast. The pre-existing code for NGS FCS commands was implemented within the OBS interface of the supervisory control (SC) software. The capfast schematic is cObsFsmFcs.sch ($KROOT/kss/ao/sc/capfast). It contains a 3 rd order polynomial based upon C0-C6, XIM and YIM terms. The calculation is triggered by a $(obs)fsm:slewActive input that drives the calculation (via input specified as CPP) when the enable binary input is set to true (1). The result of the calc is fed to an AO record that generates the output $(obs)fcs:goLoc. This output is specific to a 1DOF device. This original design strategy is still available in the new design, but via different channels. Additional tracking output has been added as well. The new output will be specifically used for LGS operations, but is intended to be generically accessible via configuration of the focus manager. The new output will be generated as a function of elevation angle, LBWFS zernike, and ADC terms (Vis and IR). The output will be consumed by another capfast process based upon a 40hz signal from the BNC card. The output value destination is dual-port memory on the PMAC. Updated 2/12/2016 at 9:31 PM by D. Summers Page 13 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements Focus Manager Screens: Updated 2/12/2016 at 9:31 PM by D. Summers Page 14 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements Updated 2/12/2016 at 9:31 PM by D. Summers Page 15 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements Operational Concept for GUI The Focus Manger (FC) GUI design currently incorporates a Tcl/Tk user screen and three dm2.4 engineering screens. The user screen has the most important user controls on it, with a “more” button to enable the engineering screen. The engineering main screen holds the component contribution controls, simulation features, and output enables. The remaining two screens provide control for setting the C0 values on Keck1 and Keck2. The Focus Manager (FC) GUI has been implemented somewhat differently than originally anticipated. Although the original requirements stated that AOMODE would be used to drive the selection of component contribution (NGS vs. LGS), during design it was decided to allow the focus manager to allow any contribution to be enabled (as a flexibility feature). Based upon this new requirement, the need for Updated 2/12/2016 at 9:31 PM by D. Summers Page 16 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements AOMODE became obsolete. The focus manager has several contribution controls (one for each), and allows summation of all enabled contributions into the total focus calculation value. Also, the extent of simulation capabilities has been expanded from the original requirements. The focus manager is driven from a synchronous trigger that originates on a BNC card at 40hz. This trigger causes the EPICS records to process within the focus manager and provides the mechanism for output to the PMAC tracking device. During unit testing, the BNC card wasn’t available in the unit test environment, so a simulated trigger was inserted to facilitate testing. This simulation trigger has been kept in the final engineering screen to allow run-time simulation during C0 testing (outputs disabled). The critical operational parameters that drive output calculations include: Demand Src selection Output enables/disables Simulation triggers (enable/disable) Contributions (enable/disable) These items are discussed in the paragraphs below: Demand Src Selection: Output source is constrained according to the demand source specified either by simulated demand source, or actual HW demand src (obs). The values of demand source include Manual, Simulate, Track, and ServoInPos. Manual and ServoInPos constrain outputs to one-shot (goLoc) outputs, and Simulate and Track constrain outputs to the tracking device. Output Select enables/disables: Output enables operate differently depending on whether or not simulation triggers are enabled. In simulation mode, triggered calculations will occur, but will not be sent to output destinations unless the correct demand source is set and the output select is enabled (ON). In non-simulation mode, the output select must be ON before calculations will be performed. Likewise, outputs can not be sent to destination without the outputs being in an ON state. Simulation Triggers: The FC software only calculates when requested via passive processing of capfast records. A specific trigger from the BNC must be received in order to process. However, the capability to intentionally invoke FC processing has been added as a simulated trigger function. In this mode, the simulated trigger function must be set to ON, and the appropriate selection (one-shot or tracking) trigger must be set ON as well. The one-shot selection causes a single invocation, while the tracking invocation is performed at 40hz. When both are ON, tracking takes precedence. Outputs are still constrained according to the demand source select and output enable/disable functions. Contributions: Contribution enable and disable functionality has been added to the GUI. Each contribution (NGS, LGS, LBWFS, IR ADC, VIS ADC) can be independently enabled. In addition, simulation controls have been added in a separate panel to override the hardware inputs. In order for the contribution to be summed into the final output value, the correct settings of demand source, output enable, and contribution enable must be set. All of these controls have corresponding keywords associated with them to provide flexibility in setting their values. Main Engineering screen details: The operation of the main engineering screen is relatively straight forward. Set the extent of simulation desired, enable the contributions, and then enable outputs. Tracking outputs override one-shot controls, so if it is deemed necessary to drive the goLoc one-shot facility of the PMAC device driver while in tracking mode, then use of keywords to disable tracking output and set demand source will be required. Calculation values can only be viewed if the focus manager is receiving triggers (real or simulated). The output value of all contributions is viewed in the top panel labeled FC CALC. The values output to the PMAC one-shot and tracking facility are just above this field. The calculated C0 value (based upon CURRINST, and as calculated internally to the FC software), is contained in the left top panel. The current instrument is shown for reference as well. C0 Definition screen details: The C0 Definition screens allow input of an instrument C0 value or a simulated C0 value. These are separated into instruments for K1 and K2. To use a simulated C0 value, the simulation enable flag must be enabled (ON) on the main Focus Manager screen. The EPICS implementation holds all channels (both K1 and K2 channels) within a single executable database. This is intentional; it allows a single executable to be used on both K1 and K2. The current telescope is indicated Updated 2/12/2016 at 9:31 PM by D. Summers Page 17 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements just above the menu selection for the C0 screen and serves as a reminder for which telescope is being used. Although C0 values can be entered for instruments not accessible to the current telescope, they won’t be effective. The value must be able to be mapped by the CURRINST keyword. A side effect of having both sets of instruments available within the exe is that for IF and SimC0 (which are generic to both telescopes), changing the value on the K1 screen will change it on the K2 screen as well. This doesn’t impact operations on the other telescope as the software is local to the supervisory control crate on the telescope in use. Focus Manager is implemented in EPICS, and has keyword support for many control and readback variables. The following paragraph discusses the focus manager EPICS channels and keyword mappings. Focus Manager EPICS variables: Inputs: Keyword Comments $(tel):ao:sc:instrumeRbv $(tel):ao:sc:el obtained ext to FocMgr obtained ext to FocMgr References: =========== FSM -> FCS enable FSM -> FCS one shot AOWFSLAV AOF2FGO $(obs):fsm:fieldX $(obs):fsm:fieldY $(obs):fsm:slewActive change -> ao:sc:fc:enable change -> ao:sc:fc:goLocFocus.PROC logic change -> You must have AOFCOSOC set to 1 (TRUE) (new), and have demandSrc (old) set to either Manual or ServoInPos These are the fsm drivers Sodium Alt: =========== $(tel):ao:sc:fc:sodiumAlt AOFCSALT Contribution Controls: ====================== $(tel):ao:sc:fc:NgsCtrl $(tel):ao:sc:fc:LgsElCtrl $(tel):ao:sc:fc:LbwfsCtrl $(tel):ao:sc:fc:IrAdcCtrl $(tel):ao:sc:fc:VisAdcCtrl CT AOFCNGCT AOFCLGCT AOFCLBCT AOFCIRCT AOFCVSCT Gains: ====== $(tel):ao:sc:fc:NgsGain $(tel):ao:sc:fc:LgsElGain $(tel):ao:sc:fc:LbwfsGain $(tel):ao:sc:fc:IrAdcGain $(tel):ao:sc:fc:VisAdcGain AOFCNGGN AOFCLGGN AOFCLBGN AOFCIRGN AOFCVSGN FO AOFCNGFO AOFCLGFO AOFCLBFO AOFCIRFO AOFCVSFO Contribution Focus Calcs: ========================= $(tel):ao:sc:fc:NgsFocCalc $(tel):ao:sc:fc:LgsElFocCalc ON/OFF ON/OFF ON/OFF ON/OFF ON/OFF GN Contribution focus terms: ========================= $(tel):ao:sc:fc:NgsFocusOut $(tel):ao:sc:fc:LgsElFocusOut $(tel):ao:sc:fc:LbwfsFocusOut $(tel):ao:sc:fc:IadcFocusOut $(tel):ao:sc:fc:VadcFocusOut Meters FC AOFCNGFO AOFCLGFO Updated 2/12/2016 at 9:31 PM by D. Summers Page 18 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements $(tel):ao:sc:fc:LbwfsFocCalc $(tel):ao:sc:fc:IrAdcFocCalc $(tel):ao:sc:fc:VisAdcFocCalc AOFCLBFO AOFCIRFO AOFCVSFO Instrument C0s, Coeffs: ======================= $(tel):ao:sc:fc:c0IF $(tel):ao:sc:fc:c0KCAM $(tel):ao:sc:fc:c0NIRC2 $(tel):ao:sc:fc:c0NIRSPEC $(tel):ao:sc:fc:c0OSIRIS $(tel):ao:sc:fc:c0SHARC $(tel):ao:sc:fc:c0Sim $(tel):ao:sc:fc:c0 $(tel):ao:sc:fc:c1 $(tel):ao:sc:fc:c2 $(tel):ao:sc:fc:c3 $(tel):ao:sc:fc:c4 $(tel):ao:sc:fc:c5 $(tel):ao:sc:fc:c6 $(tel):ao:sc:fc:c0SimEnable C0 AOFCC0IF AOFCC0KC AOFCC0N2 AOFCC0NS AOFCC0OS AOFCC0SC AOFCC0SM AOFCC0 AOWFC1 AOWFC2 AOWFC3 AOWFC4 AOWFC5 AOWFC6 AOFCC0SE (both k1 and k2) Change(existing keywd) Change(existing keywd) Change(existing keywd) Changed (existing keywd) Change(existing keywd) Change(existing keywd) Change(existing keywd) Focus (sum, output ctrls, output vars): ======================================= $(tel):ao:sc:fc:SumFocOffsets AOFCSFCV $(tel):ao:sc:fc:goLocOutCtrl AOFCOSOC $(tel):ao:sc:fc:trackOutCtrl AOFCTROC $(tel):ao:sc:fc:goLocFocus AOFCOSFV $(tel):ao:sc:fc:trackFocus AOFCTRFV sum of contributions one-shot out control tracking out control one-shot output val tracking output val Everything below this line is considered internal (no keywords): ------------------------------------------------------------------------------ Contribution Gain Calcs: ======================== $(tel):ao:sc:fc:NgsGainCalc $(tel):ao:sc:fc:LgsElGainCalc $(tel):ao:sc:fc:LbwfsGainCalc $(tel):ao:sc:fc:IadcGainCalc $(tel):ao:sc:fc:VadcGainCalc HW Proxy vals: ============== $(tel):ao:sc:fc:LbwfsFocZern $(tel):ao:sc:fc:IrAdcOffset $(tel):ao:sc:fc:VisAdcOffset NGS Focus subparams: ==================== $(tel):ao:sc:fc:enable $(tel):ao:sc:fc:xcalc $(tel):ao:sc:fc:xmm $(tel):ao:sc:fc:ycalc $(tel):ao:sc:fc:ymm $(tel):ao:sc:fc:z $(tel):ao:sc:fc:fan Simulation enables/values: ========================== $(tel):ao:sc:fc:NgsSimEnable $(tel):ao:sc:fc:elSimEnable $(tel):ao:sc:fc:LbwfsSimEnable $(tel):ao:sc:fc:IrAdcSimEnable $(tel):ao:sc:fc:VisAdcSimEnable $(tel):ao:sc:fc:simDmdSrc $(tel):ao:sc:fc:NgsSimVal $(tel):ao:sc:fc:simElDeg $(tel):ao:sc:fc:LbwfsSimVal Updated 2/12/2016 at 9:31 PM by D. Summers Page 19 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements $(tel):ao:sc:fc:IrAdcSimVal $(tel):ao:sc:fc:VisAdcSimVal Internal variables ================== $(tel):ao:sc:fc:c0Select $(tel):ao:sc:fc:goLocEnable $(tel):ao:sc:fc:trackEnable $(tel):ao:sc:fc:goLocTrig $(tel):ao:sc:fc:trackTrig $(tel):ao:sc:fc:goLocOutDis $(tel):ao:sc:fc:trackOutDis $(tel):ao:sc:fc:goLocTrigFreq $(tel):ao:sc:fc:trackTrigFreq $(tel):ao:sc:fc:simDmdEnable $(tel):ao:sc:fc:simTrigEnable $(tel):ao:sc:fc:simGoLocDisable $(tel):ao:sc:fc:simTrkDisable $(tel):ao:sc:fc:trig $(tel):ao:sc:fc:trigArbitrate $(tel):ao:sc:fc:trigSelectDis $(tel):ao:sc:fc:demandSrcSel $(tel):ao:sc:fc:elSrcSelect $(tel):ao:sc:fc:focusSelect $(tel):ao:sc:fc:trigSelect $(tel):ao:sc:fc:El2Radians $(tel):ao:sc:fc:zenithAngle Unit test stub: =============== $(tel):ao:sc:fakeElModel 4 Testing Notes 4.1 Unit test environment The Focus Manager contains sufficient simulation capabilities to test in a stand-alone environment. Unit testing was performed at HQ on ifcpu2 used for TDC/AUX development. The processor is accessed via the tserv3 terminal server. This server is accessed with telnet command, using port 3003. The boot parameters were changed such that the startup script is pointed to a FC script modified for unit testing. In addition to the hardware environment, some software environment enhancements were added. This includes a high level “context” provided for input stimulus including elevation, current_instrument, OBS fsm enable & xim, and yim. The top-level context should be excluded prior to using all other functions (scFocusMgr.sch and below). The following notes summarize the build environment: telnet tserv3 3003 – (crate/cpu) startup script configured for either nfs.hq (no FC) or /home/dsummers/kroot/kss/ao/fctest/startup/fcStartup use bootChange command to configure boot parameters builds environment (honolua): gmake clean followed by gmake in $KROOT/kss/ao/fctest src is in capfast and src directory (gensub c code) screens are in dl directory, startup script is in startup directory. release area is $KROOT/rel/ao/fctest/ (dbd, bin, and data) 4.2 Integration test strategy Testing of the focus manager code should be fairly straightforward. There isn’t much needed in the way of telescope resources. The current code requires an altitude angle for checking the elevation tracking focus model, and will eventually require a LBWFS zernike focus term for checkout of the LBWFS contribution offset. Existing scripts used to control the telescope (keyword access) should be used to ensure the NGS Updated 2/12/2016 at 9:31 PM by D. Summers Page 20 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements contribution still functions as it did previous to the modifications. The initial FC configuration only has NGS and LGS elevation contributions (with proxies for the other components). The agreed upon test plan used for the Nov 2002 engineering run includes the following tests: 1. Characterize the way the F2F loop works now, before adding the changes for Focus Manager. With TRUSTED code; Test A: (Characterize the f2f performance, by gathering FCS position data while varying C0 and Xim, Yim). Do this by filling in a matrix of C0 vs (Xim, Yim) with FCS position numbers. Use C0 of -4.2, -3.7 Use (Xim,Yim) of (0,0), (1,0), (0,1), (1,1), (-1,0), (0,1), (-1,-1), (1,-1), (-1,1) This is 9 image plane positions for each of 2 C0 for a total of 18 data points. Note the FCS and WPS positions for each of the obove combinations of C0 and (Xim,Yim). 2. Introduce the new OBS code, and verify that none of the existing functionality has broken. Note: we are assuming that unit testing of OBS changes have already been done. Test B: Convert to new OBS version (Scott, can you write a procedure for this please?) Verify that the par file is successfully loaded for FCS and WPS Configure the FCS and WPS to demandSrc = manual redo test A. We would expect the performance to be exactly the same. 3. Introduce the new SC (focus manager) software. Test C: (Load new SC code) Verify software loads and par file loaded successfully. Test D: (test output disables)... use ENG gui Set "track" to off Set "one-shot" to off Set FCS demand source = manual and then redo test A. (expect nothing to happen, since F2F functionality has been cut out, and new FC is disabled, So we would expect that when the (Xim, Yim) changes at the FSM, that the FCS will not move) Test E: (Left blank on purpose). Test F: (Test of one-shot functionality) Enable FC one-shot Set FCS demandSrc = manual redo test A. (should work with one-shots) Updated 2/12/2016 at 9:31 PM by D. Summers Page 21 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements Verify with *.TPRO on ???? Channel, that the tracking stuff is NOT being exeecuted during oneshot mode of operation. Test G: (Test of Tracking functionality) Set FCS demandSrc = TRACK Set output enable for FC tracking = ON Set one-shot = OFF redo test A. (should see the same demands as before but at 40hz continuous instead of on-shot) turn on *.TPRO for the "goloc" record (Channel name??) to verify that both demand threads are not working simultaniously) 4. Operational Tests Test the new C0 inputs. Note: They used to all share one channel, but now there are separate and unique C0 chanels and keywords for each instrument. Test H: (Test that FC accepts a new "currInst" change in one-shot operation, and that the correct C0 comes up. With the FC configured for one-shot focus manager operation Set currInst to NIRC2, record the C0 and FC output Set currInst to NIRSPAO, record the new C0 and FC output Set currInst to IF, record the new C0 and FC output Was the focus recalculated on currInst change? Set FCS demandSrc be set to manual for this test. Test I: (Test that FC accepts a new "currInst" change in tracking operation, and that the correct C0 comes up). With the FC configured for tracking operation Set currInst to NIRC2, record the C0 and FC output Set currInst to NIRSPAO, record the new C0 and FC output Set currInst to IF, record the new C0 and FC output Was the focus recalculated on currInst change? Set fcs demandSrc to Tracking for this test Test J: (Test That FC accepts a new instrument specific C0 in one-shot operation-currInst does NOT change) With the FC configured for one-shot focus manager operation Set currInst to NIRC2, record the C0 and FC output Change the NIRC2 C0 by modifying the keyword ????? Was the focus recalculated on the C0 change? Set the FCS demandSrc to manual for this test Test K: (Test That FC accepts a new instrument specific C0 in tracking operation-currInst does NOT change) With the FC configured for tracking operation Set currInst to NIRC2, record the C0 and FC output Change the NIRC2 C0 by modifying the keyword ????? Was the focus recalculated on the C0 change? Set FCS demandSrc to tracking for this test Updated 2/12/2016 at 9:31 PM by D. Summers Page 22 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements Test L: (Look for any instrument scripts that use C0 directly, insure that they work with the instrument specific C0's.) Also check AO IDL routines? (David/Chris which IDL routines need testing?) 5. LGS - Elevation contribution testing (Test that the elevation contribution is being calculated and applied correctly). Note: This test requires telescope to be moved to various elevations (non-tracking) Test M: (Non-tracking comparison with requirements document) Set-up No laser required Starlight is not necessary. Set the fcs demandSrc = tracking Set FC track output = enabled Set FC LGS elevation contributions = ON Set Sodium altitude = 85km Set NGS contributions to ON Set LGS EL contributions to ON All other contributions should be OFF Send (non-tracking) elevation of telescope to zenith, use camonitor to gather Procedure Send telescope to zenith, non-tracking, Use camonitor to gather data to verify focus manager outout as per requirements document, Gather the following channels... telescope elevation sodium height Outgoing focus demand ???? Verify that the telescope EL from DCS is coming into the FC. Is it? ( Yes / NO ) Manually calculate / verify the Focus Manager outgoing demand. Outgoing FCS Demand should be ______________ mm Actual Outgoing demand is __________________ mm FCS actually went to _______________________ mm Change Sodium layer height variable = 90km (Telescope stll at Zenith) Use camonitor to gather data to verify focus manager outout as per requirements document, Manually calculate / verify the Focus Manager outgoing demand. Outgoing FCS Demand should be ______________ mm Actual Outgoing demand is __________________ mm FCS actually went to _______________________ mm Updated 2/12/2016 at 9:31 PM by D. Summers Page 23 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements Send Telescope to 1 degree Zenith Angle (non-tracking) Sodium still set to 90km) Use camonitor to gather data to verify focus manager outout as per requirements document, Manually calculate / verify the Focus Manager outgoing demand. Outgoing FCS Demand should be ______________ mm Actual Outgoing demand is __________________ mm FCS actually went to _______________________ mm Send Telescope to 59 degrees Zenith Angle (non-tracking) Sodium still set to 90km) Use camonitor to gather data to verify focus manager output as per requirements document, Manually calculate / verify the Focus Manager outgoing demand. Outgoing FCS Demand should be ______________ mm Actual Outgoing demand is __________________ mm FCS actually went to _______________________ mm Test N: (Tracking Test of elevation contributions to LGS focus based on equations No laser required Starlight not necessary Set the fcs demandSrc = tracking Set FC track output = enabled Set FC LGS elevation contributions = ON Set Sodium altitude = 85km Set NGS contributions to ON Set LGS EL contributions to ON All other contributions should be OFF Note: the only real difference between this test and test M, is that the telescope is now tracking. Set telescope to track a star at low elevation (low in the sky ~ 40 degrees, either due east or due West so Elevation changes as quickly as possible) Is the focus outgoing demand changing by about the right magnitude? Is the focus outgoing demand changing in the right direction? Is the FCS and WPS stages tracking properly? Document a particular instance of the 40 hz data stream (using camonitor or archiver) (data captured will be the following channels... Wait a few minutes until the EL has changed significantly and then document another instance of the data stream. Does the system appear to be tracking focus properly. Updated 2/12/2016 at 9:31 PM by D. Summers Page 24 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements Test O: (Elevation contributions to focus using LGS spot size on WFS) Requires laser in the sky Set ROT to Vertial angle mode. (what angle? make elongation along X axis) Is WFS Spot size changing? (How do we test this?) Assuming we are at the correct LGS focus, the WFS spot size for a specific subaperature should be at a minnumum. Remember that the laser spots in different subaps of a given WFS image will always be different sizes, so we'd have to minniumize them on a per-subap basis. Perhaps if they are all at a minnumum, we can conclude that we are "in-focus".? Need help deciding if this test is feasible. Test P: (Elevation contributions to focus using NIRC-2 Images) Requires laser in the sky Requires closed DM loop on LGS Start the telescope tracking a star... take NIRC2 images at several minute intervals Is the focus changing? It shouldn't be (at least to 1st order) We need help deciding if this test is feasible. Test Q: (WPS validation. Is the WPS going where it should?) how to test? WLS to open so we can image the pupil with the WFS do this dynamically, while tracking... does the pupil stay in focus/scale during a track?. We need help deciding if this test makes sense, and on the procedure. 6. Performance Tests Archive Data to look for smoothness of FCS/WPS tracking demands, continuity, servo performance, occilations and system behavior during new object acquisition, etc. Test R: (Slow Archive of focus demand, fcs position and WPS position, gathered all night. (PS,SH,DS to put together archive request file in advance) Test S: (Fast Archive of full Rate (40hz) data for brief periods, during steady state operations and during new target acquisition). (PS,SH,DS to put together archive request file in advance) 7. FCS and WPS device servo tests Test T: (Use new OBS code to characterize servo performance, using archiver written for test S: ME group does PM lube/cleaning Updated 2/12/2016 at 9:31 PM by D. Summers Page 25 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements Use new OBS code to characterize servo performance, using archiver written for test S: Tom Nordin / et.al. servo tune the devices Use new OBS code to characterize servo performance, using archiver written for test S: 4.3 Focus Error Budget The Focus Manager requirements state that the allowable focus shift varies by zenith angle. The requirement is most severe at zenith (60 degree angle is also shown for comparison): .17mm (@ zenith) .37mm (@ 60 deg zenith) The allowable FCS encoder counts can be mapped to focus travel as follows: .17mm * (1,000,000 encoder counts (EC)/M) * (1M/1000mm) = 170EC The max FCS device tracking rate (encoder counts per demanded position cycle) is as follows: (.02 EC/ms) * (25ms/update cycle (UC)) = 0.5 EC/UC The focus latency budget expressed in command update cycles can be calculated by taking the ratio of allowable encoder count latency to the max tracking rate. This is: (170 EC/0.5 EC/UC) = 340 UCs The resolvable latency (the ability to sense and calculate latency) is a function of the reporting status update period, and the demand cycle rate. This includes: 0.1 s (device status reporting rate) 0.025s (outgoing demand stream (40hz) ===== 0.125s = 1/8 second The measurable latency (at 1/8 sec) should be acceptable given it is approximately 1/10 th of the total allowable latency budget (8.5 seconds for total error budget (340UC * .025s) =~ 1/10th budget). 5 Release Notes 0.1 6/25/2002 Document creation 6 References and Further Reading 6.1 051 098 113 114 115 120 143 152 154 Keck Adaptive Optics Notes (KAON) Keck Adaptive Optics Error Budget, Peter Wizinowich, 15 Sep 95 (KeckShare – PDF & Word)) Motion and Position Control Specifications, D. Scott Acton, 11 Apr 96 (rev. 26 Sep 96) (KeckShare – PDF) A Low-Bandwidth Wavefront Sensor, D. Scott Acton, Thomas Gregory, Peter Wizinowich, 09 Aug 96 (KeckShare – PDF) The Opto-mechanical Design of the Acquisition Camera, D. Scott Acton and Thomas Gregory, 15 Aug 96 revised 03 Dec 96 (KeckShare – PDF) The Sodium Rejection Filter, D. Scott Acton, 19 Aug 96 Quad-cell Issues, D. Scott Acton, J. Nelson, J. Brase, 06 Sep 96 (KeckShare – PDF) Low Bandwidth Wavefront Sensor Optical Design , Peter Wizinowich, 12 Dec 97 Optics Bench Subsystem Review, Peter Wizinowich, Paul Stomski, D. Scott Acton, 09 Apr 98 (KeckShare – PDF & Word) Laboratory Calibration of the W.M. Keck Observatory Adaptive Optics Facility, D. Scott Acton, Peter Wizinowich, Paul Stomski, Chris Shelton, Olivier Lai, J. Brase, 20 Mar 98, Proceedings of SPIE Astronomical Telescopes & Instrumentation Conference, 20- 28 March 1998, Kona, Hawaii. Updated 2/12/2016 at 9:31 PM by D. Summers Page 26 CARA / W.M. Keck Observatory *** D R A F T ***LGS AO Focus Mgr Requirements 176 182 Keck II Adaptive Optics Facility NGS AO Readiness Review, 19 Jan 99 (KeckShare --PDF) Characterization of the lenslet arrays. ( DRAFT ), D. Scott Acton, 13 May 99 (rev. 9/2/99) (KeckShare --PDF) Keck Adaptive Optics Facility Hardware Manual #1, Nasmyth Platform (DRAFT), 16 Aug 99 (KeckShare – Word) Adaptive Optics Task List, P. Wizinowich, 26 Aug 99 (KeckShare – Word) Performance of the W.M. Keck Observatory Natural Guide Star Adaptive Optic Facility: the first year at the telescope, P. Wizinowich, D.S. Acton, O.Lai, J. Gathright, W. Lupton, P. Stomski, Mar 2000 (KeckShare – PDF), Proceedings of SPIE’s International Symposium on Astronomical Telescopes & Instrumentation 2000, 27-31 March 2000, Munich, Germany. Initial performance of the Keck AO wavefront controller system, E. Johansson et al., Mar 2000 (KeckShare – PDF), Proceedings of SPIE’s International Symposium on Astronomical Telescopes & Instrumentation 2000, 27-31 March 2000, Munich, Germany. Status of the optics bench on Keck I and II, D.S. Acton, 12 Jun 2001 (KeckShare – Word) 184 185 194 196 212 6.2 Other Documents Task Notes and Gantt Chart for Keck II AO Subsystem Action Plan, Adam Contos, 2/2002 LBWFS & TTS Notes from Conversations with S. Acton, 8/2001, Adam Contos, 8/29/2001 Keck Adaptive Optics Software Design Book (v 2.7), 7/5/1996. Keck Observatory Report No. 208, Adaptive Optics for Keck Observatory, 1/1996. Low Bandwidth Wavefront Sensor Software Design, S. Hartman, 1/21/2001. AO Software Status, P. Stomski, 1/16/2002. Updated 2/12/2016 at 9:31 PM by D. Summers Page 27