Microprocessor controlled d.c. motor for indexing postage value changing means4635205Abstract An improvement in combination with a postage meter including a rotary postage printing drum having apparatus for changing respective postage values to be printed, and including apparatus for actuating the changing apparatus, there is provided an improvement for indexing the changing apparatus into engagement with the actuating apparatus. The improvement comprises: a d.c. motor coupled to the drum for rotation of the drum; a device for sensing angular displacement of the drum; and a computer coupled to the sensing device and to the d.c. motor; wherein the computer provides respective amounts representative of desired angular displacements of the drum during successive sampling time periods, responds to the sensing device for providing respective amounts representative of actual angular displacements of the drum during successive sampling time periods, compensates for the difference between desired and actual angular displacements and generates a d.c. motor control signal for controlling rotation of the motor to cause the changing apparatus to be indexed into engagement with the actuating apparatus. Claims What is claimed is: Description BACKGROUND OF THE INVENTION
TABLE I
______________________________________
Parameters
Value and/or
Parameter Symbol Dimension
______________________________________
Zero-Order-Hold ZOH None
Laplace Operator S jw
Sampling Interval
T Milliseconds
PWM D.C. Gain K.sub.v Volts
PWM Pulse Amplitude
V.sub.p 5 Volts
PWM Pulse Width t.sub.l 10.sup.-6 Micro-
seconds
Power Switching Circuit Gain
K.sub.a None
Motor back e.m.f. Constant
K.sub.e 0.63 Volts/
radian/second
Motor Armature Resistance
R.sub.a 1.65 Ohms
Motor Armature Moment of
Ja 2.12 (10.sup.-5)
Inertia Kilograms (meters.sup.2)
Motor Torque Constant
K.sub.t 0.063 Newton-
Meters/amp
Drum Moment of Inertia
J.sub.l 70.63 (10.sup.-5)
Kilograms (meters.sup.2)
Gear Ratio, Motor to Load
G 5:1, None
Motor Armature Inductance
L.sub.a 2.76 Millihenrys
Motor Shaft Encoder Gain
K.sub.p Counts/radian
Motor Shaft Encoder Constant
K.sub.b 192 Lines/
revolution
Counting Circuit Multiplier
K.sub.x 2, None
Motor Gain K.sub.m 16, None
Poles in frequency domain
f.sub.1 ;f.sub.2
48;733 Radians/
second
Starting Torque Gain
K.sub.c None
System Overall Gain
K.sub.o None
______________________________________
With reference to FIG. 10, D(S) is the unknown transfer function of an open loop compensator in the frequency domain. Due to a key factor for providing acceptably fast motor response being the system's resonance between the motor and load, the derivation of the transfer function D(S) for stabilization of the system is preferably considered with a view to maximizing the range of frequencies within which the system will be responsive, i.e., maximizing the system's bandwidth, BW. For calculation purposes a sampling period of T=1 millisecond was chosen, due to having chosen a Model 8051 microprocessor, available from Intel Corporation, Palo Alto, Calif., for control purposes, and inasmuch as the Model 8051 microprocessor equipped with a 12 MHz crystal for providing a clock rate of 12 MHz, is able to conveniently implement a 1 KHz sampling rate and also implement application software routines, after control algorithm iterations, during the sampling period of T=1 millisecond. However, other sampling periods and other conventional microprocessors may be utilized without departing from the spirit and scope of the invention. The open loop system gain H.sub.1 (S) without compensation, of the servo-loop system of FIG. 10 is shown in FIG. 12(a). To tolerate inaccuracies in the transmission system between the motor and drum load, such as backlash, it was considered acceptable to maintain a steady-state count accuracy of plus or minus one count. To reflect this standard, the gain equation of FIG. 12(a) was adjusted to provide a corrective torque C.sub.t with a motor shaft movement, in radians per count, equivalent to the inverse expressed in radians per count, of the gain K.sub.p of the encoder counting circuit transform. Since the corrective torque C.sub.t is primarily the friction of the transmission system which has to be overcome by; the motor at start-up, the value of C.sub.t may be assumed to be substantially equal to a maximum estimated numerical value based on actual measurements of the starting friction of the system, i.e., 35 ounce-inches, as a result of which a numerical value of the starting voltage V.sub.s may be calculated from the expression V.sub.s =(C.sub.t)R.sub.a /Kt, i.e., V.sub.s =6.5 volts, which, in turn, permits calculation of a numerical value for the minimum overall system gain K.sub.o, at start-up, from the equation K.sub.o =V.sub.s /K.sub.p, i.e., K.sub.o =397 volts per radian, or for simplication purposes, 400 volts/radian. Accordingly, the open-loop uncompensated gain H.sub.1 (S) may be rewritten as H.sub.2 (S) as shown in FIG. 12(b), in which a gain factor of K.sub.c has been included, to account for the torque C.sub.t and the value of K.sub.o is substituted for the overall D.C. gain, i.e., (K.sub.v)(K.sub.m)(K.sub.p)(K.sub.a)(K.sub.c) =K.sub.o. Although the numerical value of K.sub.c may also be calculated, it is premature to do so, since it has not as yet been established that K.sub.o, which has been adjusted by the value of K.sub.c to provide a minimum value of K.sub.o, is acceptable for system stability and performance purposes. Otherwise stated, K.sub.o may not be the overall system gain which is needed for system compensation for maximizing the system bandwidth BW, as a result of which it is premature to conclude that K.sub.c will be equivalent to the D.C. gain of the system compensator D(S). At this juncture, the Bode diagram shown in FIG. 13, may be constructed due to having calculated a minimum value for K.sub.o. As shown in FIG. 13, the absolute value of H.sub.2 (S), in decibels, has been plotted against the frequency W in radians per second, based on the calculated minimum value of K.sub.o, the selected value of T and calculated values of the poles f.sub.1 and f.sub.2. From the Bode diagram, a numerical value of the crossover frequency W.sub.cl of the Bode plot of H.sub.2 (S) may be determined, i.e., W.sub.cl was found to be substantially 135 radians per second. And, since the value of W.sub.cl is substantially equal to the bandwidth BW.sub.u of the uncompensated open-loop system H.sub.2 (S), a calculation may be made of the phase margin .theta..sub.m of the uncompensated system from the expression .phi..sub.m =180.degree.-.theta.[H(S)] at W.sub.cl, or, otherwise stated: .phi..sub.m =180.degree.-tan.sup.-1 (W.sub.cl)-tan.sup.-1 (W.sub.cl /f.sub.1)-tan.sup.-1 (W.sub.cl /f.sub.2)-tan.sup.-1 (W.sub.cl T/2). From this calculation, there was obtained a phase margin value which was much, much, less (i.e., 5.degree.) than 45.degree., which, for the purposes of the calculations was taken to be a minimum desirable value for the phase margin .phi..sub.m in a position-type servo system. Accordingly, it was found that the uncompensated system H.sub.2 (S) was unstable if not compensated. Since an increase in phase lead results in an increase in bandwidth BW, and the design criteria calls for maximizing the bandwidth BW and increasing the phase margin to at least 45.degree.; phase lead compensation was utilized. By definition, a phase lead compensator D(S) has the Laplace transform shown in FIG. 14, wherein K.sub.c is the phase lead D.C. gain, and f.sub.z and f.sub.p are respectively a zero frequency and a pole frequency. Adding the transfer function of the phase lead compensator D(S) to the Bode plot of the uncompensated system's transfer function H.sub.2 (S), results in the Bode plot of the compensated system transfer function H.sub.3 (S), if the zero frequency f.sub.z or the phase lead compensator D(S) is chosen to be equivalent to f.sub.1 in order to cancel the lag due to the mechanical time constant of the uncompensated transfer function H.sub.2 S. As shown in FIG. 13, the cross-over frequency W.sub.c2 for the compensated system H.sub.3 (S) may be read from the Bode diagram, i.e., W.sub.c2 was found to be substantially equal to 400 radians per second. And, since by definition the crossover frequency W.sub.c2 lies at the geometric mean of f.sub.p and f.sub.z, the value of the fp may be established by doubling, from f.sub.z, the linear distance between W.sub.c2 and f.sub.z, as measured along the logarithmic frequency axis, W, and reading the value of f.sub.p from the Bode diagram, i.e., f.sub.p was found to be substantially equal to 3,400 radians per second. Since numerical values may thus be assigned to both W.sub.c2 and f.sub.p from the Bode diagram, the compensated phase margin .phi..sub.mc, i.e., the phase margin for the phase lead compensated system H.sub.3 (S) in which f.sub.z has been equated to f.sub.1, may be found from the expression .phi..sub.mc =180.degree.-90.degree.-tan.sup.-1 (W.sub.c2 /f.sub.2)-tan.sup.-1 (W.sub.c2 T/2). Upon calculating the compensated phase margin .phi..sub.mc it was found to be 50.degree. and, therefore, greater than the minimum phase margin criteria of 45.degree.. In addition, the value of W.sub.c2 for the compensated system H.sub.3 (S) was found to be substantially three times that of the uncompensated system H.sub.2 (S), as a result of which the bandwidth BW of the system H(S) was increased by a factor of substantially three to BW.sub.c. At this juncture, the compensated system H.sub.3 (S) is preferably analyzed with reference to the system's overshoot O.sub.s and settling time t.sub.s based on a calculation of the system damping factor d.sub.f and the assumption that the system will settle in five times constants, i.e., t.sub.s =5tx. The relevant values may be calculated or estimated, as the case may be, from the expressions, for d.sub.f, o.sub.s, t.sub.x and t.sub.s shown in FIG. 15. In connection with this analysis, reference is also made to the typical mailing machines hereinbefore described, wherein a maximum drum cycle time period T.sub.ct (FIG. 3) of 234 milliseconds and a maximum mailpiece transport speed (FIG. 2) of 61 inches per second are typical values. Assuming the velocity profile of FIG. 3, and, as previously discussed an acceleration time period of T.sub.a =37 milliseconds, a constant velocity time period of T.sub.c =124 milliseconds and decceleration time period of T.sub.d =24 milliseconds, the longest permissible settling time for the system was calculated, i.e., T.sub.ct -(T.sub.a +T.sub.c +T.sub.d) =234-185 =49 milliseconds. For analysis purposes a series of calculations of the aforesaid system characteristics and phase margin were performed, assuming incremental increases in the overall system gain K.sub.o, while holding f.sub.z =f.sub.1. The results of such calculations are shown in the following Table III.
TABLE III
______________________________________
H.sub.3 (S) with f.sub.z = f.sub.1
K.sub.o = .theta..sub.m =
O.sub.s = over-
system
W.sub.c = BW
phase shoot t.sub.s = settling
gain (rad./sec.)
Margin (deg.)
(percent)
time (MS.)
______________________________________
400 400 50 28 28.67
447 450 46 31 27.78
501 500 42 34 27.50
562 550 38 38 27.41
______________________________________
As shown in Table III, the system bandwidth BW may be maximized at 450 radians per second while maintaining a phase margin .phi..sub.m of at least 45.degree. the two design criteria discussed above. Although this results in an increase in system overshoot O.sub.s accompanied by a negligible decrease in the settling time t.sub.s, the settling time t.sub.s is well within the maximum allowable settling time, T.sub.s =49 milliseconds. On the other hand, if a bandwidth of 400 radians per second is acceptable, it is desirable to reduce the percentage of overshoot O.sub.s, and increase the phase margin to .theta..sub.mc =50 to provide for greater system stability than would be available with a phase margin value (i.e., 46.degree.) which is substantially equal to the design criteria minimum of 45.degree.; in which instance it is preferable to choose the bandwidth of BW=400 radians per second, overshoot of O.sub.s =28% and compensated phase margin of .theta..sub.mc =50.degree.. For the example given, a compensated Bandwidth of BW.sub.c =400 radians per second is acceptable inasmuch as worst case load conditions were assumed. In this connection it is noted that the foregoing analysis is based on controlling a postage meter drum, which has a high moment of inertia, contributes high system friction, and calls for a cyclical start-stop mode of operation during which the load follows a predetermined displacement versus time trajectory to accommodate the maximum mailpiece transport speed in a typical mailing machine. Accordingly, the compensated system bandwidth BW.sub.c =400 radians per second may be chosen, as a result of which the overall system gain K.sub.o may be fixed at K.sub.o =400, and the value of K.sub.c may be calculated from the expression K.sub.c =K.sub.o /(K.sub.v)(K.sub.a)(K.sub.p). Since f.sub.z =f.sub.1, and f.sub.1 and f.sub.p are also known, the Bode plot of the compensator D(S), FIG. 14, may be added to the Bode diagram (FIG. 13) wherein the system compensator D(S) is shown as a dashed line. Since the analog compensator D(S) was derived in the frequency domain, D(S) was converted to its Z-transform equivalent D(Z) in the sampled data domain for realization in the form of a numerical algorithm for implementation by a computer. Of the numerous well-known techniques for transforming a function in the frequency domain to a function in the sampled-data domain, the bi-linear transformation may be chosen. For bi-linear transformation purposes the Laplace operator S is defined by the expression shown in FIG. 16. Using the values K.sub.c =13.64, f.sub.z =f.sub.1 =48, and f.sub.p =3,400 in the expression for D(S) shown in FIG. 14, and substituting the bilinear transformation expression for S shown in FIG. 16 and the sampling interval T=1 millisecond, in the expression shown in FIG. 14 results in the expression for D(Z) shown in FIG. 17. As shown in FIG. 11, D(T)=output/input=g(T)/e(T), which, in the sampled data domain is expressed by the equation D(Z)=G(Z)/E(Z). Accordingly, the expression for D(Z) shown in FIG. 17 may be rewritten as shown in FIG. 18a. Cross-multiplying the equivalency of FIG. 18a results in the expression shown in FIG. 18b, which defines the output G(Z) in the sampled data domain of the system compensator D(S). Taking the inverse Z-transform of the expression shown in FIG. 18b, results in the expression shown in FIG. 19 which defines the output G(T.sub.n) in the time domain of the system compensator D(S), and is a numerical expression of the algorithm to be implemented by the computer for system compensation purposes. As shown by the expression in FIG. 19 and in the following Table IV the output of the digital compensator for any current sampling instant T.sub.n is a function of the position error at the then current sampling time instant T.sub.n, is a function of the position error at the end of the next previous sampling time instant T.sub.n-1 and is a function of the algorithm output at the end of the next previous sampling time instant T.sub.n-1.
TABLE IV
______________________________________
Function Definition
______________________________________
G(T.sub.n) Algorithm output for current sampling time
instant T.sub.n
E(T.sub.n) Position error for current sampling time
instant T.sub.n
G(T.sub.n-1)
Algorithm output for next previous sampling
time instant T.sub.n-1
E(T.sub.n-t)
Position error for next previous sampling
time instant T.sub.n-1
K.sub.1, K.sub.2 & K.sub.3
Constants of the compensated system which
are a function of the parameters of the
motor load and system friction for a
sampling time period of T = 1 millisecond.
______________________________________
Accordingly, the algorithm which is to be implemented by the computer 500 for system compensation purposes is a function of a plurality of historical increments of sampled data for computing an input value for controlling a load to follow a predetermined position trajectory in a closed loop sampled-data servo-control system. Although the compensation algorithm was derived with a view to maximizing the closed-loop system bandwith for controlling the D.C. motor to cycle, the postage meter drum 38 the same compensation algorithm may be utilized for controlling rotation of the drum 38 for selectively indexing the racks 43 of the postage value changing means into engagement with the output gear 40b of the digit selection stepper motor 40. As distinguished from controlling the drum 38 as a function of the sampled velocity of a mailpiece 16, the racks 43 may each be successively indexed into engagement with the gear 40b as a function of amounts representatiave of a predetermined, trapezoidal-shaped velocity versus time profile stored in the computer 500. Thus, a group of acceleration, decceleration and constant velocity constatns may be conventionally stored in the computer 500 and fetched for calculating counts representatiave of the desired angular displacement of the motor output shaft 122 during each sampling time period T, for comparison with the counts representative of the actual angular displacement of the motor output shaft 122 during each sampling time period T, for indexing the drum 38 and thus the racks 43 to successively dispose each rack 43 in engagement with the gear 40b and to then drive the drum 38 to its home position. As shown in FIG. 20 the computer 500 preferably includes a conventional, inexpensively commercially available, high speed microprocessor 502, such as the Model 8051 single chip microprocessor commercially available from Intel Corporation, 3065 Bowers Avenue, Santa Clara, Calif. 95051. The microprocessor 502, generally comprises a plurality of discrete circuits, including those of a control processor unit or CPU 504, an oscillator and clock 506, a program memory 508, a data memory 510, timer and event counters 512, programmable serial ports 514, programmable I/O ports 516 and control circuits 518, which are respectively constructed and arranged by well known means for executing instructions from the program memory 508 that pertain to internal data, data from the clock 506, data memory 510, timer and event counter 512, serial ports 514, I/O ports 514 interrupts 520 and/or bus 522 and providing appropriate outputs from the clock 506, serial ports 514, I/O ports 516 and timer 512. A more detailed discussion of the internal structural and functional characteristics and features of the Model 8051 microprocessor, including optional methods of programming port 3 for use as a conventional bidirectional port, may be found in the Intel Corporation publication entitled MCS-51 Family of Single Chip Microcomputers Users Manual, dated January 1981. For implementing the sampling time period of T=1 millisecond, one of the microprocessor's timer and event counters 512 (FIG. 20) is conventionally programmed as a sampling time period clock source. To that end, a timer 512 is programmed for providing an interrupt signal each 250 microseconds, and each successive fourth interrupt signal is utilized as a clock signal for timing the commencement of successive sampling time periods of T=1 millisecond. In general, as shown in FIG. 21, at the commencement of each sampling time period of T=1 millisecond, during the sampling instant T.sub.n, a sample is taken of the count representative of the actual angular displacement of the motor drive shaft and, substantially immediately thereafter, the actual count is summed with the count representative of the desired angular displacement of the motor drive shaft which was calculated during the next preceeding time period T in order to obtain the then current error value E(T.sub.n) for calculating the then current compensation algorithm output value G(T.sub.n). Due to the recursive mathematical expression for G(T.sub.n) [FIG. 19] being a function of the then current error value E(T.sub.n), the next previous error value E(T.sub.n-1) and the next previous compensation algorithm output value G(T.sub.n-1), the expression for G(T.sub.n) is preferably separated into two components for calculation purposes, i.e., G(T.sub.n)=g.sub.1 +g.sub.2 ; wherein g.sub.1 =K.sub.1 .times.E(T.sub.n), and wherein g.sub.2 =-[K.sub.2 .times.E(T.sub.n-1 )+K.sub.3 .times.G(T.sub.n-1)], to permit calculation of the value of g.sub.2 in advance of the time period T when it is to be added to the value of g.sub.1 for calculating the value of G(T.sub.n), thereby reducing to a negligible value (in view of the time period T) the time delay T.sub.dy before completion of sampling the actual displacement of the motor drive shaft at the instant T.sub.n and applying the PWM motor control signal to the output ports of the microprocessor. For example, when calculating the value of G(T.sub.n) based upon the first error value resulting from the summation of the counts representing the desired and actual angular displacements of the motor drive shaft, the value of g.sub.2 is by definition equal to zero since the error signal E(T.sub.n-1) is equal to zero, due to the desired and actual angular displacement values during the next previous sampling time period T having been equal to each other. Accordingly, upon obtaining the value of the first error signal E.sub.1 (T.sub.n), the value of G.sub.1 (T.sub.n) may be calculated as being equivalent to g.sub.1, i.e., G.sub.1 (T.sub.n)=g.sub.1 =K.sub.1 .times.E.sub.1 (T.sub.n). And, upon calculating G.sub.1 (T.sub.n) the value of g.sub.2 for use in calculating the next successive compensation algorithm output value G(T.sub.n+1) may be calculated for subsequent use, since g.sub.2 (T.sub.n+1)=-[K.sub.2 .times.E.sub.1 (T.sub.n)+K.sub.3 .times.G.sub.1 (T.sub.n)], and K.sub.2, K.sub.3, E.sub.1 (T.sub.n) and G.sub.1 (T.sub.n) are all known values. In addition, during any given time period T, a calculation may be made of the desired angular displacement of the motor drive shaft for the next subsequent time period T. Preferably, the microprocessor is programmed for implementation of the aforesaid calculation process to facilitate early utilization of the compensation algorithm output value G(T.sub.n) for driving the D.C. motor. Accordingly, the microprocessor is preferably programmed for: during the first sampling time period T.sub.1, sampling the count representative of the actual angular displacement of the motor drive shaft at the time instant T.sub.n, then taking the summation of that count and the previously calculated value of the desired angular displacement of the motor drive shaft to obtain the first error value E.sub.1 (T.sub.n), then calculating the first compensation algorithm output value G.sub.1 (T.sub.n)=K.sub.1 .times.E.sub.1 (T.sub.n)+g.sub.2, wherein g.sub.2 =0, and generating a PWM motor control signal representative of G.sub.1 (T.sub.n), then calculating the value of g.sub.2 for the next sampling time period, i.e., g.sub.2 =-[K.sub.2 .times.E.sub.1 (T.sub.n)+K.sub.3 .times.G.sub.1 (T.sub.n)], and then calculating the count representing the desired angular displacement of the motor drive shaft for use during the next sampling time period T.sub.2 ; during the second sampling time period T.sub.2, sampling the count representative of the actual angular displacement of the motor drive shaft and taking the summation of that count and the previously calculated desired count to obtain the error value E.sub.2 (T.sub.n+1), calculating the compensation algorithm output value G.sub.2 (T.sub.n+1)=K.sub.1 .times.E.sub.2 (T.sub.n+1)+g.sub.2 =K.sub.1 .times.E.sub.2 (T.sub.n+1)-K.sub.2 .times.E.sub.1 (T.sub.n)-K.sub.3 .times.G.sub.1 (T.sub.n), and generating a PWM motor control signal representative thereof, then calculating the value of g.sub.2 for the next sampling time period T.sub.3, i.e., g.sub.2 -[K.sub.2 .times.E.sub.2 (T.sub.n+1)+K.sub.3 .times.G.sub.2 (T.sub.n+1)], and then calculating the count representative of the desired angular displacement of the motor drive shaft for use during the time period T.sub.3 ; and so on, during each successive sampling time period. Accordingly, as shown in FIG. 21, the microprocessor is programmed for immediately after calculating the then current compensation algorithm output value G(T.sub.n), and thus while the calculation of the value of g.sub.2 for the next sampling time period is in progress, generating a motor control signal for energizing the power amplifier. For this purpose, the relative voltage levels of motor control signal are determined by the sign, i.e., plus or minus, of the compensation algorithm output value G(T.sub.n), and the duty cycle of the control signal is determined by the absolute value of the compensation algorithm output value G(T.sub.n). Preferably, for timing the duration of the motor control signal, the other timer and event counter 512, i.e., the timer 512 which was not used as a sampling time period clock source, is utilized for timing the duration of the duty cycle of the motor control signal. For example, by loading the absolute value of the G(T.sub.n) into the other timer 512, commencing the count, and timely invoking an interrupt for terminating the duty cycle of the control signal. As shown in FIG. 21(c), the time delay T.sub.dy from commencement of the time period T to updating the PWM motor control signal at the output ports of the microprocessor is substantially 55 microseconds, and the time interval allocated for calculating the value of g.sub.2 and the count representative of the desired angular displacement of the motor drive shaft for use during the next time period is substantially 352 microseconds. As a result, substantially 593 microseconds of microprocessor calculation time is available during any given sampling time period T=1 millisecond for implementing non-motor control applications. As shown in FIG. 22 the computer 500 is preferably modularly constructed for segregating the components of the logic circuit 501a and analog circuit 501b of the computer 500 from each other. To that end, the respective circuits 501a and 501b may be mounted on separate printed circuit boards which are electrically isolated from each other and adapted to be interconnected by means of connectors located along the respective dot-dash lines 516, 527 and 528. In any event, the components of the logic circuit 521a and analog circuit 521b are preferably electrically isolated from each other. To that end, the logic circuit 501a preferably includes 5 V and ground leads from the mailing machine's power supply for providing the logic circuit 501a with a local 5 volt source 530 having 5 V and GND leads shunted by filter capacitors C1 and C2. And the analog circuit 501b includes 30 volt and ground return leads from the mailing machine's power supply for providing the analog circuit 501b with a local 30 volt source 536 including 30 V and GND leads shunted by filter capacitors C3 and C4. In addition, the analog circuit 501b includes a conventional 30 volt detection circuit 542 having its input conventionally connected to the analog circuit's 30 volt source 536, and its output coupled to a power up/down lead from the analog circuit via a conventional optical-electrical isolator circuit 544. Further, to provide the analog circuit 501b with a local 5 volt source 546, the analog circuit 501 b is equipt with a conventional regulated power supply having its input appropriately connected to the analog circuit's 30 volt source 536 via a series connected resistor R1 and a 5 volt, voltage regulator 548. A zener diode D1, having its cathode shunted to ground and having its anode connected to the input of the 5 V regulator 548 and also connected via the resistor R1 to the 30 volt terminal line, is provided for maintaining the input to the 5 V regulator 548 at substantially a 5 volt level. In addition, a pair of capacitors C5 and C6 are provided across the output of the regulator 548 for filtration purposes. To accommodate interfacing the postage meter's computer 41 (FIG. 1) with the computer 500, any two available ports of the computer 41 may be programmed for two-way serial communications purposes and coupled to the computer 500. For example, the postage meter's printing module 41c may be conventionally modified to include an additional two-way serial communications channel for communication with the computer 500. Assuming the latter arrangement, serial input communications to the computer 500 (FIG. 22) are received from the postage meter computer's printing module 41c via the serial input lead to the logic circuit 501a (FIG. 22), which is operably coupled to port P3.sub.0 of the microprocessor 502 by means of a conventional inverting buffer circuit 550. Accordingly, port P3.sub.0 is preferably programmed for serial input communications, and the input to the buffer circuit 550 is resistively coupled to the logic circuit's 5 volt source 530 via a conventional pull-up resistor R2. Serial output communications from the microprocessor 502 are transmitted from port P3.sub.1. Accordingly, port P3.sub.1 is preferably programmed for serial output communications, and is operably coupled to the input of a conventional inverting buffer 552, the output of which is resistively coupled to the logic circuit's 5 V source 530 via a suitable pull-up resistor R2 and is additionally electrically connected to the serial output lead from the logic circuit 501a. Since it is preferable that the microprocessor 502 be reset in response to energization of the logic circuit 501a, the logic circuit's 5 V source 530 is connected in series with an R-C delay circuit and a conventional inverting buffer circuit 554 to the reset pin, RST, of the microprocessor 502. The R-C circuit includes a suitable resistor R3 which is connected in series with the logic circuit's local 5 V source 530 and a suitable capacitor C7 which has one end connected between the resistor R3 and the input to the buffer circuit 554, and the other end connected to the logic circuit's ground return. In addition to the VCC and GND (i.e., VSS) terminals of the microprocessor 502 being respectively conventionally connected to the logic circuit's 5 volt source and ground, since the microprocessor 502 does not utilize an external program memory, the EA terminal is connected to the logic circuit's 5 V source. And, since no other external memory is used, the program storage enable and address latch enable terminals, PSEN and ALE are not used. In addition to the EA terminal being available for future expansion, ports P1.sub.5 -P1.sub.7, ports P2.sub.0 -P2.sub.7, the read and write terminals, RD and WR, and one of the interupt terminals INTO/P3.sub.2 are also available for future expansion. In general, the microprocessor 502 is programmed for receiving input data from the postage meter drum's home position encoder 82 each of the envelope sensors 56, 58 and the D.C. motor shaft encoder 126, and, in response to a conventional communication from the postage meter's printing module 41c, timely energizing the D.C. motor under the control of the CPU of the microprocessor 502. Port P0 is programmed for receiving a transition signal representative of the disposition of the postage meter's drum 38 at its home position; transition signals from the envelope sensors 56 and 58 which represent detection of the leading edge of a mailpiece or other sheet 16 being fed to the drum 38 to permit calculation by the computer 500 of the velocity of the mailpiece and thus the desired angular displacement of the D.C. motor shaft 122 and thus the drum 38; and a count representative of the actual angular displacement of the D.C. motor shaft 122. Preferably, port P0 is multiplexed to alternately receive inputs from groups of the various sensors, under the control of an output signal from Port P3.sub.4 of the microprocessor 502. The shaft encoder 82 which is utilized for sensing the home position of the postage meter drum 38 is coupled to the computer 500 via the drum home position lead of the logic circuit, which, in turn, is connected to one input of a differential amplifier 562, the output of which is connected to the other input of the differential amplifier 562 via a feedback resistor R4. The aforesaid other input to the amplifier 562 is also resistively coupled, by means of a resistor R5, to the midpoint of a voltage divider circuit including resistors R6 and R7. Resistors R6 and R7 are connected in series with each other and across the logic circuit's 5 V source and ground return leads. The LED sensors 56 and 58, which are utilized for successively sensing the leading edges of each envelope being fed by the letter transport, are separately coupled to the computer 500 via the envelope sensor-1 and envelope sensor-2 input leads of the logic circuit 501a. In the logic circuit 501a, the envelope sensor-1 and sensor-2 leads are connected on a one-for-one basis to one of the inputs of a pair of conventional amplifiers 564, the other inputs of which are connected together and to the mid-point of a voltage divider including resistors R8 and R9. Resistors R8 and R9 are connected in series with each other and across the logic circuit's 5 V source and ground return leads. Further, the three output signals from the differential amplifiers 562 and the two amplifiers 564 are connected on a one-for-one basis to the three input ports PO.sub.0-2 of the microprocessor 502, each via a conventional tri-state buffer circuit 566, one of which is shown. The input signals A and B from the D.C. motor shaft encoder 126 are coupled to the logic circuit 501a by means of leads A and B, which are conventially electrically connected to the counting circuit 270 to provide the microprocessor 502 the the count representative of the actual angular displacement of the motor shaft 122 from its home position. The counting circuit's leads Q0-Q7 are electrically connected on a one-for-one basis to Ports PO.sub.0 -PO.sub.7 of the microcomputer 502 via one of eight conventional tri-state buffer circuits 568, one of which is shown, having their respective control input leads connected to each other and to the output of a conventional inverting buffer circuit 570, which has its input conventionally connected port P3.sub.4 of the microprocessor 502. Thus, either the three input signals, i.e., from the drum home position and the two envelope position sensors are operably electrically coupled to Ports P0.sub.0 -P0.sub.2 of the microprocessor 502, or the eight input signals Q0-Q7 from the counter circuit 270 are operably electrically coupled to ports P0.sub.0 -P0.sub.7 of the microprocessor 502, for scanning purposes, in response to an appropriate control signal being applied to the respective buffer circuits 566 and 568 from port P3.sub.4 of the microprocessor 502. In operation, assuming a low logic level signal is required for activating either of the sets of buffers 566 or 568; when the microprocessor 502 applies such a signal to port P3.sub.4, the buffer circuits 566 operate, whereas since the buffer circuit 570 inverts this signal to a high logic level signal before applying the same to the buffer circuit 568, the latter is inoperative. Conversely, a high logic level signal from port P3.sub.4 will operate buffer circuits 568 and not operate the buffer circuits 566. Accordingly, depending upon the level, high or low, of the signal from port P3.sub.4 of the microprocessor 502, the eight bit input to one or the other buffer circuits 566 or 568 will be made available to port PO for scanning purposes. Aside from the foregoing, to permit the microprocessor 502 to clear the counter 270 for any reason in the course of execution of the program, port P3.sub.5 is connected to the clear pin CLR of the counter 270 via a conventional inverting buffer 572, and the microprocessor 502 is programmed for timely applying the appropriate signal to port P3.sub.5 which, when inverted, causes the counting circuit 270 to be cleared. In general, ports P1.sub.0 -P1.sub.3 are utilized by the microprocessor 502 for providing pulse width modulated (PWM) motor control signals for controlling energization of the D.C. motor 120 and port P1.sub.4 is utilized by the microprocessor 502 for controlling energization of the solid state, A.C. motor, relay 52 and thus operation of the mailpiece conveyor 49. To that end, ports P1.sub.0 -P1.sub.4 of the microprocessor 502 are each conventionally electrically connected on a one-for-one basis to the input of a conventional inverting buffer circuit 580, one of which is shown. The outputs of each of the buffer circuits 580 are connected on a one-for-one basis, via a conventional resistor R10, to output leads from the logic circuit 501b, one of which is designated solid state, A.C. motor, relay, and four of which are respectively designated T1, T3, T2 and T4, since, as shown in FIG. 7, the four preamplifier stages of the power amplifier utilized for driving the D.C. motor 120 include the transistors T1--T4. Thus, the upper nibble of the signal from port Pl is utilized for controlling energization of the D.C. motor and one bit of the lower nibble is utilized for controlling energization of the solid state, A.C. motor, relay 52 and thus the A.C. motor 50. In the analog circuit 501b, each of the leads T1, T2, T3, T4 and solid state relay, from the logic circuit 501a, is electrically connected on a one-for-one basis to the anode of the light emitting diode D1 of five, conventional, phototransistor type, optical-electrical isolator circuits 303. Since the cathodes of the light emitting diodes D1 of the opto-isolator circuits 303 are connected to each other and to the 5 volt lead from the analog circuit 501b which extends to the 5 volt source of the logic circuit 501a, the motor control signals are isolated from the power system of the analog circuit 501b to avoid having spurious noise signals in the analog circuit 501b and its components interfere with the control signals generated by the microprocessor 502. The analog circuit 501b also includes a lead, designated power up/down, which extends from the analog circuit 501b to the logic circuit 501a and is connected to the microprocessor's interrupt INTI, port P3.sub.3, to provide the microprocessor 502 with an appropriate input signal when the power is turned on, off or fails. In the analog circuit 501b, the power up/down lead from the logic circuit 501a is coupled to the thirty volt detect circuit 542 by means of a conventional optoisolator 544, the power up/down lead being electrically connected to ground through collector-emitter circuit of the opto-isolator's photo-transistor when the light emitting diode Dl is lit in response to the D.C. supply voltage level matching the internal reference voltage level, e.g., 30 volts, of the 30 volt detection circuit. In the analog circuit 501b each of the outputs from the photo-transistors of each of the opto-isolators 303 are resistively coupled to the analog circuits 5 V source by means of a conventional pull-up resistor 305, and the emitters of the photo-transistors T5 are connected to the analog circuit's ground system. In addition, the collectors of the photodiodes of the opto-isolators 303, which are utilized for transmitting the motor control signals from ports P1.sub.0 -P1.sub.3 of the microprocessor 502 are connected on a one-for-one basis to the appropriate input leads A, B, C and D of the power amplifiers shown in FIG. 7, the outputs of which are connected to the D.C. motor 120. Further, the collector of the photodiode of the opto-isolator 303 which is utilized for transmitting the A.C. relay control signals from port P1.sub.4 of the microprocessor 502 is connected to the input lead of a conventional darlington-type power amplifier 550, the output of which is conventionally connected to the mailing machine's 30 volt D.C. source via a solid state, A.C. motor, relay 52, which is turn conventionally connected for energizing the A.C. motor 50 from the local A.C. source. In general, the computer 500 includes five software programs, including a main line program, FIG. 23a, a command execution program, FIG. 23b, a D.C. motor drive subroutine, FIG. 23c, a time delay subroutine, FIG. 23d, and a waiting subroutine, FIG. 23e. When the mailing machine 10 is energized by actuation of the main power switch 24, the resulting low level logic signal from D.C. supply is applied to the reset terminal RST of the computer's microprocessor 502, thereby enabling the microprocessor 502. Whereupon, as shown in FIG. 23a, the microprocessor 502 commences execution of the main line program 600. The main line program 600 (FIG. 23a) commences with the step of conventionally initializing the microprocessor 602, which generally includes establishing the initial voltage levels at the microprocessor's ports, and interrupts, and setting the timers and counters. Thereafter, D.C. motor drive unit is initialized 604. Step 604 entails scanning the microprocessor's input port PO.sub.0, to determine whether or not the D.C. motor shaft, 122 is located in its home position and, if not, driving the same to the home position. Assuming the motor shaft 122 is so located, either before or after the initialization step 604, the program then enters an idle loop routine 606. In the idle loop routine 606, a determination is initially made as to whether or not the sampling time period of T=1 millisecond has elapsed, step 608, it being noted that each successive sample is taken at the time instant T.sub.n immediately after and in response to the fourth 250 millisecond interrupt generated by the timer utilized for implementing the sampling time period T. Assuming the time period T has not elapsed, the program loops to idle 606. On the other hand, assuming the time period T has elapsed, the microprocessor 502 updates the servo-control system, step 610. For the purpose of explaining step 610 it will be assumed that the desired location of the motor drive shaft 122 is the home position. Step 610 includes the successive steps 610a and 610b, respectively, of sampling the count of the actual position Pa of the motor drive shaft 122 at the sampling time instant T.sub.n, and the fetching the previously computed count representing the desired position Pd of the shaft 122 at the same sampling time instant T.sub.n. If for any reason the motor drive shaft 122 is not located in its home position when the value of the desired position count Pd(T.sub.n) is respresntative of the home position location, then the values of Pa(T.sub.n) and Pd(T.sub.n) will be different. On the other hand, if the motor drive shaft 122 is located in its home position when the desired position count Pd(T.sub.n) is representative of the home position location, then the values of Pa(T.sub.n) and Pd(T.sub.n) will be the same. Accordingly, computation of the error count, 610c, may or may not result in an error county value E(T.sub.n) of zero. Further, independently of the computed value of E(T.sub.n), the computed valuer G(T.sub.n) of the motor control signal, step 601d, may or may not result in a value of G(T.sub.n) of zero; it being noted that although step 610c results in a computed value of E(T.sub.n)=0, the value of g.sub.2 may not be equal to zero due to the computed value of the error for the next previous sampling time instant E(T.sub.n-1) having resulted in a non-zero value, step 610g. Assuming steps 610c and 610d both result in zero value computations, then, upon updating and generating the PWM motor control signal, step 610e no motor control signal will be generated. Under any other circumstances, step 610e will result in generating a PWM motor control signal for driving the D.C. motor 120, and thus the drum 38, to its home position. Thereafter, as shown in step 610f, the computed values of E(T.sub.n) and G(T.sub.n) are utilized as the values of E(T.sub.n-1) and G(T.sub.n-1) respectively for pre-calculating the value of g.sub.2 for the next subsequent time instant T.sub.n. Thereafter, as shown in step 610h, the envelope sensors 56 and 58 are polled if the trip logic is enabled, i.e., if an envelope 16 is to be fed to the drum 38. However for the purpose of this discussion it will be assumed that an envelope is not being fed, as a result of which the trip logic is not enabled and, therefore, the envelope sensors 56 and 58 are not polled, step 610h. As shown by the next, step 612, a determination is then made as to whether or not a command has been received. Assuming a command has not been received, step 612, since trip logic is not enabled, processing returns to idle 606. Thus, until a command is received from the postage meter's computer 41, the main line program will continuously loop through steps 608, 610, 612 and 614 and drive the motor drive shaft 122 to its home position, against any force tending to move the shaft 122 out of the home position. At this juncture, it will be assumed that a command is received, as a result of which the inquiry of step 612 (FIG. 23a) is answered affirmatively, and the execute command routine 800 (FIG. 23b) is invoked. Assuming the command to be executed is to select postage, the select postage routine 702 (FIG. 23b) is invoked. Processing thus commences with the step, 704, of decoding the postage value, followed by an inquiry as to whether or not a digit is to be changed, step 706, in order to print the selected postage value. Assuming none of the print wheels 464 (FIG. 1 and FIG. 23b) are to be rotated in order to locate a different print element 465 at the periphery of the postage meter's drum 38, then the inquiry of step 706 is answered negatively, and an appropriate message is transmitted to the postage meter's computer 41 to indicate completion of execution of the command, step 708, before the select postage routine 702 loops to idle 606 (FIG. 23a). On the other hand, if any print element 465 of any print wheel 464 is to be changed in order to print the selected postage value, the inquiry of step 706 is affirmatively answered. Whereupon the D.C. motor 120 is driven under the control of the computer 500 for moving the drum 38 to cause the postage value changing apparatus to be indexed for moving the desired rack 43 thereof into engagement with the stepper motor's output gear 40b, step 714. Step 714 generally includes the step of calling up and executing the steps of the D.C. motor drive subroutine 900 (FIG. 23c). The D.C. motor drive subroutine 900 (FIG. 23c), which is called up by the execute command routine 700 whenever the D.C. motor 120 is driven, includes the initial step 902 of fetching an amount, corresponding to the total number of counts, step 902a, that the encoder 126 will count, during the desired displacement of the drum 38 for the particular mode of operation, i.e., cycling the drum for printing purposes or indexing the drum for rack selection purposes. Thus step 902 includes the step 902b of identifying the type of drive mode of the drum 38. Thereafter the microprocessor 502 processes step 904 for the particular drum drive mode. Step 904 includes the step 904a, of fetching the group or set of acceleration, deceleration and constant velocity constants from a look-up table, for the particular drum drive mode. Preferably the constants for the indexing mode are specified with a view to maximizing the acceleration, deceleration and constant velocity of the d.c. motor for driving the drum; the respective acceleration and deceleration constants being amounts which are representative of a number of counts per square sampling time period T, and the constant velocity constant being an amount which is representative of a number of counts per sampling time period T. In addition, step 904 includes the step 904b of utilizing the total desired displacement, and the acceleration, deceleration and constant velocity constants for computing the total displacement and time duration of the respective acceleration, deceleration and constant velocity phases for driving the particular load in accordance with the desired trapezoidal-shaped velocity versus time profile. Thereafter, processing proceeds to execution of the steps of the loop 906, including the initial steps of waiting for the next elapse of a sampling time period T, step 608 as previously discussed, then updating the d.c. motor drive servo control system, step 610 as previously discussed but excluding the assumption that the d.c. motor drive shaft 122 is to be located in its home position, then inquiring, step 908, as to whether or not the total displacement of the drum is equal to the instantaneous desired position Pd. Assuming the inquiry of step 908 is negative, processing proceeds to the step, 910, of computing the desired position Pd for the next sampling time period T and thereafter continuously looping through steps 608, 610, 908 and 910 as hereinbefore discussed until the total desired displacement is equal to the instantaneous desired position, step 908. Whereupon processing is diverted to the step, 912, of implementing an appropriate time delay to allow for settling the motion of the d.c. motor 120 before the subroutine 900 is exited, step 916, by returning processing to the execute command step which originally called up the d.c. motor drive subroutine 900, for example, step 714 (FIG. 23b). After executing step 714 (FIGS. 1 and 23b), of driving the drum 38 for moving the selected rack 43 into engagement with the stepper motor drive gear 40b, the select postage routine 702, executes the step, 720, of inquiring whether or not the digit or print element 45 which is associated with the selected rack 43 has been set, i.e., whether or not the postage meter's stepper motor 40 has completed actuation of the selected rack 43 for rotating the selected print element 45 of the print wheel 44 to the outer periphery of the drum 38 for printing purposes. Assuming digit setting is complete, step 716, processing proceeds to the step, 720, of inquiring whether or not all the digits have been checked; whereas assuming digit setting is incomplete, step 716, processing waits for such completion, step 718, before proceeding to step 720. Assuming all the digits have not been checked, step 720, processing loops to step 706, and steps 706-720 are continuously processed until the assumption is invalid. Whereupon processing proceeds to the step, 722, of driving the drum 38 to its home position. Step 722 generally includes the step of calling up the D.C. motor drive subroutine 900 (FIG. 23c) and executing the same as hereinbefore discussed in the rack select mode, but including the assumption that the d.c. motor drive shaft 122 is to be located in its home position. As in the case of execution of step 714, step 722 includes the step of execution of an appropriate time delay for drum settling purposes before returning before returning to step 722. Whereupon, the select postage routine 702 executes the step, 724, of transmitting an appropriate command execution complete message to the postage meter's computer 41 and processing is looped to idle 606 (FIG. 23a). As above discussed, an appropriate time delay is implemented by the microprocessor 502 in the course of execution of each of the steps 714 and 722 (FIG. 23b) to allow for settling movement of the d.c. motor 120. Each of the steps 714 and 722 generally includes the step of calling up and executing the time delay subroutine 950 of FIG. 23c. As shown in FIG. 23c, the time delay subroutine 950 initially executes the step 952 of fetching an amount which is multiple of the sampling time period T, and corresponds to the number of times processing is to loop in the time delay subroutine 950. Having executed step 952, the time delay subroutine 950 enters a loop 954 wherein the successive steps of waiting for the next elapse of the sampling time period T, step 608 as previously discussed, and then updating the d.c. motor servocontrol drive system, step 610 as previously discussed, until the predetermined number of time delay loops have been completed. Whereupon processing is returned to the execute command step, 714 or 722, which originally called up the subroutine 950. As above discussed, an appropriate waiting time period is implemented by the microprocessor 502 in the course of execution of step 718 to allow for completion of actuation of the selected rack 43 by the stepper motor 40 under the control of the postage meter's computer 41. Step 718 generally includes the step of calling up and executing the waiting subroutine 975 of FIG. 23e. As shown in FIG. 23e, the waiting subroutine 975 causes processing to enter a one millisecond time loop 976 wherein the successive steps of waiting for the next elapse of a sampling time period T, step 608 as previously discussed, and then updating the d.c. motor servo control drive system, step 610 as previously discussed, and inquiring whether or not digit setting is complete, step 978, are continuously looped through until the answer to step 978 is affirmative. Whereupon processing is returned to the call up step 718. Having executed the select postage command 702 (FIG. 23b) and returned to idle 606 (FIG. 23a), processing continues through steps 608, 610, 612 and 614 as hereinbefore discussed, until a trip enable command has been received due to the operator depressing the start key 53a. Assuming the trip enable command is received, step 612 will be affirmatively answered and the command will be executed by the execute command routine 700 (FIG. 23b). The enable trip routine 726, includes the steps of setting the trip enable status flag and energizing the solid state A.C. relay 52 (FIG. 2) to start the A.C. motor 50 for feeding envelopes 16 past the sensors 56 and 58 to the drum 38. Whereupon the appropriate command execution complete message is transmitted to the postage meter's computer 41, processing returns to idle 606 (FIG. 23a), and, upon the next elapse of a sampling time period, step 608, in the course of execution of the step of updating the d.c. motor servo-control drive system, step 610, since the trip logic enabled status flag was set in the course of execution of the enable trip command, the envelope sensors are poled, step 610h. At this juncture, assuming another command is not received for execution, the inquiry of step 612 will be answered in the negative, and processing diverted to step 614 which will be affirmatively answered since trip logic is enabled. Step 614 is followed by the step of inquiring as to whether or not the envelope sensing sequence is complete, step 616, which is in effect an inquiry as to whether or not the sensors 56 and 58 have completed successively sensing the leading edge of an envelope 16 as it is being fed to the drum 38. Assuming the sensing sequence is incomplete, step 616, processing is diverted to an inquiry as to whether or not an envelope is available. Assuming an available envelope, processing loops to idle 606, and step 608, 610, 614 616 and 618 are continuously processed until the sensing sequence, step 616 is complete. Whereupon processing proceeds to the step 620, wherein the microprocessor 502 generates a cycle drum command, and then calls up the execute command routine 700. On the other hand, if an envelope is not available, step 618, processing advances to step 622, wherein the microprocessor 502 generates a disable trip command and then calls up the execute command routine 700. Assuming an envelope is not available and a disable trip command has been generated, step 622 (FIG. 23a), the microprocessor 502 implements the disable trip command routine, 740 (FIG. 23b) which implements the step, 742, of clearing the trip enable status flag and deenergizing the solid state A.C. relay 52 to stop the A.C. motor 50 from feeding envelopes. Whereupon an appropriate command execution complete message is transmitted to the postage meter's computer 41 and processing is returned to idle 606 (FIG. 23a) where idle loop processing continues, with step 614 being answered negatively due to the trip enable status flag having been cleared, until a subsequent command is received from the postage meter's computer 41 as hereinbefore discussed. Assuming however that an envelope is available, the envelope sensing sequence is eventually completed, the cycle drum command is generated, step 620 (FIG. 23a) and the microprocessor 502 implements the drum cycle command routine 750. The routine 750 commences with the step, 752, of calculating the envelope velocity Vl and the time delay td, thereafter the time delay td is implemented, step 754, and the D.C. motor is driven for cycling the drum to feed the envelope. As with the other d.c. motor drive steps, step 754 includes the step of calling up the d.c. motor drive subroutine 900 and implementing the same, including implementing the time delay subroutine 950, before returning processing to the call up step 756 (FIG. 23b). Thereafter, an appropriate command execution complete message is transmitted to the postage meters computer 41, step 708, and processing returns to idle, step 606. The term postage meter as used herein includes any device for affixing a value or other indicia on a sheet or sheet like material for governmental or private carrier parcel, envelope or package delivery, or other purposes. For example, private parcel or freight services purchase and employ postage meters for providing unit value pricing on tape for application on individual parcels. A more detailed description of the programs hereinbefore discussed is disclosed in the appended program listing which describes in greater detail the various routines incorporated in, and used in the operation of, the postage meter. Although the invention disclosed herein has been described with reference to a simple embodiment thereof, variations and modifications may be made therein by persons skilled in the art without departing from the spirit and scope of the invention. Accordingly, it is intended that the following claims cover the disclosed invention and such variations and modifications thereof as fall within the true spirit and scope of the invention. ##SPC1##
|
Same subclass Same class Consider this
| |||||||||||
