A new red focus stage arrived with the Red side upgrade. The new stage is controled by a galil and has a new keyword library associated with it. The keyword library is called lredfoc.
One of the new issues that was addressed is that each time the focus stage looses power, it will need to be homed. A script was constructed to properly home the stage. The script is called home_redfocus . The script has an optional argument so that the stage may be forced to home even if the dispatcher believes that it is already homed.
The homing sequence is now part of the home_lris script initiated on startup.
The existing lris "redfocus" keyword now shows mm of motion of the focal position, relative to the home position. (If you want it to have some other meaning, let me know.)
The existing lris "redfocusr" keyword is now in units of encoder counts of the new focus stage. There are 1500 encoder counts per mm of focus motion.
Unlike the old focus mechanism, the new stage has an incremental encoder that must be initialized with a homing command.
The new "lredfoc" service supplies an extensive set of keywords that gives full control and feedback for the stage. This service must be used for homing and monitoring. (The lris "redfocus" and "redfocusr" keywords are actually implemented as keywords in the lredfoc dispatcher.)
As with other Lick-built dispatchers, the lredfoc service is modal. When the dispatcher is first started, it puts the focus stage into a "Halt" mode, and it must be put into a "Pos" mode before moving.
This should be done as part of the LRIS initialization, when other stages are homed. (Note: incorporated into lris_setup and power up sequences in Sept 2009-MK).
Use either this: Make sure the stage is in "Pos" mode, and then home the stage if it's not currently homed:
modify -s lredfoc rfocmod=Pos rfoccal=HomedOr this: Make sure the stage is in "Pos" mode, and force it to rehome even if the dispatcher already thinks the stage is homed:
modify -s lredfoc rfocmod=Pos rfoccal=Reset rfoccal=Homed
If you want to use it, there is a tiny focus-status gui, $KROOT/bin/lrisfoc.statgui. It shows focus, mode, and current status. If the status indicates anything other than normal operations, it shows additional details.
There are errorcode and status-message keywords to report the state of the focus stage. They will be described in the detailed documentation. In brief, your scripts might want to monitor these keywords:
DISP0ERR: error code for the Tcl dispatcher; 0 = OK. CTRL0ERR: error code for the Galil motion controller; 0 = OK. RFOCERR: error code for the focus stage; 0 = OK.
$KROOT/etc/init.d/lredfoc.sh restart ...as the appropriate user
Then wait 45 seconds, and do the force-home sequence. (Or wait until the lrisfoc.statgui shows "Ready", and do the force-home sequence.)