Document 11351685

advertisement
A MICROPROCESSOR
BASED SPEED
AND CURRENT LEVEL CONTROLLER FOR A
VARIABLE MUTUAL RELUCTANCE MACHINE
by
WILLIAM
ROBERT GANDLER
B.S., Massachusetts Institute of Technology
(1974)
SUBMITTED
IN
PARTIAL
REQUIREMENTS
FULFILLMENT
OF THE
FOR THE DEGREE OF
MASTER OF SCIENCE
at the
MASSACHUSETTS INSTITUTE OF TECHNOLOGY
July, 1982
c
William Robert Gandler 1982
The author hereby grants to M.I.T. permission to reproduce and to
distribute copies of this thesis documentin wholeor in part.
Signature
ofAuthor:
.... . ,. r
...
.v
.
.........
Department of ~ ectrical Engineering and
Computer Science, July 8, 1982
Certifiedby:.
**v.........
..........
..................-........
Richard D. Thornton
Thesis Supervisor
Accepted
rr..............
.
-
--Arthur Smith
Chairman, Department Committee on Graduate Students
Archives
IviqSA~C;;,3 i 3 iT;TL'.
OF TECh'NOLOCGY
20' 182
LIBRARIES
A MICROPROCESSOR
BASED SPEED
VARIABLE
AND CURRENT LEVEL
CONTROLLER FOR A
MUTUAL RELUCTANCE MACHINE
by
WilliamRobert Gandler
Submitted to the Department of Electrical Engineering and
ComputerScience on July 8, 1982, in partial fulfillment
requirements for the Degree of Master of Science.
of the
ABSTRACT
The purpose of this thesis is to further William Wong's work
in controlling the same experimental variable mutual reluctance
machine.
The complexity of the microprocessor based system and
the accompanying software is increased beyond that used in the
Wong implementation. Sense coil waveform detection of a new
phase arrival generates an external interrupt to the
microprocessor. Software programs using only
position feedback
and both position and velocity feedback that allowed independent
speed and current level control were implemented.
Current level
control allows torque adjustment for different loads.
level control is implemented
Current
by having a microprocessor informed
DAC - op amp combination supply a reference voltage to one
comparator input terminal while the voltage across a sensing
resistor is supplied to the other comparator terminal. The
current level at which the field transistor is turned off and the
minimum and maximum levels that the phase currents are chopped
between are controlled in this manner. Speed control is achieved
by variation of a time delay between new phase detection and new
phase switching. An excellent linear correlation was found to
exist between the time delay and 1/speed. Speed control via
continuous phase current adjustment was also implemented but
worked only over a very narrow speed range. Finally, a program
outputting phase duration counts onto LEDs allowed acceleration
profiles to be obtained.
Thesis Supervisor: Richard D. Thornton
Title: Professor of Electrical Engineering
2
ACKNOWLEDGEMENTS
I would like to thank my advisor, Professor Thornton. I am also
grateful for the constant help and support of Davida Pekarsky,
Poh Ser Hsu, and David Otten.
Above all,
parents for their continuous support.
3
I am grateful
to my
TABLE OF CONTENTS
Page
ABSTRACT .
2
ACKNOWLEDGEMENTS
3
CHAPTER
1
INTRODUCTION AND LITERATURE SURVEY OF STEP
MOTOR SPEED CONTROL
.
5
CHAPTER 2
OVERALL CIRCUIT DESIGN ISSUES
32
CHAPTER
HARDWARE DESIGN ISSUES
42
CHAPTER 4
SOFTWARE ISSUES AND RESULTS
84
CHAPTER
CONCLUDING REMARKS
3
5
148
.
FOOTNOTES
151
4
CHAPTER 1
INTRODUCTION AND LITERATURE SURVEY OF STEP MOTOR SPEED
CONTROL
1.
Introduction
A 15 pole, 4 phase, variable mutual-reluctance
machine was
designed by Professor Richard Thornton, and an experimental model
was built by Pipat Eamsherangkoon.1, 2
This stepper like motor
had a field winding and four phase windings -- A, B, C, and D.
The phase windings A and C were wound in the same position but in
opposite directions and likewise with phases B and D.
drive scheme was used because of its simplicity.
A unipolar
Four sense
windings were wound in the same manner as the phase windings so
that the voltages across the sense windings were proportional to
those across the phase windings.
William Wong, after making some modifications to the motor,
used an INTEL 8748 microprocessor based motor drive that in a
closed loop system determined position by voltage sensing across
the sense windings, controlled choppers for current regulation in
the motor phases, and performed switching of the phases.
A three
stage control program was used to bring the motor up to high
speed with two phases on control, but the software program did
not provide for variable speed control, and the chopper control
was rather crude in that after the initial switch on time for a
phase the duty cycle was kept constant.3
The purpose of this thesis is to further William Wong's work
by implementation of current level control and speed control
based upon the variation of a time delay between new phase
detection and new phase switching. In addition, LEDs on which
5
accelerationprofile information can be outputted are provided.
The complexity
of the microprocessor based system and the
accompanying software is increased beyond that used in the Wong
implementation.
A photograph of the constructed circuit is
shown
in Figure 1.1.
2.
Literature Survey of SteD Motor Seed
2.1
Control
Open Loop Control
If only limited performance is desired, stepping motors can
be run open loop with phase switching pulses being given to the
drive circuitry at carefully predetermined
intervals.
The step
motor runs in synchronism with the pulse train provided that the
motor can supply the needed torque and resonance problems are
avoided. These resonance problems are related to the resonant
frequency of the rotor.
Periodic excitation of the rotor at its
of it will
resonant frequency or some submultiple
reinforce the
resonance and result in a loss of position synchronism, or a
complete absence of motion,
if insufficient damping
To prevent loss of synchronism
is present.
during acceleration due to
resonance points, it may be necessary to increase load inertia,
increase load friction, or use a mechanical or viscous-inertia
damper.4,5
The maximum rate
at which a step
motor may be started or
stopped depends upon both the frictional
and inertial
loads.
This information is usually presented in the form of a start-stop
family of curves, where each curve represents
of load inertia,
a different
value
and torque is plotted against the stepping rate.
6
In many cases the stopping rate of the motor is slightly greater
than the starting rate.
This is to be expected since friction
hinders acceleration but aids in deceleration.
The final steady
state speed that can be achieved is given by a curve of torque
versus speed known as a slew curve. Since the inertial load of
the rotor will only affect the amount of time required for the
motor to reach the final steady state speed and not the value of
the final speed, the final speed that can be achieved will be a
function of the frictional load but will be independent of the
inertial load.
In general, the shape of the acceleration or deceleration
ramp given to a motor
determined
in open loop control is optimally
by the slew curve for a given motor and driver
combination.
At a given speed, if the frictional load torque is
subtracted from the torque on the slew curve, then the torque
available for accelerating the load is determined, and the
maximum
acceleration possible is
given by the available
divided by the sum of the rotor and load inertias.
torque
Since
available torque falls with speed, the rate of acceleration must
decrease.
Likewise,
the pace of deceleration should start slow
and then continue at a quicker pace.
The ideal deceleration ramp
will be a mirror image of the ideal acceleration ramp.
torque were
constant with
speed, then the optimum
curve would be a linear ramp.
If the
acceleration
If torque were to decrease rapidly
with speed, then an exponential(or a curve close to an
exponential) ramp might be optimal.
In practice, linear ramps
should be used if torque drops off only very slowly with speed,
but exponential ramps should be used if torque drops off rapidly
7
with speed.4
2.1.1
Control
An Example of a Microprocessor
Based OQenLoop
Scheme
An Intel 8080A microprocessor
was used by Lafreniere
to
control pulses to a step motor motor driving a constant load in a
computer output recorder.
Time periods between motor pulses were
controlled using time
interval
values
acceleration/deceleration
table. The table
running various
profiles
in an
was optimized
by
and saving a copy of the table that
produced the optimum profile.
using one linear
stored
Acceleration was accomplished
segment and deceleration
was accomplished using
one to three piecewise linear segments as shown in Figure 1.2.
The necessary parameters used to generate the
acceleration/deceleration tables were:
1. Start frequency(in steps/sec)
2.
Maximumfrequency
3.
Acceleration slope(steps/sec 2 )
4.
Deceleration
5.
Deceleration slope 2
6.
Deceleration
slope 1
slope 3
7. Stopping frequency
8.
Deceleration frequency 2
9.
Deceleration frequency 3
The stopping frequency had to be carefully chosen to obtain good
settling characteristics.
The lowest
stepping rate required was 200 steps/second and
8
for stepping at 200 steps/second each pulse had to be 5
In order that one eight-bit
milliseconds apart.
represent
5 milliseconds,
milliseconds
byte would
each count had to be equal to 5
divided by 255 or approximately 20 microseconds.
Thus, the number of counts stored in a byte represented the
number of 20 microsecond delays required.
Acceleration values
were calculated from the equation:
D = 1/(((A
(1)
x S) + Fo)(I))
where
D = delay
count
S = step
number(S
= 0 to
N)
A = acceleration slope in steps/sec
2
Fo = start frequency in steps/sec
I = delay increment(20 microseconds)
The required table length was determined by the equation:
(2)
S = (Fm - Fo)/A
with
Fm = maximum
frequency
frequency
S = steps required to reach maximum
Fo = start
frequency
A = acceleration slope in steps/sec
2
Deceleration tables were calculated in a similar wayby
going back from the stopping frequency toward the highest step
rate.
In running the program instruction execution times are taken
into account in setting the time delays.
If the number of steps
to be movedis sufficiently large, the acceleration table values
will be used until maximumspeed is achieved.
9
If deceleration
is
performed from maximumspeed, then the microprocessor simply runs
through the deceleration table.
However, if maximumspeed is not
achieved by the point at which the number of steps remaining is
equal to the number of steps in the deceleration table, then
acceleration will continue only as long as the new acceleration
frequency is less than the initial deceleration frequency that
would be used for the remaining number of steps.
initial
When the
deceleration frequency that would be used for the
remaining steps is less than the new acceleration frequency, then
the deceleration table is used for the rest of the steps. 6
Miyamoto and Goeldel in similar work noted that the use of a
general acceleration/deceleration
table becameless optimal as
the number of steps decreased, and so used different
tables for
different small step increments. They calculated the best
acceleration profile with a computer simulation that compared the
motor response over a small time increment with the present phase
remaining on versus the response obtained if the next phase was
switched on. The simulation chose the sequence yielding the
higher velocity and used it to establish initial
the next time interval.
2.2
conditions for
7
Closed LOOpControl
Step motors realize
only limited performance in the open
loop modesince there is no way to tell if the motor has missed a
pulse or if the speed response is too oscillatory.
If the input
pulses arrive at too large a frequency, the motor may fail to
follow.
Great improvement of step motor performance can be
10
realized by using positional feedback
and/or
velocity feedback
to
determine the appropriate phase switching in relation to the
rotor position.
Closed loop control permits such improvements as
more accurate position control, much higher speed control, and
more constant speed control.
Closed loop control schemes traditionally use mechanical to
electrical position transducers to provide feedback information
of position and possibly velocity.
Slotted disc tachometers with
photoelectricsensors and permanent magnets mounted on the rotor
with permanent magnet pick-up sensors on the stator are two
commonly
used schemes.
Other schemes
involve d
tachometers, ac synchros, and potentiometers.
and ac
In traditional
closed loop control the motor is started initially with one pulse
from
the input command,
and the following pulses are generated
from the encoder assembly.
Recently closed loop motor systems have been implemented
that use waveform
detection; that is, feedback pulses are
generated by a waveform
detector.
A waveform
obvious advantages over traditional encoders.
detector has
The waveform
detector can be completely an electronic device without any
moving parts. Thus, it need not be mechanically linked to the
motor.
The motor could, therefore, be located out in a harsh
environment with a detector, drive circuitry, and power supplies
stowed away in a more favorable location.
The literature read showed only lead angle variation
being
used as a method of speed control in closed loop systems that
employed waveform detection schemes.
However, four other methods
of closed loop speed control have certainly been used on other
11
occasions:
1)
Voltage regulated control increases speed by increasing
voltage.
In addition to feedback which does the phase to phase
switching, feedback control of velocity is used for regulating
the voltage.
Proportional velocity feedback is used to reduce
the system's time constant and integral velocity feedback can be
used to reduce the steady state error in velocity.
Such a scheme
is less efficient than other speed control schemes.
2)
A chopped voltage control of speed can be performed by
varying the switching ratio, the fraction of the total time the
voltage is on.
As with voltage regulated
control, proportional
and integral feedback may be employed.
A nonlinear element
should be put in the feedback loop so that the system does not
try to drive the switching ratio higher than unity.
3)
Bang-bang control whereby zero voltage is applied if the
speed is too high and full voltage is applied if the speed is
too
low can also be used for speed control. However, such a scheme
demands a continuous and accurate velocity feedback.
4)
Finally, phase lock loop techniques may be used for speed
regulation.
2.2.1
Waveform Detection
The waveform detection schemes implemented
involved the detection of peaks -- either maxima
zero crossings.
to date have all
or minima
-- or
To a fair extent the work has been experimental
rather than analytical -- motor waveforms
have been observed and
only afterwards related back to rotor position and justified
12
analytically. Waveform detection schemes must be specifically
tailored to the particular motor, driving circuitry, driving
scheme, and operating conditions under consideration.
In some
work on variable reluctance step motors Kuo and Cassat found, for
example, peaks that were present at low and high speeds but
disappeared at medium speeds.8
Kuo, Lin, and Goerke found a
scheme in a permanent magnet step motor that worked by detecting
phase peaks in one-phase-on operation, but this scheme could not
be implemented in two-phase-onoperation.9
Often one waveform
must be used for starting the motor and low speed operation and
another waveform must be used for high speed operation.
The
detection schemes were complicated by the fact that switching of
motor phases led to transients or noise that would lead to false
detections if they were not ignored.
This has been done by
ignoring any detections for a predetermined interval around
switching.
In a closed loop control scheme used by Kuo, Lin, and
Goerke a second noise rejecting circuit was also used to blank
out false pulses caused by voltage peaks that were generated when
the rotor was oscillating about the detent position when the
motor was running at a low speed or coming to a stop.9
Peak detection of waveforms
can be implemented
either by a
sample-and-hold circuit or by a differentiation circuit.
A
sample-and-hold circuit samples the waveform at a high rate, and
when the present sample magnitude is less than the previous
sample
magnitude,
detection.
the circuit interprets this as a peak
A differentiation circuit consists of an op-amp
connected as a differentiator followed
detector.
by a zero crossing
Kuo, Lin, and Goerke found the peak detector to be the
13
most critical element in the controller.
Inappropriate pole
placement in the differentiator design would cause improper
operation of the controller.9
Likewise, Unger noted that a
better peak detector would have improved the operation of his
system.1 0
Either voltage or current sensing can be used to provide
detections.
In sensing a current, the current must be converted
into a voltage.
This is
performed by putting a small resistor of
known value in the current path and measuring
developed across it.
the voltage
Since the resistor will increase power
dissipation and hence reduce the motor efficiency, its value
should be kept as small as possible.
While either current peak
sensing or voltage peak sensing schemes may be used, voltage peak
sensing schemes have the advantage that dead zones do not occur
in the voltage waveforms if suppression diodes are used.
Because
of the positive forward bias voltage of the suppression diode, a
dead zone may be present in the current waveform
stepping rates.
under low
This dead zone in the current waveform could
cause false detection errors.9
2.2.2
Angle Variation
Speed Control via Le
The waveform
detection closed loop schemes
that controlled
speed did so by variation in the lead angle, the angle in advance
of a particular equilibrium position at which
phase is turned on.
the corresponding
Much of the literature uses the
complementary concept of switching angle or feedback angle rather
than lead angle.
The switching angle is the angle the rotor
14
moves from an equilibrium position before receiving its first
feedback pulse. If the switching angle is a degrees, after the
initial starting pulse to the motor, the second pulse and all
following pulses
are sent after a degrees of motion from the
If the step angle is R degrees, then a
equilibrium position.
switching angle of a degrees corresponds to a lead angle of 2R-a
degrees.
If currents were instantaneously established and decayed
instantaneously, the same lead angle would produce maximum
torque
at all speeds, but obviously currents take time to buildup and
decay.
While the time required for current to buildup represents
only a small distance at low speeds, this time represents a
larger distance at higher speeds. Thus, the lead angle must be
increased to increase speed. As speed increases, the maximum
torque that can be produced must decrease due to increases in
impedance and back emf.l
Thus,
the maximum
torque decreases at
increased speeds, and the lead angle that produces the maximum
torque increases.
At low speeds small lead angles will produce
more torque than large lead angles, but at high speeds large lead
angles will produce more torque than small lead angles.
Usually,
a step motor operates at lead angles between 1 and 2.5 steps,
with larger lead angles resulting in higher speed but lower
torque.
In a four phase step motor,
the maximum
achieved
at a lead angle of about 2.5 steps. 1 2
speed is
Usually,
as the
lead angle nears three steps, the speed will fall and eventually
the motor will stall.
It must be remembered
that the assumption
of constant speed operation is only valid if the average torque,
which is a function of lead angle, is counterbalanced by the drag
15
torque, including the coulomb frictional
and viscous frictional
torque, which is exerted on the rotor.
The lead angle is
adjusted in order to achieve this.
Average torque as a function of switching angle for constant
speed operation has been calculated analytically.
Tal calculated
the average torque = (1/2x)~Tg(G)de
where
= electrical
(3)
angle and Tg(O) = generated torque for
constant speed operation as a function of switching angle for
two-phase bifilar woundpermanent magnet stepping motors with
two-phase-on constant voltage excitation and for three-phase
permanent magnet stepping motors with one-phase-on constant
voltage excitation.
By taking a derivative, he then found the
switching angle that maximized the average torque at a given
speed and the resulting
value of the maximumaverage torque. 1 3
Kuo used the above method and the principle
of time
continuity of flux linkages to calculate torque-speed curves for
various switching angles that could be obtained in a two-phase
bifilar
wound permanent magnet step motor under various drive and
control schemes. In addition to calculating the maximumaverage
torque, he calculated the minimum average torque that could be
used for stopping the motor.
Specifically, chopping, bilevel,
and two-phase-on control schemes were
considered. A chopping
drive was approximated by assuming that the chopper kept currents
at a constant
level.
As
expected,
the magnitude
of the maximum
average torque for two-phase-on excitation was 20.5 times greater
than for one-phase-on excitation, but oddly enough his
calculations also showed that a bilevel drive resulted in only a
16
slight improvement in the torque produced in the one-phase-on
scheme at low and medium speeds and actually decreased torque
produced at high speeds.14
Kuo, Lin, and Yen calculated torque-
speed characteristics in three phase variable reluctance stepping
motors
using one-phase-on drive with constant voltage for
different switching angles.1 5
The waveform
figure used for detection must be sufficiently
in advance of the equilibrium
position of the switched on phase
to provide a large enough lead angle to maintain the maximum
desired speed. Smaller lead angles and hence lower speeds are
achieved by adding in an electronic time delay between the time
that waveform
feature detection occurs and
switching occurs.
the time
that phase
Thus, by increasing the electronic time delay,
the steady state speed is lowered.
Lead angles that incorporate time delays have distinct
advantages over fixed reference lead angles without any time
delays.
The electronic time delay results in better acceleration
characteristics.
Since the time delay corresponds to a smaller
distance at low speeds, the effective lead angle is larger until
the final speed is achieved, and at speeds above some low level
that is quickly reached, the larger lead angles produce a higher
torque that accelerates the motor more rapidly.
Likewise,
electronic time delay also provides the motor with better
deceleration characteristics.
makes the motor
In addition, electronic time delay
speed less dependent upon load variations.
For
example, if the load is increased, speed tends to decrease, so
the rotor moves a shorter distance during the time delay, so the
lead angle increases, tending to increase the speed, thereby
17
partially offsetting the effect of
the load increase. 1 2 '1
In an optical detection system
the angle of
detection,
lead angle with no time delay, is always constant.
be the case in a waveform detection scheme.
detection scheme
6
the
This need not
In one waveform
the angle of detection increased from 2.1 steps
to 2.4 steps as the motor speed increased.
The motor will
operate properly as long as the curve of the detection angle
versus steady state speed has a positive or zero slope.
With
such a curve, when the motor is loaded, the speed will be reduced
and hence the lead angle is reduced. This is a welcome outcome
since the smaller lead angle will produce a greater torque to
apply to the load.
A curve of detection angle versus steady
state speed with a negative slope would not work,
since applying
a heavier load would slow the motor down and thus increase the
lead angle so that less torque would be available, and eventually
the motor would stall.1 7
In control schemes with encoder feedback control, such as an
optical scheme, the injection of extra pulses may be used to
achieve a lead angle greater than two steps.
with waveform
In control schemes
detection this would be analagous to the use of a
small angle of detection
using
one waveform feature at low speeds
and a large angle of detection using another waveform
feature at
high speeds. In both cases a larger lead angle causes a higher
speed.8
2.2.U
Seed
Control
wit
Traditional Logic Circuitry
Using traditional logic circuitry, the lead angle can be
18
varied via the use of a "fixed-unit time delay speed controller."
The speed controller is composed of three main parts: a speed
comparator, a time delay selector, and a time delay. The speed
comparator compares the time taken to perform a motor step with
the desired step period and decides whether or not the average
speed over the last finished step is too fast or too slow. If
the average step speed is too slow, the time delay selector
adjusts the time delay for the next feedback pulse to be one
fixed time unit less than the preceding time delay.
If the
average step speed is too fast, the time delay selector adjusts
the time delay for the next feedback pulse to be one time unit
greater than the previous time delay. Because the time delay can
only be adjusted by one time unit after each feedback pulse, a
tradeoff exists between the accuracy or fine tuning of the steady
state speed and the time taken to achieve the steady state speed.
A "variable-unit time delay controller" that uses a time delay
increment which is proportional to the error in speed can be used
to avoid this tradeoff but only at the expense of more
complicated
electronic circuitry if traditional logic circuitry
is used. 12
Yackel has given the complete circuit diagram for one
particular implementation of a fixed-unit time-delay speed
controller.
A network of gated one-shots can produce a delay of
up to 70 fixed units with each unit being equal to 25
microseconds.
18
2.2.4
icroDrocessor Control of Acceleration.
Deceleration. and Constant Speed
19
Complex step motor
control schemes require specially
designed logic circuitry that is usually expensive and time
consuming to construct. By using microprocessors complicated
control algorithms may be implemented without complex logic
circuitry at a lower cost.
B.H. Wells used an Intel 8080 microprocessor with a two
microsecond cycle time to implement acceleration and deceleration
algorithms on a three phase step motor with a feedback system
using two photoelectric sensors and a slotted disc in an encoder
arrangement.
pulses.
Speed was
determined
by the time between encoder
For either acceleration, deceleration, or constant speed
operation the microprocessor
would perform
four basic tasks for
each motor step:
1.
Delay a specified amount of time past an encoder interrupt of
the microprocessor.
The delay was calculated during the last
step.
2.
After the delay is over, send a pulse to the motor driver
card.
3.
Calculate the delay for the next step.
4.
Wait until the next encoder interrupt which will restart the
sequence.
To provide maximum
acceleration, an algorithm is used
to provide the motor with maximum torque at all times.
With
instantaneous buildup and decay of current, a switching angle of
0.75 times the step angle(or a lead angle of 1.25 steps) would
produce maximum
However,
forward torque in a three phase step motor.
the current has finite buildup and decay times, and the
20
finite buildup
algorithm.
time must be included in the acceleration
The acceleration algorithm is:
1.
Measure the time for the present step.
2.
Predict time for the next step(TN).
3.
Delay = 0.75(TN)-buildup time
To
equation
predict
the
time
for
the
next
step,
the
following
is used:
Tk+l = Tk + a(Tk - Tk-1)
Changing the value of the constant
curvature.
algorithm,
However,
(4)
will change the degree of
in order to implement an acceleration
a modification
of equation
(4) is necessary.
If the
time for the next step is predicted, then actually it is the time
for the present step that is currently underway that is being
predicted.
To solve this problem an algorithm that predicts two
steps in advance is used:
Tk+2 = Tk + a((a + 2)(T
k
- T1)
(5)
Experimental data showed a(a + 2) = 0.5.
For low speed operation utilizing large switching angles,
the execution order of the four basic steps could be rearranged
as follows:
1.
Calculate the delay for the next step once an encoder
interrupt is received.
2.
Delay the specified amount of time just calculated.
3.
After the delay is
over, send a pulse to the motor driver
card.
4.
Wait until the next encoder interrupt which will restart the
sequence.
While this rearrangement of the four basic steps does not
21
allow a small enough switching angle for maximum
speed operation,
it has the advantage of requiring that step times be predicted
only one step in advance rather than the two step in advance
prediction that must be used with the first ordering given for
the four basic steps.
This, of course, improves the accuracy of
the prediction.
For the first three steps, the two step in advance algorithm
cannot'be used. Two alternative measures can be used. First,
encoders can be used
to generate a suitable switching angle.
Secondly, if the load is not subject to much variation, delays
can be preselected.
For the third stop delay, the time value for
the first step could be included in a calculation.
Because deceleration took a much smaller portion of the
total time
scheme.
than acceleration,
Wells used a simple
deceleration
By skipping one pulse and setting the delay to a
constant,
the lead angle was
steps(depending
changed from about two
on the speed) to less than one step.
When the
motor had been decelerated, the delay was set to zero in order to
provide a one step lead angle for slow constant speed.
Wells proposed but did not implement an algorithm for
constant speed control.
One 8 bit byte is used to specify the
speed in steps/second divided by 10.
steps/second is specified.
specified speed.
A speed from 10 to 2550
A nominal delay is calculated for the
The unloaded speed versus switching angle curve
is represented by a linear approximation.
For the motor used the
linear approximation is:
a = 9.4 -
(0.00571)(l/T)
22
(6)
with a = the switching angle and T = sec/step.
Also:
delay = (Ta)/15
(7)
with 15 the number of degrees/step.
By algebra this yields:
delay = 0.627T - 3.81 x 10 -
3
(8)
If one computer unit - 0.8 x 10-6 second, then:
delayA = 0.627T
- 476
(9)
or
delayg = (7.84 x 104 /(speed/10))
A processor can perform
set in motion.
-
476
(10)
this calculation before the motor
is
After the nominal delay is calculated, the motor
is accelerated until the acceleration algorithm calculates a
delay less than the nominal value, and from this point on a
special error routine is used instead of the acceleration
routine.
The error routine provides an adjustment
proportional to the difference between
speeds so as to minimize
the error.
in the delay
the measured and desired
The following control law is
suggested:
delayk+2 - delayk+l = a(Tn - Tk)
(11)
where 0<a<0.617 in order to insure stability and Tn is the
desired time for each step.1 9
2.2.5
Phase Superposition
Phase superposition refers to the overlap of phases or the
extent to which phases are turned on simultaneously.
Wetter,
Jufer, and Imhof defined the rate of phase superposition as
ks = (ts/T)(100)
(12)
with t = time of superposition, the time phases are turned on
23
simultaneously, and T = the interval between two phases switching
on or T = 1/f where
f
= steps/second.
If P phases are present, k s = -100% if all phases are off
and k s = (P-1)(100%) if all phases are o
In a four phase motor
k s would be:
-100% for all phases off
0% for one phase on
100% for two phases on
200% for three phases on
300% for four phases on
By varying the phase overlap any particular percentage between
-100% and 300% could be achieved.
The rate of phase superposition yielding maximum
found to vary from one frequency to another.
torque was
For a definite
fixed load, the superposition rate that minimized speed
oscillations or maximized
dynamic stability was not necessarily
the same as that resulting in maximum torque.2 0
2.2.6
Specific Schemes Implemented or Simulated
Singh and Kuo did a computer simulation of a single stack
four phase variable reluctance stepping motor using dual voltage
drive that drove the printhead in a high-speed impact printer
system. After an excursion of an even number of steps ranging
from
2 to 100, the printhead
had to come
to rest
in a fully
damped manner with a tolerance of about seven percent of a motor
step within 30 milliseconds.
The simulation was performed by
integrating six nonlinear equations for the motor using the
24
fourth-order variable-step size runge-kutta method.
The
simulation was accomplished via seven steps:
1.
The best switching angle for acceleration was determined.
2.
The number of steps after which deceleration started was
determined.
3.
The best switching angle for deceleration was determined.
4.
Either (a) the number of steps after which the switching
angle was changed for low velocity operation was determined or a
probably better method (b) the proper motor speed at which to
change the switching angle for low velocity operation was
determined.
5.
The low velocity switching angle was determined.
6.
The pulse to the last step was inhibited with delayed last
step damping.
7.
At low velocity indicating near peak overshoot the last pulse
was given.
The motor came to a uniform low speed mode before the
command to stop so that a single damping scheme was possible for
all step increments.21
Frus and Kuo ran a three phase single stack variable
reluctance step motor in the one-phase-on scheme using detection
from a waveform in the on-phase mode. 17
J.D. Unger used parameters in the current waveforms of a
three phase variable reluctance step motor in the one-phase-on
scheme to determine the damping delays needed for optimum damping
using an electronic backphasing scheme.
A "position" peak that
occurred in the current waveform of one phase exactly when the
rotor crossed the detent position of another phase provided the
25
initial information neededfor damping. It told the system to
begin the damping process.
The time difference between the
"position" peak and a peak in another phase current following
shortly thereafter
was found to vary with load, so the time
difference between these two peaks provided information that told
how much time should pass after the "position" peak until a
backphasing pulse was applied.
pulse
The duration
of the backphasing
was kept constant to avoid circuit complexity,
but
modifying it would have yielded some damping improvement.1 0
Kuo and Cassat,
working
with
a three phase variable
reluctance step motor, developed a control scheme for one-phaseon operation by detecting current peaks in the phases. First-off
mode detection
was defined as detection
of a waveform feature
in
a phase that was on during the last cycle and second-off mode
detection was defined as detection
of a waveform feature that was
on two cycles ago. It was found that peak detection in the on-
phase current was difficult to predict and not advisable, for
even if peaks were found at low and high speeds, they might
vanish completely at medium speeds.
The first-off mode was
usually reliable at all speeds and recommended for closed loop
control.
The second-off mode could only be used after the motor
was brought up to speed, but had the advantage of sometimes
allowing higher speeds. Switching the waveform detection from
the first-off
mode to the second-off modeis analagous to the
injection of an extra pulse in a closed loop scheme with an
encoder and optical detection.8
Pittet and Jufer used as feedback detection of a zero in a
26
current difference to achieve closed loop control of a one phase
stepping motor.
They have referred to such closed loop control
as self-synchronization. 2 2
Mckee used current feedback from the on-phase of a three
phase variable reluctance step motor to achieve load adaptive
damping of single steps using electronic backphasing.
The height
of the current waveform was found to be inversely proportional to
the square root of the inertia.
As the height
decreased, both
the optimal time after the peak to begin the backphasing pulse
and the optimal duration of the backphasing pulse increased
exponentially. The correct timer intervals for optimal damping
are achieved by application of a scaled version of the amplitude
of the peak to the timer's RC network. This is possible because
the pulse width of the timer increases exponentially as the
voltage decreases; that is, the relation is fortuitously similar
to those between the amplitude height of the local peak and the
two timer parameters.2 3
Lin, Kuo, and Goerke found three waveform
detection schemes
that coud be employed in a bifilar-wound four phase permanent
magnet step motor.
The voltage waveforms across the phase
windings exhibited detectable peaks, a positive peak in the
first-off mode and a negative peak in the third-off mode, at
practically all speeds.
A closed loop scheme was developed that
was based on detecting the first positive peak in the first-off
mode.
Current waveforms had detectable peaks at low speeds, but,
unfortunately, at high speeds peaks did not not always appear in
one specific phase. However, detectable peaks could always be
found in the difference between currents in opposite phases, such
27
as ia-ic or b-id,, if the two phases were in the first-off and
third-off modes. This control scheme based on current
differences was successfully implemented in the one-phase-on
scheme, but because of the existence
of some unknown parameter
could not be implemented in the two-phase-on scheme. Finally,
detent positions
of a permanent magnet step motor were detected
by sensing the zero crossings of the back emf generated by the
permanent magnet flux linkage while the rotor was turning.
The
voltage across phase a was written:
Va = Raia + dXa/dt
(13)
with Xa being the flux linkage of phase a which was expressed as
Aa = Laia - Lcic + KlcosO
(14)
with La and Lc the average inductances of phases a and c, K1 the
maximumflux linkage due to the permanent magnet, and e the rotor
position in electrical
radians.
Taking the derivative
of
equation (14):
dka/dt = L[(dia/dt) - (dic/dt)] - Klosin9
(15)
where L = La = Lc and ( = d/dt.
Then using simple algebra
on equations
KlwsinO = L[(dia/at)
(13) and (15)
- (dic/dt)]
-Va + Raia
(16)
KlwsinOwas defined as the back emf generated by the permanent
magnet and was obtained by using the appropriate
on measurements of Ld(ia-ic)/dt],
op-amp network
Va, and Raia-
By similar manipulations a back emf waveform
of the type
-KlwcosO can be obtained with phase B and phase D. In theory a
pair of measurements
of KlsinO
and -KlwcosO could have been
used
to uniquely determine the rotor position, but in practice the
28
amount of switching noise did not allow this to be done, so zero
crossings were detected to show rotor detent positions.
For
operation over a wide speed range, zero crossings of the firstoff and second-off modes were used.
However, when the motor was
started, because the speed was very low, there were no detectable
zero crossings in the off-mode waveforms,
phase back emf was used
wsin has
the
characteristics.
so the peak of the on-
for starting the motor.
advantage
of
showing
This peak in
load-adaptation
The back emf detection scheme has the advantage
over other waveform
detection schemes of being
different drive schemes.
invariant under
Both one-phase-on and two-phase-on
drives yield the same back emf waveform.
This scheme has the
disadvantagesof requiring a complex controller and placing an
upper limit on the steady state speed due to noise occupying an
increasing portion of the back emf waveform
at higher speeds due
to an increased frequency of switching between the phases in this
constant voltage drive scheme.9 '2 4
29
r
0
0rt
:ro
rt
,
pt
30
SnmSMSTUt
SmISRU
(EScuuTs)
(agefL)
Figure 1.2
Acceleration/Deceleration
31
Profile
o
Used by Lafreniere
CHAPTER 2
1.
OVERALL CIRCUIT DESIGN ISSUES
The Three Phase States Encountered During Choping
Suppose phase D is being chopped on and off.
The resulting
phase B and D current waveforms are shown in Figure 2.1. The
three states of voltage and current situations existing in the
field and phase coils are shown in Figures 2.2a - 2.2c.
When phase D is chopped off, an opposite current of nearly
equal magnitude appears in the reverse coupled phase B.
phase
D is off,
the phase B current
When
and the field current
are
being returned to the voltage supply through a diode in antiparallel with the field coil.
When phase D is first switched on, by reverse coupling it
almost immediately assumes a value equal in magnitude to that of
the phase B current at the end of
current flow.
field current.
During
3, the interval
of reverse
l the phase D current is less than the
As the phase D current increases, less of the
field current flows through the diode antiparallel to the field
coil and more flows through the phase D coil.
1l ends and
2
begins when the value of the phase D current becomes equal to the
value
of the field current.
During
2 the phase D current
is
equal to the field current and the diode antiparallel to the
field coil is off.
Since approximately the entire supply voltage
is across the phase D coil during
l,
while during
2 the supply
voltage is spread across both the field and phase coils, the
phase D current rises more quickly during v1 than during
With
a duty
cycle
of 0.5, iB will
decay
all the way
2.to zero
producing an interval of zero torque, so the duty cycle should be
32
kept greater than 0.5.
2,
Position Detection
by Sense Coil
Voltages
VD = LDDd(iD)/dt + LDF(O)d(iF)/dt + iFwdLDF(O)/dO
represents the voltage across phase coil D in T1 and
phase current flows only through the D coil.
2 when
Likewise,
VF = LFFd(iF)/dt + LFD(O)d(iD)/dt + iDwdLFD(O)/dO
represents
the voltage
in the field coil
1 and
in
2-
phase current flows only through the D coil during
additional constraint VF = -VDON is present.
terms containing
When
'1
the
At startup the
are very small and may be ignored.
So at
l
startup during
LFFd(iF)/dt + LFD(O)d(iD)/dt = -VDON
Noting that LFD(G), a sinusoidal function of position, can be
either positive or negative, LFF is always positive, and VDON is
close to zero, it is seen that during
l d(iF)/dt at startup can
be either positive or negative.
VB = LBBd(iB)/dt + LBF(O)d(iF)/dt + iFwdLBF(e)/de
represents the voltage across the phase B coil during
phase current flows only through the B coil.
VF = LFFd(iF)/dt + LFB(O)d(iB)/dt
only
through
the B coil.
Likewise,
+ iBwdLFB(O)/dO
represents the field coil voltage during
flows
3 when
3 when phase current
VF = -VDON
during
3,
so at
3
startup during
LFFd(iF)/dt + LFB()d(iB)/dt = -VDON
Noting that LFB( 9 ),
a sinusoidal function of position, can be
either positive or negative, LFF is always positive, and VDON is
33
close to zero it is seen that during T3 d(iF)/dt at startup can
be either positive or negative.
Because
2,
during
the diode antiparallel to the field coil is off
d(iF)/dt must always be positive during
2-
In
conclusion, at startup d(iF)/dt is always positive during
can assume either polarity during
experimentally
by repetitively
l or
3.
2 but
This is verified
switching a single phase while the
motor shaft is slowly turned manually.
Rather than sensing directly from
the phase coils,
sensing
is actually performed on separate sense windings, which are wound
in the same manner as the phase windings
so that the voltages
across the sense windings are proportional to the voltages across
the phase windings.
This is done so that the voltage
swing on
the sense windings will be within the -5 to +5 volt range of the
comparator.
If sensing had been performed directly from the
phase windings, positive and negative comparator input voltage
limits larger than the 20V used
to supply the field and phase
coils would have been needed, and positive and negative supply
voltages greater than 20V would have been needed
to power the
comparators.
When chopping is being performed on a given phase, waveform
detection is performed on the following phases's sense coil
voltage.
phase
Hence, when A-B-C-D-A activation
D is being
chopped
detect the arrival
sensing
will
is employed,
when
be done on sense coil A to
of phase A. Crossings of the sense voltages
from negative to positive
polarity
cause detections,
so phase D
is turned off and phase A is turned on when the polarity of the A
sense voltage becomes positive.
34
The voltage across the phase A coil is:
VA - LAAd(iA)/dt+ LABd(iB)/dt+ LACd(iC)/dt+ LADd(iD)/dt+
LAF(e)d(iF)/dt + iFwdLAF(e)/dG
LAB and LAD are small and since sensing is only done in phase A
when phase A and phase C have been turned
off long enough for the
A and C phase currents to have decayed to zero, then diA/dt = 0
and diC/dt
=
0 during a phase A sensing.
Then when sensing
phase
A:
VA = LAF(e)d(iF)/dt+ iF,,dLAF(e)/de
At startup when the field transistor is turned on and the
entire supply voltage
falls
across the field coil giving a large
d(iF)/dt, the polarities of the LAF()d(iF)/dt,
LBF()d(iF)/dt,
and LDF(O)d(iF)/dt voltages are sensed to indicate
position.
the initial
After the initial sensing at turnon, before the motor
picks up speed and the iFdLAF(0)/dG
term predominates
over the
LAF(e)d(iF)/dt term, sensing must only be performed on phase A
just before phase D is chopped off, that is,
during
field current is equal to the phase D current.
2 when the
As previously
discussed, d(iF)/dt is always positive during r2 but can be of
either polarity during
only conveys
1lor
3.
Thus, the LAF(e)d(iF)/dt term
positional information during the
2 interval.
Torque for phase A, TA = iAiFdLAF(e)/dO, becomes positive
180 degrees before the equilibrium
position for phase A.
Thus,
the iFwdLAF(O)/dO term becomes positive at the same time the
torque becomes positive, 180 degrees before the equilibrium
position.
The LAF(O)d(iF)/dt
term becomes positive only at the
start of the second half of the positive torque interval for
35
phase A, 90 degrees before the equilibrium
turnon the initial
for phase A. At
sensing of position based purely on
LAF(O)d(iF)/dt, LBF(O)d(i)/dt,
and LDF(9)d(iF)/dt terms
activates the phase that is located between 180 and 90 degrees
from the equilibrium position.
Startup failures
may occur when
is very low and
LAF(e)d(iF)/dt predominates over iFwdLAF(O)/dG. Then, phase A is
turned on 90 degrees before its equilibrium position, and if
remains very low, switching to phase B will not occur until
phase
Ais at its equilibrium position. Supposethat phase Aarrives
at its equilibrium position and phase B has just missed being
detected.
Then, the motor will stay indefinitely
equilibrium
position
at the phase A
and phase B will never be detected.
Increasing the initial
acceleration by increasing the field
current will solve this problem.
Whenphase D is being chopped, phase A is being used for
waveform detection,
and
is appreciable, then the iFwdLAF(e)/de
term predominates over the LAF()d(iF)/dt
on scheme, phase A is activated
term.
In a one phase
180 degrees before its
equilibrium position and phase A is turned off and phase B is
turned on when phase A is 90 degrees before its equilibrium
position.
In a two phase on scheme, phase A would be turned on
180 degrees before its equilibrium position and turned off at its
equilibrium
entire
position,
interval
that is, phase A would be on during the
of positive
torque except during windows
occurring in the second half of its positive torque interval when
it would be turned off so that iA would decay to zero to allow
sensing in phase C. The use of such windows would have the
36
disadvantage of reducing available torque.
one phase on scheme is employed.
37
In this thesis only a
'I r
I
I
I~~~~~~
I~~~~~~~
-
f
-
'- - 1 - -
r
!
-
C
) 4-72*14'3
J
r
it
I
time
iB
I
I
'1
I
I
..
I
I
I
t !
.,
. me
t
t ,,O
1/
Figure 2.1
Phase D is chopped on and off 3 times.
38
_
kLJ
_~~~~~~
I
- -
-
I.
+
tv
4-
·
·
-
+
_
+
24
I
dn
W
ft
4-
'-a
-JLT
_
:
4I'"A.
39
000_
ClrChh/
40
4
Z
+E
!
z
41
CHAPTER 3
1.
Overall
HARDWAREDESIGN ISSUES
Block Diagram
An overall
block diagram of the hardware scheme employed is
shownin Figure 3.1.
2L The Case For Using Fast Recovery Diodes
Current and voltage waveforms showing how switching compares
for real and ideal diodes are sketched in Figure 32.
Fast turn-
on diodes will have more ideal turn-on characteristics
than slow
diodes and fast turn-off diodes will have moreideal turn-off
characteristics than slow diodes.
Technological
considerations
usually- result in a fast turn-off diode being fast turn-on.
Generally, the turn-on surge voltages and power losses are of
secondary importance compared to turn-off surge voltages and
power losses.
When phase D was chopped on and off
in my predecessor's
circuit, a circuit without snubber networks but with diodes
connected antiparallel to the switching transistors to allow
reverse
phasecurrent flow, then a careful examination of phases
B and D revealed positive current spikes occurring in both phases
during the instant of phase D turn-on.
A highly schematic
nonscaled diagram of these current spikes is shown in Figure 3.3.
These current spikes were caused by a reverse current flowing
through the diode in phase B immediately
reverse biased.
after
that
diode
was
Since coils B and D are reverse coupled, a
current spike in phase D had to occur in the same direction so
that an immediate change in flux did not take place.
42
To minimize
these spikes in my scheme a MR852 fast recovery diode was used
instead of the 1N4720 general purpose rectifier used by my
predecessor.
The recovery charge QR, equal to the integral of reverse
current through the diode, is often 200 to 500 times greater in a
standard diode than in a fast diode.
Thus, the use of fast
diodes allows near total or total suppression of these current
surges to be achieved.
The energy produced each turn-off is
equal to QREC, where EC is the reverse voltage across the diode
immediately
after switching.
By taking the worst case, where all
of the energy is dissipated in the diode, an upper bound on the
diode power dissipation due to switching is obtained.
Thus,
,f where f is the switching frequency, gives the worst case
P=QREc
Hence, the use of fast diodes
diode switching power dissipation
drastically reduces the diode switching power dissipation
High
losses during switching would prohibit the use of standard diodes
at high frequencies.
Eliminating the diode reverse surge current also eliminates
extra turn-on losses of the power transistor.
Often, the turn-on
losses of a transistor are concentrated in its structure(hot
spots), and result in a fast fatigue of the transistor.
RC networks are often put in parallel with standard diodes
to protect them against high surge voltages
at turn-off.
Generally, to eliminate surge voltages replacing standard diodes
with fast diodes is better than using standard diodes with RC
protection
networks;
the RC networks consume a large amount of
energy at high frequencies.
43
One final advantage of the use of fast diodes is the
reduction of radioelectric
interference.
During diode switching,
an abrupt variation of current and hence of magnetic field takes
place.
The amplitude of the interference is proportional to the
recovered charge QR-
Fast diodes have some drawbacks; increased leakage currents,
greater forward voltage drops, and lower maximumreverse voltage
ratings are often the penalties of makinga diode fast.
I.
1
Transistor Switching Network
The transistor switching network used for the 4 phase coils
is shown in Figure 3.4. The transistor switching network used
for the field coil is shown in Figure 3.5.2 The field network is
the same as that used for a phase coil
except that a 7405 is used
instead of a 7401, the flywheel diode, a MR821, is placed
antiparallel to the field coil, and the sensing resistance
measures out to .079 ohms rather than .080 ohms.
In my predecessor's scheme a 075 ohm wire wound resistor
was used as a sensing resistance, but a wire wound resistor acts
as an inductance. Noninductive sensing resistances were
constructed by placing 16 - 1/2 watt carbon resistors averaging
1.28 ohms in parallel.
Placing the resistors between 2 cut
pieces of a PC board, each with 16 holes, allowed a neat compact
construction.
Since the standard deviation of different samples
around a mean is inversely proportional to the square root of the
sample size, paralleling resistors had the advantage of producing
sensing resistances whose standard deviation around a mean value
was 1/4 the standard deviation of the individual 1.28 ohm
44
resistors
around a mean value.
resistances
losses.
The value of the sensing
was kept as small as possible to minimize power
Finally,
note that tantalum
capacitors of a few
microfarads were used to keep the collectors
of T1 and T3 andthe
emitters of T2 from deviating from their steady state voltages.
3.1.
Discussion of the Switching Network
A and C are reverse coupled phases and B and D are reverse
coupled phases.
carrying current.
Suppose phase D is on and no other phase is
Whenthe phase D power transistor
is turned
off, the phase D coil voltage drops and changes polarity so as to
maintain the phase D coil current.
If perfect reverse coupling
were present, the phase D coil voltage would drop to -(VS +
2VDON),VCEof transistor
3 VDON,
and the
D would rise
from VCE(SAT)to
2V
S
+
voltage across the reverse coupled phase B coil
would rise to VS + 2VDON*
When the phase B coil
voltage
reached
VS + 2VDON,then the current in the phase D coil would stop and a
currentof equalmagnitude would flow through phase B in the
reverse direction so as to maintain continuity of flux.
However,
due to imperfect coupling or leakage inductances, this transfer
of energy to the reverse coupled phase is not perfect.
Because
of the leakage inductance, at turn-off of phase D with no snubber
network present, VCE of transistor D exhibits a brief duration
large positive voltage spike before settling to a steady state
value of 2V S + 3VDON and the phase D coil voltage exhibits a
brief duration large negative voltage spike before settling to a
value of -(V + 2VDON).
45
A turn-off snubber is used to attenuate the brief duration
positive
voltage spike in collector to emitter voltage due to the
leakage
inductance.
If
a
snubber
is not
used,
the
power
transistor is quickly destroyed by the occurrence of collector to
emitter voltages much greater than the VCEO rating of the
transistor.
The turn-off snubber network used is shown in Figure
3.6.
As the value
of the capacitance
increases,
the turn-off
switching time increases since dVcE/dt decreases, but the turn-
off switching losses in the transistor decrease.
values of capacitance,
For small
the total turn-off losses of the snubber
and transistor are smaller than those of the unaided transistor.
Let the phase current be Ip and assume that during the
transistor fall time tf the current in the inductive load remains
constant.
in
During the fall time tf the current decreases linearly
the transistor and increases correspondingly in the capacitor.
Then, if no leakage inductance
is present, at the completion
of
transistor turnoff, the voltage V0 across the transistor is given
by:
CVO= f/fIcapacitordt
Therefore, V
= Iptf/2C, the VCE across the transistor at the end
of turnoff in the absence of leakage inductance. Thus,
in the
absence of leakage inductance, the turn-off switching power
dissipation of the transistor is decreased by making Iptf/2C <
2VS + 3VDN,
the value to which VCE rises.
Now consider the effect of the leakage inductance LE.
If
the transistor has been completely turned off and all of the
current is flowing
into the snubber, LEIp 2 /2, the energy
46
in the
leakage inductance, must be transferred to the snubber. This
energy will increase the value of VCE above 2VS + 3VDON by a AV
such that
LEIp2 /2
=
C[(2VS +
3
VDON + AV) 2 -
= C[(AV) 2 + 2(AV)(2VS +
3
(2V
2 ]/2
+ 3VDON)
VDoN)1/2
Thus, to obtain a particular AV for a given leakage inductance LE
set
C
LIp
2
/(AV)
2
+ 2AV(2VS + 3 VDON)]
Also, the capacitor and resistor values must be chosen so
that the capacitor is completely discharged during the on
interval of the transistor, that is,
C (< tON.
In addition, R must be large enough so that the turn-on
discharge current of the capacitor
Ai =[2 VS + 3VDON + AV - VCE(SAT)]/R
that will flow through the transistor at turn-on does not become
too excessive.
Finally, the power rating of the resistor must be larger
than [C(2 VS +
3 VDON
+ AV)2 f]/2, where f is the switching
frequency.
The question arises as to whether to use a turn-on switching
aid network to reduce
the power transistor turn-on switching
losses and reduce the turn-on surge currents.
Generally, turn-on
switching transients are less of a danger to transistors than
turn-off switching transients so only a turn-off snubber is
used.3 ,4
3.2,
Calculations
for the Transistor Switching
47
Network
VEC(sAT) of T2 = 0.5V
V
of T1 = 0.6V
+ VBE of Tp = 0.8V
+ Voltage across sensing resistor = 0.25V
+ Voltage across RB1
= 5.OV
Thus, the voltage across R1 = 2.85V.
Let the base current into Tp be limited to 200 mamp.
R1 = 2.85V/0.2 amps = 15 ohms
The transistor specifications indicate that this level of base
current should drive the transistor well into saturation for
collector currents up to 5 amps.
Let the current through R3 = 2 ma.
R3 = 0.6V/
2 ma = 330 ohms
Let 4 ma come from the base of T2 .
R4 = (4.4V - 0.2V)/(4 ma + 2 ma) = 680 ohms
Voltage across R2
=
9.5V.
Let 20 ma flow through R2.
R2 = 9.5V/20 ma = 470 ohms
No current limiting resistor is put in series with the
1N4933 diode since the peak reverse base current pulled from the
2N6339 is experimentally determined to be 0.6 amps.
tf for the 2N6339
is about .13
sec at 2.0 amps.
Ignoring
the leakage inductance, at the end of tf the transistor collector
to emitter voltage V 0 = Iptf/2C.
C = Iptf/2V
Let Vo = VCEO/2 = 60V.
= (2 amps)(1.3 x 10-7sec)/2(60V)
= 2.2 x 10- 9 farad
Now consider the effects of leakage inductance.
LEA = LEC = 20 pIh. 5
48
Then
Assume 2V S +
3
AV to 100V.
Then AV = 20V.
VDoN is kept to 80V.
C =[LEIp2 ]/[(AV)
2
To be safe keep 2V S +
3
VDON +
+2AV(2V S + 3VDON)]
= [(20 x 10-6 H)(2 amps)2 ]/[(20)
2
+ 2(20)(80)]
= 2.2 x 10-8 farad
Clearly the leakage inductance determines
the size of the
capacitor used in the turn-off snubber.
At turnoff,
AVCE/At = Ip/C = 2 amps /2.2 x 10- 8 farad = 108 volts/sec
If AVcE = 100V,
then the turn-off switching time At is only 1
Iisec.
The transistor can handle 25 amps continuous current. So
let the initial current discharge of the turn-off snubber
Ai = (2V S +
3
VDON + AV)/R ( 10OV/R = 10 amps
R = 10OV/ 10 amps = 10 ohms
RC = (10 Ohms)(2.2 x 10-8 farad)
= .22
sec,
which will
be
far less than the on interval of the transistor.
4.
Pushbutton Inputs to the 8039 Microprocessor
The three pushbutton inputs to the 8039 are
3.7.
shown
in
Figure
Traditional debounce latches with nand gates follow each of
the pushbuttons.
Since a microprocessor reset sets all the
output ports to one thereby turning on all the transistors, a
long RESET input to the microprocessor
would burn out a fuse or
one or more transistors. Thus, a 74121 monostable is used to
keep the RESET input short in duration. The RESET pin must be
held at ground(.5V) for at least 10 milliseconds
if a reset
is
performed just as the power supply comes within tolerance.
49
However, only 5 machine cycles are required if the power is
already
on andthe oscillator
has stabilized.
always performed many seconds
after the circuit has been powered
Since a reset is
up, the pulse width need only be at least 5 machine cycles =
5(1.36tsec)
= 6.8Lsec.
The monostable
RC network yields
width = 0.7RC = 0.7(1.5 x 104 0)(10- 9 farad)
5.
a pulse
= 10.5sec.
Intel Microcomputer Comonents
The Intel microcomputer parts used are shown in Figures
3.8a-c. One 8039 microprocessor, one 8212 address latch, two
2716-1 2
x 8 EPROMs, one 8185-2 1
x 8 bit
static
RAM, and three
8243I/O expanders are used.
New programs are installed by erasing the EPROMs under UV
light for 25 minutes and then programming
programmer
of an Intel microcomputer
programs of 2
is required.
or less of memory
Because
the EPROMs
with the universal prom
development
system.
With
space only the #1 2716-1 EPROM
are continuously removed from
their sockets for reprogramming, zero insertion pressure (ZIP)
sockets are used for the EPROMs.Use of regular sockets would
rapidly lead to pin destruction through mechanical wear during
DIP insertion
and extraction.
Note that the 2716-1 is used instead of the 2716. The
2716-1 is the same 2K x 8 EPROMas the 2716.
selected out because of a faster
Intel
It has just
been
speed. According to the 1979
Component Data Catalog the 2716 has a maximum access time
of or an address to output delay time of 450 nsec.
For the
2716-1 the maximum access time is 350 nsec.
50
The 8039
microcomputer has a maximum
address setup to data in time of 400
The 8212 address latch has a maximum write enable to
nsec.
Thus, the EPROM must have a
output delay time of 40 nsec.
maximum
acess time no greater than 400 - 40 = 360nsec. Therefore,
the 2716-1 is suitable while the 2716 is not. Using one 4K x 8
2732 EPROM would be simpler than using two 2K x 8 EPROMs, but
unfortunately EPSEL lab does not have the equipment needed to
program a 4
x 8 EPROM.
The 8039 has an 8-bit CPU, an 128 x 8 RAM data memory, and
an 8 bit timer/event counter. The 8039 operates with an 11 MHz
crystal whose output is divided to form 1.36 psec machine
consisting of 5 machine
states.
cycles
Each instruction is executed
in
one or two machine cycles.
Two 8 pin SPST switches provide
on the #2 8243 I/O expander.
tested, the maximum
input
data to the 16 ports
Such information as the phase
and minimum
phase current
to be
levels, the initial
switching delay time, and the frequency with which the delay time
is updated can be inputted on these switches.
Input data should
be read in with the high order bit corresponding to P73, P63,
P53, or P43 and data should be outputted with the high order bit
corresponding
to P73, P63, P53, or P43 because
if this order is
reversed then the ordering of bits in the accumulator becomes
opposite to the ordering of bits on the I/O expanders and
arithmetic cannot be performed on accumulator numbers moving
between the accumulator and an I/O expander.
The #3 8243 I/O expander is used for two purposes. Before
or while
the motor
is running,
information to the DAC latches.
it outputs current level
After the motor has stopped
51
running, it can output phase duration counts to 7407 buffers
driving LEDs thereby allowing acceleration profiles to be
obtained.
The 8185-2 RAM is used solely to store the phase duration
counts used in acceleration profiles.
6.
Current Level Regulation
Four types of current level information are provided.
the motor is started, the field transistor is turned on.
When
As soon
as the field current reaches a desired field current level
determined by the field DAC input to the field comparator, the
field transistor is turned off and the desired phase transistor
is turned on. After a phase transistor has been turned on, the
phase current rises until it reaches a maximum current level
determined by the maximum DAC input to that particular phase's
maximum comparator.
After the maximum current level has been
reached, the phase transistor is chopped off and a reverse
current flows in the complementary phase.
When the complementary
reverse phase current has fallen in magnitude to a minimum
reverse current level determined by the minimum
DAC input to that
particular complementary phase's minimum comparator, then the
original phase transistor is chopped on again. The bottom DAC
and comparator are present solely
of reverse phase coupling.
to check for proper functioning
The bottom comparators prevent a
phase turn on signal unless the reverse current detected is above
a certain magnitude.
If very little or no reverse phase coupling
occurs, and the reverse phase current is always less than the
52
bottom current value, then the phase current will not be chopped
on again, a new phase will not be detected, and the motor will
stop.
To illustrate this better,
is set at 2.9 amps, the maximum
the minimum
current
level
suppose the field current level
current
level is set at 3 amps,
is set at 1.5 amps,
current level is set at 0.5 amps.
and the bottom
Then, the field transistor is
turned off forever(unless a restart occurs) when the field
current reaches 2.9 amps. Phase currents are chopped off when
they reach 3 amps and are chopped back on again as soon as a
reverse complementary
detected.
phase current between
1.5 and 0.5 amps
is
If reverse phase coupling is functioning properly,
a
detection of a reverse phase current between 1.5 and 0.5 amps
will occur as soon as the magnitude of the reverse phase current
has decreased to 1.5 amps.
Thus, chopping will keep the phase
currents between 1.5 amps and 3 amps.
Figure 3.9 shows the eight 74LS75 latches used to output
current level information from the #3 8243 I/O expander to the
four DACs. Since each latch has 4 bits and each DAC has 8 bits,
two latches are used for each DAC.
An 8243 can
on each of its 16 I/O lines simultaneously.
sink 5 ma at .45V
On each I/O line
a 7407(driving a LED) requiring a -1.6 ma low level
current. Each enable
is
input
or G input on a 74LS75 requires a -1.6 ma
low level input current.
Then, the
4 enable pins required to
address the 2 latches driving 1 DAC require -6.4 ma low level
input current.
Hence, the 4 enables for the 2 latches driving 1
DAC must be driven by 2 separate I/O lines.
Figure 3.10 shows the DAC - op amp networks used to generate
53
reference voltage levels for the current level comparators.
field and maximum
DAC -
O and +0.5 volts.
The minimum
op amp networks generate outputs between
and bottom DAC - op amp networks
generate outputs botween 0 and -0.5 volts.
pots with wipers positioned to input 4/5
as a reference level to a comparator
compensations
The
can be made
and sensing resistances.
The op amps input to
of the output voltage
input terminal.
for differences
With pots
in phase comparators
A pot was used for the field comparator
only so the scale factor for the field current level would be the
same as that for the other current levels. Reference voltages
with magnitudes up to 400 my can be placed at the comparator
input terminals with unit increments to the DAC corresponding to
gradations of 1.56 mv at the comparator terminals.
Gradations of
1.56 my across a .0800 sensing resistance correspond to current
gradations of 1.56 mv/.0800 = 20 ma.
When the power transistor
is turned on, 0.2 amp of base current flows through the power
transistor so for any given maximum
current level IMAX not
exceeding an upper bound of 4.8 amps set the comparator reference
voltage at 16 my + IMX(80
mv/amp).
Of course, the current-carrying capacity of the wire used
for winding the motor must also be considered. Varnish coated
number 19 copper wire was used for winding the motor.6
According
to one reference #18 wire has a current-carrying capacity of 11
amps and #20 wire has a current-carrying capacity of 7 amps,7 so
by interpolation the motor wiring
should have a current-carrying
capacity of 9 amps.
Careful attention must be given to grounding issues to
54
ensure
the proper
functioning
of
the
comparators.
All
the
sensing resistances employed in this circuit - the 4 resistances
sensing the phase currents, the resistance sensing the current
through the field transistor, and the resistance sensing whether
or not the diode antiparallel to the field coil is on - have all
been located physically close together so that the distance and
hence the inductance of the wires joining the ground sides of
these sensing resistances
between
the grounds
possible.
is minimized
of the sensing
so the voltage variation
resistances
is as small
as
This will prevent problems caused by the fact that
comparators have a poor common mode rejection ratio.
The ground
terminal of the sensing resistances is tied directly to the
ground terminal of the circuit board and does not connect with
the logic chip grounds until the ground terminal.
This
separation of logic and power grounds is necessary to prevent the
occurrence of noise in the logic grounds from the switching of
the power transistor currents
the logic grounds.
into the inductance
presented
by
Note that the pots determining reference
levels for the comparators
are connected
to the ground
side of
the corresponding sensing resistance rather than to the logic
ground whereas the ground pins for the comparators are connected
to the logic grounds(Figures
necessary
because
use
of a logic
the effect of putting a long
the input terminals
3.11,3.12a-b,
and 3.14).
This is
ground for the pot would have
wire length or an inductance between
of the comparator
-
the distance
wire distance from the ground side of the sensing
being
the
resistance to
the ground terminal along the power ground wire plus the length
along
the logic
ground
wire from the ground terminal to the logic
55
ground point connected to the reference pot.
To prevent comparator oscillation
compensation networks were
applied to some of the comparators used in this circuit(Figures
3.11, 3.12a-b, and 3.14).
problem with the maximum
Oscillations
are
level comparators
particularly a
because of the slow
rate of rise of the phase current toward its final value during
the 2 state. Positive feedback or hysteresis applied to the
balance pin 5 removes these oscillations.
The .002f
capacitor
between the 2 balance pins serves as a high frequency filter.
provides a low impedance shunt to any high frequency noise.
It
The
resistor network for comparator compensation was determined
experimentally.
Networks were constructed with the 2.2K and
33K2 resistors and the value of the third resistor was increased
until a square wave input would not cause oscillations in any one
of four 311 comparators tested.
The network for sensing the field current level is shown in
Figure 3.11.
The network used for current regulation of phases A and C is
shown in Figures 3.12a-e.
An identical network is used for
current regulation of phases B and D.
The two monostables
in Figure 3.12e that provide the clocking
of phases
for the
shown
K flip flops
A and C will also provide the clocking for the JK flip
flops of phases
B and D.
The monostables shown in Figure 3.12c that produce 5.7 and
1.89
before
sec positive pulses cause a delay of 5.7
the J input of the flip flop shown
presented with the information that
to occur
in Figure 3.12d can be
the phase
56
sec
current has reached
its upper limit.
5.7
sec
purposes.
to send
The current must exceed its maximum
First,
a
signal
to the
input.
This
limit for
serves
two
it ensures that a transient maximum current
detection occurring right at the instant of transistor turnon
does not immediately
turn the transistor off again.
Second, it
allows sensing to be done in the 5.7 sec just before the phase
is turned off.
Since not all
phase chops include a
2 state,
this does not ensure that all the detections will occur during
the
2 state, but it does ensure that the current will reach the
specified maximum level before the next phase activation occurs.
The monostables shown in Figure 32c
that produce 12.6 jpsec
negative pulses ensure that a phase is not turned on immediately
after being turned off - that
is,
it makes sure that
a detection
does not occur during the current transfer between the two
reverse coupled phases.
7
External Int errup Generation
An external interrupt to the 8039 microcomputer is generated
whenever a next phase detection
is made.
The circuitry
used to
accomplish this task is shown in Figures 3.13 to 3.16.
Figure 3.13 shows the comparators used to detect
coil voltage polarities.
the sense
As discussed in chapter two, at startup
the outputs from these comparators provide the initial position
information to the #1 8243 I/O expander.
the sense coils is tied directly
circuit board.
Note that the ground of
to the ground
terminal
of the
The LMl11 specifications indicate that neither
input terminal should be allowed to become more negative than the
negative
supply voltage.
With the 1N4148 diodes connecting -5V
57
to the noninverting terminals, negative voltage spikes occurring
in the sense waveforms cannot become more negative than one diode
drop below -5V.
Figure 3.14 shows a comparator network used to detect the
presence of state
2 the
2. During
diode
antiparallel
to the
field coil is off and a positive voltage exists across the field
coil. At least 3V will appear across the 5.6MG resistor during
state
2.
Then a base current
of 3V/5.6Mf = .54 pa will
With this PNP transistor an iB = .54 a yields
Hence, a collector current of 110
voltage of O.1V.
is used.
As
flow.
an iC > 110
a.
is set equal to a reference
Thus, a sensing resistor of 0.1V/110
pa = 1K.I
No more than 50V ever appears across the field coil.
=
Then, iB = 50V/5.6Ma = 8.9 pa. For this PNP transistor an iB
8.9
a yields
an iC < 3.7 ma.
Hence,
(3.7 ma)(1KO) = 3.7V is the
largest voltage that should appear at the positive input terminal
of the 311 comparator.
The 1.2
resistor is put in merely as an
added protection for the comparator.
The positive input voltage
limit is 30V above the negative supply or 25V.
transistor shorts, the maximum
Thus, if the PNP
voltage appearing at the positive
input terminal will be equal to (lKX/(1KD + 1.21K))(50V)= 23V,
and the comparator will be protected.
Figure 3.15 shows the network that determines if a 2 state
is an external
interrupt
RESTRICTION= 0, an interrupt
requirement.
can only occur during state
When OVERRIDE 2 RESTRICTION = 1, then
during v1 or
WhenOVERRIDE
2
an interrupt
2.
can occur
2-
Whensensing phase A, VA = LAF()d(iF)/dt
58
+ iFodLAF(e)/de.
At startup the LAF()d(iF)/dt
term predominates.
Thus, at
startup all detection of the next phase must be done during
2
when the polarity of d(iF)/dt is known to be positive rather than
during vl
or
3 when the polarity of d(iF)/dt can be either
positive or negative.
As the motor
speeds up, the iFadLAF(9)/d
term predominates and detection of the next phase need not be
restricted to
2.
In fact, with high speed operation the number
of chops is maintained at a smaller and more uniform number if
detection occurs during both vl
and
2.
When next phase
detection is restricted to '2, the average number of chops per
phase becomes larger and less uniform.
A string of phases
containing mostly
one or two chops will also show an occasional
phase
three, four, or five chops.
containing
startup OVERRIDE
In summary,
at
2 RESTRICTION should be 0 but should become 1
as speed increases.
The question arises as how to determine the proper point for
switching OVERRIDE
2 RESTRICTION from 0 to 1. The switching
from 0 to 1 should occur when the iFddLAF(o)/de term predominates
over the
LAF(O)d(iF)/dt
term.
Since d(iF)/dt is
proportional
the supply voltage and for a phase containing a fixed number
chops
to
of
is proportional to the supply voltage, then for a phase
containing a fixed number
of chops
is proportional to d(iF)/dt.
Hence, since iF, LAF(O), and dLAF(O)/dO are independent of supply
voltage, the switching of OVERRIDE
2 RESTRICTION from 0 to 1
should occur when the number of chops per phase falls below a
certain level.
In the network shown whenever the number of chops per phase
is less than a value determined by the input data switches for 2
59
consecutive phases, then OVERRIDE U2 RESTRICTION is equal to 1.
Otherwise,
OVERRIDE
2 RESTRICTION
is equal
to 0.
If 1111 or
1110 is the initial value put on the input data switch, then
OVERRIDE
2 RESTRICTION
is equal to 0.
If 1101 is the initial
value, then whenever only one chop per phase occurs for two
consecutive
phases,
OVERRIDE
2 RESTRICTION
is equal to 1.
If
0000 is the initial value on the input data switch, then whenever
the number
of chops per phase is less than fifteen for 2
consecutive phases, OVERRIDE
2 RESTRICTION is equal to 1.
A chain of three 74LS04 inverters is used to ensure that the
load input of the 74LS161 is low for a sufficient time before the
clock goes high.
Figure 3.16 shows
the network generating the external
interrupt to the 8039 microcomputer.
The interrupt
is sampled
every machine cycle during ALE, so the pulse of the monostable
serving as a nand gate input must be at least one machine cycle
in length or 1.36 jsec long. To prevent a false reading caused
by a glitch or transient, a sense coil positive voltage during a
phase maximum
current signal must be confirmed 231 psec later to
indicate a next phase detection.
This is particularly
important
in preventing a false detection during a short CURMAX glitch that
could occur at transistor turnon
8.
if OVERRIDE
2 RESTRICTION = 1.
Miscellaneous Details
According to T.I. gold plating on
necessary.
ire wrap posts is not
A T.I. technical report concludes that unplated wrap
is stable after exposure to harsh environments.8
60
Therefore,
the
use of unplated wire wrap sockets is not expected to cause any
problem.
Adequate use is made of capacitors.
Before using the
circuit three huge electrolytic capacitors are attached to the
board's barrier strip for voltage supplies.
They are placed
between the power supply voltage and ground, +SV and ground, and
-SV and ground. O.lj1fceramic capacitors are used between +5V
and ground and where applicable between -5V and ground for every
DIP on the board.
capacitors
In addition, six electrolytic 0Opf
are scattered over the board.
capacitors of a few microfarads
Also,
tantalum
are used to keep the collectors
of T1 and T3 and the emitters of T2 from deviating from their
steady state voltages.
capacitors
Finally, .05pf ceramic and 6.8pf tantalum
are used to keep comparator reference voltges
constant.
Three 3 amp fuses are present
in the circuit.
They are
located between the power supply voltage and ground, +5V and
ground, and -SV and ground.
61
Figuro 3.1
An overall
block diagram of the hardware scheme used
62
IDEAL DIODE
REAL DIODE
/\ VOLTAGE
CURRENT
I
If:t
rC "
I\ I
EW !
*
·
I
I
time
II
jI
N
I
i
time
v
2
0
w
-d
Whl
S1
A
C
F.
a
/
\ ,/
N ,0
ClT
L._
N
/
VOLTAGE
i
]
iV
I
/ times
)
time
tfr I
VB
-
V1rM
Figure 3.2
Current and voltage waveforms for real and ideal diodes
---63
_
I
GI
|
a-
"1
/
vI
-
iB
me
Figure
3.3 A highly schematic drawing of current
the use of slow diodes
spikes due to
___
'3
3300
PAOSE
COIL
PBASE
SELECT
714i
84
6800
i OF 31
FLIP FLOP,
022#f
D1122
)LYSTYREBN
[VE
B
Figure 3.4
Switching network used for the 4 phase coils
65
IV
.mh
4~
I
I
66
Figure 3.6 Snubber
67
+5V
· 'l
+sS
10
tol
7400
TO
7400
+SV
T1
7400
Figure 3.7
Pushbutton inputs to the 8039 microcomputer
68
+SV
+5V +SV
I.
I.
VCC VrDD EA
I
GND
II
VSS
PlO
Pll
P12
> XTAL 1
11,
ITAL
20
pf
-PHASE A SELECT
-PHASE B SELECT
-PHASE C SELECT
P13
-PHASE
P14
-FIELD
D SELECT
SELECT
PROHIBIT
P15
1
7404
XTAL 2
P16
-#2
8243 INITIAL
P17
-#3
8243 DAC LATCH and LED IO EXPANDER CS
P20
-P20
VALUE IO EXPANDER CS
RESET
PUSHBUTITON
INPUTS
TO
- P23 TO 3 IO EXPANDERS
P21
P22
P23
P24
P25
P26
IN8
P27
8039
MICROCO]
-A8 RAM
-A9 RAM
-#1
8243
DBO
VCC GND
DB2
DB3
DB4
DES
DB6
DB7
PROG
ALE
PSE
Figure 3.8a
MAIN PROGRAM10 EXPANDER CS
Intel microprocessor
69
DI1
DI2
DI3
DI14
DIS
DI6
DI7
DI8
DO1
D02
D03
D04
DOS
8212
D06
ADDRESS D07
LATCH
D08
+5V I CLR
STB
DBO'
DBEl
DB2
DB3
DB4'
DBS'
DB6'
DB?
DS2
MD DS1
ALE
+SV
components
GND
-+SV
+5V
I
P22 -
P21P20D08D07D06DOS-
+SV
GND
I
VCC VPP
GND
VCC GND
#1
P4C -SENSE POL A
#1 8243
P41 -SENSE POL B
MAIN PROGRAMP42 -SENSE POL C
IO EXPANDER P43 -SENSE POL D
P50
PS5
P20
P52
P21
PS3
P22
CUBRENT SENSE
P60 -FIELD
P23
P61
P62 -ENABLE SENSE
PROG
P63
P70 -ENABLE A
CS CHIP
P71 -ENABLE B
SELECT
P72 -ENABLE C
P73 -ENABLE D
A10
A9
A8
A7
A6
AS
II
P20-
D04 -
A3 2716-1
D03 D02DO1-
A2 2K
A2
Al
AO
DBODB1 DB2DB3DB4DBSDB6DB7
00
8 EPROM
P21P22P23PROG
-
P27-
01
02
03
PIN 20
04
05
PIN 18
06
PD/PGM CS
07 -
-
__
·
·
.
"
OE
CE
P23
PSEN
I
I
GID
+V
+5Y
+5V
4.7
,
VCC VPP
GND
P22P21-
A10
A9
P20 - A8
D08- A7
D07- A6 2716-1 #2
D06AS 2K x 8 EPROM
DOS- A4
D04- A3
A2
D03 D02Al
D01- AO
DBODB1DB2 DB3DB4 DBSDB6DB7-
4,_1
00
in
01
02
03
04
PIN 20
04
05 PIN 18 _
06 PD/PGM CS
07 __
-
*
- 0
I
+5V
-
CE
WS
-
7404
_-
-
Figure 3.8b
PSEN
P23
70
Intel microprocessor
components
SeooFiguro 3.9.
P73to P40 also output to the DAClatchos.
+5V
+5,V G-D
740'7
VCC GIM)
I
P72
I
7LED
8201
73
#3 8243
LED and DAC LATCH P71
O EXPANDER
I
I
C\
P70
P63
P62
P61
P60
---- D
PS3
----D
=-f-
PS2
P20P21P22P23-
PsI
P22
P50
5r
---- D
P23
II
P17-
P20
P21
I-
P43
--- D
P42
P41
-- D
PROG
CS CHIP SELECT
:_
v
P40
.
v
-
DBO-- ADO
DBL--- AD1
DB2AD2
DB3 -AD3 8185-2
DB4'- AD4 1024 x 8 BIT
DBS -- ADS STATIC RAM
DB6
AD6
DB7- AD7
OND
VSS
CC -+SV
5U
-RD
W
-iA
ALE -ALE
CS
-GND
C81
CE2
A9
A8
-GND
-+5V
-P25
-P24
Figure 3.8c Intel microprocessor components
71
l ll
P73- ID 74LS75
P72- 2D 4 HIGH
P71- 3D FIELD DAC
P70- 4D BITS
P53- ENABLE1-2
2Q
3Q
P53 - ENABLE3-4
- B1 MSB
P63
P62-
-B2
-B3
-B4
P61P60P52-
1D 74LS75
2D 4 LOW
3D FIELD DAC
4D BITS
ENABLE 1-2
1Q -B5
2Q -B6
3Q
B LSB7
4Q 7--B8 LSB
ENABLE3-4
P52-
r
I
iD 74LS75
2D 4 HIGH
P73-
P72-
P71-
3D
MAXIMUM
Q
P70- 4D DAC BITS
ENARLE 1-2
P51- ENABLE 3-4
4Q
P1-
P73 iD 74LS75
P72- 2D 4 HIGH
P71- 3D MINIMUM
P70 4D DAC BITS
P43- ENABLE 1-2
P63P63- LD 74LS75
P62- 2D 4 LOW
-B1 MSB
-B2
1Q
-B3
-B2
3Q -B3
4Q -B4
2Q
P63'
1D 74LS75
.D 4 HIGH
I-B2
4D DAC BITS
3Q
-B3
ENABLE 1-2
4Q
-B4
TOM
1D 74LS75
P62P62- 2D 4 LOW
P61- 3D BOTIOM
-B1 MSB
2Q
D
-B5
T.-qR
Iu
P63- 1D 74LS75
P62- 2D 4 LOW
1Q1
P61- 3D MINIMUM 2Q LB5
P60- 4D DAC BITS 3Q --B6
-- B7
P42- ENABLE 1-2
4Q
B8 LSB
3-4
P42 ENABLE
1Q -B1 MSB
P43- ENABLE3-4
P73 P72P71P70P41-
1Q
3D MAXIMUM 2Q -B6
P60- 4D DAC BITS 3Q - B7
4Q -.- RR
P50- ENABLE 1-2
P50- ENABLE3-4
P60- 44D DAC BITS
P40- ENABLE1-2
P40- ENABLE3-4
P41-- ENABLE3-4
1Q
2Q
3Q
-B5
-B6
-B7
LSB
-B8
ll
Figure 3.9
DAC Latches.
the
IO expander
#3
8243
The inputs to the DAC latches are from
and the outputs
72
are to the 4 DACS.
+SV
.
HIGH BIT
LATCH,
LOW BIT LATCH
1Q 2Q 3Q 4Q 1Q 2Q 3Q 4Q
47
K1
B1 B2
3 B4 BS B6
B
VE F
47
Ka
._VREF
DAC-08BC
-ffmP
-I
-v
O.Lpf
I
-sv~
COP
+V
..
VLC
I IIo
-
C
0.01 O Olyf~~~-+f
For field and maxlmum phase current levels:
4 10KE PHASE POTS WITH WIPER ON COMPARATOR NONINVERTING INPUT
TERMINAL FOR MAXIMUMCURRENTLEVEL
1 5K FIELD POT WITH WIPER ON COMPATATOR NONINVERTING INPUT
TERMINAL FOR FIELD CURRENTLEVEL
For minimum and bottom phase current levels:
4 10K1 PHASE POTS WITH WIPER ON COMPARATOR NONINVERTING INPUT
TERMINAL FOR MINIMUM CURRENTLEVEL
4 10K
PHASE POTS WITH WIPER ON COMPATATOR INVERTING INPUT
TERMINAL FOR BOTTOMCURRENTLEVEL
Figure
3.10
voltage levels
DAC op amp networks
73
used to generate reference
+5V
FIELD
COIL
_
_
.
V
82001
2N6339
OF #1 8243
EXPANDER
I
POWER
GROUND
PROG
LEVE
OP A
.05f
CERAMIC
5t
PO
6.8
TANTALUM
POWER
GROUND
Figure 3.11
Network for sensing the field current level
74
+SV
2N633
.0800
NONINDUCTII
SENSING
RESISTANCE
URMAX
I
ERMIN
RBOT
TANTALUM .POWER
GROUND
POT
Figure 3.12a Network used for current regulation
C
75
of phases A and
+5V
20
2N63
.21i
.0800
NONINDUCTr
SENSING
RESISTANCE
CCURMA
2ZK
CCURMIN
ZKn
CCURBOT
TANTALUMPOWE
GROUND
76
POT
Figure 3.12b
IA
4
-a
a
S
0
-a a
-3
iA.rA
3-
0
m
Ca
a
-1
I:
2-4
mal
l-lkI-,
0
40
a
Mr
I
I
I:l
II
.4
4C
.4
77
PROHIBIT
--MR
7401
AANDMAX
PHASE A
I
R4
SELECT
F YDrrm
l
-l
AONDEL
"
CCURDIN
-
I >CK
7476
Q
PHASE
A
B
CCURBOT
7411
7
+5V
PROHIBIT
.
CLR
PHASE C
CANDMAX
7401
R4
SELECT CLKPUL -'
CONDEL
7476
Q
K
ACURMINBOT
ACJRBOT
>CK
1
7411
PRESET
+5V
Figure 3.12d
78
__
PHASE
C
0.14
sec PULSE
74121 #1A
+5V
(
,.
D.iAB
',
+5V
.d AS.
B
20pf
Q
Figure 3.12e
79
-5V
E POL
A
-ft
E POL B
la
-
SE POL
C
L
a0
a0
SE POL D
GROUND TERMINAL
OF CIRCUIT BOARD
-TV
UUULU
Figure 3.13 Comparators determine the sense coil voltage
polarities.
80
a
FIELD
v__
..
SUPPL
.
. COIL
MR8S
GROUND
Figure 3.14
The comparator detects the presence of state r2
81
Figure 3.15 Network determines
interrupt requirement.
82'
if
a
2 state is
an external
STATE
2
OVERDIDE4
RESI; CTION
2.31 pseo POSITIVE PULSE
74121
7432
SENSE
POL C----.
..
vcc
Al
SENSE POL A
ENABLE A 741.
DCURMAX
SENSE POL B-_
ENABLE B 7410
.+SV
3.3Ef
unOW
6ND A2
r'T/CXr
+$V
100pf
740
-
B
l
Wj-4L1
ENABLE C-j741o'0-J
zxrI
GND
Q
.
BCURMAX
SENSE POL D
,
.
ENABLED 7410
-I
I
CCURMAX
2.31
psec
POSITIVE PULSE
74121
Al
A2
VCC -+5V
3.3rf
REXT/CEXT
lO+5V
.
100Opf
+5V
B
CEXT
GND OND
MENAB
SENSE
2L-4--
-IL
Q
....
7i
!
74110
INT
Figure 3.16 Network generating the external
microcoputer
83
interrupt
to the
SOFTWARE ISSUES AND RESULTS
CHAPTER 4
1.
SimDle Test Prorams
An important part of a good design procedure for a system is
the inclusion of simple test programs used for checking or
debugging the circuitry.
Two such programs are included here.
The first one is titled D TO A SECTION TEST. This program
sends reference voltage levels to the appropriate comparator
input terminals.
This allows an information route going from the
input data switches to the input switch I/O expander to the 8039
microcomputer to the LED/DAC I/O expander to the 74LS75 DAC
latches to the DACs to the op amps to the pots to the comparator
input terminals to be easily debugged.
The second test program is titled TRANSISTOR SWITCHING TEST.
With this program any of the 5 transistor switching banks can be
repetitively switched.
A phase bank will be repetitively
switched between a specified minimum
and maximum
current level.
If the field transistor bank is tested, the field current is
brought up to the specified field current level and then the
field transistor is turned off for 44.6 milliseconds, a time
duration which allows the field current sufficient time to decay
to zero.
Then, the field transistor bank is
This program
switched on again.
allows easy debugging of the transistor switching
banks.
2
The RUN THE MOTOR Program
In the program titled RUN THE MOTOR the current level values
used at startup are replaced with a second set of values when a
button is
pressed.
Thus, since the motor's greatest current
requirement occurs at startup, the phase current levels can be
decreased once steady state motion is
achieved.
This program
will now be examined in some detail.
The initial reset state sets all the output ports to one
thereby turning on all the transistors.
The transistors are
turned off, the input switch I/O expander is enabled, and the
LED/DAC I/O and
main
program
I/O expanders are disabled.
When TO
is pressed, the field and first maximumvalues are inputted to
RAM locations on the 8039 via the input switch I/O expander.
When T1 is pressed, the first minimum and bottom values are
inputted.
Then, TO is pressed to input the second maximum
value.
Finally, T1 is pressed to input the second minimum and bottom
values.
TO is pressed to start the motor running. The LED/DAC I/O
expander is enabled and the input switch
disabled.
I/O expander is
The first set of current level values stored in the
8039 RAM are outputted from the 8039 RAM to the DAC latches via
the LED/DAC I/O expander.
Then, the LED/DAC I/O expander is
After
disabled and the main program I/O expander is enabled.
an
18 unit timer wait, the field transistor is turned on until the
field current level rises to the desired value.
A delayed check
of the field current level is made for extra certainty.
Then, an
initial position sensing is made by inputting the sense coil
voltage polarities to the main program I/O expander.
sensing information causes the phase located between
The initial
180 and 90
degrees from its equilibrium position to be activated as the
85
field transistor is turned off.
first interrupt address is
The location containing the
stored in R3, the timer is started
from zero, and the external interrupt is
enabled.
Before the
current levels are changed, when the program is waiting for the
first interrupt or is between interrupts, it will circle in a
simple loop testing for six timer overflows since the last phase
turnon and for the pressing of the T1 button.
The generation of an external interrupt will cause the
execution of the first of the program's two external interrupt
routines. The first interrupt routine turns off the old phase,
turns on the new phase, restarts the timer from zero, updates the
phase registers containing the present and next phase
information, and resets R4 to allow for another 10 restart
attempts.
Before the current levels are changed, after a new phase has
been activated, if more than 6 timer overflows occur before an
external interrupt indicating a next phase detection occurs, then
a restart occurs.
In a restart the phase transistor is
turned
off and the program is reentered earlier at the MREST location
where the 18 unit timer wait occurs
ust before the field
transistor is trned on. Ten consecutive restart attempts are
allowed.
After ten consecutive unsuccessful restart attempts the
transistors are turned off until the TO button is pressed again.
Pressing the TO button resets R4 to allow another 10 restart
attempts and causes the program to be reentered at the MREST
location.
When the T1 button is pressed, the location containing the
86
second interrupt address is stored in R3 and the next interrupt
generated will
cause the execution of the second rather than the
first interrupt routine. The instructions at the beginning of
the second interrupt routine are identical to those in the first
routine. Then, it disables the main program I/O expander and
enables the LED/DAC I/O expander.
The second set of current
level values are then moved out from the 8039 RAM to the DAC
latches replacing the first set of values.
The LED/DAC I/O
expander is disabled and the main program I/O expander is
enabled.
Finally, the address of the first interrupt routine is
stored in R3 so that all further interrupts will result in
execution of the first interrupt routine.
Between interrupts the
program circles in a simple loop testing for six
since the new phase activation.
timer overflows
If six timer overflows occur,
then the program is reentered earlier at the START2 location
where R4 is reset to allow 10 consecutive restart attempts
just
before the first set of current level values is outputted to the
DAC latches.
This program will accelerate the motor up to a maximum
of about one chop per phase relatively quickly.
speed
Although most of
the phase intervals contain only one chop, an occasional phase
has more than one so the speeds obtained are slightly less than
would be obtained by purely one chop per phase.
Because the
current rate of change across an inductance is proportional to
voltage, then at higher voltages the amount of time per chop is
less and hence the speed is greater.
Also, since higher current
levels take longer to achieve, once a current level that can
maintain a speed of one chop per phase is reached, further
87
increases in the current level increase the time per chop and
hence decrease the speed. At 20V with the current levels kept
between 1.75 and 3.15 amps, a speed of 1625 R.P.M. is obtained.
3.
Speed Control Programs
The program titled
CONSTANT
SWITCHINGDELAYallows
constant
load speed control.
A time delay is put at the start of every
interrupt routine so
that a time delay exists exists between the
detection of the new phase and the switching on of the new phase.
The 8 low bits of time delay are stored in R1 and the 8 high bits
of time delay are stored in R2.
The first interrupt routine
takes advantage of these stored timed delays by starting as
follows:
SERVE1:
DJNZ
R1,SERVE1
DJNZ R2,SERVE1
; DECREMENT THE 8 LOW BITS
OF TIME DELAY
; DECREMENTTHE 8 HIGH BITS OF TIME DELAY
The execution of a DJNZ Rr(decrement register and ump if
the contents are not zero) instruction requires 2 instruction
cycles or 2.72
microseconds.
Thus, time delays can be changed in
increments of 2.72 microseconds.
Unfortunately, the use of 2
DJNZ instructions adds 5.44 microseconds to the minimum
possible
delay since both DJNZ instructions must be passed through at
least one time during the execution of an interrupt routine.
Steady state speed decreases as time delay increases.
Measurements
of speed resulting from
the inputted constant time
delays were obtained for the unloaded motor running with a 20V
supply voltage and the phase currents kept between
1.75 and 3.15
amps over a speed range going from 17.6 to 1625 R.P.M. At speeds
88
equal to or greater than 108 R.P.M. a stroboscope was used for
measurements.
For speeds less than 108 R.P.M.visual counting
was performed with the aid of a stopwatch or a pushbutton
electronic counter.
The results are shown in Table 4.1 with
speed in R.P.M. and 1/(speed in R.P.M.) resulting
from the
inputted constant time delay in units of 2.72
microseconds(exceeding the minimumpossible 5.44 microsecond
delay caused by one pass through the 2 DJNZinstructions).
Plots of time delay in units of 2.72 microseconds versus
1/(speed in R.P.M.)are shown in Figures 4.1a-c. These plots of
delay units versus 1/speed show a very good linear fit.
Performinga least squaresfit
on the 131 data points
with a
HP33C calculator yields the linear equation:
delay in units of 2.72 microseconds = 3.190 x 10 5 (1/(speed
in
R.P.M.)) - 130.3
with an excellent
correlation
coefficient
of .99957. As
mentioned in Chapter 1 BH. Wells expected an equation relating
delay and speed of the above type to result for a step motor
whose unloaded speed versus switching angle curve was nearly
linear.
1
The program titled
VARIABLESWITCHINGDELAYruns the motor
at a fixed speed by continuously varying the time delay between
new phase detection
and new phase switching.
The 8039 timer
is
used to measure the time interval for 4 consecutive phases so as
to eliminate
measurement
individual phases.
problems
caused by differences in the
A calculation of the actual time interval for
4 consecutive phases minus the desired time interval for 4
consecutive phases is performed using 2 register arithmetic.
89
If
the result is positive, then the motor speed is too slow
delay time is decreased.
and the
If the result is negative, then the
motor speed is too fast and the delay time is increased.
If the
result is zero, then the speed is correct and the delay time is
left unchanged.
The number of phases that are to elapse between
every set of 4 consecutive phases that is used for speed
correction is fed in on the input data switches.
the maximum
At low speeds
correction rate is compatible with good speed
regulation, but at high speeds the maximum
marked fluctuations in speed to occur.
rate alleviates this problem.
correction rate causes
Decreasing the correction
This program could run the
unloaded motor with a 20V supply voltage and phase currents kept
between 1.75 and 3.15 amps over a speed range going from 100
R.P.M. to 1640 RP.M.
be employed in varying
The
program
titled
Because feedback is used, this program can
load situations.
CONSTANT SPEED VIA VARYING CURRENT runs
the motor at a fixed speed by continuously varying the phase
current levels. Theminimumphase current level is always set
equal to half the maximumlevel.
measure the time interval
The 8039 timer is used to
for 4 consecutive phases.
A
calculation of the actual time interval for 4 consecutive phases
minus the desired time interval for 4 consecutive phases is
performed using 2 register arithmetic.
positive, then the motor speed is too slow
is increased.
If the result is
and the
current
level
If the result is negative, then the motor speed is
toofast and the current level is decreased. If the result is
zero, then the speed is correct and the current level is left
90
unchanged.
The number of phases that are to elapse between every set of
4 consecutive phases that is used for speed correction is fed in
on the input data switches.
fluctuations
Table 4.2 shows the speed
around an average speed of 1565 R.P.M. resulting
in
this varying current scheme from changing the number of phases
elapsing between every set of 4 consecutive phases that is used
in speed correction.
The best speed correction occurs with 20 to
24 interspersed phases. A narrow range of updating rates yields
maximum
speed stability, and updating either more or less
frequently increases the speed fluctuations.
This program can only run the motor with average speeds
ranging from 1400 to 1710 R.P.M. The upper speed bound occurs
because the time per phase chop increases
as current
level
increases so once a speed near one chop per phase is reached
further current level increases decrease the speed. The lower
speed bound occurs because the current starts to fall to zero
very precipitously.
4.
Acceleration Profile Program
The program titled SUMMARY ACCELERATION PROFILE runs the
motor from rest to full speed while storing in the 8185-2 RAM
timer duration counts for 512 sets of the designated number of
consecutive phases. In this program the timer interrupt is used
to increment the 8 upper time bits when a time counter overflow
occurs.
transistors
After
512 sets
have
been stored in the RAM, all
are turned off so the motor stops.
Then, TOand T1
are alternately pressed to read out the timer duration counts in
91
the LEDs.
Three trials
were performed with timer counts obtained for
sets of 60 consecutive phases or 1 revolution.(The program titled
TRANSISTOR
SWITCHING
TESTcan be used to prove that 60 phases
occur per revolution
by single stepping the motor in an A-B-C-D-A
activation sequence.) In these trials
measurements were made for
the unloaded motor running at 20V supply voltage
and phase
currents kept between 1.75 and 3.15 amps. Table 4.3 shows the
number of timer counts in each of the first
each trial.
100 revolutions for
The final average speed is taken as that speed given
by averaging the timer counts ofthe last 20revolutions.
final average
speed is obtained
Half
at some point from 14 to
16
revolutions and 9/10 final average speed is obtained at some
point from 39 to 43 revolutions.
92
Table 4.1 Speed in R.P.M. and 1/(speed in R.P.M.)resulting from
the inputted constant time delays in units of 2.72 microseconds.
DELAY IN UNITS OF
SPEED IN R.P.M.
1/(SPEED IN R.P.M. )
1625
1610
1595
1580
1565
1550
1540
1530
1515
1490
1470
1455
1435
1420
1410
1390
1370
1360
1345
1325
1305
1285
1265
1250
1235
1220
1210
1200
1180
1165
1150
1140
1125
1115
1110
1090
1080
1060
1050
1035
1015
995
975
955
935
915
900
880
860
6.154 x
2.72 MICROSECONDS
0
4
6
8
10
12
14
16
20
24
28
32
36
38
40
114
48
50
52
56
60
64
68
72
76
80
811
88
96
100
104
108
112
116
120
124
128
136
140
144
152
160
168
176
184
192
200
208
216
10-4
6.211
6.270
6.329
6.390
x 10-41
x 10-4
x 10o-4
x 10-4
6.452 x 10-4
6.494 x 1o-4
6.536 x
10-4
6.601 x 10-4
6.711 x 10-4
6.803 x 10-4
6.873 x 10-4
6.969 x 10-4
7.042 x 10-4
7.092 x 10-4
7.194
x 10-4
7.299 x 10-4
7.353 x 1o-4
7.435 x 10-4
7.547 x 10-411
7.663 x 10-4
7.782 x 10-4
7.905 x
1o-4
8.000 x 108.097 x
8.197 x 1o-4
8.264 x 10
10- 4
8.333 x 10-4
8.475 x 10-4
8.584 x
8.696
x 10-4
10-4
8.772 x
8.889 x
10-11
x .0-4
10-4
10-4
9.091 x 10o119.174 x 10-4
10- 11
9.259 x 10-3
9.434 x 10-4
10-3
10-4
8.969
93
9.524
x
9.662
9.852
1.005
1.026
1.047
1.070
1.093
1.111
1.136
1.163
x
x 10-3
10-31
x 1 o-311
x 10x
x lo-3
x
x
x
x
DELAY IN UNITS OF
2.72 MICROSECONDS
224
232
240
248
256
264
272
280
288
304
312
320
328
336
344
360
364
368
372
376
384
400
416
432
448
480
512
544
576
608
640
704
768
800
832
864
SPEED IN R.P.M.
1/(SPEED
1.190
1.205
1.227
1.250
840
830
815
800
785
IN R.P.M.)
x 10-3
x 10-3
x 10-3
x 10-3
1.274 x 10-3
770
1.299 x 10-3
760
750
740
720
705
668
655
646
646
640
630
619
617
610
600
583
575
554
552
526
514
483
470
458
432
405
1.316 x 10-3
1.333 x 10-3
1.351 x 10-3
1.389 x 10-3
1.418 x 10-3
1.497 x
10- 3
1.527 x 10-3
1.548 x
1.548 x 10-3
1.563 x 10'3
lo-3
10-3
1.587 x
1.616 x 10 3
1.621 x 10o-3
1.639 x 10-3
1.667 x 10-3
1.715 x 10-3
1.739 x 10-3
1.805
x 1o-3
1.812 x 10-3
1.901 x 10-3
1.946 x 10-3
2.070 x
2.128 x
10o-3
2.183 x 10-3
2.315 x 10-3
2.469 x 10-3
2.667 x 10o-3
2.778 x 10-3
375
360
335
2.890 x 10-3
2.985 x 10-3
896
960
326
3.067 x 10-3
1024
288
1088
1152
1216
1280
270
256
244
1408
1536
1664
1792
1920
2048
2304
2432
346
3.279 x 10-3
3.472 x 10-3
3.704 x 10o-3
10-3
3.906 x 10-3
4.098 x 10-3
4.237 x 10-3
4.608 x 10-3
4.926 x 10-3
5.263 x 10-3
5.618 x 10-3
5.988 x 1 o-3
305
236
217
203
190
178
167
6.329 x 10-3
158
7.042 x 1o-3
7.407 x 10-3
142
135
94
DELAY IN UNITS OF
2.72 MICROSECONDS
2560
2816
3072
3328
SPEED IN R.P.M.
1/(SPEED IN R.P.M.)
130
119
108
100
7.692
8.403
9.259
1.000
x
x
x
x
10-3
10 - 3
10-3
10-2
3584
91.6
3840
84.3
1.186 x 10- 2
4096
4352
4608
77.8
72.8
67.8
1.285 x 10-2
1.374 x 10- 2
1.475 x 10-2
4864
64.1
5120
60.9
5376
57.8
1.730 x 10-2
5632
55.4
1.805 x 10- 2
5888
52.1
1.919 x 10-2
6144
6400
6656
7168
7680
49.7
48.0
46.2
42.8
40.6
2.012
2.083
2.165
2.336
2.463
8192
38.2
2.618 x 10 - 2
8704
35.8
2.793 x 10-2
9216
9728
10240
11264
34.2
32.1
30.9
28.2
2.924
3.115
3.236
3.546
12288
13312
14336
15360
16384
17408
1.092 x 10-2
1.560 x 10-2
1.642 x 10- 2
x
x
x
x
x
10-2
10- 2
10-2
10-2
10-2
x
x
x
x
10 -2
10-2
10 - 2
10-2
25.8
3.876 x 10-2
23.7
23.1
20.5
19.3
17.6
4.219 x
4.329 x
4.878 x
5.181 x
5.682 x
10-2
10 -2
10- 2
10 - 2
10-2
95
o
~__9_._99\
9
q
2__
-
...
..
11
.
T
0
S
liiN;
0
rL
eN
--
-
4
0M4
39
8
M,
I.
0
8
.-.ai
x
..
~._
....
....
_..._
m
'...
n
.:
i :
%i~~~~~~~~~~~~~~~'
0-
K-.---rU'
o
!I.'
----
~~ ~ ~ ~
..
* G.M
~1&
S
- O·
0
P
*..........-
---
~~~
~ ~~
~ ~~
·..
i
0o7·
LU
i.
~ ~~
~ ~~
~ ~~
.
--
,
-
-
(3
1.2
11
16
--
~~~
o:
·
S;g
,,
O~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
,
96
Pa..
~ ~~
~ ~~
~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
o
0
0
tr .
t
~o
Of
-
0
o
...
*
0
9
..
o)
?
?
*.....
~~~ ~~ ~ ~ ~
*
00
o
r·-----
O
'
o8 0
o
8
..
--
*
..
*
.
..
0
8
0
?
..
P
~·
IU
... ·
~~~~~Lt-~~~~~~~~~~~
~
.. .
a..i-
--
-
..
-4--
.
- I I~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
I
- -
....
"'~
'-.........
-.
0~
f~t
~
.....
. ........................-- ....- ....--....
w~~~~~~k
)Cr--·---~~~~~~~~~~~~-.~
~ ~ 144~.0q -
~~~
..
: -:
·
0.4·
i
.
8:
.
.
-
S
·
o
9
8~~~~~:- .
..
P -.
.
'
.
.
- ......
_
o
r
a-
i.
:
'
.
.- ...
-
.
. L
.........-
.
.'-;..*
;'.
.
.
- ''.
.
·-
xm
=x
·
."
...........
"
'"~
-.
~ ~ ~~~~~~~~~~~
--
..
I
S
~~....
:...
Z.
a1
I
,jw
I.
* I
1I
0
2
I
: 14
Jr
U-
0W
.
*
to
F
P
:
:
4,
=-
.
.
I
W
97
:
II
4
1
a 4.
00a
?~~~~o
~o
~,
0a
0
0
0
O
o
oo
.. -0~
.
*~~~~~
a
o0
o09
o
8.
.- ..4-.--..
...
.....
.
...
.
.
U...
.
. ...
.
: ie':
!··
-.
_....
"
.
.
.
. ....
m ..
-
";" ''
:"'"'_.
: 7_1
- ·. ·- ~~~~~~~~~~~~~~~~
..P4..
~~~~~~~ ~ ~ ~ ~ ~ ~ ~ ~ ~
·
~ ~ ~4
IU~~~~~~~"'
a~..
~ '!: .
0
·
~ ~~~
.-.
._ ___e
..
'~
~..
~ :'"
0-h~
....
~ .~
.
~
~
~
q
.:
-
4
:
_·...·
~
" ·
...
sam
nj:............
N
.O
.
....-..
....:_:
.u
.
.
.
~
~
"
''
:.
~~ ~ ~ ~ ~
.
.
.
:
-
.
:'-~
::~i-'
.
...
.....
98
='
c
-
'
.
.
.,
.................................
q
~~~~~~~~~~~~~."..-.4,
.
r
:
"!.·
......
m':......
N
N~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
~
t
·8
.......
N
~~
:
'
'-i
.
.
--
~ ~~~C
'1
.....
sa
~
~ . ~~~~~~~~h
'
.
' ::'
1.
£
U~~~~~~~~~~~~~~~~~~~~~.
.:
i. .
,
.
0
it
___, _
4
.
i~~~~~~~~~~~~~~~~~~~~~
*
.
2.
i~~~~
-'
0
0
.
~..
1.
i
00
0
C
~1
..
,
'
!:
-:'-
.......... :P
:
o
oa
0
'
'.:':::.....
' ''"
;'
pt
.
*
Table 42
The speed fluctuations
around an average speed of 1565
R.P.M. observed for differing numbers
of phases elapsing between
every set of 4 consecutive phases used in speed correction in the
program
titled
ELAPSED PHASES
1
2
24
8
16
20
24
28
32
64
128
256
CONSTANT SPEED VIA VARYING CURRENT
MINIMUM SPEED
MAXIMUM SPEED
1310
1280
1300
1300
1520
1540
1540
1480
1500
1460
1360
1280
1910
1910
1880
1840
1610
1590
1590
1550
1630
1640
1720
1720
99
Table 4.3 Three acceleration profiles showing the number of
timer counts for each of the first 100 revolutions as the motor
is accelerated from rest to full speed
REVOLUTION I
TRIAL #1
TRIAL
1
2
3
4
3943
1745
3031
4098
3545
2040
1511
2057
2936
4067
4011
3406
5
2969
3679
3529
6
3121
2849
2894
7
2800
3167
2359
8
2611
3026
2286
2
TRIAL #3
9
2315
2437
2093
10
11
12
13
14
15
16
17
18
1982
1970
1837
1733
1657
1562
1503
1450
1399
2168
2145
1962
2107
1857
1767
1582
1511
1448
1915
1793
1713
1711
1764
1510
1413
1384
1340
19
1351
1401
1387
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
1317
1264
1249
1214
1174
1170
1124
1114
1085
1068
1069
1035
1018
999
1000
980
962
957
946
936
927
934
901
930
889
895
893
881
876
868
1362
1315
1279
1245
1219
1193
1173
1135
1109
1100
1071
1063
1045
1089
1012
1010
984
963
966
948
936
936
939
909
910
909
895
876
896
865
1267
1233
1199
1196
1131
1127
1102
1087
1066
1065
1015
1016
1010
982
979
966
954
936
943
926
916
910
913
895
888
934
938
867
872
853
100
REVOLUTION
TRIAL #1
TRIAL #2
TRIAL
50
859
876
51
871
881
852
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
862
859
858
844
846
849
952
824
831
830
830
832
870
873
823
815
819
819
819
821
816
817
819
814
815
817
867
814
815
813
813
819
862
818
812
870
815
872
815
819
814
814
816
815
869
872
815
815
821
869
857
853
868
857
854
856
858
836
857
833
858
855
900
847
900
831
910
878
840
822
829
831
830
821
821
822
819
878
823
824
877
824
825
823
879
827
879
828
871
826
827
822
820
820
820
818
819
987
AVERAGE
LAST
857
830
856
831
845
836
833
833
877
891
825
877
822
820
819
818
818
819
811
820
868
814
814
808
822
812
868
815
815
813
813
813
813
815
922
817
812
816
925
815
830
823
814
822
830
882
817
876
879
829.0
842.0
837.4
857
20 REVOLUTIONS
101
3
TRIAL #1
REV.
TO ACHIEVE
1/2 FINAL SPEED
REV. TO ACHIEVE
9/10 FINAL SPEED
TRIAL #2
TRIAL
14
16
15
42
43
39
102
#3
.
t- . - .
.
TTO- 'T M-4R/PIT-41
T A SFCTTON TEST
ltF-:
..J
.... ...
;If'F TI
MAF:RO
;F'
INE
T ,- .
FIER Rt .
Fi
F; THF 4
9
1
i,...
:
14
i1.5
A
17
1·,
;
;
19
'0
?4
:5
27
2,y
n
FK'I:
iifi7
:-¢}'.D
(F
h.OF i-,:
T,,I,,
iTrTAL T'i
:
Y.RST:
1; I,5A
MV NRINCRNT T THE
OlMPARATi;R
iNPUT TERMINAL, IMM,; ;
i PAMP FF.SETS
-NPI OTHERNrf NTFAr
ti fi-ii
i wfin-.
I ?RRFS?iNl
;TRO :ANr
MV
H
111t
i
fli Alt
CORE'.';
PN
, Tr 10f N, AT
THF
''i MPARATOiR
T~NP!T
TERMINAL
ONRAIIT
.
fS..|jI R.T.,rTCW,1
TC MPSTOF
1~tA.'i
,
"'
: THF
i
TFP ...CSTOF DATA INPUT
..
Tt]
'
4"'Tl
IF!t
i Wl_
t;INTCATr TE VA.E
TO E APFPI.
rI Tr5 THF Ar !fTHiP7AS; TSE MST
'
S.,NIFICANT IT H'AN P,, A TF
CA:T
'',
STNIr
" T
"r
; . = 1 FNAtLES THE LATCH ADpRF'',.' TfIE
T'
4 itNH TT-OF THE
.AC,
FTEi r.
P'.."
=1nriSh
FNAlC.Ei THEFLATCH
ADpfRESSINi3T'F.
H
IL RI'" ii
rF
THF
FT'.':ls-5
FIEL D~C.
: PS!=
! FNA.FS THE LATCH ADRFEf.;SSJNG
THE 4 HIGiHBiTS - F THi
' ·MAX
IIflM (TiP) irlC.
P0 = i FNARB
F.t THE .CTF: ArlDFS.INCTJ HE 4 1fiW BTC,
THF
; MAXfU.MITP) nA.,
: P43 = 1 FNAPBLES
THF LATCH AEIPRE'S;-TNGl
THF 'i ;-:
iFT,!* TITMUM(H
,LE)
DAC,
;P4. =
PI.APBLES
THE I ATC;4AnDRESSINGTlE
T . -F : MITNIliM(Mt.E)
OAC,
P41 =
ENABLESTHE LI
ATH AREStFR;F;i T$HF4 Li-i nT,-,
rF 'HE
BO)TTOM
5A .
: P, =
ENAB-tLES
THfELIA.TCADDr.E.S-,:
INGi THE 4 K!l
T, f TT
E
ITTOMnDAC,
: Y':TFMRFSET
,iMP RFFFT
i;
'{04 9?
0,009 ;3-2,0
: ¥R
.
0f9; :7
o OTTOM
TE
f'!
;7
fRRi :.
.-,:r FXTTNT: FETFRNAl.
;
TNTFRIPT
000:-?:]5.'
0l07
0,:0¥) '"9'"
'.'PARA'.
DAl. 0r; .CONVFRERS.TT,
WT
i,1 POTS C;ET TO aPP,! 415 'F
I'E O-fAP
7
'I 17
JTPIUTVOfl
TO
T
T THE i'*lMP'r
".inr ".tilTr
TrT
i
fRE
F, .
I
CiPUTOT
HCF
"IOUt ~
LIIR S.'i
'.-.
s;F[E
IN THE S:
' CITIT NMBE AIPpt
' TA
THF
H rV;, St~:Utf
rN i rF'lT
A
r.
4
I
· TES.TnAC
THTS PROGiRAM
TE.ST'STHF RfFFRENFC IT1,1
PC[
N NF
T Ti TE
i NVERTIiNGTINPiT `TE`MTNAiL"F TI,
F EL D, 4 M,
TP).
('11
; 4 MfTNIsMIMftM^i:LE)
COMPARATORS
,.
Nr i THF NONTNVERTING
T-rm ' IN
ALS
.
0lQ
0- 04n9,~
PA E
:ifRCF S:TTENT
4
?.I
,'.f.TT
.....................
'
40
REFTFR
41
4o
OlRf 7
42 TIMINT:
TIMR TNTRRIIPT
44
PT I NTT
4.5
TR
4A
t7 RESET: MOVA,toO
Iq
Fil'T P',]'
TiBL
A
-oFROO.,r
MAtN PRir
,.i
1 A :
49 HFR9:
nP, TI P,
FT
,'
T
i
.i! ' T1RN FF THE T.-NITc;ETOx,
i
- ......................
-'-r'90
,SArNFERR, \;
N ENA2i' THF NPiT Tf ,I
1 ,.'lI AN
91
Mriv[ AP7
Ol
) 4,¢
J2 .
('"~r,
%,' Ol
94.
~~~~~~~~~~.
.
°THE
RUf *..~,
0?1 ,
,P
. T:- T M
T-4/
..ST-41
T'h 'S,:'.TTItINT;T
MA ,rA
] a,
R:tBI.
ER
,
A'AGEI.E
v1.Oi
n T
!.iC
rp,
I
0!0!
!
(;rt
AP
FlItRiF STiTEMFNT
i-LlkeF
5
57
MovrIn4,
PI
MiiV R7, .
MAV , 4(,
';CB14
~iii 7~(F1:
A,
0(')!8
[AF
.T4n
.F
IFn
O0.1
-Qit.o.
A
FE
1n
f:'
APIP
.ET:
E E
TINPUT
ilITCH
10 KfXP~Es;
FNABIETHFILFD!ACI~
T 0 cFxrfDNr
MOVOP7,t
.
,4
AF5
MNOV
A4,R
MOV P5
MOVA,R7
Mnvo P A
'.S
siV
HR.
HFR
.l
KM
JMP HERc
~JD
..
71
;71
..-..
:,iT
'ND
MOV ,
Cn!E
00t
ni4!F=:l¥.
O0l?
00) s
TT,
NT -fl :
[DIS
:
RESET
F'E- 0009
Ni FtRRflRS
: R'4ALETHE LED/rrFC 0 EFPNDER
ANDENBRI.ETE NPUTfSWITh (0 EX-NrPAUR
SYSRT O)i
TIMTNT 0007
A."84 :F :T,1njN. MAC Efql
XR-F TITTl
'ST,-T
M3-421lPT-41
MA.
TERT
WrT
T-41.N3
,
MTRAMIASTOR
EAS FMBA.SR, .0
'ONf: Nr.!
'"RINSTi i
' WI4Tl iTT'
PPGE
,T1I
1
RCF TFTMFNT
!.S;OIF.
ITE
.?
.
4
·
A
i7
8
it
12
3:3
14
15
16,
17
18
tg
190
7:
;
2
:*~
:4
25
2L6
27
'28
.29q
; TRANSISTORSWITCNJING,
TEST
;'THIS PRXO'R.AM
TESTRTRANSISTORSWITCHI.TNG
WITH 11J!RRET REGUl.ATION
STHE PROHIB[T ,UTPIT IS ZIERO.
3;FRMi THE COMPiRATORS, HT
FIRST THE APPROPRTATEVAIS
ARE PLACEDON THE LATCHESAg~tPESSiNi3
TINDI-ATE
THE TOP SET OF DATA TNPIlT SITf.HES
; , ) ON P73 T P,
I-E! T TE FFLO DAC WITHP73'A" rTiet'
; THF VALUTS KE APPT
: ANl P60 AS THE
TS
, LIKEWISE, ON P3 TO P40,
1 THE BOTTtM r.FT
; i:iF DCiTATA
INST ?jlTCFDES, TINDC:ATET UAUEETO BE PPED
n
S,
THE A ADDRE,3SINGTHF MXIMtI VAILUE(TSP)COMlPARATR.
; PRES TO,
2, ) RN P7.3 TO PO INDICATE THE VALUETO E APPLTETJ
TO THE PDAC
; PADDRESSING
THE MINIMUtl VAL!JE(MIDDLE)CMPARATOR., N P53 TO
ED TO THE DACFRES
4NGTHE
P40 INDICATE TE VAL.
O BE P
; ROTTOMCOMPARAT
ORS
PRESS Ti,
;3. I TEN. E.-.ECT THE TRANS.R.TORBANK'TO BE TESTED,
$A5 A,
; P73 =
TTIS
: P72
.- == 11 TESTS
7FTS PHASE
PR4SEB,
P71 = I TESTS PHASEC,
P70 = I TESTS PHASF D.
ECTED MINIMUMAND
: PHASEC IURRENTS
ARE SWITCHED FTWEN THE SED
; AXIMI.'MVALUES,
IF
I N'
N EF
THE ABOVE ARE IWIfFNJN,THE FIEL IS TESTD, AFTR
I REACHINGTHE .ELECTEl FIELD VAJ
1E, THE FIELrD nfAN.ST[OR
RS
TlRNE
OFF FOR ABOUT44,6 MILLISECONDS,
PRE
TO
; 4. ) TO SE ECT A NEWTRANS
iSTOR BANKMERE.Y CHANGE THE
; VALtUE
1F
THE P7 SWITCHES.
:31
ORG 0
? SYSRST: ' SYSTEM RFSFT
.P RET
3..2
,
.34
;5
ORG'3
.. EYTTNT: FYTFRNAL NTERRUPT
o0S I
RFTR
38
d000l
·
O00 f)0409
{X03:
)O.Rt5.37
04 3
dhO07
,
r;07.35
0008 9?.
i)0009?.3.:0
....
. ,
.
&')f!P.
:9
s4
ORi 7
41 T!MINT: TIMFR NTERRUPT
4?
DS
TNTT
4.
R.TR
44
4¢,5 S.!F3T:MOn., ,nH
4A
47
!R1
A.En,
iFF H
MAIN
1OEXP'ANDER
O!
f. PA, TI!RN
f!TilPI ,A
THE TRANSISTFR
TR. :
ARi.
P
THE
; EXPANER
.
AND ENABLETHE iNPUliTSW
4:3
rfOOlD?0ln
0,
)F
-:'nF
t
00lti
;F
0012
OCF
..1. .
01t4 ADr
49 MATN:
JNTO MAIN
(0)F
HEREt: 'T
WRFI
AIT FOR T
91
Mntvr A.P7; MfiVTIN T
Mit~V
R4,4AE :OF Ti FIF
?
9
."
MfIV iPA
: MO-VFTN TI'F
D
5¢
!iV R5.a : F ,.-EFTiL
1in
TO BE PRESSED
4 HI,H BITS
H
i. fl:iVAiL
4
nTit
DtA. VJAt.
.!I'.D.I
0
.ATCH
[.:PANER,
TST-_T M.-,-48/IIp!-41
MACtRO
ASEMR.I.ER, V3,0
TRAN.SISTO SWTTTSiNW.
TFT
!.1
n.I
R
nn
l1
0¥17
AF
00!. 461B
.5,
OF
A8
OF
A9
AA
2340
F,9
if,3ift.
0 3' ..
.f
0,077 Fn
40C
Ar
FF
FF
300
Co
3F
041
,0o?
004-2
!.INE
MOIR.rESTAT FNT
MnOVD
A,P.
k*
;MOVE
IN THE 4 HIH BITS
VlMr.
R6.A
nFTHE MXIMM AC VAL.L
r5o7
mOVTD P4: MO-E iNTHE 4 LOW.BITS
[13C VA!.UE
OF THE MAXIMUM
MOV R7,A
5
.59HERE2: ,JNTIHFRE2
AO iFRE3: JT! 4Fj
'WAITFO T TO
r
E PRESSEE
61
MIOVD
A,P7
MVE IN THE 4 HIGH BITS
6-2)
MI2 RA:
OC T
MINIMUM AC VALUE
A.2
MO1.TA,P6; MV
TN THE 4 LOW BITS
64
MV Rt A
OF THE MINI.MUM
DACVALU
65
MOV AIP5
MOVEIN THE 4 HTH BITS
A
MOV R2,J
..
OF THE BOTTOM AC vAILUE
A7
Mt'rl
A,P4: MOVEIN THE 4 LOW BITS
-9
7
.
MOV R3..,4
OF THE BOTTOMDC VALLE
69
MV
O AF,40H; DISABLF THE INPUT SWITCH 10 EXPA'DER
7n
OLTL P A4 'AND
.
ENA..E THE Lt/DAC Ti EXPANDER
71
MOV A ,OCH. DISA-L TE 2 MAXTNMPAC LATCRES
7?
iOVD P,
: ANO ENABLE TF 2 FIT.D OA.I. ATCHES
73
MOVASOOH
PDISABLE
THE 2 MINIMUMANP 2 BOTTArM
LATCHES
74
MOj.DP4,A
75
MOV AR4; MOVE THE 4 HIGH BITS
76
MfnlvP7 A , OUT TOTHE FIELD D C
77
MOVAR5
MOVit THF 4 .iW BITS
73
MnOVP6, A
OT TO THE FIELD DAC
79
MOW A, ,H;
DISABIE THE 2 FIELD 1D3 LATCHES
P)
MOV1P,A
AND .NA.LE T
2 MATM
.AX
TCHES
RI
MOVA,RAf
MOVETHE 4 HIGH BITS
82
MOV
P7,
OUT TO THE MAX
VALIE
8.
MOV A.R7
MOVETHE 4 LOWBITS
834
MOVDP.
I'T TO THE MAXlIMUM
VALUEDAC4
8M5nV
A,# OH
DISABL.ETHE 2 MAXIMlUIVALUE F.C LIATFtHE
86
MOV13 5, A
°7
NOV An ,tO.CH ENALE TrE
MINTIIM VALUE AC LATCHES
.
IOu13P4, A
r
mOVA.RO
M.,E THE 4 HIGH BITS
90
MOVD P7.4: OUT TO THE MITNIMM VAIJ.eDAOC
9
nV A,1
: MSVE THF 4 lOW BITS
9?
NVO P',A
OUT TO THE MINIMIUIM
VALUE DAC
..
5
5A6
,MLUM.'
9w
0045 3C
FA
0047
F
004R
'04'9
RF
13
00414
13040
.OF
. .
i]t 4
"059
0110FR
PAi;,
MOV A,4#401:HDI-ALE THE 2 MINIMUM
.
.,,
lATS
MO4
V1DP4,A ;
E TIF
TAND
HNA8
2 BTTO1M .A IAT ES
PNOVAR?: MrYVFTHE 4 HTIGHBITS
9MOV P7.A
A O!T TO TH
T BTTOM OAi:
97
MOV AR,P
MOVE THE 4 .OW RIT
98
nmOVIP6.A; 1OUTTR THE BOTTOM DnC1
99
N1OVA,~(
0H:
DP.SAB
.E THE ? FTTOM B40AL.ATCHFS
no
nunOVP4,A
1I1 HERE4: .NTO HERE4
02 HFERES: ,!TC0
HERE5 : WAIT FIORTO TO RE PRESSEJ:I
!0 MnOV
A,'ROH
R
DISABLE THE LE/
F AC TIn XPANnR
104 rITI. P1A
AND ENAFLE THE TNPUTSWITCH TIOEXPANNIER
105 SELECT:
.
MOV1A,P7
10A
.JB3 AONLY
107
J2 FtNt
!Y
.JRt CONLY
10s
109
.JBO
1[ ,NIV.Y
10A
C'rI,-?T
r"',"'
'Mff:-4,.P': T-4! MlCR1
,n
:F.Eml,1ER, V:.
' T'.vn
3 i,
;T-li
"'r-,-.
TBJI
T'T
! TNF
OI.!RtcESTTE ENT
I:
14
iF
i 1 F FNF:
IttA
39
;:-.i
fA
fF
117
iMOIJ
A,OCO : NF. F: TWE MAiN PROF;RM Tfl ErPANDER
.OiTi P2,A
mnv ,tl0w
TtiRN iqN
TE FELD TRANtSf!TOAR
IsT3 2P.A A
" rp;:iplF
.
THF INITIA Vfl
11 CMAN.
LF
MOVn
lP A P:
fNFCK FIELD CUiFRRENT
EVEL
M;.I 1,A
MO A,,V
P
I:NFTRM WITH A [RYFDl fYLECK
ANI..
Ah'
I..'O FftF
FT
t
17
59
MfOVA.,i:fH : T![RN FF TE FiTF r TRANISTTOR
OIJT..
PI iA : N
tABI.ETHE NITIrT VE
VtJtl.I r F;PND,-R
ltm P, A
D;RA-!_ETHE MAIN FPROFRAM
iO EfXPANDER
CiFLR
A : WAIT :--rR ARlt1T 44,.6 MILLISEC'NDS'
MCVT,A
$TqT T
MOVRI,~4:
N1UMFII
VESFl S. RFFOR
F
.... i. R O]FTmE
) ' .............
TE FTELD T
t I
I'5 FTFF:
ON AGAIN
JTF MFiREF
I 0
,iMP WAIT
1 I MfRNF: .JNZ R I ,WAIT
STIir TNT
.,IMP'SIECT
-34
MOVP
A, PIN
OIUTLP ,A
Tr!.RN,,
ON P
-AA
JMP SELEFT
14
MO ARIN
141£
T!RN N P~:.
B
:A
;3
OO70
,04.
,-,,-,
Fr97
r454
,07R
C'.0t7
nr74
C)';4
-t{,;',7
1344
t(f]:r
i](]o 0454
!47 rNY:
MOVA,.34H
ItTL P,1
'
.,IMPSEL.ECT
Of).
o;T,
T
',35!,,24
149
MOVAI,
sI
.3i
TLSP1.4
,:MPSiECT
153
t 4';
L ~(].
1,4d
TRI!NF
TURN
IiN
PiA
tiA-- Pr
END
IISR S4,1q. .s
if
,,:m
c,
,.v
-.-
4 .
-O)54
,F.,F
E
,r:.A, Fr'M
Y I',..
YIMPI
rFT,
.li
l
.
.....
L
:
if01i?
YR'T- 0,^i-ts. -.
NA.j
14F1':: 001
TiMI,
TTIfNT
-RR,i,.
1 i7
,
.07 ..
0007
h-p'T
FXTINT
O'C'fO
p..
,
-.,
,r'?
~4,
U.F{. -
0074
()('}
FiFr
II
I
!~~
,:
..
AA
iFf'
iLfr
.
.
0s,.,k
OO
.
R'MIIi~F
!;39
,-,,-
2;-~
0t
--",,j,3.,
3l-
AM4: :F!:R
:FJ:ST?Rf
NIarf r!Rl~t
!!FR115v ETTh1('-ijN
TE ,MlITn'I'
TftiY
Ae*M4)R
oT?7';R2iINAi~.
TT7IiRF(`RItNT-
T:.$1-T T Mf:F-4/!fFT-4!
o tN TIlF ITtR
rF:
O. I
MAlRID
.MRi, V3,Cf
I TE
RFl!
PAGE
f
,RfE
,TATFMFNT
R,,jN
THF MirTl
THE F.n
TRS-TOR
iS TURNED nINANl THF F
r CURRENT
R :i'.Nl
OWFf Ti RTSF UNTIr
, .rI
tT .. .iF--,
"CTFRF
. ,.
: FTr[it nDA,vM ieF
FETf IN ONTIE
F T!NJT DfATASWITTCHFS A PF.rTART
1
Al.'
iiR.
FFT FiI. :,S,-I
IRRENTT RE3!!t
THE
ATTIN
'ALF"
: ICiPRENTWItL. FE IFPT BETWFF MXTf!M AND MINIMPMiLVELS DFETFRtIND
· BY THE MAXIMUM
AND MTNIMUM
FAif VAI IFS FEnD N!3
-FE ltf
'NPT T
: PRCRAM T
:
'7'
4
.,
7
TNITTALLY
T.TR An
MTNIMYiM
,i.iM REP
T TTt RTEs.
t'fIIT~R
4Nf1PP~.~
REiN$
TAR
STRTTNW'
PRESSIN3
THECE
T- THETnI Ibt4,-,
9 THF
WI
1JTT1IN
WI1
NA
M XINMitUn
MT
.UANll
P.F
'?.
.I:
EVnF.S WITH A ECrr.r
n -'ETOF MXIMUM ANDMINIM!IMrASE
LEVEL
S
TiJ AXTM'llM
Ii RRFhFNT
REF.ITRFMFNTOF T
MTCIR .:C.Ir AT
12
;
'TART!P,
IT ttLV'.
rIESTRA..E TO rIEEAS: P
F
.ErE.RENT AnNI:F
1tr3
·;TEADYSTATE MOITION
HA. BEiENACHIEVED. EXTERNA
L !NERRT
T
T
14
: NDTTCTEDEFTEF
IOTN F tHE NEXT PHASE II
F TRIIC-GEREDY 7FiRfl
,~c:'
..
~ilC 'DcN':'c
_m-,_
C NAUFrdRM i''ING
?
CEF,"
'2
.. ,.... :F: ,rNiRiF"'"FRO!M NEGATIV
Tn
,:T Tt!,
V,,.
lAk
; PrILARITY,
7
' Xf:TOiRIJN THEMOTOR:
7
?o
'
rI ) ON P7 T P,
THE TOP ET OF "^A
.
i.F.
,
Tt
4;,..TE
19
:THE FTF'IE
IfN: ",AVA
. W-tH 73 A.;STHE 'MS AN; 60 A'_'.:;
THA
E i
. - "":
20I
: Tl P40, THE BORTTifMf
SET OF DATA IttNPiUT NITTi
HESi TNfrTi
f'TE T E FRST
T
VALE TO B APE
T:-T
'f
rif - r'
1
MtMi VALUEt[-p
. OMRF'RATOR5;WiTH P3 AS THE M; N D4 1 AS THE L....
J: "
F2RFRS:
Til,
24
2) ON
i P73 TO P0 INDITATE THE FIRST AL.UIT RF PPL ErtTO THE
DA ; A DRESSTNO THE MINIMUMVAIlLE(MIDE)
.iMPArATORS,N P34' TO
2fA
;
P4i TrII.TATFTHE FIS:T VALUETr BE APPt TFDLTO THE
H nF: ADDrE.SI,
"7
; THECBTTOM IMPARATORS,
.
: Rq:lltiF
:
'9
?, ) lNJFP TO P40 iNDIECAT TUE SF'NrI MAV!tUMViLE.,
:
;
On
:29
.r
PRESS T,
4,)
NP
T P
TNDTCATETHF SF:OND MINIM!IM
P4 T'4fi'ATT- THF .OP N PiTTOMVAL!.
PREcS TI,
4 5 PRFS; TO Tn -TART THEFMOTORWTH THE FTRST T
iES
FT
R'.'
,
TtTITO OEPIAr THE FTIRSTST OiFVAI
: . } 'REPLC
SET,
'
:*
::5
..
-i
·
'
.
37
N-"
TO
T
F V
V'A IES
TH THE SECOND
i.i. fC)
79 YS,RT:
0S00 04) B
tUE.
:YSTFMRE'F..T
,Jp RESET
4
41
.tld'7 '
~,~f}
n
Li
*1,7,,
v,'
i,F
,:_ .T
' FRTRETR
47
43
44 TINT:
-':'~
ORR,:
i
c
TFRN.AI
MOVA
R TiTF
'.
PRRUiPT
TO THE XTCRNLTNTERRUPT
RUT!T[N
,9
'iIST;iT
.'i,
rdTA
: ......
.3iATMr:
.2
;FR
,
,'
iTIMR 'C TFIRPT
r
-
HO'.!;E
LO2TI.[.':LN
I.fT-tiI
t ,-4O8rfPT-4it M-rpM A4SKEBLER, ,.
O
PAGE
2
RIN THF MOTR
OURCESTATEMENT
!ITNF
3A
0('011
0015
006 AO
AO
OtA
OO!I
18
0019
((l0if
AO
4n
OfF
0022 !8
0024
On
AlO
nn004
f£2 '18
i0
.>nSF
0?.C
002T)
OOF
00?F On
AO
i^{)2-
fM}.n.
flOnr:
18
00"A Onn
0049
no<^S iOF:
tt^>,7
18
()04(
OF
fh417
0,045
Oi342
.74
fOf}4:aAIS
i;.lh4a !8
sfx4= OX
TUlRNOFF THE TRANSISTOR, ENA4B.ETHE IF'.T S.4ITH
55 RESET: MOVA,tR0.;
Ol.ITLP,A
S';ITC TO EXPANDER,ANO DISABLE THE LE fLDAC TrI EXPANDER
56
.57
,pm P2FA . nISABL.E TE
AJINPRORAM O ExPANDER
58 HERE!: JNTO HERE.
I
WAIT FR T TO BE PRESSED
.59 HERE2: JTO HERE:
MN R .20H
60
MOVDA,P7 ; M
T
4 HIGH BITS OF THE
61
.iJV@Ro,A i FID VALUETO MEMORYLOCATION20H
A2
INC RO
63
MOVI A,P6A MOVETl. 4 LOWBITS OF THE
MOV .@MR,
A
FIELD VAULEVALUETO DATAMEMORY
LOCATIfON.T
21H
65
INC RO
66
A,7
MVi AP.5 ; MOVE TE 4 HH
BTS OF THE FIRST
UOV.RWA
4; MAXXiMHM
VALUETO DATA EMORYLOCATION22
A9
M VD
70
P4: MOVETHE 4 LOWBITS OF THE FIRST
i)V PO, A ' MAXIMMVUALUE
TO DATAMEMORY
71
LOCATITN 2.37 I'ERE3: .NT1 HERE3
73 HERF4: JTI HERE4 ; WAIT FOR Tt TO BE PRE'.&ED
74
INC:RO
WVD A,P7
MOVETHE 4 HIGH R!BTSOF THE FIRST
759
MOVNO, A ; MINIMUMVALUETO TA MEMORY
LOCATIONl24H
76
INC RO
7A
MOVDAP6
MOVETHE 4 LOWBIT; F THE FR;T
79
.O3V 9R0,4
; MINIMUMVA.LUETO :gATAMEMORY
LOCATION24
INC RO
SO
70
MOVD A,PS ; MO
IF THE 4 HIGH ITS nF THE FIRST
81
MNV R0,4A
8'2
BOTT1 VAL.E TO DATA MEMORY
LOCATION2H:
INC:RO
84
nMOvn
AP4
MOVE THE 4 L.OW ITS OF THE FIRST
M1OVROA
BOTTOMVALU;E
TO DATA MEMRY LIOCATION.27
o HERE5: JNTO HER..
87 HEREA: .ITO HE6
WAIT FOR TO TO E PRE.SSE
INC PO
MnV APS
MOVETHE 4 HIGH BITS OF THE SECOND
MOV ROA : ?'AXg4IU'.VALLE O DAiTA MEMORYLFCATION 2H
90
9r
TNCRO
..
'MOVn
AJP4
MOVETHF 4 OWBITS OF THE SE:.OND
NOV 0R0.A ; MAX.T.JMVA.IJE TO DATAMEtORYLOCATION '29f
94 HFRF7: ,NTI HFRE7
959HERFS: .JTl
HERE
WATT FOR T TO BE PRE-SSED
9.O
INR RO
MOVD , P7: MOVETRE 4 HiH RT.S F TE SEONrD
97
MOV ROKA: MINIMM VAWF T DATA MrIED_3Y
LOCATION Aq
99
MCVDAP6
MOVETE 4.ItOW BITS OF T
jnf
SFCOND
MOVltFRA
.0
;I MINT1.mM
VALUE T DrATAMEMORY
LfiOACATIO
2
INC RO
10?
MOVl APS, P MOVE THE 4 HIGH BITS OF THE SETifNr
MOUV R0,A;:
MIMU
v UL TO ATA EIMORY tIOCATTIN
2f
104
107
?A4A
3M
HE9:
R;8
BITSOF THEsEC.ND
MOVDI
A.P4.
a
MOVETHE 4 !L.OW
MOV@R0A,BOTTOMVALUET DATA 'MEMORY
.Ca tTION ?;fr
iNTO NEFF~
RE9U)
,JTo HEREI
.0
WAIT FOR TO REFORE THE MOTORSTARTS
109
o
TSTs-Tr .'-/RIlNJ
THE MOiTOR
It
OR.I
41 MP.C AsR.M.FR
.
LtINE
t10 START2:
.240
111
112
113
1,4
9n
M,q
1t
117
005A FO
1ir
18
FO
119
120
121
3F
123
124
125
0063
0fA.'FO
(K)642F
127
;9) A 2
.il..F
3F
0047 3E
007 27
dO:.93)
18
FO
129
t130
131
1.33
134
i; ,3
139
134
17
tS
3F
FO'
730
O0
'" :F'
0oP,5
001179
6x.')7<
A()71 rF7
00'.~ 3E
00.
<)hO
tfq
0081 27
OZ,
oD7 (~F7
!40
14!
142
149
146
147
148
149
151
1r.
157
AtIt W ,,.iY 0I)ATTEMPS r
TAT T
MFOTirR
M
AO#,.40H DnT.AIE THE INPUT .SWITCHi0 EXPANDER
1OHTL.
PA4
AND ABIt.ETHE LED/DAC TO EXPtANDER
MOV A, #O(:H: DI-SAB;
E THE.2 MAXIMU!M A4CLATCIS
MiVO ',
A;
ANDEN.F
TE 2 CTFL
.
DACLATCHES
C.R AP Dj!.A.E THE 2 MINI.IM
mVO P4, A
AND 2
TTO3M
DAC IAT'CHES.
MOVRO,
TE 4
MOV A,@RO MOVETHE 4 HIGH BITS
MnV R4,.#-I:
MOVf1P7,A
INC RO
MnV P, Rn
MOVnPA,4
MOVA,0.0?
MOV PA
TC PO
mV A4,R0
MfVtVDP7r,
c:
t .9
495
;
UT TO THF FIELD DAC
Mr
CtHF
4 lOW BITS
; OUT TO TlE FIELD DAC
: DJSA.BLETHE 2 FIEL.D DAC !ATCHES
.,F,.-.
. .
; AND ENABLETHE 2 MAXIMI.MAC LATC
: MVE THE.FIRST 4 HIGH BITS
. OT TO THE MAXIMUM
VALUF DAC
R0;
M3VDl
P6,A
MOV A
MOVFTE FTM.T 4 LOWBITS
U.iTTO T,-EMAXIMUM
VALU.EDA:
I-CLRA: DIABLE THE 7 MAX4IMUX
M AC LATCHES
1MOVO
P, 4A
MOV A,*#.fH;
ENABLE THE 2 MTNIM iDACL-ATfCHES
MOVyO
P4,A
INC RO
MOVA,.0RO ; f'IVE THE FIRST 4 HT( RITS
MOVDP7,
OUT TO THE MINIMUMVALUEDAC
INC RiO
MOV ARO
: MOVE THE FIRST 4 LOWg
BITS
MOViDP6,A; IUT TO T
MINIMUM VALUE DA.r
MOVA,.t:H;
DTSABLETF '? MINIMUM DAC LATl.F:E
MN3V P4?,A
ANDFNABLE THE 2 .3TTOIM D.:
I ATOI40
TINCRO
1OVJ
ARO
MO-vETIlf FRST 4 HITH BITS
MOVDP7,A: OUT TO THE OTTO VAtUFI 0AC
INC RO
MOYV
A,RO:
MOVETnf FIRST 4 OU
L FITS
MOiVOP,A; OUT TO iE TTO M VLUE DAC
CFLRA, : nTrI.AlETE ? POTTIM 0'. LATCHES
MOVD P4,.A
MnVA,OCOH : DISABLE THE LEn!DAC I0 EXPANDER
OHTI.P . A
lR A EIARP.
LE TF MAIN PRFOGRAM
T0 XF''NDER
O.Ut.P,4A
.M!P RFST
WATTIT: nMV
d4,I;
T.IT1T WA4T^ FOR t TIMER l'NITT
FR
OF LDITTSOF TIEF
WATTTM: .OV TP, ,WITTTM WA1TT.S
-TRT T : EUAI. TO THAT TN4
140
WAITTF: JTF WTMR WAITTF WAITS FOR TMER FLAGT
J,'MRP
'WATTTF
142 WTMR: STOP TC?4T
,~r.44
59
f.
2
SOURCESTATEMENT
RCCF
00,.
PAGE
V3,i
11
T'T:-TT
M-,-4IU
MR1
T-4
PWi
A'-.$SMR
LER V -4.0
4
t"
Ni TH1
F M1OTOR
ITNM
FF
iCF STATFMFNT
f'tF
S
: FTERNAt INTERRUPT
T
PO1IT.TNES
16
MFtV .Fi
Lo.
..n
"-tflP1,
ANL P
17
cc.
sfya
117A
74
.R A
MfiUT.A
.TRT T:
'.TARTT
TR
FROM0
MJV:R5,:6 NUMPER
t
OF TIMER UFRF!
BO,; EFO
RE
Fr
177
179
10i
'.-:;AP A
4E
I
FrLA,,5
Ont F:
.it
Oc~9r.
' ,
: T!IrN FF THF 1in PHA4
FiF
AVNlT1RfrNI'
IN THE NiW
OOFFH
;
T.iRN4
fiF THE PfROHT1iTTONOF D,C
MOVA,9 A
PHA'
REASTER
ENTERErl
.7.:C
ii:....
R',F'TARrT
R7.FR
MOV
'27,.
I!
i
*.s,
AF
MO' R6.A
!,8A
!4,
IR7
MOVPP7,A
MrV,4,,-:
:FF
IPF.
iTE
'
-!I"'A-
I 89
OAA
FNAFR'.ENEXT PHASE TO TNPfT Tn NTERRUPT
TF AN ;NDFRSEPEEDl OC:URS Airi.O
10 RE'TAR5T ATTErmPT
RETR
MPV
ARA
Fnv.,
0.-,7
!90
193
9
Ar.
I..,
F7
,7:
'..',
204
'I
(]OR!;
,',
f',T
ts,
t ..
r
sri-·
ilU
ITI. P,
' TURN tFF Tuc 1.
,-N!P1,4 0FH:
TURN-IFF THE
ANl T1"'1 A'
iP'
TIN
OTF
IPR .Cr
PH-,E
THF
NW F:,E
Ct..H A
MOV T,A
:TRT T .- TART THF T MR FROM }
lVF 5,46
:
NUMER OF TMER O.'ViERFL
OW' EFORE A R:TA,RIT - ENTERET,
MOTA, R
UPDrATE
!
PitASF fREf'.ITFR R7,, ,
n5MOU
RI7.A
'1aAP A
7R1,4R.
A
il A
aNi. , 0CIFH
MOV RAA
I'
'71
·..
F;~cli:}
F::"7:
·c D X3
r-
7i Ir,
NAB
E NEXT PHA4S TO '..P'T
Mf,OrP7,A :
T TNTE4rF'T
rtI AP.F THE MAINPRRAl M 7fX .; F'Nc;-,
fAiL
, .7r
"
N R TH
u
,:5/D
F T7'iC',U NFlF,
TiT:AR F iTHE FTFI:
i.: T.
;
MfVP
:P ,T '
"'" 'N T' ' ;l rm.A
t- ',Mf'it.!..T,
f:r5n :.,
,
D... "C.THE
1,F:-';FS
MiMUM
ND F:TTOM1.AT:
t.!
R,
rMOV.lP4 A
Mr,,R, 4?,qH
MtV A,
; RO
MIfVFT!F F
4
4tTiN
.
....TT
Mic,,VIl
P7, A ~l..
- T TF ,,,,
H MAY
'XMM
i' :
p .:t
!L
P4
P
MO A, i,:
A
.
t1
I
'U
It.,~
I!~
V"
if~l
1:b4
tISS-TT
-RI-4
RHN THE MOTOR
iUPT-41
MACRIA
IJ£ 0."
2'b
2??
',~4
¢ .'.f
3F
3012
F)O.3 2F(
30
* :
rrnnFO
22?
ZO4
4
Fp
.'F
i,_I
FOf
:?7
R
Fi
nrflF
Oon..n
2'4
9AF
00E4 1Bf1
OdF.
5
INC o
MfV A,RO' : MOVETHE SFCIND 4 lnW ITS
245
00R
PAE
,flUFRC.E'
STATeMENT
OrC. Fn
r7
1.)
:REMRI.
,lR,V 0
240
MO0 P6I4 : OiT t'l THE MAXIMUtI tlE
'
G.1R A:
InT.ARIE THSiE
MIAXIM.
TAC
LATflES
Mfvn P., A
MC' A,:OCH
FNABLETHE MINTMIJM
l.:
LATCHES
M.;IVOP4,P
Nr Ro
OWV
A-0 ;MOVE
;
TH-E
.
FC.iN1 4 TCGH
R. T;:
MOVr P7, . :
T TO TiE MINIMUMVALUE fPAr
MOVA,
nR: MOVETHE .ELCOtNn4 LO.1W
BITS
MOl PA
; Ol TO THE MINIMUMUJAL!EOA
OV A,~,#}0.}, DI.SAE THE 2 MINIM.UM
1. T'AC
LAT,.S
MOVDP4,A
AND ENARl.E THE 2 B COTTM
DACLATCHES
FN Ro
MOV A,@R0 MVE THE SECOND 4 HIlIH
1TT3I
MOV) P7,A
OUT TO THE BOTTOM 4AC
INC RO
MOVA, RO' MOFV&E
THE SECONDt4 LOWBITS
MOQYP6, A
OUT TO THE BO.TTiM .':
CLR A
DTSAEIE THE 2 BOTTOM1AC.LATCHES
MOWV
P4,A
ORL P1,8OH
DnISABLETHE LFDP/AC iO EXPANDER
A.N. P2,# 7F ; ENABLETHE MAIN PROGR
10TO
EXPNDEE
MiWR.1.
;,47
,' STORE THE LOCATI N
7W DnATAI
; 3F THE FIR3ST INTR
T
fCO:NTAINING
TE ADnrES.'
.T
ROUTINE iN R3
RETR
249
250 MREST: MnV A, -81S
CALL WITTM
U09
OOER
OF
OOEE1
A9
04FFOF
9
I0FO04F
94
2'52
254
'AO
ir
OiRLP.I,#IOH ; SWITCH N THE FiTD TAI.VISTO.
;JTIl THEFTELJD
CiRRENT REA{ES THF VALUE 3qETERMTNED
Y THE FIE-D1-AC
MOV A P6
CHECKFIELD [!RRFNT L.EVEL
IMOVR1,A
; .ONFTRMWITH A FILAYE CHEiFCK
dNI. A,,1
dBO)M:FN
.IMPFON
mOWnAP4
n,
JD.
. P4
'~ iFxl
: TNTTAI. POSITION SENSF, SIGNAL
]R
DEI TO DiTF);rD(T)
.P3 ,.ICfl,
24td
{sI {,7.
;79
271
CD.MFANJN3PfS;TTTCNA
8R MEANINOPOSTI 1 O
POSITIrN
AD MEFATN3i'
,{81S7r0:
.SENSED
SFNSEri
,.I~P?
RR) *. .SEjSED 1A MEANINGPOSTTO B
: rEPINF
7 AS CURRENTPHARFSEWITCH R, AS NFYT PrH;E St'i TC
MOV R7.0H
0t!0F
START DELAYEDFOR 18 UNTTS
420
27'.7
.nV RtP4t69t
nhvk "Ii)l~
01s0Ct- St11109
1
T :r':-4:z!PT-T4
g.i, TPF mfnTTR
M .- AS..
TT,:-T
I ff
CF..I
Rt
,
.
PtiAF
!A
!...
!I S'TATFMENT
?7i .:~0:
ElfA,
?7?
·7
CrSO:
tf7f
Ii 11
O!i F BF08
Oi1E .FOI
MnV R7:02:f
MOV RA,QO4H
,iMPS)
MOV R7, t04Hi
MOFV
RA, ).4
IJMP
¢'$
MOV R6, OiH
27
. ,a
ti:
7o
0 !.r:3E''
M'' A #i04H
MNUD PA,A
SElECT SENSfEINTERRUPT
4'aDIIR:E IN R2.
,,
.,
01
F
MOnVnP7,P: ENA.E NEXT PHASE TO TNPIUT
TO INTERRIIPT
MOVA.R7
ORL A,#OEOH
nifr!P1,A TIHRNJFF THEIFI-l tANn TRN iN THE SF CTED,-PHA.E
f-Ni. P',OiiH
TFN
i
FF TrE pri-OiTTT'NT i 'ET-TIAr
I;WilRNT
itA
:-' F
"l12Lj)
*4
'07
'PI(
,:....
CLR .I
301
,37
MOV T, A
STRT T; START riE TTMER FROM 0
Mn -sP5,
NjMPFR nF TTMER OVERFLOWS,
BERFOREA RETART IS ENTERED
30
FN
,
0(f'J':D
fl d 49r
'.3
207
.F1i . f4
:t:i t=.1.
0!f30
PF:O/
(')~
"' 45q
0!::5
.62
l;.
--'I!
...
i.',
.. i
FTI
JNTI WRKli2
,JTF MRET
!MPWKL l
.Ei,JN7
R i'nL
STOP TNT
JMP RFSTRT
.
4
ENARLE THE EYTFRNAL NTFRR1UPT
31? WFtP•!.2: ,ITi ;7
:."
:
,JTF mORET?
(I7
014
N!4R
m
t
'?&52
39
fFA
ir,
c.
!4t
MP NirR!,!.
-:4
::15 MORET2: r,.iNR!S,Lt;ORKI?Z
Ur.p T
o16
3t7
*TOlP TCNT
MA
V A,#f:H :' TURN FF THF TRAN'-T:TFR
O!.iTI
Pt,'A
TNf R4 : Tffi TIiF
RA
T
P HE.
T TiPP T
.
-
'.". " .
'T
,:4F7
..
01
A
*t=,
i}
.
;1
{J
3?
3!
:'-:R
HEPEJ
*'_.
i .r
'.
0i4F
S
RF:
z
,7 HFF I1
. ,-,P
. rIT
!, T 1
,_jT!HF'I
,!TOIiFRF! 9
MV -4,1-1O : ALLFW i0 RESTART ,TTEMPFT
.h" MREST
-Tr3
i
-
TL;S
PFtl'r:
if ATN
TRIS-TT M -4
1HPT4-41hMACR
RIINMEKMO.TR
LCcT IP
.INE
4E.
.FR.
,'0i)
PA'
7
S0URCE STATEMFNT
MOUV
R,#:Lt3W DATA? '
"HE.
CfNTAING Tu AF.REC; nF
RT
F THF LOATJlN
T
.'
ENRRUT
R.JP
TIN TT
,81NCE$ THF tRC
s LEVF1Ls N R'
JTF MiRT3
·:7tWORK!'.3:.
.?4
JMP WfLRL3
: ,ET.~:
331
·~.. .wTS
DIS I
.q
rJrJ7
STOP TNT
MOVA,R0.
t 6F
ErC
.
01 3 65
01 4 .27f4:3
329
,Csiff
40
341
.342
01A7 044F
I'.ER S.YMIL.S
DATAl f,!
O1
DATA
HFRF
y30!
MORFT 0139
SOAD 0102
FRVEf1 011SF
WO17Lm013.3
0020
MCR.FT?01135
i'H49
0106
i .3
.SRVE?
WtRIKL2
ASSMr_Y i MP.ETE,
P·
ISA.LE THE MAIN PROFRAMiO FYPANDFR
~JTLP,A
,JMPSTART?
END
EXTTNT003
HFRE4 0022
MORET30160
Si
01120
RTART 04F
W0R..3 01SC
,r1rFRRORS
114
0WED
FON
MR1ST 00E7
01C4
0000
0030
03I '
HEREF OOF
MSOEN
00F5
010A
0007
HERE
1O004C
HEP.Ei 0lf52
HERE7 003A
XijR8
0100
0!10
1T1, T .,oo,:
SBO
WA!TIT
t0013C
RESET OOOB
,.o
016
WAITTF 0089
HEREFl2
(104A
rETrT 0149
O'
IC
got1I
WA4TTTM
0'8
AFM4:, :'F:T
Ft,Lb
FEBR!GXRF TITL('.lRSTANT
STTWITiN DELAY')
T-:T:`-M,e-:.-4/llPT41.t
MACROASSEMBLER., ,nO
,-,nfc--.At,, :.ITC:NrG, DELAY
!_F.ur liBJ
I. INE
4
5
6
7
11
I2
13
15
17
18
t9
22
24
3!
32
.4
S.rTATEMENT
PRGRAM TO RUN THF MOTORWITH A FTXED TIME DEiAY AFTER NEXT
PHAtSF FI.TT'I
BEF1RE PHASE SWITCHI I
INITIALLY THE FELD TRANSISTORTs TTl.RINDON AND THE FELD CRRSNT
IS A.LOWEDTO RISE !.NATILIT REr'iES A LCVE EiTERMINED
E8Y
TE
: F
DC: VALUEFED TN ON THE INPUlT1ATA SWTTrES.
PFL.D
A RESTART
WILL. ALSO 'SUB..ET FED I.RENT TO Ti-F.
'
E REUArTION.
HA.:
;C1RRENT
WILL RE IEPT BETWEENMAXIMIUM
ANDMlNIM.MtI'E E S DEFTRMTIEF
:BY THE MAIIMJMANDMINIMUM A. VALUESFED IN C T-E INPI T DTA
s ITCER.F. EXTERNAL NTERRUPTSTO NDICATE DrET.ECTIONF THE
NEXT PHASE uIt.l BE TRTG.REDBY ZEROCROS.3IN.'S Oi THE ENSE
WAVFOFRMS
GjIN FROMNEGATIVET POSITITE POLARITY, PRESSTING
; THE Tr BThrrN
WILL START THE MOTORWITH THE TIME
.AY ORIGINALLY
SPECIFIED, TO C.HANGE
TO NEW TIME DELAY VALUEq RET TE INT
: DATASWITCrES APWRPRIATELYANDA.TERNATELYPRE'$...
TO 4ND TI,
; TO RUN THE MOTOR:
1· ON P73 TO P60. THE TOP SET OF INPUT DATASWITCIFES, INDICATE
;THE FIELD DAC VAIUE WITH P73 AS TE MSR AND P A THE .LSB,
ON P.3 TO P40. THE BOTTOM FT F INPUT DATA
nSWITCHES INDIC:ATE
THE VAi.
LIE. TO E APPE
T
lA. ADDRE`3l&S THE MXIMUMVAL(E
(TOP) COMPARATORSWTTH P: AS THE MSB AND P4h AS THE 1S.
PRESS TO.
2, ) ON P73 TO P0
NDICATETHE VA.UE TO BE APPLIED TO THE
fl.A
ADDRESSI'NGTHE MINITJM VALUE(MID..E) C
:RMP
'RATORS. ON P53 .o
P40 iNDICATE THE VALUETO BE APPLIED TO THE AC:ADDRESSINGTHE
;BOTTOMCOMPARATORS.
; PRE
T!
3,) ON P73 TO P40 INDICATE TuF DELAYTIME AFTER NEXT PHASE DETECTIfr'N
BEFORE PHASE .WITCHIN 3s TO OC.iUR.
PRESS TO.
; 4. } PRES TI TO RUNTHE MOTOR.
5;.) TO 0CHANGFE
Tn A NEWTIME ELAY INDICATE THE DFSIRD VALUEAND
: ALTERNATLYPRESS TO AND T1.
4nR
5s RYSRST: : SYSTEMRESET
8A
JMP RFSET
37
ISG
,:~003
FR
.000.4
P.
0h07 :39
OO.OR '.-N
000-i
I
FRGR
0
0000
000
.SO1,
PACE
9.1
rl8
(i001)
OiOl
D
(0O0E2',(iF1
IONff'mt'r
3
19 EXTTNT: : EXTERNALINTERM.JPT
40
NOV A.R3 : IJJ.MPTO TE EXTERNALINTERRPT ROU!TiN WHIOSE
!,OCAT'N
41
.IMPP A : IS STORE) AT THE ADDRESS N R3
4?
tORG7
,44TIMTNT: ; TlMFR INTERRUPT
45
DIlSTCNTI
4A
RFTR
47
48 DlATAl: nB LOWSERVEF
49 DATA2: DR LOW
rVRE2
'
50
MfU A, 80H
3
TURNOFF THE TRANSTSTORRR
51 REST:
l
TTHNAKE
TNPIIT -WTCH
Jt_
P
IP,A
: i0 EXPANDER,AND
IHE
LED/OAG
niSAL~E
'
0EXPAlDER
5.4
lT P.
. A; IISR-.E THE MAN PRC(URAMI0 EXPANDER
J.NTOHERE!
.3F
i 15
il.
.I.lHl
i.....
'!P
I
I-.-' .'
_
hOR.
5i7
.,..
i 1.9 ..
.TO HFRE? WATTFOR TO TO_F- PR-ESSE
MIV R. ?OH
MOVnIU
A P7
SWA
P A
Mrv R A
MOVrDA, P6
MIVUFTF FTFln nAf': AI.I IF TT I flTTN
',.7t
RxtRir,
AA
Fii
-, 0,,
A:
MnV
O,AR?
,NV RO
A9
Osif1Zt
I
S:OrlJrfC?
':TATEMENT
LI TJ
55 HERE?:
L .1f
PtC,
-y
.
J
P.
I
-.W
T TlTN'tT EIV
M.
r,,'
R?,A
MOD
r
;, pf4
:') r!R4A
.M.....
E THE
THEMAXUM .. fA:
V.J :,X-I,,
,IT
. U,,I
MOV FR0,A: MOVE
DAC VALUJE
NTO'f
I.
A.
NATITN
2i
N
70 HFRF?: ,.INT!
HiRF3
7" HFRF4: ,!T HFRE4 WAiT FOR T TO EF PRESSrED
00?6
('I-
47
MOVlR
A,P7
FWAP A
~F'l! R5i
74
7,
.
RF
MOVETHE
MINIMIJM
Dl.A:VALUE
VA LElNTO
INTO
M,.E
'TI, RFTtlM
I LOCATION
:LOTCAi
TINJ ?22H
H
AA
F iF
"I -, .i
-,t
.-.- r.t
flf
....
?
MiV
i r' A ,--.
MOV-.
, -,
"C1 4t
002
..
A
9
mF.
,UR,:
i:P MnT
,.INTO
:In1
'.
,.Frilo
HERE ,;
,finn AP$2
FR
T
An
,
.
.
-
.
OTO BE PRE: LF
NJ(TF
T T
PF F
...-,
H
ITS I
RI
T
.f UTTi
H
47
A
f!C
:
g-.;sl
n
il1'. I
inp
M5
MinlVl
R
!t
,FJ
UIT THF
A :
9:7
iA
17
I2E
A
'II , G A
'Ci
Ap
F00.
Mi''fbT¢.!
..i; }"
f
r'il
.P~
RIAR2'
-iTT...
ON RT.T
AI
Ti:
NF
.r
1 T TT
P.'
.t
NPUT RT
:-;0
THAT AN TT
0 YlFLF.
: THE ALLIS' TT.C fL.Y
Ri
n
T1E 4,IG TNP
T ITTS'- THAT N iNPUT : YIFI..-S
'
, THE S1,!AU_ ""'NT
T
Ti-: RF : PUT THE 8
W DiELY BTTS FFiR THE LrIN? ELAY NTO !OC'ATION
1)-7
.....
fi,
MtJ
'
,-)a
I 2 !n.
At l
RO
,
3PUT
THIF'8 HI3H
-./HT .R
?N;F!
· , 4F-H
.
,I
,,
,
rI ' iT'S FlORTHE D.JNZ FL 'Y iNTO.C:AT:TfN
APIF THF
:?.:a'
JI
T::;Ar.
NP!T
't
I:';,"4T:
E-'f'O;'gi
T!UqTIT Mrw-211T-41
M UZO A&C~
SEMN.F.R
,NST,ANT WSTCHNTSDELIAY
!'ICr
""R
VOS
TNIF
.SIICE STATEFMENT
004f: :19
110
1I1
lTI
004fF fn
090 27
!12
FpI
(t)4n
?'
.J
057 B820
atl004 PC0
009';9 3F
0,09 47
NO7 F
114
1M
6I
!.17
1 1!: 7
i1.
flO9R
130.
12
F; 4 "'":
00.58 It
4 _r1
005)r.I
i00F 47
iS F:: F
i.0060 7
004L1f31)
0042 23C
0Cf44 r
00.4 1
00.4 FO
004h7:F
(1O06g.8
47
0049:C
004A ??0n
QOOr
AC i
0056n -t
00 F FO
fO1AF
E
007n 47
00j7 3F
0072 27
(X)73 3t
0074 30r
00374
:R3
0077 27
07 :
0079 4r79
()7P
A7P
h0
07f'5.lt
RO.FA
00W
RRO9
PA
; a'N ,AFi:.E THE F //1A'T, c -MnV Ah40CH DiARIF THF.2 MX IM Ai mAinFR
LATCI.E.
MOluV,
DA[NARIE
.P',
Mi,,
T4l2
)A.AT,-'H
,
fJR A
rBT°BE THFE*2 TNIP?'IM
V
4!..A...
.A 3TTOM ..... AT.CnI-. .
MnVR0,#?A2H
,O aR
MOUETHE 4 LOWRITS IN 1LOCATION r?I10 T T10
MO1VI)
P4SA THE FEL17 nP6AG
W A
T THE 4 HIJ 'H STT
IN I CSAT TO 2*20
H I T T
MDVDP7,A
THE FTFL1) IAC
113
.
MnVA4
.:03.
11
f24
129
.6AM
135E
12'9
I0
131
1
133
134
135
15
t3173nMIN
1.
139
o4
141
142
143
t44
145
l44
147
CLRA
14P,
IITI P?,A;A
119 HFR7: ,JNT1 HEPF7
190) HFR: .,T
HRE;
19n@.s1
E $13
R4,
1F,2 .TAIRT?:nOVtR.4LOW
ic
00s81234
00i!1
.F
fg054 Rm14
0A
04,F.
,
0088: 2-nFF
000'AAL12
00
96
01581R:
1'90
~.92;
194
19
...
19
157
125
.OIARIE
THE2 FI
.-
-ATS,
M_!lDP5A
AD D FABLE THE 2 MAXnIM' iA LATCIES
INC Ro
NO AlRn
MfOJ
A NO lv THE 4 VWRIT
TN I CATTIN .H 7OUT
TO
MOV. P4, : TE MAXI1, VAI.L
T1Mfj PI-I P A
r'MOVE'THF 4 RT1GHBTT.'IT
I OCTit0N 1H.IOT t
VD P74A; THIEMIUA
;i
V,;E A11
C.'R A
NiO5
V I p 9.p ,
fsl2i?BLFRE
THE
. M AY
t P tlUM BiA
G. I AT.nF
OV A, 40CH
MOVDP4,4A
NAR
IF TE 2 MINIMUM
rlA I ATCES
INC RO
tlNMV
PA,RO MOV:ET1E 4 LOWBITS N IC..ATIiN 22 Ill
ST TO
MODVn
PAA
THE MITNISMIIM
VALE At
SWAPA
MOVETH 4 HIOC BITS i.
O
ATITN 22H O5T TO
MOVDP7 A
THE MTMIUM
nPVA.:F :
NV.nA.#O3H
, iTn.31-t1iM
nTISALEh
TmnE
I
N!
: fH
c
¢ v D4
;
, P4,f
F i fA; l
2 3RT5M '.i:A !
INC R
MO1 A,4 RO; MOVETr ' i4 1 W B;T ; i Ai i
22-'i
H Ot:T TiMVO P6, A
TE ROTTIM 5A(P
!S4WAP
A
MNOVETHE 4 HiTfjf RITS IN l rATIN
23H FUT TO
MON P7, A T RE FITM [AC
CLR A
MIv P4.A
DT
ISALE THE P TTM laLATcHcS
MNOV A, if)CH
nUTI.
P1.n ; DISALE THiED!AkC:
TO EXPANDER
1P23
"
"
NO AS04H
MiD PA,A :
MOVR5,I#?
JMNPMRFST
ENAN TWH
E MATNPROI;AM TI EX-,,,DER
WAIT FR T.. TOE
RESD
; A.'U.O
.NOV
TINLY
0
[aTTrT 3T TART
A TF IOT;i
nlATAI STORETT 1
nlO.ATIh,
G
T INi TF FRSTT
INTE~4RRU'PT
4H)rFfj TI5N
:3
Z'r;T
'3
NI
......,,.,.... ,
140~.IO?7
INTERR-'
(IRRTTFR FtVER'F1
rF
W' PFFijRE A
ESTAR;TI:I F-EI'2
EP
:
S27
UROUINEA
14i6t
1 A T !T:
.OV
",4-t
WATTIT
IT TTR I TM,
UNIT
!
WA'TTM:nV,A
WWITT
TS FAR il OF "NITS' AF TT143
TR T rfIUFI
A1 TO THAT
164
,T WTMF I
WATT FR
IWAPTTF:
TTMERF1A .TF
117
~...
...........
i,.i
TT.- T l:/-48/t.PT-41
MACROkF-;:EMRI
FR VPA;
.ONSTNT J3WITCINGH
.1 FAY
LA.
iE
OI.
ol0nF 04.c
t0090 A
009! '
!5
166 WR:
1A7
4
SOUItRCE
STATEIENT
JMP WA[TTF
STOP TCNT
RTR
169
(1092
' EXTFRNAL.NTEI.IPT ROUTINES
SERVE:
V170I7N RE1
; ORF1EENT 8 LO BITS rF TME
AY
171
JNNZR,ERVE1
DEC-.EENT 8 HIGH BITS OF TTME DELAY
172
t172
Mt A. R6
174
ORL A, OEOH
!75
1OlfLPt1,A; TURNOFF THE OLD PHASE AND TURNON THE NEWPHASE
17
Ai. P,#)OFH:
TURNOFF THE FR-ITBITTON F AC REGULATTION
177
178
Cl.R A
179
MOV
T,A
180
STRT T
STARTTHE TIMREFROM0
181
MOVRS, t270 N.IMRER
.
rF TM
OVER
FLOWS rFORF A WFSTART
IS 47TErt
132
1*'
MOVAR6 : I!Pn.TEFPHASE IRETGISTERS
R7,R6
'"'4 MM" 7 . A
5
ScWAP
A
1:VA
11I.3L
A,7R
1:7
RL. A
AM. At F
::9
MOVRARA
190
191
4MOVD P7.A
ENA.L.E
R NEXT PHASE T INPLIT TO ITERR!F'T
t7
99
0094 FA92
~094 FE
(69h74.0
009 :9
0i09A 99PF
l'09r
?7
A09062
009F 5
009F P.Oi4
OnA FF
0ft2 AF
0l1A.t47
.)B4 4'
(F.lA5 F7
000A !'t-CJOF
5HA8A.IF
0fA9
F2
A^A RC.LF,4
193
194
19
19tA
COA:
R824
flOf FlO
O,'F'FVA9
RN).Ft
00R. FO
,97
193
'1
MO.' R4,4-10
; TF AN UNnERSPEED F:F
C
MNOVRO,#24H
MnVA,eRO: PIT THF
R1,4 ; INTO R.I
I N RO
M A Ie) : PIT THE
MOV
IO,W BITS
r
T!I4 BITS
S. AI. W
0 RFSTARTATTEMSPT
F TTMF nLAY
J^NLP.T_..%T.
O. 4
' TT F ;EI.AY IN '
2-,!
I-t
i
R..
?,A ; INTOR2
t4M4;;
;iJR'-:
',(llIo:
RFTR
02
Oflr4 F7P4
'O,RA F'R4
3:SEVF2: ,lJNI7 RI
2604
iN7 72,S
FRVF2
'
SRVF?
-EMFLITHER 1.
ITS F T : F
,Y
,I'.CMFNT,
'
TF
3 TYIHRCT,TIME FLAy
705
E '..
~,?='
O;. .- 27
')(oo
f:::
,
3
iS
;
·
7
..
.. 1 t
.,
T.:.
T,,'iF:N-,,FT
rFF. T4F ;!.f1 PF
..
.
"AC.-,
sijjE-.
A, F-
..219
'4. 9
'
,,
."17
71R
.'''
MV
: ...
Ml-J R7,A
RAP A
3TART
i :TRT
TH T.CFR FROM
RL
' .A
i 1o
I.'!ATF PHAg'F r..T?-..
'.jF':F
?
M4'
V
.aF,.5i : NJ.I':t:FR
FFfTIMR
n:F,,IJ,
FF,
P
"'.1 P4
;, .i
PI ..
it
M-,V T,
....
:
T
CI;rF?
.......
.
.,:';(r},r
'~f
O(]Cfi
47
iORL
. Ap
F
R7,..',
,,
FT
-
''
? ..... ?-,-
:I-'..!
r',T-TT
) .
L 1!.l
s
."
SWTL-4:HTNfl
T-1 EY
Y.
.:
I
0 t:7 F7
,fl'x'
5'F
n.r :
'T,
IATF'FT
ANI A, )FIH
.:
',',74
.:R..fl
r!
i..
.f'r
s??,
.. 1,
, -_
MAIMfl
P7,A
~,
. .
lI
.
,...,
:f) tt 99PF
7
,
7NPUT T
T7RtIP
u
.. !0 RESTRT F4'TTKFPTCS
iAIN PR.
r.,-iAM T FXPANDFR
TF
-i:Fr
NAJ1r THE TNPI!T.IT
1A'
MO't 4, P7A
-¢/P AP4
ORL 4 R2',
-n A
MrrffirA,P7
SW.APAf
MF'JR2 A
Mllujn , P6
nRt. A,R?
MOV
R2,4
.V ..., . ,,PUTTE
r-u,
PU.T T!iF
4
*IMOVgtlA
T
'qn)
,nr 47
4A
19
T
'UERSPFEEP
"t! AlRPS
F
0flU- 1TI
fiNi..P1,tF-itH:
4A
AA
PF,
PSA
):P,-.NR
?30
A
nfT',
IF Hl
fO
.'S
4,4-.fi: FpAnl
O
ft~F
PAlfl
FNABR.F
NT
',49
.45
"A
i 1_i S
r7
H GH
wfO
,'-T,T:;
n
IN ' '
T.
ADD TO
AE
; LTHE !T SO THAT N
,.tqT i YfItfS
,:;14t ~.ET
T.E,- ORE'[Ai
INf: R2;1 ADD i TOrTHE "H:3I, BTT..S
I.
TH.T AN iNT
.f ii
YIEDS THE
TFNC:
R I,
rO'TaP2
T
TMS R2FP ADDFATO
H;CT;i ;.Y PT TE YNTr
FIRST TIf
MOV
A, RF' 4IS UT THTO
MfJR,-'
T3'E
8 I_0:.4
- T,:HBOS TF TTMET
MnV PI,. ;
INT, TATWIN -"H
4A
A7
IN
N'
10;7
( i~
.
;
PIIT
)
,R .
.I. ..
TH HIG
,dT..;-
..
r
....
:
F
il'F47
I:jirF
F-THF TNPUT
. MIN
....
'FTTF
F:FI
'Y
SWITCH
F .T EXDER
TH TOn
F ,~,v
FR
RRIFPT
ARFtSR FN
-;: """
iAF5
RFTR
ne MsP:
37-,
_49i C,?46,
". I
CIOF7
sslfx'
:^'
ttF.tAY
r
F:rF' 5o t'NTS'
.At. WAiTT
nRLS
P1.tiH"U
ii9
AF
7,' :,
FN:
D A^PA*
." AfP
:-WITCHT
!N THE FFIED TRAtN.'-S':TTR
UiNTTLTHE FELD
11
S,'"
' THF"1
Y - ;TiEti FD ' T.'
Fi~
C:fiNFI.
TRM iT
I......R
_i';
L.- 'L.- .R..
A DR!FlAtYE'r
F:HF
IRO MFN
~.]Lh-
,_
MnVD A,P4
Ai'
A''t- 1
NTT'IAI PFi i"TTTTN$:;pl':';_,:':;INL
,IMP P46E
I -yI!
i , Cia
'n7
r!7-n
^t:
!5: 1
.'
?'21,.
?3
j,'.";]:
' t19
'"""'""'l:DiMFANIN:i
::TTTF
Ai
T7'
DF
Ti
riFniT)
RE NTi
i--T! M..C-48/l'PT-41 MP.ACRO
A;SEMBt.ER. , F)
MNNSTANT
SW!T7ITNG 1ELAY
t
. OBJ
d0104 24C A
Ol.R 2410
LiNE
?7
77
'78
.79
PAGE
A.
SOUflRCE
STATFMFNT
,IMPSO;F.%N!RF
,qCm.ANTNiPlSTTON D
,fRI 'i0
i,'SETJARBMEANING POSiTTf, s
,iP RRI SENSFn rA MEANTING
P.3iTI.N B
: nEFINE R7 A'S CU!RRFNT
PHASE SWITCH, R6
S NEXT PHASE SWTTC
3O SAO:
01(OERFO2
7420
MI Rv,
W.,r
H
iMP Si
MOV R7, fl,'H
4%,
)4H
V
O114
..
0!8
MOV Rt
7.C41H
SI
'
.87
REOI
0 iA RF,^.
0.1.:
QJMP
S!
tfOV
R7,
H
MOV RA.4t01H
292
: STAF
7.~.8
FO
0!
01 22
i.3A
0!174 1n
FO
AA
012
OI2A
294 Si:
294
297
299
307
FF
0142
39
993IF
301
27
MNV
t, #24H
MNOV
M R0
NOVRIA
:
INC.RO
M'J AiROP:
MOV R2 A :
PtT TE 8 LOWBITS F TIMF DELAY T
INTO RI
PUT THF 8 HJ1iHBITS OF TIME B.IlAY JN LAt^ ,ON 2H
INT R2
NOV AIRA
MOVD P7,A: ENAR.E NEXT PHASE T INPU!TTO INTERRUPT
MV AR7
OR. A, E0HF
l.JTL
P, A T T.RN FF THE FTELP AND TURN ON THE SELECTEDPHASE
ANI. Pt
, FH ;tr TURN FF r14FPRtHIBITnN OF DAC C.:RRENT
REGULATON
CIR A
MO TA
ST'T T:
A'
.3!
START THF TMER FROM0
EN T : F-NAPR. THE EXTERNALINTERRUPT
01 49
4 WORKt
1: ,NTfOWORI ?
319
.139
'17 MNRFT!: T.I47 R, WORItI
dMP :RK!!
0j1 o3
0!37
I45
139
F4R
i4~C
01141
0143
': .!j
0147
d)t 7:~
hl4°
STOP T:NT
,MPRESTRT
'" WORKI.
2: JTO CH4~Jf.i
A7t.
,IT MNIREFT
:3f,:
JMP wR'L.?
,{N7RS, {0RK'L
iTS
T i..TtP Tf:-NT
,;MPRiESTRT
.,
..rCATIINJ24H
i1.,qr
120
r..T.
AmlOCn
';, .ILKtFRf,O
INMCT
-.-481PT-41
'
'.n
A
R
014D 4A59
o 4F
2441
O' 53 EPn4n
19
0,.1 7 ED4.
A5
1.-59
l65F
01
0158
24.99
1: MMrtR3.41-ilt nATA
19
337
0.1F ROA
3: .INTi WORIv[
4
WORKI:
.,1
MIllET3
..TF
MFT5
,iMPW1( 3
.MFJcT:
3: 11IN RW0iRL3
DT.' T
STOP TCNT
JMP R TRT
. JT! :PAN42
JTF T
4
.,MP W KL4
,t $
n10RET: D4JNZR5,WORK
DIS I
STOP TCNT
RESTRT: fOv PAI;OH
T!.RN OFF THE TRANISTOR
OlITL PI,A
INC R4
IF 10 TRIAL.SARE LIPT.hEN STFP TILL T
MfV fAR4
.17 TEP
I.MPSTART?
STFP:
.IMP HER7
W.R.4:
..4A
349
35(2
:3n4
.39
F.r
047
0479
r TORE THF Il ATICN ~' NTINII
TIE AlRF'S
f
: Tr [INTERIPT RiJTINE THAT CHANF.S THE ELAY
TME N R'
4:'
1'l167 PC.
oli 6
7
RIJrFI,
S-TATMEN'T
'.I
n04R P.BA
01Al
n16
PAi:
':W.JT
-:T.r
ING ;t.Apy
354
.r,.
849
350
855
56
:7
:~8
CHANW3?:MOV
0170 ?43:3
,3.KOWDATA2:
IS PRESSED G(A.IN
TORE THE i[.nTIfN
CONTAININ THE APFREfSS rF
THE NTERRPT RUTINE THAr CNGjES T4E iE!AY
TIME N R3
,IMP WORKL.
EN!D
:.3:ERSYMROL3
01 .F
C:HANGI04R
HFRE4 0024
HFR
il00.'2
mI'RFT4 l!SF
o010
-.rATR 0 07F
.TEP
01AC
WORK(1.2
f!:3F
WA .L2O140
mASFMi.
Y CnlMPl!FTE,
NO ERRRS
DATA,
HERES 00f34
MRFST OOF
.n
SY.RST (fII).
!0000
WfiRKL4ot.n(7
DATA2 OOOA
HERE6
OfiFC
TTMINT
030
1V
wTM1
f:3Clz
EXTNT
HERE7
NPAiF
Sfc0
f011
WAITIT 0088
FON
00F4
fESET
kO0fl
f',;:lr=
WATTTF
HEREI 0OF1
RFSTRT0 1
I
RE? 1011
MORET?
010?
r
UWATTMORki
0133~
WW3-K.
-.rft
"Rt t
.M4. :Ft:VARLt,MAN
DFIPBUi RF
TTTLF('
iTRT-T f .- 4R1 IPT-41 MA.CO ASFMi.l E,
VNARTIAR
F SWTITCHi'rniElAY
icJ O.
I.
TI I.
VI ,f
SWITCHTIII FLAY')
PAGE
1
.iljRCE STATLiENT
Ie
: PRnORA Tn RUN THE MOTORAT A FIXED SPEED BY VVYINO THE TME
J
O
'JE.. .
-
ITNTTAl
Y THF FTEI. TRA)NTITOR TS nE
N
E i- ...n Ct!RRENT
,
rs A{.O.D. TO Rrs c UNTIL IT REArHF:
L/FI
.ETERMT.:,I'_
RY TI-(
' FTF~r
FT.RD AC Ij~lR!!EF
TN FINT
INPUT DATA
DTE*', A RESTRT
: IlL
!SNi.!.r
SJ'R!JrT
FIEL C;flif.T I'""J
TqOT
SAME Ei.ULa
TIONS,
:;CI.fURRENT
WIl.. BF KCPT ETWFENMAXlM AND MiNMl!M LEVEL; DETERMINDFI
iY THi;F
MP'AXIM ,ND MINIM ;A.IIES
J.
R
FFATA
FED Ti N TFE INPIIT
.,,
Y.TiT ,
' ITIF INTlT NIME
gNTFRV!
^t THF
,fiN Ti
rTMFi
FFU
fJ,,:Ef,
E
P.A.
AT -H rI:.:Ri
i
TlFrIX
-RE TINPT
SPEC
FFn i N
TN
fATIA
; SWTTF.:NER, 1W 'IA.CIJI..ATI.F OF
TIME INTERVAL- EEI;RE,_
A
,
.f5
,.
7
Q9
.1
It
PATUI.I
M TIITERVAl.
TfiTI
S PERFORMEB
FOR54 :.ECTfL
PH'.fHiES
UI.. 25
: RE.iTSTERJ
ARTTIMFTIC, F
TRES!LT
IS PO.S!TV,
THErNTHE MOTOR
2
4
15
.
17
9
."".'
.,.
9
24
46
7
if
0
:t!
2
.-.
34
I"R
:37
Ft
s:iR
:39,
40
41
4?7
43
44
:-5:im
A E Is
IP TON 4.OWAfNDTHE DFI
AY TIME
JS nCR'-CF.
T IF T-IE'1r
LT
: S NEATTIVE THEN THE MOTnRSPEED IS TTONFT
rNDTHE:DELAY
TIMEIS IN.R.A:ED. TF THF RFU!lT iS ZE,'i TIF SPEED iS I:mRRECT
/kNDTHE £P.FLAYTNTMF S LEFT I.kiJH-fiOEE,
t/ RESTART WiLLNOT RESTRiT.E
THE.IT!TIA. TIE .EI.fAY,
AlSr.r FED IN ON,THE ,1TSTTDATAIiTT,,
.
,
: IS THF NIBER OF PHASESFROi~M
0 TO 2.) TIHATAE T1OELAP'.: BETWEFN
; EERY '-ET OF 4 OfNS.ElUTTUVE
PHAE.S THAT . II-,DFO1RSPFEE '""rElTIn.
EXTERNALINTER.IPTS TrJOINDItTE DETECTIONOF.-FE NEXTPHASF
'INTr.E TRI!3EREO BY 7ERO CL.RS.:,:i OF T'E .SENSErc
A'ERlMS
or
: FR
ROM NEPATTVETO PGITIVE Pl ARITY.
: TO RUN IHE MrTOR:
:1T ON P73 TO Pn. THE TOP :TOF
DTA INPUT SITCHFS,
INDICTF
: THE FTFsD
VA.tlIIEWI.TH.P73 ARSTHE MSB AND0
P60 'S TiE LSB.
I ,PON 3 TO P4, THE
TTOM S.ET OF iNPUT TA SWITCHES, NII.TATE
ST V.JIITETN F APPLIl
TO .TE
A(
A DR.ES TN
~ HE MX I..UMVfAtLI
(TOP) CIFMPARATORS
YITH.P3
THEM.$ ANDP4n A$ THE l-S.
PREOSS TO
,
T
: ,, ) FN
PTO P0,73 INDICATE THE VALUETO F APPFt.ED TO THE
nrA.
;P40
INDICTATFTH
E T i SPPEf.TrI TO .THIE A
r
T
THF
: BOTTPOM
CnMPARATOR,
:5 PRE. TI,
:
T
3
THE
ON P73 T PD40IrNDICATE
T
INITIAL.
nRE..AY
TTIME.
; PRESS T.
44,) ON P7? TO P40 INDICATF THE DESIRED TIMF INTERVALFOR4
ONSEC!TIV PHASES.
t
FAVT THEirP7R rINTE i POiF
TT iON PITSl
TI
I THT
M!;T SFRVtEAS A + OR "'-'""'
IN
-UPTR',I
~
.-..OPtf
.N
: OF ACTAiilI TIME iNT,RFVL - IR;.
N TITIF
ODn'INTERVA
: PRF..ST!,
: Fi, ON P73 TO PAO INDICATE TF NJ!MRF.R
OF PHA:;FS THAT ARETO
,
APF .FTWFENELFRY SET OF 4
,'
P'AS'E,,
S T_.
ts ,,,-
*45
tFnR
;
)
. SpED ORRECTION,
0000dOfP
(]ON;3
?3)4'
47
458
49
50
51
52
9;:l
2vSr,:
94
pR.; '
TI TO RU:N R RESTART THE MlTOR,
, 7, ) TO CHAP7FT
A NEWTIMF INTERV'!. FOR ONSEclTIVF F!A:;SE
:
NDICATiE
THF DESIRED VALtUFiNitP7 TO S r40ND l TERNATFR
P
FS;
: TO ANDTI,
i.
ORf 0if
SYSTEMRTET
iMP RE'SAT
i??2
r,'..r.-T
.
VRIAFR
.F
.:-4St./PT-41
MACRASS-i.;EMrER,
v',)
IDELAY
.INF
)00A n
(10:
PAiE
2
SWITr..HIN
5,
57 FXTINT: ; ExTRNI.
T!NTERRUPT
IMOV
A,.R3 , .!IMP T THE
rXT'RNAL INTEPRUPTR;TUTINfEWJi.SE L.ATil:J4
FP
(004 I
.nfRCF.C.
STATFMFNT
i9
'IMPP R@A
'.
STOREDAT THE ArFES3
ITN
61
(1007 '.:
00t0 93
0009 1A
(ARA 4R
010OR FA
A.
55
1f414
000
(trIF
(fin 041!A
00!4 A5
FAAt
001 A
00ltR
FF
43EO
Onm 7
43 TIMINT:
TIMER TNTFRRI.PT
6.4
015 TCNTT
A6
RFTR
:
67 nATAI:
R !.'.4 SFRVF2
A9 DTA3:
nB 1.f SFRVE3F
7
71
: .c-tR.JMUTINES
7? WAITIT: Mln A,4.-1 ; WAITIT WAITS FR 1 TTR
NIT
I
73 AJTTM: ~Mv T,A WAITT WAITTSFOR .OF UNITS OF TTME
SiTRTT;
EQ!LA. TO THAT IN A
74
7..WAITTF:.ITF WTII , WAITTF WAITS FOR TE
FLAG.i
.!IMPWATTF
7'
77 W4TMR: STOP TC:NT
73
RFTR
7'9
IA
: FXTFRtA. TTElRRIlPT RT,TF.R
; ECRPfEENTTHE 8 I.
nW BITS OF TIME DELAY
3 S..-ERVEi:D.JN RSERJFl
iDJN7R2.SER.VE:
E.rCRENT THE
r 8 HIGH BITS 1OFTTME ELY
:3
94
I
4
R.A
in
MOVA RA
rl. A, Fe0f
r.gT.
PA;
T!.IRN FF THFEm.D PHASF AN T.f.RN .NTH NE PHAS
ANL P1,)fH
; TIURNOFF THE PR!TITTON OF DnA fREfi.ATION
Cta A
0)i
fi')4D
A?
k.3.
i7
FE
9?
fco.M.
47
4E
F7
.)9
04
MOVA,R6
MOV R7,A
SWAPA
CRL ARA
,il/i,
R A
'07
Arv
¢:1{;3
0::0.
UPrATE PHASE
REGISTERESR7,
7P
'Af
.A#0Fr
MAV R.Aa
Af
O0A-f
0028-.
:,C
MInYT,A
STRT T ; START nl- TTME.RFRnI 0
MOv R4O,#3!1H ' .EAR THE.8 H1IH ITS OF ACTUAILTIME I JNLOCATT
ON
MOV .Ro,
0.:
A
.
FFR THE NE4YT4 PFAS C.YCLE
..
MnV R5. 20
NJIMPEROF TIMER CrNFRFLOWS
BEFOREA RESTART IS FNTERED
r':F
P7,A:
MOV 4,, -0
)0'9
ENAPR.FNEXT PHAS T
INF T T.n T'TFRRF'T
IF AN UNER;.SwrPEIE
OCCURSA.
LLA~ f0 RESTART
R A TTEMPTS
MFVU
P.Rf0,Y
MfV A.@RO : PUT THT
I ,Y>)
T4H.
18W RTS
OF TiME
,
',
l,
TN R.ATT.N
4H
'11.0S
BS FMF-'1FR,
WIWIAcTRIS-IT. WS-4/11PT-41
l ,AY
n
IT T'i
.VARTARLF
.l.C
Io 3, A9
11
18
I00,7
13
103'?AA
NIOVRI,A ; INTO RI
TINCRO
BPTTon.
A.5g>RA:PIT TE , HIH
MO1iVU
,A A : INTO R2
MnOV
12
F0
^X1<~~
.
Sl!RC.E S ATr.MFN
tINE
J
PA~
TISEDTLY
iNlJI. ATtION_5.
1t4
* 02A Ft"7?
,,30Af,
P0
003Dl 07
C
)c'.AF
.4
0040, AO1
0041'9f
RrO'R
r(X)47
0044 FO
0047 A0l
0043 BO0A
S004A93
9
004RA15
004C F94B
On4E E4W
3090 r..P
0051 43Fa
('. 39
00(54 399F
0(5 42
097h,AA
°
27
0059,
0099 A-?
005A 55
(5R Rtl4
115
I]
J17
118
.2 rD
ON 3H
P.F.'EMENT THF WORINGRFC TER.- L.OCAT
n.R
F PHASES REMAINING
TRACKOF TH.EU
TO KEFEPP
A,RO
MONY
D, A ,FFOR ASPEED CfOUNTISMADE
C
l Dt14
pMOV R.f.:,,:s
,
Ro. A
. . V
11]9
RETR
1201
OVfRO, 2,H
121 RAC.:
IU A,@R : !NITTIAl. TE THF W k'INTt)fREGISTERI. CATTON RiHt-F;ER
OV
3 REMAINTNfi
3:#; TO KFFP TRAC OFTHE NU1BERCF PHAer
O,. 13
tT2
0- ..45
A PFEfI C!ONT 1T MADE
MOV RO.A ; BFE
124
MOV R:3,.F.0iDATA2 STORE TE IOCATION CfONTAININGTHE ADURE.SR
FOR4 PHA.S
12!F THE TNTFRRIIPTTHATCOULSNTS
: IN R3
1t7
RETR
f,:,
129
j!.NT
STrFP THE Tl
]30 FRVE2: STOP TNT
131I
ECRFMFNTTHE 8 !O1 PITS OF TIME DELAY
Pl.JN7RI,SFRVE2
Ii
CRfENT THE 8 HIGH ITS OF TME ELAY
0N7 R?,:'EE? : E.
.
NOVA,R6
15
AF
ORt.,l.
134
NITI Pt1.A TURNOFF THE i.D PASE ANP TIJRNON THE NEWP;SE
37.
P! ODFH ; TIJR OFF THE PRCIBITION OF BAC REG1LATION
-I
RANL
139
A,T
.MOV
140
TV R2.A: PUT THEFTIMER COUNTIN R2
}141
.CR A
142
T, A
MnOV
143
STRT T : START TE TIMER FROM 0
!44
MOVR5,420 : NIMBFR OF TTIMERAVERFLOWSBEFORE A RESTART .SENTFERED
145
0i05nrFF
f0SFEAF
(-rF 47
0nf0,04E
OM.t F7
0)A2 5..F
0064 AF
146
147
!4R
149
; 50
191
!52
1$r
I PPATF P.HASE.REGISTTRS R7,R
Mn A,R6
MOV R7 A
SWAP4
OR. AiR
RL A
ANI. A, WOFH
MOV R, A
AF
0t054i9
199
MOVf P7,
A F:RFiA
OOA
197
0
nO R4,#t-f
FO7
naSXs R
n0AA P,
'00R E7
G,'0, .A
1,0L-j
trqq(16A-V
VMA. RRO
14
RI A.
,,i
4 P"H"SE Ci.E
I
POSITION 'INDEX
.
: IIPrIATE
M4J
1.'.,2ROA
4 4 PAsE fYiL
,
TJRO , iAVE CMPETEn
1f P.lrhiK
25
F
.JUST .:;TARTtItA CYC!L
RTT
I
,R1 TR
0F,4 ?7
f6A
IO
1.'4
: hNAI E NEYT PHASE TO
TOrINTERRUPT
INPUT
i0 RESTA.T ATTF''T,
i
li,'IW
On':URS
TF AN I.iNPERS5PEPD
T.STR-T
?('..-42/i.PT-4
V'AR.!iF
T
'
! . nR.J
90071 R 34
0073
0074
of}.
(,07.
FA
,.0
An
EAF?
0079 10
007P 04F?
007C jlR.4
007E FA
007F 40
,X8s R824
0:32
FO
~
r i..
o03,°,07
i .°
MRf)
PAJGE
AS..n..EFRL,. V3,0
4
ti..G
F!.AV
t. TNF
65
1.67
IA8
iA9
170
171
SOURCE
.ST'ATEMFNT
sM1V
RO,)34H
,' A
1
34Ht
CNTAINS TE 8 LOWBrTS OF ACTUAl.TIME
8
3H:
fCONTAINS
TE 8 HIGH BITS OF ACITS_ TIME
2
pA) A, RO; UPDATE THE 8 [LOW
BITS OF ACTA. T1MF IN 34H
MlN @ROA ; WITH TIME
.FAP.3Ei
!UdTSIDEThE iNT'ERLPT
JM' FINIS
INC U : PDATETHF 8 HIGHTtBITS nF A-f AL TIF T N 35 Wfi'T TI;ME
INC @RO: ELAPSE)DOUTIDE THE TNTERRiPT
t7
17.3
.lIMP
FINTS
174 STRTCT: MOV RO, 344
JNTEPRRf:UPT
Mn') AR?
PLT THE 8 LUl RIT OF TIME ELAPSE! PUTSIF
175
tOlV¢RA,A :N 34H
MOV RO,2?4
177
MOVA @RO
t7
179
IDC A ; DECREMENT
SINCE I REPRESENTS
THE SHORESTiDELAY TIME
180
AND 0 REPRESENTSTHE LONGJEST
IELAYTIME IN
2$4
4tLOCTIOTN
R2, : PUT THE DUtRMENTFD 8 LOW ITS F DELAYTME IN 2
181
mnV
,00.4AA
00'.5 !,q
,ro,,t FO
4 2
&,f'r
184
008a7 n7
187
v008R
1,1, ,27
00(9 97
A7
(S.:':F 7
00iF 24
009A. A7
t91
194
197
199
0091 RI4
202
201
foiX4
24
'05
0 C74 A)
MOVA.e@RO:PIT TF 8 HIAGHBITT OF E!.LAYTIM TN THE ArCCl.MUl
ATOR
DEC A:
I)ErEiET Srt:E
t. REPRESENTSTHE SHiRTEST D1AY TTIME
AND 0 REPSRESENTS
THE I.ONGEST tELAY TTME IN LOC:ATIN 2'1H
C1.R.C
R. A; ROTATFTHE F. HGH ITe TO THE RIGHT
XI A, R2
RRi.
RITATE THE RPLOWBITS TO THE RIGHT
nA
XYH AR2
(tR C
RRC A
ROTATE THE 8 HTGH BITS T THE RIGHT
xCH Ap2
RRC A: ROTATETHE R LOW ITS TO THF RIGHT
; ADD THE DELAYTIMEn l.RItN4 NTERRUIPT,TO THE 8 L.O BITS F
ACTUAt
TIME OUTSI
THrEINTERRIPT TN LOC.ATION34H, NOTE THAT
a: DJN7.INSTRUCTIONiS 2 CY.ES 3'HILE A TIMER IRF ENT ).i:!..
; EVERY.. CY.ES
THU$, OVFR 4 NTERRUPTSA DJNZ IUST.TCTION
THE .1N7
iON DEAY TE
T N
TS
IS 8 CY1.ERS, 3n 2 RIGIrWiARIP, .THIF
I;VE lNITS OF .? iYCLES OVER A PERIOD OF
T.NTE
RPRUPTS.
nOV R034H
ADDA@Ro
MiOVRO,A
4 TI.TFRRUPT TO THF 8
INCs
RF ."THENADD THE DELAYTIME PURI "&r
MOVA, r,2 HIGH BITS OF ACTUL TIME TN I.OCaTInN :5H
AnDC A,RO
,Z07
i3099 f4F?
0;,,
tAAt
:09-C 9AA2
o0fO 04A4
r1O.47.RR09
00A4 R..134
.)A7 .6
O,";0-:.E'A
JMp FINT
MOV R,# .?H P IT THF NIMREROF PHASFS T ElAP R 'TEEN F'cFRY
FOR
-1i
CiOR-RECTION
.PD
riV A, 0O ; r.FT OF 4 f:,i-Si.T TE,PHc'. <S
;
N THE AC:_P
iUMULATOR
2!5'
,.INZ
WATS-PI
I.
.IMPTtHERE
O.OTHER PH"'SF El.APSERFTWEFN EVERY SET nF 4
.sI -,
ATSPV: MNOtV#L ,
DATAI STORE IE I'
.TTN
CONTsiNIi
.T T-i,
E F, iNTERR
S
PT
IN RQ3
ADDRESSRE
.'
I TOHEGr: M1OVRo,#34H
MOV AUR? P ~aCtE
THE UPDAT.D 3 L
BITS OF ACTiAl..
TIME
IN
THE
AnD A,R:
C UwLNAT R
u219
-I
IrR KTIPIN
21O
f~t~ElS
!
1
t .C
.IR-TT MCR-4q/!IPIT-41 MPIRO AnFMLER, . V2.0
V4AtRI.IF .WITlCH[GTTnEL.AY
1C
Oc
Rt.
It.E
0AA 18
0.p i0
0OA R8 6
(OAF .37
OOAFA0
,
iOORn7
nARI AA
xP.?.'
RF,835
i0084 FO
(OaBI)000
(00R9.7
(i:OB 70
OOBrR27
OiORCF?.7D
,r7
2
,9
,.
17
7
'
,*3
,
4
242
243
245
OxOCA
ClE
r44,7
47
,4
·P. 04F
F
2
.f'F 18
(OrF FO
OnO 07
rGODli
C.IPA,4
(0re3 .AO
onnr4
(a4F?
G,OPSc]2
tn
OOFR FO
iF9
tFF
n.E
o0FC 04AF?
.OF
R824
0f0170 nOS0
INC1RO· uPnATE THE 8 HIGl ITTS F
JA. T
INRS'-i
TNC@RO
MOVRO,,t2AH
PI.A
AIln A4.RO
cPI A
PUT THE 8 .ltW BIT OF ACTULT
- THE 8 LOCIW
B8TS OF
MO z.A .rDESIRED
TME N R2
MOVRO,3.9: PIFT!TE 8 HTGH ITS 11F ACTUP TIME
. iTTN
MNVARO:R0 ACJIINULATOR
MOV
t
RO,;
CI.FR THE : HITGHPITS F ACTIiAlTIME TN Lt...r"TTI
N
.:..8
,P.
THF
CY
CLF
MOV
RO,.?7H
ADDC,O
: HRIGiH
8 BITS
ID'EHTiRED
FrA(TAI. TIME - HJAi P, BITS OF
CPI. A ; TIME
.IP7 TF! I NC ArT!JI.. TIME IS LESS THAN n.ESJRFDl
TIFE
A-TIqAtAL
SPELEDIS .F.WATFR
THiANDESTREDSPEE
Z INCRE'.E THE TIMt DELAY
. JN)7 rLc
FOR ANY OTHERNONZEROrItMB.R rECREASE THF TME
MOV Ap,r
DClAY
!JNZ
D..OCR
.1
IMP FINIS
DFLDCR: OV,R., 24H
MOIV
A, RO
DEC A
DE44
DECREMENT
FROM THF ' iiO RITS ANDiPUT THE NEWVAI.!' TN
MOVi@pA:
LOCATiON ?4H
.ZJ(6
rIPgF
IF A 0 RFSUi-TS ICREMENTFRAM TF
HITGH-TS.
T.;il
; t REPRESENTS
THE LOWESTTIME D,.ELA'RN 0 R ESENTS
.
THE HIGHEST TIME DE.AY
3
34
2..'51
422l
r2.37
.. B.RF94Gi5
OOf:0 FA -9
OOlC 96CI.
OtI.C OAF4?
42.
Oir5 R82¢4
.7
O
lOrS 07
<!O".A0
OOP)AR234
.0rPS P001
OOlA i8
OOnR RNOl
0ln 04F2
.nr
R.,
,.F
OOEIFO
OOF?
10
? I!
.....
fr..' !%.F7
SOl!CE STATEMENT
2r,0
221
222 SKIPIN:
'3
.4
225
A22
OAR7
fP7
,
.
PAGE
s
249
,2.50
rPoE:
,1
2.52
2?3
.MP FINlS
INC Rp
MOV A@R : EFCEMENTFROMTHE 8 HIH BFTTSANDPIT THE NEWVUl.'F
nEC A:
N IN
OTTON
tl
2.
..17 LOWEST; It-IFSS
F
A ZFRn RFSULTR IN THE 8 HTIGH ITS
.]V
O4 @R,.A
;.5
.J.t FINTIS
6 I.L(Ot.I
T: MOVRO,?4H : TN JH*TrHCASE THF DELAY T A,RAFADY
A l.t1.i AS P-ST,
£
?i7
iOV W.R0,#l : iTHENKEEP T TI3 WAY B8 PiTTING A 1, VAl
: E
,,Tc.
35
INC RO DE!AY RFIRTSTERS
.V
9
In @RO,t
2,l)
JIMP
FINTS
DELINr: MnOV
RO.: !?24H
2
MnV A,0R 'INCREMFNT THE I
TORI IfLTTON
?4H
f
Y.
0RO .
..
..
A4
.17M
MREfN
I:
IF - 7'Fh , THF HTIEST
O:5:
DF &CFMn
Y.A:
A1
TF
S"65 ~~~~:
Ti'1, THF I F:~TPi'Tlf8
nNRFN
;f-:E
.
hF
2'
·
:~.9 HiGH
~ I:TTS
-,Ft7
.,itP FINI
?F IMORFTN:TNC.RC! Tc THF n HJ;IGHRBTT PRE ARL
7,.8
READY0, T E' THE nE~i Ir
/9
MnV A.RO:
','; AIF At o-..s
70o
,i7 HII.3FS : IF THEo HR
H.TF-':
RIT; I
A
ARF
T NOT0,TH
F,
T. Em
iNFFNTTHF -!1fiHl
271
!NC
iNC Ro 1BTT ELY RE .STrS.
*77
.MP FINTS
7':
HT,EHFE:M1
I F THF DFI.nYY-.
Tr
R; .-. -, F1 TE,,, ;'EE
274
N RO,:It:.4H
R0i*......................
ITN
-:.-.,T
274
27
MWT,4E
:".T~D TT aT 'y P!RTji,%I ZERO
RTT D3AZi
Y
THIS-IT M
M-4.ii/ljP-41
MACRO
A.fMER7,
V,:'
'VAR!t iF. 'wTCHTN
E.AY
f,..
ilo%
Sd RLDESTATEMENT
.'.TSTER
,: Wr~",;'
FR
NWVRO
r494NI
S
mnV A, RO;
iT THEf
ON.BITS OF TIME riF AY TN I.OCATliiN 2414
nOV R!,A : TNTn RI
INC RO
MNVAIRO
PItT THE 8 ..... H .. T. .F T
'
t':~".A.T'gr '
2I..
MOVR?,A: I[TO
RETR
OAF?
Fe,
18
Fo
00F4
2.79
?11
AA
f0OFa
OOFC
F9FA
FAFA
.
rREMENT
tE
TE
.OW BIT;I
?84 .;FREf3: D.1;7 R.SERVER?
TITN
TTF
28
IN7 ,'2.ERVE.3 t rECF..l.FMENT
THE 8 HIGH BIT'S .F TIrf
FF
41EO
.29
207
99.F
2.9
CLR A
MnV TA
STRT r: START THE TIMER FROM0
MfV R0,435H;
rLEAR
THE R HIf Ht BRIT ' ACTUALTIF TN L'
TI.F:N4
3..
MNV RO, A
FOR THE NEXT 4 PASfE CYrl.E
MOV
,R520: NYUMFR
OF TIMER OVERFLOWS;
EFORE A R.,TART TS ENTERED
?9A
298
01 OA
c
01 O. 47
?99
MOV A, RA ; UPPATE PHASE REISTERS R7 R26
't. R7, A
SAP A
OR.. AR6
RI.
,
3fx
302
AtF
fl)
! 3F
1
3113 1880
griP 9RF
On
(1,
0
4
4
MV RA
30
3O7
:'09
310
.,§t.1s
47
0A
Ai F
"II
313
.g4
319
47
aF
i'l 4
O1!? 8940
eit,; 9A7F
89
.1.
-rtr?~n
.. :
ENABLENEXT PHA-EFTO TNFIT TO TNTERRFPT
MOVR4,4-1
I TF AN LNERPE-FFE OCfR.UR U.!RiW 10 RESTART ATTEMPTS
TrISABLE
THE MaTN FRO;iM TOiEXPANTFR
r NABLE THE IP!!T SWITCH 10 EXP4ND3FR
.WAP A
MOV R2.,A
MAl A4
ORI AIR?
MNOR0,#?2Mj , PlT THE 8 LOWBITS OFTHE rFTSIRFD TIME TV
MiOu RQ0.:
FOR 4 CNilSECUTTVEPHASES IN L_,CATTiON
2',H
MAVD AP7
nv.w 4A
01'1F
4A
oi
MOnD P7.A
RL. P2,,Rxsr;
ANL Pl,
F
MCNtDA,
P5
6I'
:317
011O,..E
Or'E.{.LY
iN A R4
'RL A OE0H
.qllTt P,A
TTlN OFF THE rl.PHAISFANDTIM.r ON THF NEFW
PHASE
AM1.P,0DFI4H
TUlRNiFF THE PROHITITTON
TRFIJI.AT:'.
OF n.AC
0104 ,7
01 Af A?
nlrr
TlAY
051.LAR?
INC RO : PT
m
THF HICIH IT.
MOiV R;,A: 4 'CC.R.fCTt:,F
'-.:" ;
iF TH
IES-IRFDTF
INT'R.AL
iTN
NH 1OfTiNJI
R5IP#W4K ' DJS~AR
.E THF T P .sWITCTrH
.O :,,,P,.FR
ANI. P2, 7FH ; ENABLETHE [iiN PflOGRAM'O -YPANEFR
:::7-!
3nf1!
_27
:?,;:
!
.
AL
.ri
TTS.R-T
T MICAi-4/ 'PT-41 MefO ASEMRLER, u3S.
h
'ARIAt F ':WTT:HTN D.ELAY
PAE
1U{. On.J
I TNF
0!'2F F:324
01MA0Fh
1t:1! A9
330
.21
332
MOVRO, 24H
012?
In
"
..
Ii A,'
0!34
:'3~p.5V
MO R, A
0.13 .83,9
0137 PO}i
337
33
339
240
141
342
n
1MOV
IN, 42,H
MCOV
@RO,#.IIH
l
0139 R.qPO
0l2( ?Sd
On1tE :9
0l3- 3A
n014024.0 :,
0142 :364?
0t144 R?,'
0146 OF
0147 47
0i14
36ti'2
A
3;
01?5 A0
kn
dOw"-7o
4h=J,
VrL
1
I
601K 42 "
01.4 A0
-l5 v,.4
')l A7
01A·
.6A,
op
Y'
DELnAY ,N LCATICIN 25H
,; NTO R2
INITIALIZE TO START OF 4 PH-AC;E
CYCLE
044
DATA?W.
STORE TrE !O.CATTON
ONTATNINi THF A'DDRESS
THE T'NTFRR:1PTTT
'iUNTS F
4 P'H4''
R'!
IN,7
P
THE FTEI 1ACl
FUT
ALUE IN LOCATION X.H
:
371
s'n
.iV
74
V40E)
A,P7
SWP A
MCN
.
R. iA
Mvn PA,P
CRL AR?
MnV RO. A
INC RO
;
37A
:::77
72
S3AP A
MOVKP2,A
J AP4
,
FIT THE
XMJ-I.1M
Pri
VALlU IN LOCATI1N12'1H
'.t F',.-:: .JNT HERE3
.r4L5 HFRF4:
.rl HERF4 ; WAIT FOR T TTn
ARE FPRESSEI
37
I
RO
O:
.
70
PUT THE MINThlMIM
.AC: VAIUEIFN Ll-TT
,N 22,
MrOV ^ P5
0
"
24
1
INTO RI
.rlr
nrl
l:.0 47
O!IA
.|^
0 tr
HT' *i
.P4
.D
....
3O8
!
.
,
M.,)t A, PA
eL. A,R?
MOY@ROI t
P'
M
OVD A,P$
AWAP
A
MOV ROP;
-
BIT- OF 'Tli
M1V A,P 0H
T·lIRN
OFF THF TRAPNSSTS , ENARLFT
INPUT
ITC1'
Tli PI,A : In EXPANEFR, AND
ETdISA.
E TE
_LEO/t . ExP-NFAP
OtTL
ISBE
R' THF MAINt
f
PROCiRAM
I. EXPANfER
,!NT H4REFt
JTO HERF" : WAIT FOR TO T RE PRECSED
O3VRO 9.0Hl
MOVuD
A P7
WP" A
4
:
q157 !t
(059 OF
0159 47
j 15A4
015R E
4AF
01.n AO
d 9F 8
N.,#LCV
M3f4
:OF
3AO
nl
1LOW
Mna A,@RO: PUT THF R HTGHRTT3; F TlE
3.51
35,F
nt7
"C
22
-',
f51C
AA9o
.nLjM
PIIT THwF3
OV Rt.A
.A-.MOV
IN
.
i01F
Mnv A,R0;
..
3j45
'46 R.$ET:
:47
48
,;
49 ,FRE1:
7) HRE:
8I
35
:
n 49 OE
014A 4A
014R 40
0t4C 18
4n on
tE14F
47
tJ
'OTJR!t"
STATEMFiNT
:34
F
7
C. ARR2
MOv RO,A
A
PfUTTHE ROTTOM Ar: VtiF JTN it:ATTI,
:!
HERFS:,'~4TO FRF9v
-',6.7 ':-'? H-FRE.-F: .ITO HFFRF : 'AjT FR TO TO F PRE--FI
'.
I NC RO
4
MOVIIA,P5
-0
,2
23',
TT.TR-TI M$r-42/UPT-41
J>TR
·
......r....C
L.nOC ELp.l
01 A8 47
AA
,1 .An
t
MACrO
i .sM.ERC
, T0TEMT
PaGE
R
.H
LTNE
S.)R.E
STATEMENT
4APA
X. .i.
387
4A
47
01170
O.AF AO
MOVR?,A
M.ivnA.P4
ARI._A,R?
TINC
A
ADD i TO THE 8 LOWTNPIT BITS SO THAT AN ITNPUT0 YTE!.L
,T.r SMAt.EST TIME fELAY
it
MOV@R, A
PI.fT TE 8 LOWBTT.S OF TNTTP. TIME [t;FAY iN !.rTIO
71
01k7
0170
OF
47
94
39!
.~2
t.V 2A
,-99
,OV!1 A P6
A 2
'INCA; At
4A
17
TNI R0
iOJn A.P7
I TOTHE
HIGiH INp'lJTF'ITS
2.E S.AIM,-F. TE
n074
Ao
4879
0174 18
on
h!7F 47
I 1789AA
4A
11793
O!7R
,17F
18
OF
47
OE
0912
01
4A
3Ai)
18
OrF
47
OF
0194
0184
-410
M'J
424
425
497
427
432
,4
4.'
F.
47
Tr-GH
PITS OF INITIA. TE
r t
I
D[ELAYIN I.11.ATI
sHFRE7:,JNTI
HERE7
404 HERRE: ..IT HERE8 WATT FOR T TiPRES-Di~
INC RO
MfKI) A,PS
407
SWAPA
OV R2,A.4
408
409
MIlil A,P4
410
OR,. A,R2: PUT THE 8 tOW pBTS iF THF DESIRED TTME INTERVAi.FCI
MOV ROA
411
4 CON: CITIVF PA'.5?ESN LOCATI, ?,
all
ITNCRO
41?
'1.0f A ,P7
413
4!4
:'UAP A
415
NOV K ,A
4!6
m.nvnA,PA
417
AR
AI.
; PUT THE 8 IGH
1TS OF THE r7ESiREDTTME NTERIAt. FOR
41t
ttOV ROA ; 4 tC.NSECJTIVE
PHASES. IN 2,71
4s0
419 RFRE9: ,.NT HPE9
HEE!lO: JTO HEFlI ; WAIT FO!RTO TO FE PRESSEF
471
INC RO
4?2
MniVTA, P7
43"
1 AO FO
347
PUT THE 8
TIFt.lr
403
4..
C!
8f8
031
:',F
RO.A
:
THAT AN TNPUiT0
ELAY
41.7
4.'
MOV i,, A
MOVnA,P.4 : PIJT THE NUIMBR F PHASFS THAT ARE T L"P5' 3ETWEEN
ORL
t.
,,q2: E:VRY SET OF 4 CON-ECIUTIVFPHi43ESTAT T:S1i.1c3.
FOR
MOV RO A; S-.'EFT1n
.MRRFTM ON IN .OCATTON28H
MOVA4.#40H;
: T11S
PFTE INPUT UIT.H5JTO FX'PANER
.NARIE
IJt P1i :; aN!l
THE tfA"'I
!1 .XPAND'R
MOVA,
; BTSAP.,
LE TE 2 MAXIMUMAC
MFiJ
V PiA : AN. 13
ENAt.E THE 2 FIELD DraCL'
f%14E:
C:.R A
MSARI.E!
T,
THE
MINT.M..IM
Mnvn P4.4
Anq 2 BOTTOMDAC ATIF',m v R). .0H
NOV P,
,.0
: MOtVETPF 4 CWR
TN 1.X
Movn Pi,,A:
OUT TO THF FTIELDnAC
ATr 0i 7i',H
S4~aPA
; MnrvETHF 4 TfN 8rT
rINLT'!- Il^ *,
-.
MNOV1 P7,A: glT TO THE FTEiP
L.AT.P
, ,:-WrT74
:nE!
w1
p'._-4o/iPT-4 MRO AFr:RtIF
V2)
, ~... ...A . Z-.i,:_ _!.!~ ..0-
TF:T:-IT
-:,.trl*
....01
ii
.
.
40
MOV440,.3H
MOVDP5,A
INC Rl)
MOV A,0RO
NIiVDp, A4
SWAPA
MOVDO
P7,
f..R A
M./D PAP ;
.Ys
451
MO1V P,A
INC RO
Ff0
452
MOV AR0
47
44f
olfA
:'F
'AIF
9
3
SOURCESTATEMENT
440
441
4-I42
44
444
445
lA6 -n
IA7 I0
Fl
t 4Af
;-
447
; O :1,.1F TRE 2 FIlF.d AC LAT.HF
NO ENABIE'ITHE 2 MAXIMIIUMAC I ATlHESi
MOETrE 4
,OT TO E
MOVETHE 4
t.!TTO E
LWBPITS TN .LOCATIOiN
21H
MAXIU!M VAlJUFC.
HI(rHBRTS TN iOCATiOTN
2IH
MAXTIM VALUF OAC
DTSARLE
THE 2 MAXt[IMi DAiCLA:TCHES
0ot,
t
r
01RI
Mi:VDP6,4A
SW A
MrfJl P7,A
MOVA,3H
Mf;vDP4,A
INC RO
MOVA,RO
OD1 P, A
SWAPA
t.V1OP7,4
CLR A
M.IOUN
P4,A
454
0R.S
01139
45
457
47
.r'
.Fh
lih 47
0IR -IFr
0iRF
1.i
4rA
4A?:
4A4
J
In4
1 7>
1P9n
..
'5..
imh ./I
iOtF~f
T1
.-. r!.
P.
01;N; 5AC7
.:1-*7
:z-
- ..
470
'
47?
473
474
R
476
477
RFfl
1313n04
Ri
)H
4I82
IA,
RR09
MOVETHE 4 LOWPITS N LOCATION.2H
'UTTO T E ITNINJ1M vALUE OAC
MOVETH 4 H1:3 BITS TN LOCATION21!1
OUT T 1.
TMIlNIMUM
VALUEDfil
; DITABI.E THE 2 MINIMUM
fl AC L.ATHfFg,
TTT
OM AC LATCIES
: ANDENSAB.ETHE 2
MOVETHE 4 Lnw RBTS IN L.CAlATiN 23,H
C!T TO THE BOTTOMD1C
BH
TS IN lItOCATTON
23H
MVNETHE 4 HI
.1LJ TO TE BOTTOMriAC
DISA.BL THE ? BOTTOM
i
AC
I ATCF.-F
MOV A4 0fifN
13JTLP,A
DI;S4BLE THE.ED/DAr. TO EPANDER
C..R
OU.ITLP,A
ENABLETHE MN PROGRAM 0 EXPANDER
t
HEREI : ,TI, IRERFII
WAIT FOR T TO
W
PRESSED REFRF
RE STARTN THE MOTORfi
.RFI 2: JTI HFR!F2
A tLLOWP0.Y tO ATTEPTS TO START TE MOTOR
MOV R4.4-tO
RESTRT: MOV RO,#2914
.T'-RT
T 4 PHAS;E :FCYCLE.
ilv (ROt !i I INITIAI.ZF Tf
sPIT THE ,NMBFR3F PHA.SFS T FLAPF ,BETWEEFN
M.V RO,. 28H
EVERY
CT OF 4 CO.N"E.C!fTIVEPHASES tUSE FOR ';PIEE COlRRECTTIOi
M)TJA,RO
IN THE ACCUMULA.TOR
478
479
491
4f
.n
4fQ
-1
ENABLEt.
THE 2 MINIMUMDAC LATCHFS
.N WAITw
i-
NOV mR..l'..
UATA2 * STORE THE lfOCATIftJ CINTA NINGNI
THE APPRESS
OF THF NTEiR(PT THAT C'J:'TS FOR 4 PH4ASE
O
:
R3
2N
,.!MP
ON~wR
WATT?: MOVr, i3 t.OW4"ATAI1: STORE THE lrCATIr N Pn1TAININ TF .FTrST
; TNTERRPT . RS
IN R3
nMV RJ,38H
1 . 1.;F IFr.:ATTfN3",HAS THE UnORI.iN R'EISTER TOirEEP
4.6
Mmv fRO,4
TR4.K( ,F TE
1'iM,, OF HA.4.5E;.REAITNItN
4
FRF
,
PFD
: COiNT IS ME
''!
Mi3VA4014H
MO'n P.V
A : -.LEFrT C';ES'EF
! NTERRUPT
IMOV
R9, . * NIUMR O TER
tRFItOWR RF.W
-E
F
A RT:TAT T.T$ ;.TEED?
°,
r
l
304
.n.f
*r
. L.
f
.1 F4 i 4fF
MnOJV
A.i-I : SrTA
RT Er!.Y'cI FR
CALLt ITTTI
° UI~T-
.
'.31-TT
MArN A0S:-%3MPR
FR. . V.2
HM--48/PT-41.
PM'UlC
.1
vRAFA;F rWITTCHINGDqE
lIY
-t 1 1r0.1
LI NE
OIFA
R'.l P1,#
0IF8 4400
crsp
0200
SO,!jRCE
STATFrMFNT
496
4fi9
4q7
OF
490 FON:
99
501
592
0204
0206
H
,
uITCH ON TF
I ,-T
FTFI. TRANSISTAIRlINTl'4t. T
FIELD
.- E v41J$ l T.TN
fl .riY
I...
4i'?
.IMP FIN
ORG20014
MOY.C.
A, P6
CECKFELD CURRENTi.EvEL
MiV Rt A
Mnll A,P. : CfrIRT
ITH A ELYED PfFX
4NA.A4RI
.I0 MEN
.IMpFfd'J
of
5.
3209
9o. MSEN:
.C07
IR3 Si)
JMP So
020El
P:?
0119 44129
51!
0213
!74 SPO:
RF04
02111
02.
I RFO4
n2!
5I1
I NITIoL P.SITTINh SENSEFSIei-AL T DUE
Ti O) P{TIF)i/nT)
M.FV.D
A,P4
CDnEANTNI POSITIN A
SFNSFD BC MEANI3 Pil.TTON D
SENSEDAB MEANINGPOSTT ON C
F.mN.'-.E
D4 MEANINGPOSITiON B
,-u
DEFINE R7
,Ov R7, #Oftf
MNVR,,,
tO2N
..1MPSt
Mn R7,fO1H
MlV R6,404
....
P!
rS
IR; NT PHASE."c
H,R. .P
, as'EXT
-
PuASr rWITC:H
7,
5!7
o.8
0227r
4429
.F03
mKi)
. , i
TAM3
R. 6
MV "A,4 "-.U
5C
..0
,1)
FO
AS
19
F',
527
59
FF
,
RTAlF 1
.
MnOV
ROP.24
MOV A.kR0; PUIT TfHEq IW RBTT
S flTTF
MOV RI,A:
INTO RI
INC RO
Mnv A.,sRO P!T THE ,, HIG1 RIJT F T
MOV R2,A: T n R2
MOV A,R6
MtlJ P7,
TU A. R7
F.
43P29
:
,
XT
ASFN
?.N:TF
O T
DELY
iTME Nh'1.t.TtiN
r ,IN
El,
-u1
PT
..
AAT-i
N
2r
:"I'
.=4;,
..=,47
°
54o,
,
5~9541
Ot!TL P!, A
TN
OFFTHFT FTF!
j
AND
TRiN Cl THE
r
' fTF
-F r PH
NO.:a s 0 P
Ti 1UN 1F 7- Rrrljlr;M r M TU
ii - T ;-
rSF
I-
27
; I.
5.,
5~
547
,-",?:'-:OF
MN Pf0,.s{
#
TiV
tPR0,'
A
ENJI
i!.~
..i
j
: CEFA-RTUF : Ul;'H T-S OiF
THEiF'"'T
Y'Y'AI
N- RI!.
BE...TH FTFPX,
E Afi
..
Af,
T T,
T..,
,:',
!
FR
.1,;,
,
1 iMAFrlO ,:!SEMBI.ER,V3"
1TS-I;1?t:!;T-l
V;.I:F4_E !r3TTHTNf PE! AY
IINF.
ii
:PItCrF STATEMFNT
WORKr
1: ,iNTO WORKI.?
Ir .
qitr-,::
0241
fJ?4*
cr?
U
E
. 4*.
11.1
0?4:
.,
,.-, t4!7
THE s HIGH
rjNCRFMFNT
ORATI~J"4-5IH
'WoR-4(2: ,TO
*TF MFiRFT
JMP RkI'?
MORET2: t
Rf, 350
.' INCREMENTTHE
N. .::
C: .
ATION
35H
D,.JN7'P., iRKtI2
1t.4NRj
:
564 p If,87<
,MF' I4TRT
o?..3
:-,-'
i1
447n
14F
5&qO
.4.
NSTRT:
58A
*_i9Z
5rq
m3
24rR5
2dC.5
FR
R
iRROR*
HfH
BITS.iF
Nz
574
lJ4PNSTRT
577
97R
WO)RK4: JTI C A.,l2
4
979
J.TF MCRET4
5:30
.JIMP RKL4
,
584 MnRET4: M. RiW 3;5
,H
599
C7F
r -:~r
Tf
T.' I
CTUI" TIM
IN
MOV RLOWU D4TA3: STORE THE i.ORATIONCfiNTAININj THE DrRE'S
; i THE INIERRPT RO!TINE TTgT CNNGES TIE
9%7
568
; PESTRF SP.
IN ~R
569
JiNTI WlIRKI.4
57 WOCRKLS:
.JTFMrrET3
571
JMP WORYLU
MORL'F: iV RO.43H;
tN/REMFNT THE 8 HIGH IT.S F C:TZAL rIME IN
574
1N. R(
; IOCATION :'H
.1/i.
071.!
,;7.~;,
i5
Tlf
D,.JN/ RS, ORwLT
IMPP......
NTRT
A:9
o24F
0?7F RrS
F
T.
·..........
i
.`-i.
5c,
10
ED4f:
447:3
A,
-54
MttiP
WRiKL1
tv Rf 35H
INC R
4773
444C
02A4
i '1
IIREFTI:
t
INCREMENTTHE °. HIt.h PITS OF
03 H C
I..
-
TI,3. TIME TN
.T'.H .I
......
'.JN7
RMWORKI
.T RSTR
T.'[I4
TDrS
T
STOP TCNT
fXTI_
P1,A;
CIR
TIIRN OFF THETR(INCSTO
TINC,R4: IF !0 TRILS "aE !' THnf., STOP TtLL TI i" PReSlFi) AA;T
MnV AR4
.7 OtVUERTO
590
IMP RFSTRT
5.9
HERFI1
.is9 OVERTO: tMP
· r.. ,,;j
HAfNG?:MOV Rt.OW
597
,iMP [,R.,!
! r: 27 11itItT^SLitr;
T11
ATA?,: STiRF T; TFN
: OF THF
.
: DESI.REDS EFP .. ,
D
if
1..,
iTNr-xt-;
..
r2:3244:?$
FNn
it:FR '. VM d .
U.F NC OOnF
HFUF2 014?
TMNT1 :r0029 L.A )I.. 1 ..
FYTUNTo0003
FTNIS 00F
..r;.:
RE
5.
.,
HFRF4 0155
i :'.
PATFR
FFE5
i0009
0:1200
f';Af0i, 0
H!REI.
rATA.3 000n
HiFF:'7
4 " ;1 ,79
H .A t 79
rr,.. I
_...
. .,.. .j.1
,,-".,: i ¢ !;'':
7d
FFR8
pnn... .
· .,::.,
i.s
:..
COR
.
E.r,
T' !R - - '-,j
ir;t,?a
i, 1,
VgRTRii
.t .F C4IT-'r
'" r'ti r. Y
.i 1:"
.
tiT
,MfIRF
TM
S4; KnFF
'er,
.-
,i .r
)Ot
?
.. TTTF
a
'i
:-
4nA
TTM
I .!I!
,;r'ilMr,f
V P-CYMCi
r- ' rrl.
. .
,'_,
!' .'- '6
't_
OOfl
(iC-7F
- 4.I .-
I. . Ir
T
TO 071
EiR
O-
.WTSPtOO3A9
02 F
'-5vRI- cO;S,F
i?-F
iiRET2
O"lC5$-2
iniT17
T._INT
t
i 2,
JPRp
r
.
v.4r
MFIFT3
,':;F¢T'F]
.. ,Fz"'cFI
.¢. . ,_.R.
',RF-.T
, 5r .4
0 ;
114
AvlT-T
L&l
'i
4
0 ii
D
AIT--.,°
,'AT fj'
W- Fi
,
C
.:-.-.,
,),
C
? '0' 3
TsVr.'i-TT i'-4'
/IJPT-41 MACROA.:E,:,l ER,
RNT
SPEDl VIA VARYI'G CURRE
NFPSTANT
!LOn
7
!O
.-R
.4
.
·
"9~
26
7?
<8
9
30
: ACT¢'&t TTIE .TiTFRUAL- DESRFri TIME TNTFRVt4. IS PERRFRMED
S
'F
!
lFIT
GTTfR ARTFTiC.
RT
FOnR4 PHASES USIN, 2
W) T
IRRENT L' VE...
IS T 9 .-O
IEED
MPOTT'VF THN TE MOTOR
IS INT E'.D.., iF THE -SIUtT IS NEGATIVE, "tCN.THE tO1iTR SPE
ALS i FED IN
IS TOO FAST ANDTHE :FRENT IEVEL IS rEC.AE,
T
ON TiHEINJT DAITASWWITtC'.SS TrE NUMBEROF P.HES. HATAR TO
THAT J. .,-Er!
PHAF.SES
17El AFE BETWFN FVERYSET F 4 CONSEI.!TTIVE
TS Tn NOnFICATl
DETCritrC
;FOR SPEED
CIT. cORfRECTION, EX . . IRR.
BY ERO nO,-I.t-,
iOF THE
OF THE NEXT PHASE WILL BE TRITGG-ERED
GOlNT FROMNEGATIV TO POSITiVE P.ARITY,
; ;NSE WAVEFORMS
,TO RN THE MTOR:
CRRENT L.EVE WITH P7
:1. nI P73 TO PO INDICATE THE MAXIMUM
E *
ON
3
TO P.0 INDCAT'E THE
m9p5
_A!HE- ..
PA.CA
A'3 T
SET OF 4
: NMIER F P1HASESTHAT ARE TO E APE BETWEENEVJFFRY
............
AiI.F
T_HI".E:3
I.
m.Ne~e
~1r, 'm.2,'l%..%.
SPEEDCORECTON
ON~t~l3E1J~,!!
TTVE~::
THAT S USED F
PRESS TO,
; 2, ) ON P72 TO P4A INDICATF THE DETiRE! TiME INTERV'J4 WITH P7°
AS rTHEF
MS8 AND Pi40 i THE Lse:,B
; PRES'S Tl.
THE MfTR,
3,) PRES..SrTo T R
'i
...
ii,
1t27
IS
14
15
t,.
r
.
;1
19
:
F:
O,.4
3.5
.7
42~4
)
,:
HO
F
OO
3411
,S011Z ,,A
('!dOF!r
39
isC~ijF
~4
RETR
00;!llF
.R.
.TA..:
P. A
.9
51
52
LOCATION
ORS17
TITMERTNTERRyPT
f. TCNTr
0,]8
f .
*TFM RESET
JMPRE,FT
4!
42 TIIINT:
0007
0
Yor.T:
?
ORG 3
3
FTFERNAl TnTFRRUPT
37 EXTTNT: T
.
JU.MPTO THE EXTERNt.. INTERRUPTROUlTINEWHE
MOVA,R3
9
.t.
iMpp A
IS RTnOREri
4T THE ARESlR iN R3
6001
ow000
t
r
TE MOTOR T A FTXEY .s;PEE
; PRfliRAM TO R
TI.i,
RN,
HN TUFFTFI
INITIAI. T
F
TRANlISATR.
A 4XM0I.!MI VFL
TO RISE I!NTIL IT RFAC,4F-,
; CIIRNT IS AL7tOWDF
u TCiES,.DFTERMINEDB THE MAXI!M VA UE FED IN ON THF ATA INPT
IO
. ;RESTARTWT. ALSO.IRECT FiTFD i'RRENTT TH-E A" Rl.AT
A
MTit!MiM
TWEENT4E MAXIjM,'MiD
In'
I EPT ET
PHA. CURRENTWI! I
VAI tIE FED IN ON THE DlTA I.NPUT
MAXIMUM
LEVE. 1 DETERMINEDBY TH'qE
:
IfML¢l.,
I
TMXirl
S.'-S ATTHALF
H MT
'INi I LEVELt.
;0:3PEEb:,
. TCHE-S, THE
NPM, ITSA
E,--,,
!,NSFC.TTVFPI4SESE AT T' DESRED FIXF
FOR 4
THE TTIMETNTER.VAL
..,c
,,, .....
,T
"
":.3PE
IS FED iN 3N t
3
0,0 0408
PAGE
JIRLC
R '"T3TA.
t.
o.!
V,_0
ERE .
R4
E..ET:
t
.;T
HHf:r
T
t
i'.s4
.,TIT
FOR TO TO
!
f-, r.- - .P! T,-,,r
F jj-n
PkNiARAMR FNPB-~F
TRaNS...I
,-.
YPTR
N·
T~1T~~
t.cf.. P . :... .....
:,
THEMAIN
4 .-4%!
HERE2:
,rHiRF2:
.,
,:, -TRN
T F
EIi
PIA
... PGAnAh
T,
E PRES'rE
T
..
O
T...-I
,-t4-81pT1
4
f.NSTANT SPEFn
FvTA
..LI.'E
.OC OP.k..
01!3 R3 05
009! B20 .
0o.7 (IF
x0018l47
O AW
A
Ft
OOc(lF
ohtR 4A
.
f4
,t01F 97
0OtF
A7
Ab"'
47
0070O!8
0021i t9
?O" AO
.
a7'
At!
0074 ol0
0fi 47
00, AA
f0?7 (F
0i0284A
,oOIRo
oz2A .O
OdnR 4462P
i.02P
5f19
PARF
";
iR CE STATEIENT
s
57
8
59
An
1ORL.
Al
A?
.
A3
,4
65
(10!A
irn
MAF.R
f A:SEB
.
ER,.: VF. 0
VARYINOCG.IRRfNT
MftVROtI420H
MNOV
RI,
.H 3
MiVD a,P7
SRWAP
A
MOV AA
M.vn 4A,.P6
A,,
V ROFA; KEEP THE FIiNAL
14AXITiMUM
V4fE IN
t.C f.ATJON 20H
N1OV R1I.A '. EP THE UPIATFrnMAXIMUt'M
VALU TrNL.
TIN iN
F R C
DIVIDE THE MAXIM! VAIA.lEPY
RRC A
TO O,3TAIN THE MINIMUMVUE
IC RO
INC RI
nO ~Rn,:
OV @RIA
MOVn AP5
4
9
70
;EEP THE ORIGINAL MtINIMUMVLUiE N .l.CATtN
KEEP TH ,,.,,ATED INI~UM VAiL.:F
!N lliTTO. :,31,t
.H
71
.WAP
A
72
73
74
75
74
77 HERF3:
nOVR?.A
MovO
)g o
.- A.R2
I. RO PUT THE N.UIMEROF FLAP-'FI PHASERIN LCAPTTON2?
MOV ROIA
.NTI KES3
JI
ERE4 ,' 4JAIT FrR T T
E PRE'.:;
MOD AIP9
SWAPA
MOV 2,,S
A
MOVDA,i)
OR!. A,R2
INC RI , MtIF THE 8 OW BIT.e rF THE
RESIED
TIME TO ME.nMY
MIJ
i A
i.CATTON
CIOVD
A P7
78
,
ER4:
Or F OD
0030 47
0021
. AA
00
0C
00.3 4iA
F.34 19
03.,i5 At
00rF-,O
f',. l7 47
79
Sn
l
R2
3
84
85
8
:7
039 (IF
OO.A 4A
490
':.:..9
CO2, A'
MOD
krf93
D
'$AP
'-):
0()4fs D:F
i004 RR2?4
r'45 RO31
B,
0F047
VO AP6
ORL ,R2
9
I NC R
MOVETHE 8 HICG!BITS F DESIRED TIME TO EFORY l.OClATtN
9W
MOV RI A
HFRF5: .INTOHRE
.
94 HF4RE: JTh HERFA WAIT FR Tn BEFORE RfN.I;3 THE M1OTOR
.
>95
N R4 , -iV
A.LOWQiNLY I0 A TTEMPT T :TART THE MOITOFR
A R TSTRT:
MOVRO4TNITI _P1AF
I rl .C.Y
S'
Tr O 4
Q7
MOV Rfl,. H
9MOnv
°93
R3,#i 'LW ftATAI
S-;TRE THE l .CATITFN
CONTAT
INItM: THE FTIRST7,TFR,''T
99
i
RE,.
1".,J
H
OVtETHE
rNrO
1MFR
.-70
OS P-. SFS TO rL PSE FORETHE FIRST
l1ot
1MnV
A,SR(
; 4 PH-ASECOUTS INTO R'
107?
M.NOV
r.2.A
1i3
lMOV
A, 40H ; PISO:D TFHF INPIT :WITCH TO FPANncR
104
RT Pi,
AND
:
NAr!F THAN.;F
I Ef:/
T Fr..NFlR
1,0
E NOV p
AO FH ;
ANABLFE
TE
FLF; rAP. If at'r
1)
MNOD P A ,AND T'"HE
'2 MAXTMIlMl
ACT'. ""'3
07
..
R-AFIE THE 2 MTNIIM
M03D P4, A
NPs2 ROTTOM AC. i.ATrF:.ES
19
nMV RO, #(H
2
('
).'
(3.049R?
0,45R.0
004. A
'm4n
40
04
3
.090 ?~30~F
,w,=.-, :D
!
i
,.
FR?0,-")
:R2:
3WAPA
.M0
A
89
I -..
,
T7TF-TT W""-.!';{~lPT-41
MPR AEMP.ER,
C.,lNTANT SPFn VIA VARYINOCURREdT
L,. AF.
kl
,
LTI',N
o:07 FA
SOUIRF
.i. .7
Ito0
IF
11OD
ii?
11:)
114
0051":
37,
;115
.
iOSDi?3'0.
05F 7.
i6&
117
059
47
0Y'0A
:-:F
0,h01 Fn
0042f}
,,? 7E,,
0,AC 47
'io44 3F
0"x)0,:i5
0i47 3?
064, 27
'A0 3F
.
O(:AA ,r2jA
.fl3 :.
.AQn)27
00mE :3C
100A6F
2.-:r
l0071 39
hn72
2l
00173 3
.A
0074 4.:
..
.r37 ..
1!20
1.21
i??
1.20?
3
t124
125
i'~
1t 7
I?8
t
: 0Ov
11MI
I
12
12
134
t1.35
0179 55
f07 1A7E
"0,
047A
001Q7,~=
0
?2iSf
0n05 FE
',:
,.4Fi
gOir3
:3:
.t.,4,99n,
F
,.
Ai?7
; I.
i-7
..
.
A?
.(ir3P
aF;
A:O
14
-:,r,,r~c
,I.cFc
00 47
3A091
i').O~'7F7
·
140
141 WAITTF:
147
i4, WTMR:
144
145.
144
147
14.: ERV!'E:
149
150
TMER UNIT
.OF
U.NITTS
;FTME
STRTTTI ; CAL TO THAT TN
JITF WTMR; WATTF WAITS FOR TIMER FLAG
JMP WATTTF
STiP TNT
RF'T
; FTv7'RNl. TEJRiPT
ITROITNFS
,,%
. (
MOV
.'
Sf
A,RA
nRl. A, ugFl(
OFF
nLP PHAlSEAND Ti{RNON THE :NE
Pl,O-l
1l
TR nTHE
F TE'RN
PrtI1TITTN
F 0:4''"tTr
"f,-1
tiPA.SE
FitITL PJP
TIIRN
.'aiNL
.'iRA
.!
v
'
O 99:55
:
.f};'7
'.,Rr
,ATTTI:
.iN T,A WATTM WTTS FR
f!
.
TTEMENT
:S!JROI.ITTINES
nv A,i; WAITIrTWA'TS FOR
WATIT:
. .
:
MOVA,R
; IVE THE INlTIAL 4
.OW
RITS .UT
MOV;)O
P4.A ; T1OTE 'TM M
.. DT.C
SWAPA
: MOV THF INITIAl. 4 HTiH BITS OUT
M)VDOP7,1A TO T
MINIMUMDAC
NOU A,~OSH ' DTSALt.ETHE 2 MT.N,ITMUM
DAC LATC',,.S
MOVI)P4,A ; AND
i N-3! .E THE' 2 BOTTOMBAxC,A'Trs
I:.R A
: MOVnE
THE 4 HIGH PITS .OUT
MnVDP7,A: T TFHE .TTjM
T
VAUE T'DAC
MOV A,
MOVE
F
THE 4 LOWPFITS 0F!OT
MOV P.A
TO; THI ROTTAMVAIF.. fnA
r.LR A· DISABLE THE 2 BOTOM BG LATCHS
1 P4, A
/OV
AP,OCOH DIABLE
T
THE LEDrfAC TO EXPANDER
OtjlT. P1,A
C.R
; ENABLETHE MAIN RO.RAM1n EXPANDFR
OTL P2,A
.
MREST
119
,"6r
PAGE
M.i A,RO
MOVETHE NITI
4 N ITSI. rT
P,6A .
TO THE FTErLDAND
IA XIMU1M
DACS
WAPA
; MOVET
INTIAL 4 "Ur
NAL-. STS
MOVf P7,A ' TO THE FIELD AND
D MAXIMiM AS
C.R A
;
SARI. TH1E'2FTFil
n
P.A.MOVD
AND
f2 MAXIM'M nAfCLATCHES
M'V A.
#rH':
ENALELiT,E 2 MINIMUMDACLATCHES
MD P4,A
137
71
' C
T,A
STRTT: TAT ' TTMFR
" FPPM
P
,7V .
....
R T NIH
iF7
1,5
MNV.R9F,i#2
V :i.r'CA OF.n
ACTUifll
.-.TiMF IN u
NMPiER
MR; i TIMER OVERFLS BRFF E A RF,'STARTT:; FNTrFIc
1A.,
!,F
",AI
IA?
'
i64
'
iV R7,A
SWAP
RI
RA
RI. A
.1 '
IIPAI
PT- PrA-E REFGSTFR'2
R7,IRt
APC AS:,EMRtFP,.V, f)
TSIS-TT M-4.,_ JPI-i
flN 3rTANT3lPFFTl vA V.',i
LfJRRENT
PARE
4
SnI
l P E STATEMENT
L-AA1,.OF4
095
AF
009A :'F
t7
IA7
MOt R6.,A
MlOVTr
P7 A;
ENAF:tE NEXT FPA-SFT
, TF N (INPRl'EP
0097 RftF
170
.7!
MOV3
R44-1
(040
172
7.-.
lE.CR2
MOV A,kr
'N7 FI.NT5R
M,7
l I~XifO
rC
9A.9F
.74
175
AS9n
A5
--
2
INPUT T
lu:CrS
JTUR.triPT
4!LOD 10 ~FSTART ,ATT.MPTS
I.A.. TON C.NTA!NING THEF
. AlR.'FSS F
THE fJNTF.RiUPT
THT C"T'tS F-OR4 PF;,=: '
:F'
;- STORE THE
177 FINIS:
1795
STOP TNT ;
T~7PTHF TIMFR TOU'NT
004F
FE
I8d
!8!
OOAR
4?
27
7
A?.
90
19
I
00R9
FE
47
E7
9eF
195
t 9A
M.O'AR6.
ORM.
A 4OF.)H
tI'T.. PI,.A; TAirURN
OFF THE C11 PHAE AND TURN
AUL Pl4,.tOFH
TRN F'FF TE
FPROfHII8ITION
OF D
MNVA,T
MV R2,A
PlUT THE TTIMER
F.INT
N R2
!.RA
MOVTA
TIMER FRM 0
ART T
STRT T '
MVO R5, 20h ; fitLf ER OF TIMER'WF!.
S
M9V A,R ;
MOVR7,A
SWAPA
'R.l A R6
.UPilATEPCASE REGI3STERSR7,R6
ANL
4,#)FH
A
199
00R7
O'V0 P7 A
E:NARF
:
NUXTPHASE TO tRPrWTTO INTERRIPT
'.'; .
F AN UINDERSPEE
R OF;
CCLRSA¢L.LOW
10 RESTART ATTEMPTS
,OVR4, t-10
OOr
. .s
?,ll
FFOREA RESTART TS ETFRED
197
11t5
93
!97
20t
¢(:67
f,)C
OOCAst
27
.i¢,C~'
202
204
705
l:h/:,
?07
2l!d
102
MOV RO241
MOv A.eRo
Rt. A
,MnV RO,A
UPDATEPOS.TTTN TNDEX N 4 PHAS'iE:Y,.F
*.: CIIRC...; HAVECOFMP!LE
TIEDA 4 PHAf. :.l.
.JI ST;RTCT JUIT TARTNGI A CYCL:E
MO. ,
:
T ....', B~T OiF T
IN.iT,,.A
: 351.4mNTATNJ THE S HICH
F :.T;F;
AO
(O..
-10
9n
THE NEWU
PHASE
WE'il. ATItN
217
219 ATE:
T;
rTlFAr.T TIE
MOVtA,R?
ATnD
0,R0; 'P!.ATF TF o LiW
i
RTT. nOFACTIIAL.TMF
J *:-'414
l .RO, A.
OV
.'NC ATFR
TINCRO
iNr
¢RfO. I IPPATETHE - HT.. H RTT; !rF 4Tll_ TT7M TN 314
..
,7i'"P"
r
Cr-T
.-4R/fPr-4
MACR3.AiSFMR'ER. V,(h
PAGF
5
.l3NsTANT
PF.D VTA VIARY
IN ' CIRRENT
I ,.
JI.
FAI
1)On10
1f0
1)
37
6O
,:..lt
0n7
r T3
rB,
S,
'TATirF
ENT
STRTCT: MOVRO #24H
AeR2
Pi T THF I.AW8BITS
o
rF
rimv@RO A
ACTUMLTIME TN 34H
RFTR
1 -4 C._N1IlHK:
MOVRO~ 2t3H
iR2n P' 'E TEP
I
!PnAT; 3 LOW ITS OF
A,?RO; ACT
M.TIFIN THE AIIJJl ATOR
'.I.
SKIPIN
221
.5
INC Ri ; UPDATETHE 3 HITHI BITS OF ACTUA T
INC
IN
-35H
A
ADD A,@RO
iO
0
01R
OODI
PUITTHE lOW
r PITS OrFACTUA TUIE - T.M LOW s BITS OF
DEIRED TIME IN R2
R0,)35H.1
MlV R2,A
,qA
23
?'2!
F!0.',
MCV
0.'F4
2,e,
37
900
FO
0F7
V.9
Ml.V Af.
CRO' PFT THE , H!fH RITS OF ACTUA! TTMTEIN TH.E :iMLt
MNV R0O,f0 CLEAR THE 8 HIOH BITS OF
TIME IN
IACfAL
LL.NI
; 38H FORTHE NEXT CYLE
240
,NV R t33H
37
70
27
2400
:R)
p42..}
s44
2,44.
INPAE:
247
9OF
248
249
?AF
01f7
254
'-C55
,RA9
4.,
01 o8 93
,-'..
27
.I. A
An.I)C
A,eRO
CPI. A
HT 8 BIT
TS
CT . TF
ME --SITRED
TIME
,jMP NP.~E
ORGSi 0qI
.J.B7CUR~iGR;
CI RD.R . ACT.!AL TME IS !.ES THAN TES!REDTF
,.',B7
;CTJAL '.:PFOIS TREATERTHAN E
FI.'rR)n
t-Sr
DECRFAE6 TF L.{URRENT
,
.JNZ . !RINC'
NMBER ICREASE t E,"'uRENT
, FOR NY iOTHERNi,ZERO
MNOV
AR'.
.j7NZCURINC
MftTVFTHE NM.!MBER
OF PA-S-, TO
5ELAP.E FR,-R T-RF
MOV RM,~2?
MOVA.
;RRO
; NEXT 4 PHASE CUtI'NT
INTO R2
MrfVP2'?
r
H_,
{,
M.nV
3;LOJ
..
DATAJ ; TF.'RETHE LIOCATTON
CFNTAJNINf THE FcRST INTERR.iP
A:
nRE.IN R3
'
RFTR TF AfTIIi TIME = rESI'RRED
TTiME, THFN ! ' "" '
TH i:UFRNT
,
li'tFCNl-.
ORL P2,.*q04
ld
Ir
LE TE "IO
1· .,PANR-,
ANL P1.47FH; ENAB.E TIF IFirA
10 FX'rER
CLR As ,TB'D..PLcETHE FIELD ANn MAXTXMIDAC'.
14T
ITCH : ;'
MOn P5, A
rNOV
A,#-
Mnvn P4;
. n,.
.r1_ THERTT0iM
1Ar '...
"',
ANDENAF;L.E
THE MINITMtrACI, '.h'FS;
,
INC B. .NFAF
'%?
AF
Ao
nF'
%?:'{'
271
27;'nTH
,7t
AT.R
plOU
AiPO
THE
r!tM
C.tURRFNiTlUE
.'Y
.. -
i. riA
E!
iNZ NOTHI
nOV RO,'-)FF
iUNLFSSTHF MA^v1M,r.,lr
VAU I. RFAY
"" 5'
V 4 RO
:
'..
CIR
Cr: DIVIDETF
THE MA.YTIMUM
"^'I lF RY 2'
RR' A
OBTAIN T.HE
nTl
.1Ti'IMVAI'At.!F
T;
Rr
OV- r-),A
Ml'v1 PA!,
P:
~ITTHF
T
!HPrATEDMITNMIII " 'UFiN j i "F TIFN'H
: M'Vi TvF 4 !P1,nTED) ._:%i
F:TTS
3
O
iT', Ttl1jT
T"M t .,
.!.
C
PA:,,E0
T'3-1I!
. ....-41IPT-41
MAC-RlA$.MB!.ER.
3.0
MiNSTANT PFE
ITA RYTNPG^
'IRRENT
47
01 9
1F
47
.INS
iSORCESTATFMZETi
27A
277
SWAPA
MnVP.P7,P ; MOVETHE 4 iPnATFrD lHT-H BITS 3iiT TO TE
lR A; DISABE THE ,? MIN.iMUMDACLATCHES.F
MOnI)P4,4
MOVA.,Ir3H
NABI-E THE 2 MAXIMIUM
DAC AT:E
MOVDF, A
Mv R
,OH
MniVA, RO ; MFrE THE SPDATED
4 L RITS OUT
MnVDP6, ,TO T
MAXIM1U.M
A
W;Apn
: MfVF:THE IPDATED4 HIGH BITS FdiT
MOVD P7.,A
Tn T-E MAXIMUM
DAn
.LR A; DISABL.ETE ? MAXIMtMIAC I ATr:HFIS
'77
,?.
'7.
87
R:30
1.2i
F99
01i
0!13
7.8
'1133
0124
01:R
".C
47
?7
9A7F
MINIMt.,MPAC
MOD P5,A
t.. P,::H *
DISTABL.E
THE LED/C
!O EXPANDRFR
AN. P2, 7FH ; ENAB
E
TlllE MATINPFROilA: In XPANDER
MOVRO,#,H:
.MqE THE N!ilMBER
OF FPHASETO FLAPSE BEFORE THE
I3V A.,PRO·
,
NEXT 4 PA-:SECOUNTINTO R2
MOV R2. A
297
OV R3,L5 DATA
.)
1I TFE THE lfOCATIONCONTAININ THE FRST IrNTEiItLPT
-4
ADDRESSIN 3
RETR
299 URI.tCR:ORL P2, 80H
DISABE THE MAIN PROGRAMIO EXPANDER
AN! Ptl,7FH
ENAB.E THE LEI/AC TO EXPAnDER
:LJRRA, D!SA.L.E THE FIELD ND MAXIMUM
nPfC LATCES
WND, ps. A
301,
MOV A,O.CH
DnISABLETHF BOTTOMDACLATCHES
&....~
MOVDP4.A ; aND ENABLETHE MINIM iAC
1. ATiHES
..
0,12Ei
014
??
014
3rJ
0
011C
4tF
01 4R 07
(4.,' AO
97
O1 .4F
A7
014F
s)44
10l
0151
"14R
hf
,n
n .'
7
302
303
304
30)5
306
~o
:lOP.
MOV ROA;
Mnv P,4
·.~ .?
30
.,7
~s4.,
6O
0l
1 'a
ilft
f
di,-9
'1"?
·..,
t.,'
'19
nr.4
rt5
-,
:':t4
47
F0
'R
32'7
04m
AA.!.8.
03
MOV RO,Of0H
m1oVAIRo
DEC A
MOY ....
AA: DECFAS.F THE MAXIMI.MCU-RENT VA...E BY I .KC LEVEL
CLR C: DIVIDE THE IPDATEDMAXIMUM
VA .UE BY 2
RRC A ; TO OBTAIN THE JUPDATE
D TMNIMtM
VALUE
',.,'
..,·,,.-7
5ts
':-"77;
.m .
:..~
..r,.fs.¢. ,
.
*f
.-.r-.
PIUTTHEF1IPDATEIMINIMM Vl.NFF
VJ
"TIY .rTIATiT '31tH
; IMOVE
THEUPAiTED4 LOWi
BItS lUT O ,E MINMjtl
! id..
'..1P A
MOVETHE U:PDATED
4 HIGH iRTS
MOiD P7. A ; O' T
T
MTNIMIrMn04
Ct 2 A : I
.SAFBLE
TIE 2 MINIMUIM
DlACLATr:HES
LATFCHES
MNOV
A,f,
, ENABtE THE 2 MAXTMUM -AC
IMOVD
Ps,A
MOV R0, 130H
MOV ARO
MOVETIHIE,,P.ATED 4 .rnw 9ITS
MlYIDP6 A ; OnT TO THEFMAXIMU
! DrAI
SWAPA
MtOVETHE I!PDATFD4 H'TIH BITS
MnVDP7, A
IOUT
TO THF MAXY
JMlM lA
PR A: DOISaBLE
TUHIE
2 A4YIMU lAG LATP:ES
Mnvn PSa.
ORL Pt.
01H: nOFr F THE
/,9l:
T ,-,N.s
I1
t:.i-P2.,7FH
FNABE THE MAIN p"R5'OAMTO EXFANnF'
M7V/Ro. ?2'H M-VtlF
THF !MA,qROF PASES ) E
WPReRF
l
T ,-V A,. O
: NIYT 4 PHAS' II.NT INTO
j
Nnv., '
nM;l F.
l ,,..v
W ,ATAI
; STORE THE
....................
:ATrN
'K I'O"JTA'TIJ
!
TF' FIR.ST
T. -..
J"J('RC'
IPT
T-otT
Mf -4I/PI-41
MAC. A.ER'IF ER
rn S' TANT' ' mF'S VTA VRYITNGf llRRENT
LO : OB.J.
PAIE
'3. 0
t'OURCE
STATEMENT
LiNE
A: PRRE'.-.$
iN R:3
33
Ot.P
.n
RETR
,IVA-18
0i AC
01 "E
ORL.PI,lOH
_7'
trAYFU
FR 18 !NITTS
A9
..
7
7A
01 7A
017
: OC
2472
t281
7,'tp
017F 7497
01 :7,. .-),I
I ,m
f40
43
,Z44
..'L,
24.
344 FF/,N:
247nADN:
3428
354
344
BF(O
,W02
01.ts
RFU
R. 4
<IF6 SAO:
3.45
34.ts .;I::
'49I
SIC:.
01::
RF(8
3A0
4
:2
'),'::SDO
G..
,:t
99
gstl.E
;
IwITCi
ON THE FIELD TANSST OR UNTIL T:E FIELD
C; RRENT REACHF T'E VALUE
.
ETERMT"E) BY T
KMlW A.PA:, CHECKFTFLR ClORRENT
LEVEL
MOVRI,A
4LYED F:HECK
,!v A Pf, CNFTRM WTTHA En
ANL ARI
, 0 MSEN
JMP FON
0i
1,E
0i1g
0183
,START
CA!.LWAiTTM
t 70 ?910
s
7
-'1
364h
3.'-.
366,. r^
T =
MOVDA, P4 ; NT!TTALPOSITIONE:N'.-SE. SN
,J8)
.I19r SOB;
RAO '
SENSEDCD MFANINOPOSITION A
111t
JB :380
13
O·
'E.R3ED PC MEANINkPOSITION D
.&.. SgO: SFNSED AB MFANING
SE.iSEDDA MEANT4IN3
POSITION
EFFINER7 AS
MOVR7,01IH
MOV P6,40~2H
JMP S1
MCn'R7,nO2H
IRR,
FNT PHASESTH
'
FIELD DAC.
TS DUE TOT(TF/TD(T)
AS ET PHA5E SWITTCH
MNR,,04H
,IMP Sr
NOV R7,$04H
MOV RP,O#H
Jm2PRi t3
V1R7,4f8H
NOV R6, iIH
;STAGF i
(l9R 7204
:iF
FF
019F
01A1 FF
C1:aI
oIA4
9
9nF
·R37 ;l:
37(i
371
7.-,
y7
()l
A7
377
AJ
,7
l AR
O!AF
ti
. t . 05Rf1
,_ _,,
m P.04H :
E;i
FrT
[INTFRRi'PT
IE:
Mfiv P,
MNV AR
Mofv P,A
ENAP.tF
,
NFXT PHASE TNT
TOPT
O INTERRUPT
MOV A,R7
IRl. Ai FE0OH
O(iTli PIA,
TURNI"tFFTHF FTELD
T:E'
ANDiTIR-N
THE SEi FTE PH.!:E
LNt
Pl, 4dFH "'..RN OFF THrN
FtR.QIT
I iF X i.
T," R;;E'.';
1"i.TTrON
F R A
(M1VTA
!iNVRF0,3.H ; .FAR THF S FJI4H
, T. i.F
'
ll T I TF " T
="
t
.10 :l A.
FiR T i FTR-'T Y ::E
STRTT
START THE TIMER FROM0
M13Oi
R9,'.O ;
OF
[IBR
TIMERO.tRFiOWi .F-FROREA RESTAT r- ENTE-IED
**t&''!
"Il
IF
s. 7,
EN£.;
k40.
sANPd..E
,
THE EXTERNALINTFR1IPT
PFf:..
!.ilTi T I
!T !-41 MAMR ASE. MB.ER,
JTA VARYTNt¥
CURRENT
! *m:
L.OC nlJ
!kAF
PAiF
3, ()
8
SO!IRCE TATEM.FNT
;825 wnRK : ,ITF M'RFT]
.. P Wrt. I
,r7iORETI: MOVRO,25H
.W Rl:
TdI.
i0
39
TnJRNOFF THE TRA4STSTI1R
ANDFNAPI..FTHE IED/.'nC i0 EXPANEF
DISABILETHE MAIN PRIiRA~MT) -XPoNER
OR Pf
fi O
TATED IN L OCAT.-.
MOVR0,420H ; UT THE ORGINAL MAXIPUIM ALUE
:OH
MV RIA.R0 ;INTO
r
.LOATION :'ilH
UONTATNIN3THE UPDATED AXIIM
OPL °7,PIIA
292
.1q
37
400
.101
"8
PO
Al
01'. A 1:3
t
1I
F
in
011,'
P
PUT THE O-RITINALMINI4.t VAI.U!FICNTAINED ITNLOC.ATION
INC RO
MOVA,O
TNCR1
INTO LOCATION31H ONTAINING
.
THE .PnAT
MItTNMUM
NOJ_¢R,A
iN.
S PRERSSEDPiIN
IA:4 R4 : IF
TF 1f0 TRTIALS REFP THEN STOP TTL T
4N J,4
MF.~
A,R4
JZ AGATN
.,iMRESTRT
JMP HERE5
4302
404
4o5
406
niC:
'91F:
·l
hl*;.)1"
""'i 0I44.
043D
408 Ar~IN:
409
4:..0
4,
.'R sYMOm!
AGAIN O1CF
17
MAFlpTi l3
ClUR
CHK OIJ
HFREl
ST
NRF'
END
( RkfDCR1 2F
ER.;r2 ot 1
MSEN 017A
CL INC
SVYRST 1000
TIMINT 0007
019.
:ITPIN
- iFt
061.
Y
N L.CATriTN
ST.. T T
tJJOA. 40.
Otr9
O RA A9
RA40
01BC
nl,,1
] CI.
HTGH B. ITSF
r. CTUAL TIZF
'il
'LI
OIR,
:. .0
',FNT THF
M!S.
STRTrT olAl:
tFX
COIMPLETF, NO RRORS
R
14
NOTHI
0(107
DATAI 0009
HEREC4
NPAAE 0100
WAITt.T 0076
DATA? 00A
HERE5
RESET 0030
0197
.MD
W'AITTFhOhA
EXTT'NT
RERET
SEPATVE
i oFz~-Tj
lATERI 0017
ORET1
U1
rnf I 1
OlAF
!,'R~il
t
'.,s'-4WO
AR
.t'ERATIN
4:3 "" :M:C, a.- DnFJ}F XEF TIT;i..qc. ulqn.
· ~T," To
/,F- T._4RIIpT_4!
ARn AEMBl.ER
,!MM~RV,LCCE.LFRt
RAlTT
~ PROFTLE
1P i.J
'.
d
.7'
PFILE')
PI.
..SnlRCF .STATEFNT
I.TNE
.
7:naT
L H ~TITRAN$Bs..I~TOR
AT -&
..
CFNi..ANI
lcl,:.
THF
FOR (OTATING A SUMMIARY ,E1 RATTrN PROF I.. F.L
PRIOGRAM
: TMITTVA9IV
"'n
FT1·FH T~~J'I~IT
I5ijiC~
TURNEDP
FTM T.'
4
5
6
7
..
R IT
I:
: Al!OWED TO TSE UNTIL IT REACHSFA I.VEL PETERMINED
BY\THEFI-TD ODAC
V:L. FED IN N T E .!T .. A r.,
. PHia4.
;
L.EVE
L ITFR .TNT
; CURRENT WILL BE KEPT ETWEENMAYTM.l AND MNIMUTM
MATA
FE I
N T .. -,T
vA
1AiD MINMIID! IPd 'E
BY THE MAXIiUM
TE MTOR FTFRBA
STNART
PF.SSING THE T1 R!,TTON!tl
;SWI TC..:
TR
PIA.T tJTl RE ~[
IHi?
UNA OF Ti-IFNF~r PE
TF
BE. T..
f THF ENYE WVFORMS
r
IG FROMNEGATTF TF
BFY7FRO CROI,NG.
TO1lE
INTDI
CATE TET I, 'F
8~~~ITFf1RPT~
.
,,,.
..r......
; POJTIVE ?ARITY.
10
TO R1N THE MOTOR:
ON P73 TO P60, THE TOP SET iF DATA INPIIT lI;TTF:HE.,INDICATE
.SR AND P,7 A! TlE i,R, .OiN P.3
THE FTEID ,qA7VALU. WITH P7 AS THE
; TO P40, THE BOTTAMSET OF rATA TNPF'UT
SWITCHES ICATF
THE FT,iST
t1.,
Vali-E TO F APPIED
irTnf
TNrE :qA
rDSf.
lrSrSFi. tH-E MYIMl; VtALEf(rlP(
I6
; COMPARATORS
WITH P53 AS THE .M8 AND P40 AS THE 1.SB.
PRESS TO.
17
N P73 Tn P60 NDICATE TIE FTRST VA llF Tn RF APPLIrD TO THE
;2.)
MINIMUM
VAL.'uE(MDL.E,
TMP
EATC, .N PL TO
19
Dr ADDRE%INGT E
; P40 INDICATE THE FIRST VALUETO EFAPPLIED TO THE DAC "R.ESSi
n
:CO ARATORS.
;.THE BOTTOM
tPF~FsS
; PRESS T.
.
TIL PHAE
;
,X,) ON P73 TO P60 INDICATE THE NUMBERnF CINSrECU
:L'
'8
F.R WHIH
TIME CIf!RATIRNIS TAKEN.
,~
: PRES3-2
TO.
HE MOTOR. FOR 512 ..ETS OF TSiEFrTiNATiD
T
4.) PRESS T TO START
;
IF CONSEIFTiVk :tHIAES., TIME COINTS WI.l BE .. TO.RED TIN
,
sNI'MBRERS
r7
.28
;
THE 8!8 -2 RAM, THF. ALL THE TRANSISTORSWILl BE TURNEDOFF.
IS
: 5,i L5.
TERNATIELYPRESSTO AND TI TO REA)DOUT THE TIME DJRATIS
,9
:-O?
TN TE LE,
I;
12:1.)
,
o'"
ORG 0
· " SYSRST: ; SYSTEMRFSFT
',P
RESET
.0].nfi
0000 040Q
36
ORG3.i
.NTERRI.IPT
'7 FXTTINT:: EYTFRNAiL
(PT RITTNE
I-NTERRi
UMP T THE XTERNIA1.
.RTPIC
.iM SE
8
000I
003 347n
!IRG 7
40
TIMEFRNTERfRUPT
41 TTIMNT:
WHENTF I n.,FIR R' TIMrEl BITS OVERFLOW THEN.' INCRERFNT
42
TNr R:
.4P
*;THE 8 UIPPERTIMf. BITS
.iITF CLRTF
,4
Cf.I
RTF: RFTR
4.
T,.T:'j
T
OFF THEFTRANST R.:s ENABLETHE TNFPU
T.1URN
MOVA4U0H
F, ,
47 RESET:
0007
'e07
In
10
.A
fxi3A ' 95
00:
(,lp
.
?03
,r,
'}
0O,¢F ?A
,Wt:]OF,C
!
0013~8,go
fi5
;F
i,']AA;l
49
r'
~
'1
WTTO
.9 PA
,I.lTI. P.A
p
:
ISB!,T
:XPANDRF,
DE NR
THtE
tATN
PRGRAM
,l EXPANDER
HEREI: .JNTl RElI
tF
ITW.TO,
""IE
I.. ERE?.
..: WAT FAR TO TO F- PRESSED
rE,:
n ?./.'F,
57
M'-,J
RO,#20H
F2
.
A.P7:
V.r'v
MF`!J OnA
M
.^4
.42?
7 TMOT THF KT'iHPITT: OF
FIf
VA.. ,_Tn ...
iY
I .ATiiN
OH
'
'..M 4Di/P-41
-T
A".FR""'-,
-- i - MW,,-QN
,A
.,;IMMARYCr._ATTOtJ FR iLIE
lnRJ
0.8C
I55
C01718
OpA A.
57
9ti
.t.i)pOn
in
,Ogli
. Ot,., Oc
O01F AO
OO 46
4F '0
0ir'n
0'?4
10
fi...' OF
005 I7
003F
CO
002A403.
d:.
40
,nAA i $1
,rE,OQ?7
A0RF 0O
4A¢i"7
iRo
(t)44
04 ,'t
f..ii4
A.
..
pCFir
S3SUR.FF
STATEMENT
TN: RO
M'VI) A,P6
MOV RO,A ;
INC RO
·
,
M.Ir A.PS
MOV ~.RO,
A :
M OtVE
THF 4 f.&IW
B8TTSCF THE
F.qD VALUIEVA.lUE
TO ATA MEMORY
t.OCATIl
21,,
MOVETHE 4 Itifl4 [(ITCOF THF FIRST
iAliXTM
I!
I,
. TO ATA M1EMORY
.CATTION 22H
!NIUR4
M.D A,P4 ; MfV TF 4 OW BITS OIFTHE FIRST
m,
AmIMM VALUETO FTA MEMOICY;TT,
2::
,
',i%1vRO,A
44 NFRF3: ,1T1 HERE'
65 EFRE4: JTI HE4
WAI[T
FOR TI TO BE PR
ESSEDrl
TIN
C RO
M.I A-.
A,P7 MOf THE 4 HH PITS OF TE FIRST
A7
NOV RO, A
INlM.M VaLUE TO DATA i.;RY LOCAT.sN 24H
69
70
OE THE 4 LOWBITS F TE FIJST
MINTMlM VALUF TO ATA MNlEM:RY
LODCATION
254
71
r
7211
IN RO
MnVDA,P5 ; MOVETE 4 HIG-i PBITS iF THE FIRST
73
74
MOV R .
; BOTTOMVALUETO TA MEMORY
LO."ATIO'N26.H
INCJRO
7.
7A
MOVE
.
THE 4 LOWBITS OF THE FIRS;T
MOVnAP4
77
MNOV
0R0.4
; OTTOMVALUETO PATA MEMORY LCATION 27H
78 HF.CRE9: JNTf)HFREf
D
79 HERF: JTO HRF. ,' T FOR TO TO BE .RF.,E
MOD0A,P7
1. f
SWAPA
MfV R?,A
83
MPtVDA, p
.,84
nIRt.A. R2
MOV R3, A PUT THE NMBFR OF CNC-;EC:UTVFPHFASESF(IR N.
tCIR A
TIME D.RATION IS TAECN IN r3
HFRE9: JNT1 HERE9
HEr,I : JTI HEFO ; jAITF;OR T1 BEFORF.TE MOTOR',TARTR
r
'
'
lXPAPER
wITH
MFi!V
A.4.~H t iSPARF THE IPI.IT
90
Oll Pt A ; AND E
Ut-.:rE
THF IED/BAC
'"" 10 XPnrR
MOVA.Of.CH ; DTIABLE THF 2 MAIMU!MDAC'L.rri'i
.
MFV'DP5, A
AN ENIBLE THF '2 FTLD-..D
R,'AC
A''T."'
nlSABF THF 2 MTNIMUTM
CI.R A
NI 2 FOTTOMr040 I.TCHES
PC4A:
A
94
OVtnD
ilv R2. .
IT
MOVET,' 4 HIt
.IV A....;
97
MFUn 7,4;
n!:TTOnTHE FEIt 1iPrAC
.i
99
i
I 04
sli
05
sli
NiV A, 'R0: MOVFTrHF4 OiWR T
"
MiO. P6A,, ' OUT TO HE FIEULDC
lOSV
A,S3H: riAP!
AR.i THE2 FIELD DAr:.ATs
'rVDli
PS,4;.A A.
NDh;tl
TRiF 2" AT
MAXIMUM
l
n
'I
ITNC
FR,
'IV A,.i~O;
OVETHE
"'
FTR.-T- HIGH BITS
MAXTI!MM
pR,'l
P7 ' u,,,
,ri
f T,: THE
.............
YPLU'
,LF E '.
MOUTI
P7,A
PAF
;
0095;, ^,
ii)o
,4'.'nfl
MF= FiRSTI.'4
W
;ITT,
T,'-
PAA:
P:°D
iT
! TO 'Tc MAXIMt VAi_
.' R A
rDTS.a
. T 2 t-AXYIMI
M PAX
T 5
!'THE:
if:';
i-P'
7-',' O !'
;:TS'-1
lT , lr---A01',0;T-4j
.T-..,/rA.rp
,_
htAr '
RA.MR-MFw
Wk.'
FR,
V.-- I
Fq
,
1.1
PfA.-
:
'-fIM. ARW'!
At iFRATT ,N 'pT
O.,
Oi[,
Sr!.r;:E
TIN
TATlFMENT
MOflA tO H;
1.i~,
F .AiLAE THE 2,-7:MT,I
1'
1..C
tATCES
MVODP4,A
1 ...
MOVA,RR; MOVETHF FRST 4 HIO B.T'-;
MOVI)P7,A;
fJT T THE MINIMIM VALUE BAC
IN;: RO
TT;
MFlVFTHF FRST 4 L
Mo AR:
TO T ErTtlJM{.' VAI)JE DAC
.MOVP/:,A:
"!3T
MOYA.. -,4.O nISABE THE
THE MNTMIlM DA. iATCHES
,MtOVD
P4, A ; ANDEMYIARL.
T
2 BOTTOND C LAT:-IES
.
TCn RO
,I(vJ A@RO
MOVETrE Flt
4 HIGH BITS
MnflO P7, A; 011TTO THE BOTT!OM
V!E lAC
14i
211
3O
:n
110
i 4.
OOAI
0044
I 2
00.7
00A:: Fo
27
4f.
!1.F.
.M ARO;
,
MOVEFTHEFFIRST 4 .OWBTS
MOVr,PA
; rlilT T THE BOTTOMVALUE'A.
.LR A
nSISABLE
TH; 2 BOTTOMDAC .ATCrES
MVn0vP4,.A
IM A OGCOH D.ISABE THE ED/DO TO EXPAiJNFR
Il.!TL P A
fI.R A ; ENABLETHE MATNPROGRAMTO F.(XPANPFR
OUTI.P".PA
.,MP MR.'T
125
I
A
tj?.
147
j '4
23FF
no7o
t7
Io
;7B
0477
(l~07~T.A.
FF
n2
04n
00i7CR
I'
:tBIROi TINES
WAITtT: MOVA,-t;
ITIT WAITTSFORIt TIMER !,'0IT
WAITTMWITS FR t OF i.1NITSF TMI
AJTTM: MOV T,A
STRT T;
ErfQUAlTO iAT TN A
WAITTF:,TF UTMI
:
WAITTF WAITS FOR TIMER F.AG
.JMP WAITTF
JTMR: 3STOPTNT
RETR
144
: FTERNAL !NTFRRUIPTRT1EF
t45 SERVT.: MIJ A',RA
14A
nRI. A.0E0
147
UTT P A; T.rij I OFF THF r.D PHASE
TU.iRN
RNDN THE hfEWPAF
145
.
,HIt Pt ,r0FH
TiRN OFF TAR
THF RFHIBITION
R,,.fML'TON/.U C.:
14G
150
rl.IN'7 R4. lPDATE;
rTNLNTINUE
Cl lINTING IF TE RE:OiTRENI1MRER
OF
: rCNSE! JT'VEPHASES AVEF..TLAP.D
;5rs~!
~.i
,;.STOP
T£INT
i53
JTF NEXTI
IF A TTMEROVFRFI.0LHA,: OCC.
PRED. T.cEU -,;'cEEvNT TH154
; !,,.
PPER.. 8 BIT C0'.I:.NT
,IMP NFT
1f55
10 NXT: TI
R5
,7
fTDSTSNT:
R-OF ANY PFNInTNG
TIMER TNTFRIPT
4?
t.-!
0t081
r,
I.. .
is
'
.N.T:
V
RA
.i"'l
144
T TFENF
TTTMFR
FTMF-
r.
ir
'.;r
'
:.Pm :n !S3FTmLF.
. -- '..
R
E TTi
FTI
.. . . ..
Fr.
3g
9~n0
011094
:.'
M4
MOYV
A. R5: STOR, T F HFsPfER BJT CUT'l I'lj AN iDE FXTFRNA..RAl
aT.,
,.Hl,XITlArN
I
IMOVX
RO,1A
1.:TION
l
OU PR.,#0:
.STSFR THiT
E PPR
T)TE :.'i!N
,
T TT$-;TO 0
0VsA,;
; MTIE Ir EM'BREROF C$E
ITFIs
PHASEd FOR I;ITCH A
P4,'
,V
A
T'MFF !RFTT
.
' '" TAiFN t' R' iNTV
O °4
~tcvx
iAA
1A9
170
171
172
1f7.
0.09
Fl
t1'. ,PA
C,ANCF.T
A9
A1DIRESS.BTS T THEF YTERNA' RAM FROM
.JZ
P[PIATE: O
f OP1
T
1
TEo
LOWER
T
ADDRE.3
31
; R8ENF 0
IN'C RI
MOV A,@R1
.17 ASTPH WHEN
A9AR
,:
IF4 EAY T RTURN TO 00 ASAIN THE ET RtAI.
: FM I -C(ATOWn APF AU. FJUH. qN T
TRiSISTORS W;
; FF Tl'NFD lcF
.OUTLP?,A
!74
4 7L
177
i1
009f
4
ri:_ :TATMFT
:.
.
PrAGE
17g
.'
TMOV
A ,,
: IP AT
E PA
RESTERSi 7, R6
:
,I
NAP A
OR. ARA
Rt.A
ANLtA OFH
MOVR6,A
Of)A!F4'-:r0F
I!S
{Or
1t9
AF
F
.'?7ti
4 . ..I
Z;r
F1
,.
1.9
197
198
to9
COR?
1 rs
_0RA
s iFt
.n.-i-
: E'ARt1. ' T,PHA3 Tf
Ar!VD
P7.
M.'
O7
,JNTI
HEE!7
PWA
A
HE7:
170
'1)
t
7:
r
,OC:?
WF'?,iji:
TTERRIPT
4
1A;STP: MO.' ,A80H;
TF -t'':
4.
TOOEXPAfNDErR
ANP INITIALIE
OUT!..
T"='E
R~NIY
AA3i ATS
ARPRk
'tllJTI. P2),,,A
,.',.- F1XTFRN~ci.
,
AnTFIR
RS$3 !T3 TO
TF 00'"
t
MOV A, #4(f; TURN 1OFFTHE PHAMETRA.STATP-,R
C. iTLPI,A; AN ENABLE THF .F/.E:JiAC miEXP,ER
FRE-i.: t.IsTO HERE.i
TSHENAi,..TE
,RNATELY PRE: TO ANDiTI
I TO, lOUTPlT
THE
JT0
RE HER.
.E
; TIMER C9xODT
TOTiE
iFT LMT I E;S ND iTHE
-R
CFU.T TO
THE I'PPFR .ElDS
MrVX A,RA:
MrnvnP4,
SWAPA
;MOV0PM.A
TN RO
47
i
.--,Uad
CF
.4St
T'2'HT
17
mr,n
. P,
FR
i I
RI.
A.
17
M1iVY
Mrsvr AP9'0.
PA,A
717
.";Wp A
ri
H7.,
,-4:rd,./UPT-41 Att ;FRIFR, v.
r l-T"
-Ct
?MiMAPA.
[OC
n.
O.'h£R JR
e liD to
hlir!8
OARiA¢In
0si
'Il,
1
AOC~
- il1 .9
019.q r e
O( )2
T .fE F
IIn
)on
INC RI
SF.UENCE A9A8 FROM.0. TO 01 T
10 TO 11 TO O0O
7nv
A,RF
:.
.4.
'7S
NOV4AR1.
,IZ
t A.;TCT
OITI. P2,A
JMP HER'Ff.
:~8
L-TCT:
WOV A,#8%H
O!in. P?iA
lMOPHR1,44ti
OflOnA3A
J.MP
23
'n.'MRET:
H'EFI
MOVY
A.--1'
; START ELAYEDE
FFER18 ItIUTS
234r
SWIT:. ON THE FTELD T NIRTAOR UNTIL THE FTEL
; !i.RR7ENT
REACiES THE UA OJJt.E
LETERMiN?t
ED1YYA T1 Fr!Il.n
; CFC
FIELD i::.'CRRENT
LEVtEi
.RlI.
P,#I1 H;
R910
OOF
i . f
9.
URCE STATEMINT
'2
O-'.'OF
23FF
t47.,
PAGF
.T.TEf.ET
l.
!R.
1.N
f
nfljrs
.A?
Anoo~1
(1OD6Q
04...2
T
74
,:OFAOF
59
(10F
I 2AP
MOVo AP6
MV RA
NFTRMWIrH
.VDv APPA ;
AN. ARI
JPO MSEN
.JM!PF?..N
DELAYEDCHECK
244
'42
O.9VrjA.P4
.JMPNPAI.G
oC
oEn
1'4P NPAfT:
;'7.49. SOr:
Rr:
OitO.A R"'0'
257
.r
,ll
"'15 *"r43
,
nflcr
01
*F03.4
0'11t4
?4F
i
INITIAl POSITION SENSE
.NAL
SeI :JE TI
'T;
JB) .,OBC
i yVf
01OA ?41C
0!.'3A
d!08S.
2410
..7tCh
t
CO MEANTNG
POSITTION
O
NSEOl .R MEANINGpnoITIN C
EF:!
.NSFD A 4,C~i
Nt. /ED C MEI4N
.,IR SOr;
INGiPO3TTN
.AMP
AB. 3-FE
.iMP!gBO
,
........ .
PA`SE SWITCH, R
: FFI NE R7 AS CURRENT
MOV R7.I0ntH
. i-,
7,
3....I
AS NFXT F'A$-FSTH
..')P.1..#0
.JMP3I
'F:.
r:Fi(:MnVR 7, 02H
MOVR6,40
4NP S!
MOV R7,404H
.S6!
r.
MOV RAS,nRH
,iMP I1
NOU.J
R7LOSH
. :lv R, O1H
'7
27t
· i3
.c .j
M1V
0af4H,· S
F41
-'4TrESENtE NRRIFPT
i!MVr PA,
MOV A,r. MFVETHE
FIF
fMiPBFR
rf'-c fi
, . MINV
1 TKRh T'FN
I
MT,"4 ti
O'VR4,
1 , A4 · TTME
i4 ..URATTCN
l. A4
''1
t
MAV
nRI,41H:z l!41
. ..,.',
nr.
AT:,n!¢.
411
.....
.
~, I%
A.
1 A
Ti ,j
.t
.. ,U T-,
T:,
L~.,.~:
~ ,?-,
,,~,r!
.r''I
[::
'..i.h.
,
p
.
rII-T
,.fl,,. RPI-41
1
f
R, V3i)0
.....
it'Mt^R"
[.4.!, ... ASZFM'f
.:fMRtIAY08CI !L.'RiTTnE.-~CFrF
LtOC
np.
fil
TF EIXTERNAN..
RAM 9A3 .AUDRFS.RITS FtRO3M TO
MO) @R!,tIOH
RI! 01 TO
TO
n 1 TO 0
275
276
77
8!30
tt?
t1
@R91i#20H4
INC RI1
MO'
iNC ¢R1, 30H
MOv RI
279
!.t
R
19 lsh
..., I 00
RI
NOV .5t 090H
RI
4 .,
'-::0
O!f,~
t0
0· l j .,..:,rTh4 A.
,.r; ,
hr}39
., .. ?&
19
O'eR
O
rig
40, R.Ih
o!3E
OitO
I 4,
0143
Ot!
40144
44
INCRI
Mt
INC
PR, 4OH
RI1
eRI1 110H
MW
.b11V
29?
,,
. .5t..
..B5elR7
.p,.g,>
[ITALZE TE R I lOWR BITS
: C .LNTFRTO TE C PSITION
; fSr
,'.'
0 4A
F
, 0
..'
397
A
,,
301
:r70
014R
4r:
MNOTA
STRT T; S;TRT THF TIMER 7rt
0
MOVR5,#0 C.fl..EAR THE UPPERS TIME COU;NTBTS
oA1.4F
0190
0151.
j'a
.- TF
tirY R 00C2
!i. TPII
4 O0:
T,'tWNT 0007
EN
; ENABPLE
THEFEXTERNAL.
INTFRRUPT
FNABI.E TNE TIMRR NTeRRUPT
EN ,DTI
"$1.,
"Ir
F TilE RAML .CATION4
V. A R6
MSSUD
P7, A
FNABLEP
NEXT PHASF TO It.LT TO iNTFRRUIPT
MI:VA,R7
ORL A,#0(F0H
UlT!. P.hA
TURNOFF THF IFI.
l
AND TURNON THE SE EP:TEDPA'.F
AN. Pi,
3DFH ; lJRN OFF THE PR.HIBITION F DAiC :CURRENT
REGIIt ATION
"-4
! !..
..1
A
E STATEME'NT
E1Rt
LEN
tt 1
01"7 19
Br120
19
PAUiE
00
309
3107
lORK
t.:
.JMP !:JOK!t
311
FNDI
:
PXT
Ao;otTr
INT
HFR E
MRFST
HFRF2 00.20
0020
UP!iATE 0OA2
a:-.:Mr!V(
OP!
M Tf,
..
eAITIT
'WITTT 007
:'Jf RRRS
147
HFRF!0
HEREl
'HFRF.
NEXTI
0'0F
"A'TTF
'I0V
00n.77
.JI TTF
:r30
f YT27
...
UAitT.,,
007i
flnT,7¢
1
fiERFVi5
00,2
0:3.
NIPAPF
ai5
.' RI'LI ( ',
HERF A 00114
i_ .!,E
i
'FI
R,
;I007
:iFrt I 7 ff3rC
ST:T, 0is70,
:Yr.;-:T 00tir0
CHAPTER 5
The program
titled
CONCLUDING REMARKS
CONSTANTSWITCHING DELAYusing
only
position feedback that allowed independent speed and current
level control ran the motor over a speed range going from 17.6 to
1625 R.P.M. Current level control would allow torque adjustment
for
any constant load. Because this program has the greatest
speed stability and range, it would be the program of choice for
any known constant load since a lookup table giving time delays
for desired speeds can be easily constructed.
However, for a variable load situation,
VARIABLE
the program titled
SWITCHING DELAY using both position and velocity
feedback that allowed independent speed and current level control
would be the program of choice.
Although the speed range only
extends from 100 to 1640 R.P.M. and the rate of time delay
updating must be properly adjusted for speed stability, velocity
feedback
is necessary in a varying load situation.
Current level
control would allow adjustment for the maximum necessary
The program
little
titled
torque.
CONSTANT SPEED VIA VARYING CURRENT is of
practical use because the speed range is very limited,
only extending from 1400 to 1710 R.P.M.,and because speed and
current level cannot be independently controlled.
It does,
however, have the advantage of minimizing power dissipation
during high speed operation.
using 10 or 12 bit
significantly
It would be interesting to see if
DACsrather
than 8 bit
DACs would
extend the present narrow speed range.
A two phase on program could be written
although
this
would
limit the upper limit of speed because in a one phase on scheme
1 48
speeds of nearly one chop per phase are obtained while in a two
phase on scheme the speed must be slow
enough to allow sensing
windows of zero current for proper waveform detection.
Acceleration
and deceleration
profiles
could be optimized
for different supplyvoltages, current levels, inertial loads,
and frictional
loads. Since the air gap between the rotor and
stator varies from .003 to .010 inch in the motor used, 1 a more
precise motor mightbe necessary for this undertaking.
The 8 bit timer incremented only every 32 instruction
cycles
or 43.5 microseconds, thereby limiting the resolution of the
phase duration counts.
microseconds an external
For time resolution less than 43.5
clock can be connected to the T1 input
and the counter operated in the event counter mode. Then, ALE
divided by 3 or more can serve as this external
would allow a time resolution of 3 instruction
microseconds,
possible.
clock.
This
cycles or 4.1
but a T1 pushbutton input would no longer be
Interfacing with an external 16 or more bit timer
capable of incrementing with every instruction cycle would be the
best solution.
In the future an Intel 8749H,which is similar to the 8039
but has a 2K x 8 EPROM included on a single microcomputer chip,
could be used.
Since the use of more than 2Kof program memory
never proved necessary, a microcomputer system could be
constructed without using any address latch or external EPROM.
The use of microprocessors belonging to the Intel MCS-48
family, such as the 8039 or 8749H, has one major drawback.
The
MCS-48 family is primarily designed for switching operations and
has a rather weak arithmetic
capability.
149
Members of the MCS-48
family have addition instructions but no subtraction,
multiplication, or division instructions.
moderately
complicated arithmetic
Implementation of
algorithms
in the time
available would require another type of processor with more
arithmetic capability,
possibly one used as a slave processor to
a MCS-48master processor.
the need for 2 register
A 16 bit processor would eliminate
arithmetic.
The waveform detection scheme has a major drawback; the
field coil must be placed in series with the phase coils.
This
greatly reduces the maximumpossible phase current slew rate and
hence increases
the minimum possible phase chop duration.
Thus,
faster speeds could be obtained in an optical detection scheme in
which the phase coils were not in series with the field coil.
150
FOOTNOTES
CHAPTER
1
1. Thornton, Richard D., "Microprocessor Controlled Inductor
Motor", Proceedings of IEEE Conference on Variable Speed Drives,
September,
1979.
2. Eamsherangkoon, Pipat, "Construction of a Variable Reluctance
Machine", M.I.T.B.S.M.E. Thesis, 1979.
3. Wong, William, "A Variable Reluctance Motor with
Microprocessor Based Motor Drive", M.I.T.M.S.E.E.Thesis,
February, 1980.
4. Maginot, J. and Oliver, W., "Step Motor Drive Circuitry and
Open Loop Control", Proceedings: Third
Annual
Smosium
n
Incremental Motion Control
stems and Devices, Ed.,B.C.Kuo,
Urbana, Illinois: Department of Electrical Engineering,
University
of Illinois
at Urbana-Champaign,
1974, pp. B-1 to B-
39.
5. Beling, T.E., "Permanent Magnet Step Motors", Theory and
ADolication of Step Motors, Ed., B.C. Kuo, St. Paul, Minnesota:
West Publishing
Company, 1974, pp. 206-251.
6. Lafreniere, B.C., "Interactive
Microprocessor-Controlled Step
Motor Acceleration Optimization", Proceedings: Seventh
SvmDosium on IncrementalMotion Control
Annual
Systems Sa Devices,
Ed.,
B.C. Kuo, Urbana, Illinois: Department of Electrical Engineering,
University of Illinois at Urbana-Champaign, 1978, pp. 97-110.
7.
Miyamoto,
H. and Goeldel, C., "Optimal Control of a Variable-
Reluctance Step Motor by Microprocessor", Proce.edines: Eighth
Annual SmDosium
n Incremental Motion Control Systems and
Devices, Ed., B.C. Kuo, Urbana, Illinois: Department of
Electrical Engineering,
University of Illinois at Urbana-
Champaign, 1979, pp. 133-140.
8.
uo, B.C. and Cassat, A., "On Current-Detection in Variable
Reluctance Step Motors", Proceedings: Sixth Annual Svmosium
Incremental Motion Control Sstems
and Devices,
qn
Ed., B.C. Kuo,
Urbana, Illinois: Department of Electrical Engineering,
University of Illinois at Urbana-Champaign, 1977, pp. 205-220.
9. Kuo, B.C.,Lin, W.C.,and Goerke, U., "Waveform Detection of
Permanent-Magnet Step Motors, Part II", Proceedings: Eighth
Annual Symposium An Incremental Motion Control Stem
and
Devices, Ed., B.C. Kuo, Urbana, Illinois: Department
of
Electrical Engineering, University of Illinois at UrbanaChampaign, 1979, pp. 243-256.
10. Unger, J.D., "Adaptive Step Motor Damping Using Current
Feedback", Proceedings: Sixth Annual Symposium on Incremental
Motion Control Systems and Devices, Ed., BC. Kuo, Urbana,
151
Illinois: Department of Electrical Engineering, University of
Illinois at Urbana-Champaign, 1977,
PP. 5-18.
11. Tal, Jacob, "Step Motor Control for Maximum Torque", IEEE
Transactions
n Automatic Control, April, 1976, pp. 224-227.
12. Kuo, B.C. and Singh, G., "Closed-Loop and Speed Control of
Step Motors", Proceedings: Third Annual SymDosim
on Incremental
Motion Control Systems and Devices, Ed., B.C. Kuo, Urbana,
Illinois: Department of Electrical Engineering, University of
Illinois at Urbana-Champaign, 1974, pp. C-1 to C-32.
13. Tal, Jacob, "Torque Boundaries for Permanent Magnet Step
Motors", Proceedings: Fourth Annual Symposium on Incremental
Motion Control Systems and Devices, Ed., B.C. Kuo, Urbana,
Illinois: Department of Electrical Engineering, University of
Illinois at Urbana-Champaign, 1975, pp. M-t to M-6.
14.
Kuo, B.C., "Calculation
Characteristics
of Torque-Speed
Performance
of Closed-Loop Control of Permanent-Magnet
Step
Motors", Proceedings: Fifth Annual Symposium on Incremental
Motion Control Systems and Devices, Ed., B.C. Kuo, Urbana,
Illinois: Department of Electrical Engineering, University of
Illinois at Urbana-Champaign, 1976, pp. L-1 to L-22.
15. Kuo, B.C., Lin, W.C., and Yen, D.W., "Optimal Torque-Speed
Performance Characteristics of Variable-Reluctance Step Motors",
Proceedings: Seventh Annual Svmposium on Incremental Motion
Control Systems and Devices, Ed., B.C. Kuo, Urbana, Illinois:
Department of Electrical Engineering at Urbana-Champaign,
pp. 291-306.
1978,
16. Kuo, B.C.,"Closed-Loop Control of Step Motors", Theory and
AoDlication of Step Motors, Ed., B.C. Kuo, St. Paul, Minnesota:
West Publishing Company, 1974, pp. 252-272.
17. Frus, J.R. and Kuo, B.C., "Closed-Loop Control of Step
Motors without Feedback Encoders", Proceedings: Fifth Annual
Symoosium on Incremental Motion Control Sstems and Devices, Ed.,
B.C. Kuo, Urbana, Illinois:
Department of Electrical Engineering,
University of Illinois at Urbana-Champaign, 1976, pp. CC-1 to CC11.
18. Yackel, R.A.,"Speed Control of Step Motors", Proceedings:
FirstAnnualSvmDosiu on ncremental Motio Control
ystems and
Devices, Ed., B.C. Kuo, Urbana, Illinois: Department
of
Electrical Engineering, University of Illinois at UrbanaChampaign, 1972, pp. 373-430.
19.
Wells, B,
"Microprocessor Control of Step Motors",
Proceedings:
Fifth Annual SymposiumQ Incremental Motion Control
Systems and Devices, Ed., B.C. Kuo, Urbana, Illinois: Department
of Electrical Engineering, University of Illinois at UrbanaChampaign,
1976, pp. S-1 to S-9.
152
20.
Wetter, R., Jufer, M., and Imhof, L., "Performance
Improvements of Stepping Motors by Means of a Variable Rate of
Phase Superposition", Proceedins: Eighth Annual SvmDosium on
Incremental Motion Control Systems nd Devices, Ed., B.C. Kuo,
Urbana, Illinois: Department of Electrical Engineering,
University of Illinois at Urbana-Champaign, 1979, pp. 307-310.
21. Singh, G. and Kuo, B.C.,"A Computer Design and Case Study
of a Step Motor Printer System", Proceedings:
hird Annual
Synmposium A Incremental Motio
BC. Kuo, Urbana, Illinois:
University of Illinois
Control Systems
D.evices, Ed.,
n
Department of Electrical
Engineering,
at Urbana-Champaign, 1974, pp. D-1 to D-
21.
22. Pittet, A. and Jufer, M., "Closed-Loop without Encoder of
Electromagnetic Step Motors", Proceedings: Seventh Annual
SvmDosium on Incremental Motion Control Svstems and Deices, Ed.,
B.C. Kuo, Urbana, Illinois: Department of Electrical Engineering,
University of Illinois at Urbana-Champaign, 1978, pp. 37-44.
23. McKee, K.D.,"Load Adaptive Damping of Step Motors by Back
EMF Feedback", Proceedings: Eighth Annual SjmDosium
on
Incremental Motion Control Systems and Devices, Ed., B.C. Kuo,
Urbana, Illinois: Department of Electrical Engineering,
University
of
Illinois at Urbana-Champaign, 1979, pp. 213-226.
24. Kuo, B.C. and Lin, W.C., "Waveform Detection of PermanentMagnet Step Motors, Part I", Proceedings: Eight Annual SvoMsium
gn
Incremental
Motion
Urbana, Illinois:
University of Illinois
Control
Systems
and Devices, Ed., B.C. uo,
Department of Electrical
Engineering,
at Urbana-Champaign, 1979, pp. 227-241.
CHAPTER
3
1. Maurice, Bruno, "Fast Recovery Diodes" and "Applications of
Fast Recovery Diodes", The Power Transistor ia its Environment,
Ed., Jean Marie Peter, Aix-En-Provence, France, THOMSON-CSF,
SESCOSEM Semiconductors Division, 1978, pp. 337-389.
2.
Rischmueller, Klauss, "Base Drive Circuits of Switching
Transistors", The Power Transistor in its Environment.
Ed., Jean
Marie Peter, Aix-En-Provence, France, THOMSON-CSF, SESCOSEM
Semiconductors
Division,
1978, p. 108.
3.
Peter, Jean Marie, "Switching Aid Networks", The Power
Transistor in its Environment, Ed., Jean Marie Peter, Aix-EnProvence, France, THOMSON-CSF, SESCOSEM Semiconductors
Division,
1978, pp. 181-205.
4.
Skanadore, W.R., "Methods for Utilizing High-Speed Switching
Transistors in High-Energy Switching Environments", Tempe,
Arizona, General Semiconductors, Inc., pp. 1-10.
5. Wong, William, "A Variable Reluctance Motor with
Microprocessor Based Motor Drive", M.I.T.M.S.E.E.
Thesis,
153
February, 1980, p32.
6. Eamsherangkoon,Pipat, "Construction of a Variable Reluctance
Machine", M.I.T.B.S.M.E.
Thesis,
1979, pp. 14 and 18.
7. Wheeler, Gershon J., The Design
Electronic Eauiument: A
Manual tfr Production and Manufacturing, Englewood Cliffs, New
Jersey, Prentice-Hall, Inc., 1972, pp. 90 and 164.
8. Peel, MLE., Manager, "Analysis of Wrapping and Rewrapping on
Unplated Wire Wrap Posts Exposed to Harsh Environments", U.S.A.,
Texas Instruments Technical Library.
CHAPTER
1.
Wells,
4
B.H., "Microprocessor Control of Step Motors",
Proceedinsa: Fifth Annual Smpollym Q Incremetnal MotionControl
C. Kuo, Urbana, Illinois: Department
Sstems
and Devices, Ed.,
of Electrical
Engineering, University of Illinois
at Urbana-
Champaign, 1976, p. S-6.
CHAPTER 5
1. Eamsherangkoon,Pipat, "Construction of a Variable Reluctance
Machine", M.I.T.B.S.M.E. Thesis, 1979, p. 23.
154
MITLibraries
Document Services
Room 14-0551
77 Massachusetts Avenue
Cambridge, MA 02139
Ph: 617.253.5668 Fax: 617.253.1690
Email: docs@mit.edu
http://libraries.mit.edu/docs
DISCLAIMER OF QUALITY
Due to the condition of the original material, there are unavoidable
flaws in this reproduction. We have made every effort possible to
provide you with the best copy available. If you are dissatisfied with
this product and find it unusable, please contact Document Services as
soon as possible.
Thank you.
Some pages in the original document contain pictures,
graphics, or text that is illegible.
Download