There are now new and simpler scripts for diagnosing and fixing the most common grating move failures. First, log on to the motor controller VME crate. For observers, this is accessible from the pull-down "Engineering" menu (but you need to know the crate login name and password), or by connecting directly through the TIP line:
    punaluu{lris1}: telnet tserver4 3009
Then, check the status of the grating turret and tilt mechanisms:
    -> check_turret 
The check_turret script reports the status of the grating turret position, the turret detent, the grating brake, and the grating tilt.

If the the problem seems to be in the turret or the detent, then home the turret:

    -> home_gturret 
This command home_gturret will home the grating tilt to a safe position before attempting to home the turret, so it IS safe to give this command even if the grating is not at home. This is a major improvement over the home_compound 0 command described below.

If the the problem seems to be in the grating tilt or brake, then try to home the grating:

    -> home_grating 


Here are some examples of the output of these new commands.

Lower-Level Diagnosis and Troubleshooting

Following is a description of troubleshooting procedures should a grating move repeatedly fail. This text below describes how to diagnose and fix turret problems using other VME crate commands. These commands may help diagnose and fix problems in case the simpler commands above fail.

First, log on to the motor controller VME crate. This is accessible from the LRIS Tools menu (the Engineering pull-down menu for observers), or by connecting directly through the TIP line:

    punaluu{lris1}: telnet tserver4 3009
  1. Description of move sequence

    Grating turret moves are completed in the following sequence (with corresponding VME macro command available to the troubleshooter):

    1. Grating brake unclamped (unclamp_grating_brake)
    2. Grating is homed
    3. Grating brake is clamped (clamp_grating_brake)
    4. Detent is moved out (move_detent_out)
    5. Turret is rotated to new position
    6. Detent is moved in (move_detent_in)

    The VME output is comprised of a series of reads through the API motor controllers:

    ST:Time=60810830:Set grating position = 951207
    W0:Time=60811010:All gratings home bits not set!  Homing grating tilt.
    ST:Time=60811190:mcs_limit():  Motor controller input2=11111110
    ST:Time=60811910:mcs_limit():  Motor controller input2=11111101
    ST:Time=60812600:mcs_limit():  Motor controller input2=10011100
    ST:Time=60812600:File: lrs_mcs.c, Func:mcs_limit, Line: 381:
    ST:Time=60812600:Motor home bit is set.
    ST:Time=60812810:mcs_limit():  Motor controller input2=11111101
    ST:Time=60813530:mcs_limit():  Motor controller input2=11111110
    ST:Time=60813833:move_compound():  First move started
    ST:Time=60814073:mcs_limit():  Motor controller input2=11111110
    ST:Time=60814763:mcs_limit():  Motor controller input2=11111101
    ST:Time=60814853:move_compound():  First move done
    ST:Time=60814853:move_compound(): main move started
    ST:Time=60816201:move_compound(): main move done
    ST:Time=60816201:move_compound():  Last move started
    ST:Time=60816441:mcs_limit():  Motor controller input2=11111101
    ST:Time=60816981:mcs_limit():  Motor controller input2=11111110
    ST:Time=60817071:move_compound():  Last move done
    When the observer selects his grating (wavelength) setting, 3 more moves occur:

    1. Grating brake unclamped (unclamp_grating_brake)
    2. Grating is tilted (move_grating)
    3. Grating brake is clamped (clamp_grating_brake)

  2. Troubleshooting steps

    1. Query the state of the turret

      -> show_current
              Stage                           Current Position
              -----                           ----------------
              0.      grating_turret          2
              1.      grating_turret_detent   -1
              2.      grating_brake           -1
              3.      grating_tilt            19139
              4.      red_filter_selector     548051
              5.      red_filter_changer      1860115
              6.      blue_filter_selector    -2
              7.      blue_filter_changer     -1
              8.      red_camera_focus        4101789
              9.      slitmask_selector       3331181
              10.     slitmask_changer        1761157
              11.     offset_guider_focus     1885379
              12.     offset_guider_pos       4546864
              13.     offset_guider_filter    0
              14.     slitview_guider_filter  3
              15.     trapdoor                -1
              16.     polar_calibration       -2
              17.     polar_waveplate         6
      value = 0 = 0x0
      Note the stage numbers and identifications. For stages 0-3, valid positions are:

      Number Stage drive Valid positions Error position
      0 grating_turret optical(2,4,6,8,10), service(1,3,5,7,9) -2
      1 grating_turret_detent -1(in),1(out) 2
      2 grating_brake -1(in),1(out) 2
      3 grating_tilt 0(home)-100000

      The stage positions must be individually read at low level before proceeding. To check the positions of individual stages, use the show command, as in:

      -> show 0
      -> show 0
      Stage = 0.  Position = 3
      value = 0 = 0x0
      -> ST:Time=126692:get_stage_pos_code():  returning 1
      -> show 1
      ST:Time=173816:Motor controller input2=11111110
      Stage = 1.  Position = -1
      value = 0 = 0x0
      -> show 2
      ST:Time=174116:Motor controller input2=11111110
      Stage = 2.  Position = -1
      value = 0 = 0x0
      -> show 3
      Stage = 3.  Position = 15
      value = 0 = 0x0

      Also, all 4 of these stages must be in a valid position in order for XLRIS to broadcast a grating position; otherwise the position is broadcast UNKNOWN.

      Note that the grating_tilt does not appear homed (Position = 15) in the above example. In order to check whether any gratings are NOT homed, the tilt stage must be addressed at the API level as follows:

      -> api
      api> set 1
      api> ver i1  ; the word i1 should be read twice
      api> ver i1
      0 "I1 = 10111011"
      If one of the gratings is not homed, one of the 
      first 5 bits will be 0; in this example 
      grating 2 is not homed.
    2. Rules for making low-level moves Only if
      • the grating turret (show 0) is in a valid position (eg not -2), AND
      • the grating turret detent (show 1) is IN (-1)
      then can you proceed with grating tilt moves via the higher level software such as keywords or XLRIS. Otherwise the grating could be driven into the LRIS structure!

      1. Check the grating brake (show 2); if it is in position -2 or 1, try to clamp it:
        -> clamp_grating_brake
        If it does not go to the IN (-1) limit, try to cycle it unclamped and clamped again:
        -> unclamp_grating_brake
        -> clamp_grating_brake
        If it makes it to the IN limit, and all other positions are valid, then you can continue with high-level grating moves via XLRIS.

      2. If the turret position (show 0) is in error(-2), then it must be homed. Follow these steps:
        1. Check the grating_tilt (show 3). It must be homed to proceed. If it is not homed, home it using the commands
          -> home_grating
          -> home_compound 3
        2. If the grating_tilt is homed (show 3), then check the turret_detent (show 1). If it is not OUT(1), then move it out:
          -> move_detent_out
        3. Home the turret:
          -> home_compound 0
          This will drive the turret to its home position (1), which will still be broadcast to XLRIS as UNKNOWN. After this move completes, show the value of the turret detent (show 1); if it is IN (-1) then you can continue with high-level grating moves via XLRIS.

      3. If the turret position (show 0) is valid, and the turret detent (show 1) is not IN (-1), then move it in:
        -> move_detent_in
        If it does not go to the IN (-1) limit, try to cycle it out and in again:
        -> move_detent_out
        -> move_detent_in

      4. If the turret position (show 0) is valid, and the turret detent (show 1) is IN (-1), and the grating_tilt (show 3) is not homed, it is generally safe to home it. An exception to this is when the grating is in a service port position. In this case the grating should be examined before proceeding with any homing operation. This is a 3-stage move where the grating_brake is unclamped, the grating_tilt is homed by searching for an LED-logic pulse, and the grating_brake is re-clamped.
        -> home_compound 3

      5. Here are some useful numbers for making low level grating tilt moves:

        There are:

        • 12526.5 motor steps/degree
        • 886 encoder counts/degree
        • 14.138 motor steps/encoder count
        • Never tilt the grating more than +/- 3 degrees from home in the service port!
          (e.g. +/-37500 motor steps: "api> mov 37500").