Carriage Servo Firmware; Transitions; Reading The Position Counter; Carriage Speed Command - DEC LA 120 Technical Manual

Table of Contents

Advertisement

4.5 CARRIAGE SERVO FIRMWARE
The carriage servo firmware ascertains the current position of the carriage and generates the speed
commands needed by the carriage servo to move the carriage to the position where it should be. Actual
and desired positions are determined every time a tick interrupt is received, which is every 2.5 ms. The
speed command given to the servo is then updated on the basis of these position determinations. This
command is such that the carriage servo moves the carriage toward the desired position as rapidly as
possible. As the carriage approaches the desired position, the speed is reduced to allow for a smooth
stop.
4.5.1 Transitions
The position of the carriage is measured by an incremental two-channel encoder mounted on the back
of the carriage servo motor. Each channel has a square-wave output with 660 cycles per revolution,
with the output of one channel leading the output of the other by 90 degrees. A transition is defined as
the change of the output of one channel from the logic "0" level to the logic" 1" level or vice versa.
Thus, there are two transitions per cycle in each channel and since there are two channels there is a
total of four transitions per cycle and 2640 transitions per revolution.
The motor moves the carriage 4 inches per revolution. Hence, there are 660 transitions per inch of
carriage motion and
1 Transition = 0.001515 inch
The carriage servo routines are entered every time a tick interrupt is received. The tick interrupt is
cleared and the actual position of the carriage is determined. Speed, flight-time correction, carriage
position, and error are determined. A real-time clock is also incremented.
4.5.2 Reading the Position Counter
Upon entry, the position counter in the DC305 chip is read. Interrupts are then enabled. The previous
reading of the position counter is retrieved and subtracted from the current reading of the counter. The
difference is stored for use in subsequent calculations. Since readings are made at fixed time intervals,
this difference is a measure of the carriage speed. The value of the current counter reading is stored for
use during the next tick interrupt service. This calculation is valid as long as the carriage did not move
more than 127 transitions during the preceding tick interval.
4.5.3 Carriage Speed Command
The determination of the command speed for the carriage servo is begun on the basis of how far the
carriage is from where it is supposed to be. The actual target speed for the servo is obtained from a
table lookup. This target speed is the speed input for subsequent routines where it is processed to
generate the actual servo command. The sign of the target speed is chosen so that the carriage moves
toward the point at which it is supposed to be and the target speed decreases as the carriage approaches
its destination so that it arrives there at a reasonable speed.
In general, the speed command is based on the target speed unless the change from the previous target
speed was too large. In that case, the acceleration limit is applied.
4.5.4 Error Conditions
A speed error is computed by comparing measured carriage speed with the target speed. If this error
exceeds a limit, it is an indication that the carriage is not moving as fast as it should and that it may, in
fact, be stopped completely. If the error exceeds the limit for many ticks in succession, it is presumed
that the carriage is stuck. This causes a pause flag to be set. Other pause flags are set when there is no
paper or when the cover is open. Before a speed command is sent to the DC305, the pause flags are
examined. If none are set, the speed command determined as previously described is sent. If any pause
flag is set, a speed command of zero is sent.
4-16

Advertisement

Table of Contents
loading

Table of Contents