Embedded Galil Software Files

Updated on June 15, 2021, 7:40 am

The embedded galil software source code is written according to the "embedded galil software coding standard". The embedded galil software source code is distributed in seven files: buttmove.g, coldstrt.g, errors.g, gripops.g, main.g, periphio.g and xyops.g

Another file called "makefile.mak" list the files above and is used by the "Source Edit Tool" of the "Visual Basic Maintenance Tool" to download the files into the galil box.

 

1) buttmove.g

This file contains all the code related to moving buttons at the black box level. Right now we are only using #Move. None of the other functions is in use.

INCL. FUNCTIONS:

(Note: that all embedded functions begin with a "#" This is a Galil Firmware convention.)

#Move --Move a button to a new location.

GLOBAL VARIABLES DEFINED IN THIS FILE:

Pi = 3.141592653 TwoPi = 6.283185307

The following variables are the basis of ALL the plate geometry. Don't edit them except in this file!

MaxFib = 288 --the number of fibers in the system.

rPark = 215000 --radius of the park circle, encoder steps
rStow = 214250--radius of the stow circle, encoder steps
rStep = 214200 --radius of the stair step, encoder steps

GrpOutX = -200000 --X position for parking gripper
GrpOutY = -200000 --Y position for parking gripper

phiStow = 0.0001 --angular offset between stow and park positions.

thetaSep = 360 / MaxFib --The angle between buttons park positions with respect to the center of the plate
(possible values for ButtI[n] )

The following "global" variable is a record of which button was last known to be in the gripper. It is used in the event there is a failure to drop a button, or the system comes on line with a button in the gripper.

InGrip = -1 --Button Currently in gripper

These variables allow the move velocities for x-y operations to be changed during operation of the positioner without re-loading the code. These are the default values. from early in the project.

MovAccel = 1000000 --Acceleration for moving buttons
GoToVel = 1000000 --Velocity for traveling to buttons
MovVel = 500000 --Velocity for moving buttons
SloVel = 500000 --Special velocity for moving FOPS

 

2) coldstrt.g

This file contains the initialization routines for the high level system. individual axis initialization functions are in the drivers for the respective axis.

INCL. FUNCTIONS:

(Note that all embedded functions begin with a "#". This is a Galil Firmware convention.)

#Cold -- starts up the system
#ShutDn -- shuts down the system

GLOBAL VARIABLES DEFINED IN THIS FILE

(none)

 

3) errors.g

This file contains various error handling functions.

INCL FUCNTIONS:

#OrthStp -- interrupt handler for stage mis-alignment.
#Fault -- interrupt handler for master fault.
#Panic -- empty
#IntrOn -- allows user to re-enable interrupts after error.

GLOBAL VARIABLES DEFINED IN THIS FILE

rtBitON = 4 -- Mask to enable the orthogonality interrupt
OrtBitOF = 251 -- Mask to disable the orthogonality interrupt.
FauBitON = 16 -- Mask to enable the "fault" interrupt.
FauBitOF = 239 -- Mask to disable the "fault" interrupt.

 

4) gripops.g

This file contains the code that operates the gripper and z stage.

INCL. FUNCTIONS:

#Grab -- picks up a button
#Drop -- drops up a button
#Open -- opens the gripper
#Close -- closes the gripper
#IfButt -- see if a button is in the gripper
#Zinit -- initializes the z axis
#Zhome -- homes the z axis
#zgo - move the z axis to the specified position.
#Ginit -- initializes the gripper axis
#Ghome -- homes the gripper axis

LOCAL VARIABLES INCLUDED IN THIS FILE:

zCarry = 100 -- Z value at which to carry buttons.
zPlate = -4500 -- Z value at which to position buttons on plate.
zPark = -6700 -- Z value at which to position buttons on park circle.
zToClr = -500 -- Z offset that clears a just released button.
PushDist = 30 -- Additional amount to push button into plate when dropping.
zAccel = 800000 -- acceleration for Z axis
zVel = 3000000 -- velocity for Z axis
zHAccel=10000 -- acceleration for himing Z axis
zHVel = 60000 -- velocity for homing Z axis
gAccel = 1000 -- acceleration for gripper
gVel = 200 -- velocity for gripper
gWOpen = 130 -- wide open position
gOpen = 110 -- open position
gRelax = 85 -- relax position

 

5) main.g

This file contains the top level function that starts up the box on reset. It also holds the "reserved" functions that are defined by the Galil Firmware for interrupt handling and various error conditions.

INCL. FUNCTIONS:

#AUTO -- This function is called on system reset.
#CMDERR -- traps command errors.
#ININT -- reserved by the box as the input interrupt handler.

GLOBAL VARIABLES INCLUDED IN THIS FILE

Reboot = 1 -- Flag to indicate system has rebooted and must be initialized.
IntMask = 20 --Interrupt mask for system. 20 means that interrupts 3 and 5 are enabled.
Inhibit = 1 --Flag not to move. Set true by error handlers. Cleared by XYhome.
DbVoid = 1 --Flag that the internal database has been reset and must be reloaded.

Controller Tuning Parameters:

KPX = 16.0
KPY = 14.0
KPZ = 600.0
KPW = 16.0
KDX = 45.0
KDY = 26.0
KDZ = 2178.0
KDW = 48.0
KIX = 2.13
KIY = 2.0
KIW = 3.0
KIZ = 31.0

Software Limits:

FLX = 230000
FLY = 227000
FLW = 240000
BLX = -230000
BLY = -226000
BLZ = -227000

 

6) periphio.g

This file contains the various functions for controlling assorted peripheral devices such as the focal plane plate.

INCL. FUNCTIONS:

#Led -- Sets the on/off/brightness of the gripper LED
#Plate -- Warps or flattens the focal plane plate
#IsWarpd -- Returns warp/flat status of plate
#Temp -- Reads back a specified thermal probe
#Fan -- Turns the electronic's box fan on or off
#Pwr -- Reads and returns the status of various power monitors.

GLOBAL VARIABLES DEFINED IN THIS FILE

Tscale = 1 -- Scaling factor for thermal sensor calibration.
Toofset= 1 -- Offset factor for thermal sensor calibration.

 

7) xyops.g

This file contains the code that executes xy/motion Along with the initialization routines for the xy gantry system.

INCLUDED FUNCTIONS:

(Note that all embedded functions begin with a "#" This is a Galil Firmware convention.)

#XYinit --Main Gantry initialization.
#XYhome --Main Gantry Homing function.
#xhome --Homes X only
#whome --Homes W only
#yhome --Homes Y only
#encCalc --Computes position based on encoder index marks
#Brakes --Locks and unlocks the brakes
#xygo --The *MAIN* x/y motion routine.
#where --Reports the various axis positions as tcl set.

GLOBAL VARIABLES DEFINED IN THIS FILE

Note that the following variables are the only means by which to adjust the plate center.

EncCx = -179628 --Zero point offset for primary x axis linear encoder. Use this value to offset *both* X/W. i.e. the plate center.

EncCy = -259064 --Zero point offset for y axis linear encoder.

EncLn = 500000 --Length of the x encoder in pulses (appx) This is used as part of a kludge since the X encoder had to be mounted backwards.

EncCw = -130081 --Zero point offset for slaved w axis linear encoder. Use this value to correct orthoganality only.

Hvel = 50000 --Velocity for homing x,y
Haccel = 80000 --Acceleration for homing x,y

 

Last Modified: April 27, 2000
rcantarutti