Function generator whose output attains to desired value at designated time
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     This invention relates to a function generator, more particularly to a function generator whose output attains or reaches to a desired value at a designed definite time and in which, the desired value and/or the time can be varied in the course of attainment as desired. 
     2. Description of the Prior Art 
     Function generators which generate outputs of prescribed functions in response to inputs have been well-known. One example is taught by Japanese Patent Publication No. 56(1981)-44451. The function generator taught there includes an integrator and generates an output of a ramp function varying linearly with respect to time. 
     It should be noted, however, that the term &#34;function generator&#34; is used in this specification to not only mean the so-called function generator such as taught by the above reference, but also to include any computing means which generates a value a specific function as desired. In that broader sense, a technique proposed by Japanese Laid-open Patent Publication No. 3(1991)-245201 can further be cited as a prior art. This discloses a control system for a robot or the like involving some limitations .such as a voltage to be supplied to the robot&#39;s motor being restricted to a predetermined value. The system generates a control input which enables an output (controlled variable) to be in coincident with a desired value within a possible shortest time. 
     Aside from the above, when generating a trajectory of a robot such as a trajectory of a free (swing) leg of a legged mobile robot, the trajectory has to be generated taking into account the restriction on the free (swing) leg&#39;s footfall time. Because of this, there is a need for a function generator able to produce an output which varies smoothly from an initial value to a desired value and to complete the transition to the desired value at a designated definite attainment time. This can not be satisfied by the techniques proposed in the aforesaid references. In addition, there is a need for a function generator with this capability which is further capable of changing the desired value or the designated attainment time in the course of the transition. 
     If one attempts to constitute the function generator using a filter, particularly using one of the various types of digital filters that have become available in recent years, one has a choice between the two general categories of digital filters: the FIR or non-recursive digital filter and the IIR or recursive digital filter. Each of these has its drawbacks. Although the FIR digital filter has a finite settling time and can smoothly correct its output when the desired value is changed in the course of attainment, it does not allow the settling time (designated attainment time) to be changed. Moreover, when designed to have a long settling time, the filter involves a high-order linear difference equations with constant difference quotients which greatly increase the amount of computation. Although the IIR digital filter can smoothly correct its output when the desired value is changed in the course of attainment and does not involve a large amount of computation, it does not allow the settling time to be changed and does not have a finite settling time. These same shortcomings are also encountered with the use of analogue filters. While it is conceivable not to use a filter but instead to use a polynomial expression for obtaining the desired output, this also runs into the problem high-volume computation and a very high degree of difficulty in changing the desired value or designated attainment time in the course of attainment. 
     SUMMARY OF THE INVENTION 
     An object of this invention is therefore to overcome the aforesaid disadvantages of the prior art by providing a function generator whose output attains at a designated definite time to a desired value or at least a value approximating the desired value and which enables the desired value and/or the designated attainment time to be changed in the course of attainment. 
     Another object of the invention is to provide a function generator whose output varies smoothly to a desired value or a value approximating the desired value, which is of a simple configuration, and achieves its output with a small amount of computation. 
     For realizing this object, the present invention provides a function generator whose output is a specific function of its input, wherein the improvement comprises, means for varying the characteristics of the function generator according to a remaining time up to a desired time such that reaches the just or around a desired value. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The above and other objects and advantages of the invention will be more apparent from the following description and drawings, in which: 
     FIG. 1 is a block diagram showing a function generator according to a first embodiment of the invention; 
     FIG. 2 is a view of a pole manipulation on a z-plane of a transfer function describing the operation of the function generator of FIG. 1; 
     FIG. 3 is a graph explaining the characteristics of a coefficient used for the pole manipulation of FIG. 2; 
     FIG. 4 is a flow chart explaining the operation of the function generator according to the first embodiment of the invention; 
     FIG. 5 is a waveform chart illustrating an output of the function generator of FIG. 1 in analogue form; 
     FIG. 6 is a block diagram showing a function generator according to a second embodiment of the invention in which the function generator uses a first-order lag filter; 
     FIG. 7 is a circuit diagram showing the first-order lag filter of FIG. 6 constituted by analogue circuitry; 
     FIG. 8 is a flow chart showing the operation of the function generator according to the second embodiment of the invention; 
     FIG. 9 is a block diagram showing a function generator according to a third embodiment of the invention; 
     FIG. 10 is a flow chart showing the operation of the function generator according to the third embodiment of the invention; 
     FIG. 11 is a waveform chart showing an output of the function generator according to the third embodiment of the invention; 
     FIG. 12 is a block diagram showing a function generator according to a fourth embodiment of the invention; 
     FIG. 13 is a circuit diagram showing the function generator of FIG. 12 constituted by analogue circuitry; 
     FIG. 14 is a block diagram showing a function generator according to a fifth embodiment of the invention; 
     FIG. 15 is a block diagram showing a function generator according to a sixth embodiment of the invention; 
     FIG. 16 is a waveform chart showing impulse responses to be used in a function generator according to a seventh embodiment of the invention; 
     FIG. 17 is a block diagram showing a function generator according to an eighth embodiment of the invention; 
     FIG. 18 is a block diagram showing a function generator according to a ninth embodiment of the invention; 
     FIG. 19 is a view showing a tenth embodiment of the invention in which a function generator is used to generate a free leg&#39;s trajectory of a biped mobile robot; and 
     FIG. 20 is a view, similar to FIG. 19, but showing an eleventh embodiment of the invention in which a function generator is also used to generate a free leg&#39;s trajectory of a biped mobile robot. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     FIG. 1 is a schematic view of the function generator enabling attainment (arrival) to a desired value at a designated definite time according to this invention. This figure focuses mainly on the input-output characteristics of the function generator. The function generator comprises a conventional IIR digital filter 10. As shown in FIG. 1, the digital filter 10 is applied with an input that immediately varies to a desired value from an initial time t0. 
     The configuration of FIG. 1 can be expressed as a difference equation as Eq. 1; 
     
         yk=r*yk-1+(1-r )*uk                                        Eq. 1 
    
     When this is z transformed, its transfer function will be expressed as Eq. 2; ##EQU1## Where the pole on the z-plane is designated as r. 
     The pole r has initial value slightly smaller than 1, decreases with increasing proximity to the designated attainment time te as shown in FIG. 2, and disappears at the designated ,attainment time te. There is no particular need for the values of r to decrease monotonously; it can be defined, for example, as shown by Eq. 3. The value of the pole is annihilated to achieve settling at the desired value at the designated attainment time. ##EQU2## 
     The symbol n in Eq. 3 designates the number of steps between the initial time t0 and the designated attainment time te, namely is equal to ((designated attainment time te-initial time t0)/sampling interval). The symbol n&#39; designates a non-negative constant. As shown in FIG. 3, the output waveform can be varied by varying the magnitude of n&#39;. 
     The foregoing will now be explained with reference to the PAD diagram (structural flow chart) of FIG. 4. First, in step S10, yo is set to an appropriate initial value. Control then passes to step S12 in which the value of k in Eq. 3 is raised in increments of one from 1 to n, each time repeating the operations of step S14 to S20. In step S14 control waits for a timer interrupt occurring once every sampling interval mentioned before, and when one occurs, passes to step S16 in which r in Eq. 3 is calculated, step S18 in which uk in Eq. 1 is replaced with the desired value (final attainment value), and to step S20 in which yk is calculated from the equation indicated (i.e. Eq. 1). These processing operations are repeated for each timer interrupt in step S14. 
     Since the value of pole r is varied from around 1 toward 0 so as to gradually decrease the value of 1/(1-r) with increasing proximity to the designated attainment time te (as shown at the bottom of FIG. 1), there is obtained a smooth waveform achieving perfect coincidence with the desired value (final attainment value) at the designated attainment time te (at nth step). An analogue representation of the waveform is shown in FIG. 5. In contrast to an output obtained by the prior art filter, which has difficulty achieving the desired value, the output of the function generator according to this invention achieves precise coincidence with the desired value at the scheduled time. Once coincidence is obtained at the designated attainment time, the output faithfully follows the input. 
     The foregoing can be said to amount to starting with an IIR filter and then switching midway to the characteristics of an FIR filter. As a result, the IIR filter&#39;s drawback of not settling within a finite time period and the FIR filter&#39;s drawback of involving large amounts of computation are eliminated, whereby settling within a finite time period becomes possible and the amount of computation is small even in cases where the number of steps between the initial time and the designated attainment time is large. Therefore, the amount of computation does not become large even if the desired value or the designated attainment time is changed midway. The making of such changes is thus facilitated. It is also a feature of the invented function generator that the output waveform is changed by the pole setting. Generally speaking, therefore, setting the pole small overall results in rapid approach to the vicinity of the desired value, followed by gradual settling to the desired value. On the other hand, setting the pole large overall results in slow approach to the vicinity of the desired value, followed by rapid settling to the desired value at the designated attainment time. 
     While the foregoing description focuses on the pole location, the important thing is that the upper limit frequency of the pass range of a low-pass filter be gradually raised with increasing proximity to the designated attainment time. It is also possible, therefore, to vary the zero point location. In the case of the FIR digital filter discussed later, for example, the pass band can be varied by varying the zero, point location. While the pole location was explained in terms of the z-plane, it can be conducted with respect to a complex number plane if an analogue filter is used. 
     FIG. 6 shows a second embodiment of the invention. This embodiment is similar to the first except that the configuration uses a first-order lag filter 20 whose time constant T (i.e. the value of (-1/pole)) is reduced over the course of time toward the designated attainment time te. FIG. 7 shows an example of the same constituted using analogue circuitry. 
     The operation of the function generator according to the second embodiment will be explained with reference to the PAD diagram of FIG. 8. First, the attainment time te is designated in step S100, whereafter control passes to step S102 in which the filter 20 is input with a step input which immediately changes to the desired value at the initial step t0. Control then passes to, via step S104, to S106 in which the time constant T (or the value of resistance R in FIG. 7) of the filter 20 is gradually decreased with the passage of time from its initial value T0 (R0) at the initial time t0 to approximately 0 at the designated attainment time te (i.e. the absolute value of the pole is changed to very large negative values or -∞.), and to step S108 in which the output of the final stage integrator is determined to be the output of the function generator. 
     Specifically, it suffices to predefine the relationship between time constant T of the filter and the remaining time trest up to the designated attainment time te. In other words, it suffices to define the time constant T of the filter as a function of the remaining time trest up to the designated attainment time, as shown by Eq. 4. 
     
         T=f (trest)                                                Eq. 4 
    
     Provided, however, that f(trest) is the increase function of the remaining time trest in the vicinity of trest=0 and that, as shown by Eq. 5, for example, f(trest) is set to be greater than zero. 
     
         f (trest)=T0*trest/(te-t0)                                 Eq. 5 
    
     In this embodiment, since the pole is manipulated to have negative real value in the complex number plane if discussing this in the analogue circuitry of FIG. 7, when a step input is applied as in the case of the first embodiment, no overshooting occurs and there is obtained an output waveform which coincides with the desired value at the designated attainment time. Moreover, since as shown in the drawings the configuration is simple, the designated attainment time and desired value can be easily changed. 
     FIG. 9 is an explanatory view, similar to FIG. 1, but showing a third embodiment of the invention. The function generator 100 of this embodiment is constituted of three function generators of the first embodiment connected in tandem. The poles r of the three IIR filters are manipulated similarly to in the first embodiment. The operation of the function generator according to the third embodiment is shown in a PAD diagram of FIG. 10. Aside from the fact that the coefficients are increased in steps S200 and S210, the flow chart of FIG. 10 is the same as the flow chart of FIG. 4 relating to the first embodiment. Since this third embodiment comprises three filters in tandem, even up to the second-order differential, it achieves smooth continuity and perfect coincidence with the desired value (zero in the case of the differential values) at the designated attainment time as seen from the analogue waveform representations shown in FIG. 11. 
     FIGS. 12 and 13 show a fourth embodiment of the invention. This embodiment is related to the second embodiment as the third embodiment is to the first, namely it is constituted by connecting three of the first-order lag filters of the second embodiment in tandem. In this embodiment, by setting the initial value T0 of the time constant of Eq. 5 to an appropriate value, it is possible to obtain waveforms whose increase/decrease velocities are symmetrical in the manner of FIG. 11. The values of the three variable resistors are reduced at the same rate, for example, in accordance with the characteristics shown in FIG. 13. The effect is the same, as that of the third embodiment. As in the second embodiment, the output of the final stage integrator can be defined to be the output of the function generator. However, it is also possible to define the output in terms of the input and the outputs of the respective stages, by linearly combining the same, for example. 
     FIG. 14 schematically illustrates a fifth embodiment of the invention, which is an improvement of the third embodiment. In this embodiment, the values of the poles r themselves are determined by the function generator according to the invention. More specifically, a second function generator 200 constituted as an IIR filter is similarly provided and the pole h of the second function generator 200 is varied to satisfy the characteristics shown at the bottom of FIG. 14, thereby determining the poles r of the first function generator 100. 
     This embodiment enables easier change of the designated attainment time than do the first embodiment. In the first embodiment, changing the designated attainment time requires modification of the r determining function shown at the bottom of FIG. 1 (9), ie. requires Eq. 3 to be rewritten. Otherwise the output waveform, particularly the second differential output waveform, does not change smoothly. In the present embodiment, on the other hand, the second function generator 200 whose pole h is given by Eq. 6 is input with a step input vk which has an initial value of n&#39; and becomes zero from the first step, and poles r are determined from the resulting filter output pk as expressed as Eq. 7. When the designated attainment time is changed, therefore, the poles r change gradually notwithstanding that the pole h changes rapidly and discontinuously. Thus, the smoothness of the output waveform can be maintained and the designated attainment time can be simply and arbitrarily changed, without need to rewrite Eq. 3 or conduct other troublesome procedures. ##EQU3## 
     FIG. 15 schematically illustrates a sixth embodiment of the invention, which is an improvement of the fifth embodiment realized by the addition of a third function generator 300. The third function generator 300 is input with a waveform wk (initial value n&#34;) and the three function generators are recursively coupled such that the pole of second function generator 200 is determined from the output qk of the third function generator 300. This embodiment enables the designated attainment time to be changed easily and arbitrarily while further enhancing the smoothness of the output waveform. From the explanation up to now, it will be understood that four or any other desired number of function generators can be coupled and that the larger is the number of coupled function generators, the smoother is the output waveform following time changes. 
     FIG. 16 schematically illustrates a seventh embodiment of the invention using an FIR digital filter. An FIR digital filter is generally expressed as a difference equation like Eq. 8; ##EQU4## 
     In this embodiment, the upper limit frequency of the pass range of the filter is gradually raised by appropriately varying the coefficient am, thereby producing a waveform which smoothly attains at the desired value at the designated attainment time. Once the filter frequency characteristics are fixed, the filter coefficient am satisfying the frequency characteristics can be obtained by well established digital filter design techniques (as described, for example, in &#34;Digital Filter Design&#34;, by Masaaki Mitsuya, published by Shokodo, Tokyo, Japan.). This embodiment employs these techniques. 
     The coefficient am is the time series filter impulse response. Once the desired impulse response has been set, therefore, a coefficient which satisfies it can be designed with utmost ease. In the illustrated example, the filter characteristics are varied so as to gradually vary the impulse response waveform pattern. More specifically, a group of model impulse response waveforms differing stepwise are established. For example, a group of model impulse responses varied progressively such as somewhat dull impulse response waveform, a somewhat sharp impulse waveform, a sharp response impulse waveform etc. are established in advance as illustrated in FIG. 16. Each time the model impulse response waveform is changed, the coefficient am is redesigned to satisfy the new impulse response waveform. More specifically, starting at the initial time t0, the model impulse response waveform is progressively changed in the direction of increasing sharpness. The FIR digital filter is input with a ramp-shaped waveform that begins to change from the initial time T0 and attains the final desired value M steps before the designated attainment time. Here, M is the order of the FIR digital filter immediately before the designated attainment time. As a result, the output of the FIR digital filter is smooth and the final desired value is attained at the designated attainment time. 
     Alternatively, it is possible to establish a model low-pass filter and redesign the coefficient of the FIR filter to satisfy frequency characteristics of the low-pass filter each time the model low-pass filter is changed. In this case, the cut-off frequency of the model low-pass filter is gradually raised from the initial time t0, and the FIR digital filter is input with a ramp-shaped waveform that begins to change from the initial time T0 and attains the final desired value M steps before the designated attainment time. Here, M is the order of the FIR filter immediately before the designated attainment time as mentioned earlier. As a result, the output of the FIR digital filter is smooth and the final desired value is attained at the designated attainment time. 
     In the seventh embodiment, when the number of steps between the initial time and the designated time ((designated attainment time-initial time)/sampling interval)) is small, the order of the difference equation can be made small, so that the amount of computation is reduced. When the number of steps is large, however, the order of the difference equation has to be set high, with the result that the amount of computation becomes larger than in the first embodiment, for example. At the same time, however, there are fewer constraints on the waveform than in the other embodiments, so that it becomes possible to generate waveforms with a high degree of freedom. In addition, the amount of overshoot is small when the target value is changed before attainment. Specifically, since the computation is fundamentally a weighted averaging of past inputs, no output exceeding the input range is produced insofar as the weighting, i.e. all coefficients am, are non-negative. 
     FIG. 17 shows an eighth embodiment of the invention. This embodiment is similar to the fourth embodiment but additionally includes limiters for suppressing sudden changes in the output waveform. In this embodiment, unless the pole is set smaller overall than in the arrangement without limiters, the output is liable to settle abruptly to the desired value just before the designated attainment time. Limiters can also be added to the configuration according to the second embodiment. 
     FIG. 18 shows a ninth embodiment of the invention. In this embodiment, when the difference e of the output between yk and yk-1 exceeds a prescribed range (-L, L), h (the pole of the filter which generates poles r in accordance with the amount of the excess (the second function generator 200)), is modified so as to weaken the reduction rate of poles r and thus prevent abrupt changes in the difference value. In other words, the gradient of the value pk, in the second function generator 200 which determines r, is prevented from becoming too large, which is desirable because when this gradient becomes excessively large so does the variation in the first and second order differentials. This feature ensures that when the embodiment is applied to, for example, a joint control in a biped mobile robot as discussed next, the rotational velocity of the joint drive motors will not be exceeded. Since priority is given to the designated attainment time, however, cases may arise in which it is impossible to avoid an abrupt change in the differential values immediately before the designated attainment time. This is an example in which the difference value is fed back to the waveform generation system even though it is nonlinear. 
     FIG. 19 shows a tenth embodiment of the present invention applied for a free leg&#39;s trajectory generation in a biped mobile robot. As shown in this figure, it is the general practice in biped mobile robot control first to determine the displacement pattern of the leg&#39;s extremities (foot) and then to compute the joint angles by inverse kinematic calculation. In this case, even if the acceleration/deceleration of the foot&#39;s displacement pattern itself has a gentle waveform, there is a tendency for inordinately large angular velocities and angular accelerations to be produced in the joints when the attitude of the robot is such that the joints are extended nearly to the limit. This embodiment eliminates this problem. 
     FIG. 20 shows an eleventh embodiment of the invention which is also applied for a free leg&#39;s trajectory generation in a biped mobile robot. This embodiment prevents inordinate joint angular velocities by feeding back the absolute value of the knee joint angular velocity in the third embodiment. Although it is similar to the ninth and tenth embodiments, it must be noted that even though the function generator according to this invention produces a smooth output, in the case where it is applied to a legged mobile robot, the desired smoothness of, for example, the displacement acceleration may not be obtained owing to the fact that a legged mobile robot is structurally nonlinear. In this embodiment, therefore, the concept of the tenth embodiment is further developed by feeding back the absolute value of the joint angular velocity. Specifically, as shown in FIG. 20, the value obtained by multiplying the absolute value of the joint angular velocity imparted with dead band characteristics by a gain K and poles r is added to the state variable of the function generator 100. Since priority is given to the designated attainment time, the feedback control input falls to near zero in the vicinity of this time. Thus, as in the tenth embodiment, cases may arise in which the change in the angular velocity remains large. 
     As is clear from the foregoing, each of the embodiments can have various types of inputs, including an input which immediately changes from the initial time to the final desired value, an input which changes in a ramp-like pattern from an initial value to the final desired value, an input which changes stepwise from an initial value to an intermediate desired value and, after a prescribed time period, changes stepwise to the final desired value, an input which changes so as to once exceed the final desired value, a broken line input, an impulse wave input, etc. 
     The fifth and sixth embodiments are obtained by adding second and third function generators. Similarly, it is also possible to add second and third function generators to the second and fourth embodiments, thus enabling the time constant T itself to be decided. In other words, a waveform whose initial value is T0 and whose final desired value is about 0 can be input to the second and third function generators and the output be used as the time constant T. 
     In addition, the application of the invention to the generation of the free leg trajectory of a biped mobile robot is only one example and the invention can also be applied to the generation of the trajectories of other mobile units such as automatic vehicles or to the generation of the trajectories of the manipulators of stationary industrial robots. 
     Moreover, the present invention has thus been shown and described with reference to the specific embodiments. However, it should be noted that the invention is in no way limited to the details of the described arrangements, changes and modifications may be made without departing from the scope of the appended claims.