Description
Multi-Digit Parameter Setting Procedure
Technical Field
This invention pertains to a method for setting a parameter at progressively faster rates and is specifically directed to a parameter setting method wherein a signal having a characteristic which varies at a progressively faster rate is generated and the value of the parameter is thereafter changed periodically as a function of the variable characteristic.
Background Art Numerous electronic devices require the setting of a parameter to a preselected value in order to perform subsequent manipulation of the device control variables. When the parameter is employed in conjunction with the operation of an electronic device or the like, circuit sub-systems in the device are frequently designed to set the parameter using digital techniques. Thus, for example, in a fluid metering device such as that disclosed in co-pending application Serial No. 278,954, filed June 30, 1981, an electronic signal having a value representative of a desired infusion volume may be generated by manually activating an electric switch or key to drive a parameter setting circuit in count-up or count-down fashion. The electronic signal so generated may serve in a control capacity, governing various other circuits in the metering device to permit infusion of a fluid volume from the device equal to the value of the desired infusion volume. The electronic signal may also drive a display circuit to provide visual indication of the desired infusion volume.
Applying prior art approaches to the construction of a parameter setting circuit used with the fluid metering device disclosed in the aforementioned application, however, can yield a parameter setting operation which is time-consuming. In particular, prior art parameter setting procedures are characterized by constant parameter count-up and count-down rates. When large changes in the parameter are necessary to reach the desired parameter value, this constant rate feature inherent in prior art procedures leads to relatively lengthy parameter count-up or count-down sequences. That is, for a switch-actuated parameter setting circuit of the type utilized in the above-identified fluid metering device, the switch must be manually engaged for extended periods in order to reach the desired value of the parameter. It would consequently be of benefit to provide a method for setting parameters wherein the parameter count-up or count-down operation proceeds at progressively faster rates over time, thereby shortening the total amount of time necessary to arrive at the desired value for the parameter.
Disclosure of the Invention
It is therefore an object of the present invention to provide both a method and apparatus for setting a parameter to a desired value.
It is a further object of the present invention to provide a method for performing parameter count-up and count-down operations at progressively faster rates. It is yet another object of the present invention to provide a parameter setting method wherein a signal having a characteristic which varies at a progressively faster rate over time is generated and the value of the parameter is changed periodically as a function of the characteristic of the signal so generated.
It is a further object of the present invention to provide a circuit means capable of producing a parameter signal representative of the desired value of a selected parameter, the apparatus including a means for generating a control signal having a characteristic which varies at a progressively faster rate and a means for driving the value of the parameter signal in either increasing or decreasing fashion as a function of the characteristic of the control signal. These and other objects of the present invention are achieved in a first embodiment of the present invention by a dedicated hardware circuit having a series of counters and connected visual display devices which respectively provide an indication of the "hundreds", "tens" and "ones" digits of the parameter to be' set. The counters and connected displays are clocked at an exponentially-increasing frequency by a signal supplied from a count-pulse generator. The signal from the count-pulse generator is in turn generated in accordance with a series of exponentially increasing numbers programmed into a memory device in the count-pulse generator.
In a second embodiment of the present invention, a software routine is activated to generate a signal having a magnitude which varies over successive periods of time in accordance with the accumulation of an intermediate count. Each time period has a duration determined by the amount of time necessary for the intermediate count to reach a predetermined limit, and the value of the intermediate count is increased at the end of each time period such that the successive time periods are progressively shortened. The value of the selected parameter is also changed by a fixed amount at the end of each time period, causing the parameter count-up or count-down operation to proceed at progressively faster rates for as long as the parameter
setting routine is activated.
Brief Description of the Drawings
The various features, objects and advantages of the present invention will become more apparent upon consideration of the following Brief Description of the Drawings and Best Mode for Carrying Out the Invention, wherein:
Figure 1 is a detailed diagram of a dedicated hardware circuit for implementing the method of the present invention;
Figure 2 is a schematic representation of the hardward employed in implementing the software embodiment of the present invention; and Figure 3 is a flow-chart illustrating the various method steps utilized in conjunction with the software implementation of Figure 2.
Best Mode for Carrying Out the Invention As previously indicated, it is advantageous to progressively increase the rate at which a given parameter may be counted up or counted down during parameter setting operations. The present invention provides a means for accomplishing parameter count-up or count-down at such progressively faster rates by governing the count-up or count-down operation as a function of a control signal which itself characteristically varies at progressively faster rates. This control signal, for example, may be generated with a frequency f which increases over time. The parameter count-up or count-down operation then proceeds as a function of the control signal frequency, with countup or count-down of the parameter occurring at progressively faster rates defined by the progressively increasing control signal frequency.
If the parameter to be set is represented by a base ten multi-digit number, the ability to monitor the parameter setting operation can be considerably enhanced by starting the parameter count-up or count-down at a relatively slow pace which thereafter increases such that the rate of change for digits in each significant digit group of the multi-digit parameter differs by a factor of ten from significant digit group to significant digit group. In other words, at any given point during parameter count-up or count-down the least significant digit should be changing at a predetermined rate, the next significant digit should change at one-tenth the predetermined rate following each carry-over of the least significant digit, succeeding significant digits should change at one-tenth the rate of change of immediately preceding significant digits following each carry-over of the immediately preceding significant digits and so on until the nth or most significant digit is reached, which most significant digit again changes at a rate equal to one-tenth the rate of change of the immediately preceding significant digit or 1/10 [n-1]of the predetermined rate following each carry-over of the preceding significant digit. The overall change in the net value of the parameter resulting from the count-up or count-down and carryover of individual significant digits, of course, steadily increases, eventually becoming so rapid that changes in the least significant digits can no longer be accurately observed. Nevertheless, meaningful visual monitoring of the parameter setting operation can continue because of the relatively lower rates of change for the digits associated with the more significant digit groups. The aforementioned desired rate characteristics for a base ten multi-digit parameter may be achieved by establishing the rate of parameter
σount-up or count-down in accordance with a control signal frequency f which varies exponentially over time t, i.e.: f (control signal) = Ae[Bt] where A and B are constants determined by the particular type of parameter involved and the use to which the parameter will be put.
A dedicated hardware circuit for setting a selected parameter based on the teachings of the present invention is illustrated in Figure 1. The dedicated hardware circuit includes an INCREASE key 2 and a DECREASE key 4 which respectively drive a PROM 6 via paired AND gates 8, 10 to furnish an UP/DOWN indicator signal on lead 12. The UP/DOWN indicator signal is supplied to the up/down inputs of a series of three-digit counters 14, 16 and 18. Counters 14-18 are respectively connected through banks of appropriate amplifiers 20, 22 and 24 to drive three digit displays 26, 28 and 30. Each counter and connected display is associated with a different digit of the selected parameter. Hence, counter 14 together with display 26 provides a visual indication of the parameter "ones" digit while counter 20 together with display 28 provides a visual indication of the parameter "tens" digit and counter 18 together with display 30 provides a visual indication of the parameter "hundreds" digit. Counters 14-18 may also be tapped to provide a digital signal representative of the value of the parameter being set. This digital signal can serve as a control signal for various electronic applications requiring a measure of the parameter.
The clock input to each three-digit counter 14-18 is connected via a drive line 32 from a count-pulse generator 34. Count-pulse generator 34 includes a timer 36 which drives a Look-Up-Table or Read-Only-
Memory 38 in response to clock pulses received on lead 40 from a pair of dividing counters 42 and 44. The dividing counters are in turn driven by a binary clock 46 such as a National Semiconductor CD4047B 32.768 KHz clock. A series of numbers having values which exponentially vary in the manner disclosed by Equation (1) are programmed into the Look-Up-Table 38. A corresponding series of outputs are sequentially supplied by the Look-Up-Table along data lines 48 in response to the clocking of the timer 36. Data lines 48 are connected to the data inputs of a pair of cascade-connected rate multipliers 50, 52. Rate multipliers 50, 52, both of which also receive clock pulses from binary clock 46, are tied to the clock input of dividing counter 54 via lead 55. The output of dividing counter 54 forms a COUNT PULSE train on drive line 32. As will be explained below, the frequency of the COUNT PULSE train on the drive line varies over time as a function of the variation in value of the series of numbers programmed into Look-Up-Table 38. Count-pulse generator 34 is completed by the connection of a reset line 56 from PROM 6 to the CLEAR inputs of rate multipliers 50, 52 and the RESET inputs of dividing counters 42, 52 and timer 36. The operation of the parameter setting circuit will now be described. When a previous parameter setting locked into three-digit displays 26, 28 and 30 is to be increased to a new value, INCREASE key 2 is depressed to initiate the UP/DOWN indicator signal on lead 12. Actuation of the INCREASE key simultaneously switches the reset lead 56 from PROM 6 low, removing the reset condition from the dividing counters 42 and 54, rate multipliers 50 and 52, and timer 36. Count generator 34 is then cleared in preparation for the parameter setting sequence. The UP/DOWN indicator signal on lead 12 conditions counters 14, 16 and 18 to count up in
response to the individual pulses of the incoming COUNT PULSE train on drive line 32. Meanwhile, removal of the reset condition from dividing counter 42 enables the dividing counter to generate clocking pulses on lead 40. Timer 36 subsequently counts at a fixed rate to drive Look-Up-Table 38 through its pre-programmed series of values, providing cascade-connected rate multipliers 50 and 52 with a series of data inputs having exponentially-varying magnitudes. The output on lead 55 from rate multipliers 52 thus clocks dividing counter 54 at an exponentially-varying frequency to generate the COUNT PULSE train on drive line 32. The frequency of the COUNT PULSE train likewise varies exponentially, clocking counters 14, 16 and 18 at a progressively faster rate. As a net result, the value of the parameter reflected in the three-digit displays 26, 28 and 30 increases at a progressively faster rate over the period of time during which INCREASE key 2 is depressed. When the desired parameter setting has been reached, INCREASE key 2 is returned to its original position and the high signal on reset lead 56 reappears to shut down count pulse generator 34, whereupon the COUNT pulse train on drive line 32 ceases. No further clocking of counters 14, 16 and 18 occurs. Consequently, the count appearing on three-digit displays 26, 28 and 30 at the time the INCREASE key 2 is released is locked into the three-digit display until either the INCREASE or DECREASE key is once again depressed to initiate another parameter setting operation. If desired, a limit on the rate at which the parameter count increases may be established by programming appropriate outputs into the Look-Up-Table 38 of count-pulse generator 34. That is, after INCREASE key 2 has been depressed for a predetermined interval, the series of values
programmed into the Look-Up-Table level off to a constant value such that further clocking of timer 36 drives the Look-Up-Table to provide a constant output to cascade connected rate multipliers 50 and 52. Dividing counter 54 is then clocked at a constant rate to generate a constant frequency COUNT PULSE train on drive line 32, which constant frequency represents the upper limit of the clock rate. The parameter setting otherwise locked into three- digit displays 26, 28 and 30 may be decreased by depressing DECREASE key 4. The UP/DOWN indicator signal on lead 12 from PROM 6 now conditions counters 14, 16 and 18 to count down in response to the COUNT PULSE train received on drive line 32. Thereafter, count-pulse generator circuit 34 functions in the manner previously described to generate the COUNT PULSE train at a frequency which exponentially varies as a function of time. Counters 14, 16 and 18 are in turn clocked to count down at progressively faster rates, driving the parameter displayed on three-digit display 19 downward at progressively faster rates until the DECREASE key is released.
Under some circumstances, it may be advantageous to provide a means for stopping the parameter count-up or count-down operation when the counting capacity of counters 14, 16 and 18 has been exhausted. To this end, an AND gate is inserted in drive line 32 and connected through switch 59 to the CARRY-OUT pin of counter 18. When switch 59 is in the ON position, the shift from high to low value which occurs in the CARRY-OUT signal as the counters reach either a fully loaded or an empty condition, i.e., as the counters reach either a "000" or a "999" reading, acts to disable AND gate 58, preventing any further pulses in the COUNT PULSE train from clocking the counters. A "ceiling" or "floor" is accordingly established for the parameter count, and the direction of the parameter count must be reversed before
the parameter counting operation can continue. On the other hand, moving switch 59 to the OFF position permanently enables AND gate 58, permitting the counters to "roll-over" or recycle upon reaching either a "000" or "999" reading and allowing the counting operation to proceed without a change in counting direction.
The parameter setting method of the present invention may also be implemented in software form. Turning to Figure 2, a simple schematic of the hardware employed in connection with such a software form is illustrated. The. hardware includes an INCREASE key 60 and a DECREASE key 62 respectively connected to a microcomputer 64. Microcomputer 64 drives a display means 66 to provide a digital display of parameter count-up or count-down operations in resonse to the depression of INCREASE key 60 or DECREASE key 62. The microcomputer also outputs a digital signal on lead 67, the digital signal providing a measure of the value of the parameter at any given point in the parameter setting procedure. The program employed by the microcomputer to perform the actual parameter count-up or count-down operation is based on a data register or data bin filling concept, wherein a data bin is repeatedly filled to a predetermined limit during successive bin filling cycles, the bin filling cycles occupying progressively shorter periods of time. At the completion of each bin filling cycle, the value of the parameter is increased or decreased by a fixed amount, thereby furnishing a progressively faster parameter count-up or count-down. In order to fill the data bin to the predetermined bin limit over progressively shorter time periods, it is necessary to accumulate an intermediate count in the data bin, which intermediate count is increased in magnitude following the completion of each bin filling cycle. The increase in the intermediate count between bin filling cycles, of course, reduces the amount of time required to fill the data bin to the
predetermined bin limit during the next bin filling cycle. It can thus be seen that the period between successive completions of the bin filling cycle are shortened as desired, enabling the parameter count-up and count- down operations to be performed at ever-faster rates. Figure 3 illustrates a flow-chart of a program suitable for use in carrying out the parameter setting method of the present invention. As indicated at program block 68, the program is called every T' seconds. In one representative embodiment of the Figure 3 program, T' is equal to 5 milliseconds. At each calling of the program, a determination, indicated at program block 70, is made as to whether the INCREASE key 60 or the DECREASE key 62 (not shown in Figure 3) is depressed. If neither key is depressed, the value BIN of the data bin is set to equal the predetermined limit BIN LIMIT while the value COUNT of the intermediate count is set to equal an initial or starting value COUNT START, as indicated at program block 72. The program then returns to program block 68 and is recalled following an interval defined by T'.
When either the INCREASE or DECREASE key is first depressed, a "YES" determination is made at program block 70 and the value BIN stored or accumulated in the data bin is increased by the value COUNT of the intermediate count, indicated at program block 74. BIN and BIN LIMIT are next compared at program block 76 in order to ascertain whether the value of BIN is equal to or greater than the value of BIN LIMIT. Because BIN has previously been set to equal BIN LIMIT, A "YES" determination is made at program block 76 and the value of BIN is decreased by the value of BIN LIMIT, indicated at program block 78. Thereafter, assuming that the intermediate count has not exceeded a predetermined COUNT LIMIT, a determination which is made at program block 80, the value COUNT of the intermediate count is
increased by one, indicated at program block 82, and the value of the parameter being set is counted up or counted down depending upon whether the INCREASE or DECREASE key has been depressed. The latter program steps are respec- tively indicated at program blocks 84, 86 and 88. The program again returns to program block 68 to await the passage of the T' second interval. At the end of T' seconds, assuming that the INCREASE or DECREASE key remains depressed, the value BIN is again increased by the value COUNT and the comparison between BIN and BIN LIMIT is performed at program block 76. However, due to the previous passage of the program through program block 78, the net value of BIN is now less than the value of BIN LIMIT and a "NO" determination is made at program block 76. The program consequently returns to program block 68, shifting at T' second intervals through the program sub-loop defined by program blocks 68, 70, 74 and 76 until the COUNT accumulation at program block 74 finally drives BIN to a value equal to or greater than the value of BIN LIMIT, whereupon program blocks 78-88 are implemented to count-up or count-down the parameter by the predetermined amount.
The value of BIN will continue to vary every T' seconds for as long as the INCREASE key 60 or DECREASE key 62 is depressed. The bin filling cycle, i.e., the program loop defined by program blocks 68, 70, 74 and 76 wherein the intermediate count is accumulated in the data bin until the data bin limit is reached, is completed in progressively shorter periods because the intermediate count itself is increased in magnitude following the completion of each bin filling cycle. Consequently, the count-up or count-down of the parameter, which also follows the completion of each bin billing cycle, occurs at progressively faster rates or frequencies. Of course, once the predetermined COUNT LIMIT is reached, the operation of program block 80 serves to hold the count-up
or count-down rate at an upper limit established by COUNT LIMIT.
The frequency at which the intermediate count increases, and thus the rate at which the parameter count-up or count-down proceeds, can be ascertained at any point throughout the parameter setting program. From a mathemati cal standpoint,
COUNT FREQUENCY = (2)
where COUNT FREQUENCY represents the frequency at which the intermediate count is increaed, COUNT represents the instantaneous value of the intermediate count, BIN LIMIT represents the predetermined limit to which the data bin is filled, and T' represents the time interval between intermediate count accumulations during each bin filling cycle. The instantaneous value COUNT can in turn be computed by determining the time integral of the intermediate count frequency. That is,
COUNT = COUNT FREQUENCY dt + COUNT START (3)
where COUNT START represents the predetermined value of the intermediate count at the beginning of the parameter setting program. Combining Equations (2) and (3) yields the following:
COUNT FREQUENCY =
Taking derivatives,
d/dt (COUNT FREQUENCY) = (5)
Solving the differential equation involved yields a final form for the intermediate count frequency at any given
time t during the parameter setting program, i.e.:
[t/(BIN LIMIT x T')] COUNT FREQUENCY = * e
(6) It is apparent from Equation (6) that the increase in the intermediate count used to fill the data bin during successive bin filling cycles, and hence the rate at which the parameter count-up or count-down occurs, increases exponentially for as long as the INCREASE or DECREASE key is depressed or until the COUNT LIMIT is reached, whichever occurs first. Comparing Equation (6) with Equation (1), it can also be seen that the rate of parameter count-up or count-down produced by the parameter setting program discussed in connection with Figures 2 and 3 is equivalent to the rate of parameter count-up and count-down produced by the dedicated hardware circuit of Figure 1.
The values of COUNT START and BIN LIMIT, as well as the value of COUNT LIMIT which determines the maximum intermediate count rate, may be approximated by choosing a desirable range for the parameter counting frequency. For example, 3 Hz may be chosen as the initial parameter count-up or count-down rate while 100 Hz may be chosen as the final or maximum parameter count-up or count-down rate, which maximum rate is to be achieved only after the INCREASE key 60 or the DECREASE key 62 has been depressed for ten seconds. Because the rate of parameter count-up or count-down is equivalent to the rate or frequency at which the intermediate count is increased, Equation (6) can easily be solved to obtain a value for BIN LIMIT. First, Equation (2) is rewritten in first and second forms respectively representing the intermediate count frequency at the outset of the parameter count-up or count-down operation, e.g., the STARTING COUNT FREQUENCY, and the maximum frequency achieved by the intermediate count, e.g., the COUNT FREQUENCYmax:
STARTING COUNT FREQUENCY = (7)
COUNT FREQUENCYmax =
(8)
Combining Equation (7) with Equation (6) , and suitably rearranging, yields the equation:
= e [t/ (BIN LIMIT X T')] (9)
The STARTING COUNT FREQUENCY is 3 Hz and the COUNT FREQUENCY at time t = 10 is 100 Hz. Consequently:
100/3 = e [tO/ (BIN LIMIT x T')] (10)
10/(BIN LIMIT x T') = In (100/3) = 3.5 (11)
BIN LIMIT x T' = 2.85 (12)
Using Equation (4) and solving for COUNT LIMIT yields:
COUNT LIMIT = 100 x 2.85 = 285 (13)
Similarly, using Equation (3) and solving for COUNT START yields:
COUNT START = 3 X 2.85 = 8.55 (14)
Where the desired interval for accumulating COUNT in the data BIN is equal to 10 milliseconds, Equation (12) can be solved for BIN LIMIT, yielding:
BIN LIMIT = 2.85/.01 = 285 (15)
If the value for COUNT START, COUNT LIMIT AND BIN LIMIT thus derived are employed in programming the
routine outlined in Figure 3, the parameter displayed in display means 66 of Figure 2 will be counted up or down at a 3 Hz rate immediately following the depression of the INCREASE OR DECREASE key, and the desired 100 Hz count-up or count-down rate will be achieved after the
INCREASE or DECREASE key has been depressed for a period of 10 seconds.
Where desired, the values for COUNT START,
COUNT LIMIT and BIN LIMIT may be slightly modified to assist in binary implementation of the Figure 3 program. Specifically, COUNT START may be set at 8 and BIN LIMIT may be set at 256 while COUNT LIMIT may be set at 255.
Using the aforementioned binary implementation, Equation
(6) now reads:
COUNT FREQUENCY = X e[t/2.56] ^g)
Referring to Equations (7) and (8), the actual values of the initial and maximum intermediate count rates, and hence the initial and maximum parameter count-up or count-down rates, can be recalculated. That is,
STARTING COUNT FREQUENCY = 8/2.56 = 3.13 Hz (17)
COUNT FREQUENCYmax = 255/2.56 = 99.6 Hz (18)
Using the binary implementation scheme outlined above, then, the initial parameter count-up or count-down rate will be 3.13 Hz and the maximum rate of parameter count- up or count-down will be 99.6 Hz. Substituting the maximum rate of 99.6 Hz for the value of COUNT FREQUENCY in Equation (16) yields the time required to achieve the maximum rate:
99.6 = e[t/2.56] (19)
32 = e t/2.56 (20)
Solving for t,
t = 8.86 seconds (21)
An actual software routine for accomplishing the parameter setting procedure discussed in connection with Figures 2 and 3 is reproduced as follows:
A DOSSET ΕQU *
* TEST FOR INC OR DEC KEYS DOWN A LDA KEYBRD A AND #%11000000 CONSIDER INC AND
DEC KEYS ONLY 1D2E BNE CON372 IF NEITHER KEY IS DOWN,
* PRESET COUNT AND BIN
A LDA #8
A STA COUNT PRESET COUNT TO 8
A LDA #1
A STA BIN
A CLR BIN+1 PRESET BIN TO $100 = 256
RTS RETURN
IF EITHER INC OR DEC SWITCH DEPRESSED, THEN
A CON372 LDA BIN+1
A ADD COUNT
A STA BIN+1 ADD COUNT TO LSBYTE OF BIN D38 BCC CON375 IF CARRY IS SET,
A INC BIN ADD 1 TO MSBYTE OF BIN D58 CON375 BRCLR 0,BIN,RTRN22 IF BIT 0 OF BIN IS SET
(BIN> = $FF = 255) A BCLR 0,BIN CLEAR BIT 0 OF BIN (SUBTRACT
$100 = 256)
A INC COUNT INCREMENT COUNT 1D43 BNE CON378 IF ZERO,
A DEC COUNT DECREMENT BACK TO 255
A CON378 JSR CDVERF VERIFY CRITICAL DATA INTEGRITY
A LDA #3
A LDX #PARLIM+2
1D52 BRCLR INC$,KEYBRD,CON384 IF INC KEY DOWN,
A JSR INCBCD INCREMENT PARAMETER
1D55 BRA CON387 OTHERWISE,
A CON384 JSR DECBCD DECREMENT PARAMETER
A CON387 JSR CDNCKS UPDATE CRITICAL DATA CHECKSUM RTRN22 RTS
It is understood that additional modifications to the above-disclosed apparatus and method for setting parameters may be made by those skilled in the art without departing from the spirit and scope of the present invention. All such modifications are considered to be within the purview of the appended claims.