Download SC2000 User Manual rev1

Transcript
Side Effect Statements
Side effect statements are used to control devices or channels in ways that do not involve motion control of the galvo.
Certain commands operate with zero cycle overhead, making it possible after fully specifying a motion program with
slew and position statements, to insert side effect statements for the purpose of control and synchronization without
affecting the validity of the independently developed motion program.
The most fundamental side effect statements are ‘enable’and ‘disable’, which are used to enable and disable the
SAX servo boards. ‘enable’and ‘disable’each take a single parameter, the device specification. 1 is the X-axis,
2 is the Y axis and 3 specifies both axis for simultaneous enable or disable both SAXes at the same time. It is important
to note that SAX modules must be enabled before they can servo command voltages. Enable and disable can be issued
from inside a program making it possible to operate SAX boards according to conditions detected at the temperature or
sync pin inputs as well as at the beginning and end of a program.
‘SetSync’and ‘UnsetSync’operate on the first four sync channels. These four are different from the other eight
sync channels in that they can be both written to and read out. Each command takes one argument, the sync channel
specification, valued from 1 to 4. The hardware pins corresponding to the sync channel are located in J4. Channel 1
operates pin 1, channel 2 operates pin 2, etc. The ‘SetSync’command turns on an open drain MOSFET causing the
J4 pin to sink current through to J4 pin 5. ‘UnsetSync’turns the open drain MOSFET off leaving the pin in a high
impedance state with respect to pin 5. The read operation for these sync channels references the ‘
internal output port
mirror register’
, not the logic level present on the pin. ‘SetSync’and ‘UnsetSync’can also be used internally by
programs providing a simple flag mechanism that two programs can use for communication when running in dual single
axis mode. In this manner of operation, no external connection is required. Two related commands are
‘DelayedSetSync’and ‘DelayedUnsetSync’and their action is exactly the same as ‘SetSync’and
‘UnsetSync’except that the transistor action occurs some number of ticks after the command is executed in the
program. The delay is specified in a global configuration variable, typically set to compensate for Codec and servo
delays.
‘DeltaTweakAxisXY’, ‘DeltaTweakAxis’, ‘TweakAxisXY’ and ‘TweakAxis’are used to adjust the
gain and offset correction factors on the fly. ‘DeltaTweakAxis’and ‘TweakAxis’are used in raster mode and
‘DeltaTweakAxisXY’and ‘TweakAxisXY’ are used in vector mode. The ‘DeltaTweakAxis’commands
take two kinds of parameters, gain and offset, which are processed as deltas or incrementals of the current correction
values. The gain parameter is a floating-point value ranging between 0.5 and 1.5. This gain delta is multiplied by the
current gain value to produce the new gain value (the power-on default gain value is 1.0, see Equation 1.) The offset
incremental, a positive or negative integer, is added to the current offset value, the result being stored as the offset
correction, effectively relocating the origin by the incremental value (see Equation 2).
Equation 1: Delta Gain equation
1.32
New
gain value
= 1.2
x
Previous
gain value
1.1
Gain
Delta value
Equation 2: Delta Offset equation
27
= 25
New
offset value
+ 2
Previous
offset value
Offset
Delta value
The ‘TweakAxis’ and ‘TweakAxisXY’commands take the same kinds of parameters as those above but instead
of being deltas they are the actual gain or offset value and the action of the command is just to set the gain and offset to
the given values. These commands can be either program statements or immediate directives and care should be taken to
46