Abstract:
A weigh feeding system using a stochastic controller wherein the weight of material and the position of a material discharge actuator are sensed, and an estimate of the mass flow state of the material being discharged is created by use of a Kalman filter process. Plant noise processes and measurement noise processes, which affect the measured weight and actuator position signal, are modeled as stochastic processes and are used, in combination with the sensed weight and actuator position signals, to calculate the estimated mass flow state. The noise models are modified to account for disturbances. The estimated mass flow state signal is used to calculate a motor feedback signal which, in turn, is used to control the speed of the discharge apparatus. In this manner, the mass flow of the material actually being discharged is driven to a desired mass flow with minimum error variance in the presence of unavoidable plant and measurement noise. Self-tuning of the stochastic controller is employed to accurately determine parameters of the plant noise and measurement noise processes, and to compensate the controller for control dynamics. Feedback control tuning is also employed to monitor the set-point error in order to achieve quick response while maintaining smooth steady-state set point control.

Description:
A portion Of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever. 
     This invention pertains to weigh feeding systems. 
     The present invention uses a Kalman filtering process to develop filtered estimates of the actual weight state and the mass flow state. These filtered estimates are used, in combination with modeling and classification of the plant and measurement noise processes which affect weight measurements and discharge actuator measurements, to control the actual mass flow state. The class of noise is determined, and a stochastic model for each class is created. The estimated mass flow signal is produced based on the measured weight and measured actuator position or velocity, and based on the stochastic models of the individual noise processes affecting the system. The noise process models are modified according to the magnitude of their effects and probability of occurrence. 
     The estimated mass flow state signal is then compared with a desired mass flow set-point, and the resultant error signal is used to control the discharge actuator to produce the desired mass flow. 
     The present invention also employs self-tuning of parameters associated with the noise processes which affect the weight measurements and discharge actuator measurements and self-tuning of control parameters in order to compensate the Kalman filter states due to the effects of control dynamics. This noise model tuning and control model tuning allow the Kalman filter to operate optimally. In addition, feedback control tuning is employed to monitor the set point error and to generate adaptive dynamics to achieve a quick response while maintaining a smooth steady-state set point control. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a loss-in-weight feeding system embodying the present invention. 
     FIG. 2 is a flow chart of the overall flow of control of the present invention. 
     FIG. 3A-3F are a flow chart of the computational steps performed by the weight signal processor and motor signal processor of the present invention. 
     FIG. 4 is a flow chart of the computational steps performed by the motor controller of the present invention. 
     FIG. 5 is a flow chart of the computational steps performed by the present invention to calibrate control parameters. 
     FIG. 6 is a flow chart of the computational steps performed by the present invention to calibrate noise parameters with data editing. 
     FIG. 7 is a flow chart of the computational steps performed by the present invention to determine the correlation coefficient. 
     FIG. 8 is a flow chart showing a second method according to the invention of integrating the sensed motor position into the estimation process. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     In the present weigh feeding system, solid or liquid material stored in a hopper or other container is discharged by a conventional discharge actuator such as a screw feeder, conveyor, pump, valve or the like as appropriate. The discharge actuator is typically driven by an electric motor. The system also includes a weight sensing device, such as a scale, for sensing the weight of the material in the hopper or the material being discharged, and for producing a signal indicative of the sensed weight state, and a discharge actuator position sensor, such as a motor shaft position encoder, for sensing the position state of the discharge actuator. The signals produced by the weight sensing device and the discharge actuator position sensor are applied to respective signal processors which, in turn, produce signals which are combined to provide an estimate of the weight rate state or mass flow state of material being discharged. The estimate of mass flow state is then used in a feedback loop to control the motor to drive the estimated mass flow state to a desired set-point mass flow. 
     Other weigh feeding systems using stochastic control with weight sensing only include U.S. Pat. No. 4,775,949 (Ser. No. 879,430, filed June 27, 1986), and Ser. No. 344,458, filed Apr. 28, 1989, continuation of Ser No. 174,976, filed Mar. 29, 1988, the disclosures of each of which are expressly incorporated herein by reference. Each of these prior applications was invented by the present inventor, and each is assigned to the same assignee as the present application. 
     Throughout the present specification, different symbols are used to represent various physical and calculated quantities. Table I lists these symbols in the left-hand column, their meaning in the middle column, and the corresponding variable name used in the source code program listed at the end of the specification in the right-hand column. The notation &#34;nip&#34; or &#34;not in the program&#34; means that the symbol is used in the text of this application but not in the program listing. 
     
                       TABLE I______________________________________                       ProgramSymbol Meaning              Variable______________________________________I(k)   motor signal         Iu(k),V.sub.c  control input to system                       VCTEMPx(k)   position state       nipv(k)   velocity state       nipz(k)   measurement          nipw(k)   plant noise          nipw.sub.1 (k)  position state noise nipw.sub.2 (k)  velocity state noise nipn(k)   measurement noise    nipb.sub.1,w  position compensation factor                       SSWCOMPF  of weightb.sub.1,m  position compensation factor                       MPSSWCOMPF  of motorb.sub.2,w  small signal velocity gain of weight                       SSVCGAINb.sub.2,m  small signal velocity gain of motor                       MPSSVCGAINr.sub.w  variance of weight measurement                       NS1G2  noiser.sub.m  variance of motor measurement                       MPNS1G2  noiseQ      covariance of w(k)   nipq.sub.1,w  variance of w.sub.1 (k) of weight                       Q11q.sub.1,m  variance of w.sub.1 (k) of motor                       MPQ11q.sub.2,w  variance of w.sub.2 (k) of weight                       VSIG2q.sub.2,m  variance of w.sub.2 (k) of motor                       MPVSIG2A.sub.c  correlation factor   ACORRn.sub.c (k)  correlation noise    nipσ.sub.nc.sup.2  variance of n.sub.c (k)                       SIGNC2C      combining coefficient                       ATX.sub.w  position estimate of weight                       XHATX.sub.m  position estimate of motor                       MPHATT      time between measurements                       TDV.sub.w  velocity estimate of weight                       VHATV.sub.m  estimate of motor rate                       VMPHATV(k)   velocity estimate error                       nipσ.sub.v,w.sup.2  variance of velocity error V.sub.w (k)                       P22  of weightσ.sub.v,m.sup.2  variance of velocity error V.sub.m                       MPP22  of motorV.sub.T  combined weight rate estimate                       VHATTOTALV.sub.d  desired set point    VDESIREV.sub.d  set point error      VCERRORσ.sub.v/m.sup.2  variance of v.sub.w/m                       nipG.sub.c  control gain         CGAIN______________________________________ 
    
     Referring to FIG. 1, a weigh feeding system according to the present invention is shown. Material stored in hopper 10 is discharged by feed screw 11 driven by feed screw motor 12. Scale 13 measures the combined weight of hopper (with material) 10, feed screw 11, and motor 12 to produce a measured weight signal Z w . It will be understood that in a conveyer weigh feeder, scale 13 would sense the weight of material being discharged upon at least a portion of the length of the conveyer. Signal Z w  is applied to weight signal processor 14 in computer 15 which produces an estimate, V w , of the mass flow state of material based upon the measured weight Z w . Also, motor position sensor 16 measures the shaft position of the motor which is coupled to the feed screw 11 to produce a measured motor signal Z m . In the preferred embodiment, sensor 16 includes a pick-up coil which senses the passing of teeth of a gear that rotates with the motor shaft driving the feed screw 11 to produce a stream of pulses of variable frequency which can be counted and processed to determine rotational speed of feed screw 11. It will be understood that sensor 16 can be of any type and may be coupled directly or indirectly with the motor as long as it produces a signal which is correlated with actual mass flow. For example, sensor 16 can be an optical or Hall sensor in the case of a rotating prime mover, or can be a proximity sensor in the case of a vibrating prime mover. In addition, instead of sensing the position of the discharge actuator, sensor 16 could be a tachometer, or the like, which measures the velocity of the actuator. Signal Z m  is applied to motor signal processor 17 in computer 15 which produces an estimate, V m , of the actuator rate based on measured motor signal Z m . 
     Mass flow estimates V w  and V m  are combined by using correlating factor A c , combining coefficient C, and summing junction 18 to produce combined mass flow estimate, V T . An operator enters a desired mass flow set-point V d  through control panel 19. The estimated mass flow state V T  is compared with the desired mass flow V d  by summing junction 20 to produce an error signal state V d . The error signal state is used by motor controller 21 to calculate a motor control signal I M  which is applied to motor drive 22. The estimated mass flow state V T , and the actual mass flow, are thus driven to the desired set-point V d . 
     Weight sensor 13 and motor sensor 16 are subject to random and systematic instrument and phenomenon errors. The sensors produce erroneous results not only because of internal electronic noise, but also because of the physical inertia of the sensors and the effects of external electronic noise. 
     In addition, the physical plant including the material hopper, feed screw and motor are also susceptible of disturbance. These plant disturbance processes include: vibrational noise due to the mechanical movement of the feeding screw or material mixer contained within the hopper; varying or non-uniform output feed due to lumpy material, material bridges or non-uniform screw discharge; refilling of the hopper with material at times and at refill rates that are uncertain; unintentional aperiodic superimposed hopper disturbances such as bumping the feeder, or dropping or lifting extraneous weights such as tools; and periodic and aperiodic disturbances of the hopper due to environmental effects such as wind, neighboring machines or passing vehicles. 
     In general then, a weight measurement yields only crude information about a loss-in-weight feeding system&#39;s behavior and, by itself, may be unsatisfactory for assessing the system&#39;s states and ultimately controlling the mass flow, particularly during an operational set point change. Thus, additional information about the mass flow rate is obtained from a second sensor mounted to the motor/actuator which measures the rotational position of the actuator. Processing the sensed motor position signal, using a process similar to that used for the sensed weight signal, produces a motor rate estimate which is correlated to the weight rate, and which is independent of the estimate of weight rate derived from the sensed weight signal. Combining the two weight rate estimates, according to the present invention, yields an improved estimate of actual weight rate. 
     In order to facilitate the calculation of the various operational parameters used by weight processor 14 and motor processor 17, self-tuning is used to control the feeding process to generate data from which these various operational parameters can be calculated. In the general self-tuning process of the present invention, when a weigh feeding machine is first started, or when a dramatic change in operating conditions is presented (for example, changing the type of material being fed), the feeding machine is set to a calibration or tune mode shown schematically by switch 23. In the calibration mode, system calibration processor and control generator 24 causes a series of control signals u(k) to be applied to the weigh feeder, and the weigh feeder reacts to the control sequence u(k). Weight sensor 13 generates a corresponding motor measurement sequence Z w  (k) and motor sensor 16 generates a corresponding weight measurement sequence Z m  (k). The input/output signals u(k)/Z w  (k) and u(k)/Z m  (k) are then used by the system calibration processor and control generator 24 to estimate the noise and control parameters, for example. Then, the estimated parameters are sent to the signal processors 14 and 17, the calibration mode is exited (shown schematically by moving switch 23 from tune to run) and closed-loop control begins. 
     Referring to FIG. 2, the process steps executed by signal processors 14 and 17 (FIG. 1) are shown. The specific process steps are shown in more detail in the flow charts of FIGS. 3A-3F and FIGS. 4-7. 
     After the process is started, nominal parameter values and nominal variable values are initialized in block 26 by, for example, operator entry or retreival from memory. Control then passes to decision block 27 where it is determined whether or not the weigh feeder should be calibrated. If calibration is not necessary, for example, if the parameters entered or retrieved from memory in block 26 are known to be accurate, control passes from block 27 to block 28. If, however, calibration is necessary, control passes to block 29 where calibration of parameters is performed. In block 28, the Kalman filters (signal processors 14 and 17, FIG. 1), are initialized and control then passes to block 30 where measurements Z w  (k) and Z m  (k) are retrieved from sensors 13 and 16. Control then passes sequentially through blocks 31 and 32 where noise covariance matrices Q m  and Q w  are calculated. Then, in block 33, rate estimates V m  and V w  are obtained. Control then passes to block 34 where combining coefficient C is recalculated, and a total weight rate estimate, V T , is also calculated. Control then passes to block 35 where correlation factor, A c , is updated. Then in block 36, it is determined whether or not a bridge in the material being fed has formed. Finally, in block 37, motor control signal, I(k), is calculated and is output to control the speed of the motor/actuator. Control is then returned back to block 30 for new measurements, and control continues cyclically thereafter. 
     Turning now to the detailed flow charts of FIGS. 3A-3F, after the process is started, the following parameters are initialized in step 38. 
     V d  --the desired mass flow set point; 
     T--the sensor sampling period for Z 2 ,Z m  ; 
     G c  --the gain constant of the motor controller; 
     r m  --the initial value for the motor measurement noise variance; 
     r w  --the initial value for the weight measurement noise variance; 
     q 2 ,m --the initial value for the motor plant noise variance; 
     q 2 ,w --the initial value for the weight plant noise variance; 
     FF--the feed factor of the screw motor. 
     Although not shown, also within block 38 various flags and counters are set to appropriate initial values. 
     Then, control passes to block 27 where it is determined whether or not the parameters entered in block 38 should be calibrated. If so, control passes to blocks 39, 40 and 41 where the calibration procedures shown in detail in FIGS. 5, 6 and 7 are respectively performed. After calibration is complete, or if calibration is not required, control passes to block 42 where the following system variables are initialized: 
     u 1 ,m, u 2 ,m --motor controls effecting weight and mass flow, respectively, calculated from motor sensor; 
     u 1 ,w, u 2 ,w --motor controls effecting weight and mass flow, respectively, calculated from weight sensor. 
     Also in step 42, feed screw motor signal, I M , is initialized at a desired level so that the motor is initially moving at a desired speed. In the alternative, signal I M  may be initialized to 0 so that the motor is initially stationary. 
     In step 43, counter k is set to 0, and control is transferred to step 44 where the first samples Z m  (1) and Z w  (1) are taken. Control is then transferred to decision block 45 where, if k+1 is greater than 2, indicating that the filters have already been initialized, control is transferred to the process steps of FIG. 3B. Otherwise, control is transferred to decision block 46 where, if k+1 is not equal to 2, control is transferred to block 47 and counter k is incremented. Additional samples are then taken in block 44. If decision block 46 decides that k+1 is equal to 2, control is transferred to block 48 where initialization of the filters is begun. 
     In block 48, the initial weight state estimate based on weight measurements is set to the measured weight at time k=2, Z w  (2). Similarly, the initial motor state estimate based on motor measurements is set to the measured motor position at time k=2, Z m  (2). In addition, the initial motor rate state estimate based on weight measurements, V w , is set to the difference between the first two weight measurements divided by the sampling period T, and the initial mass flow estimate based on motor measurements, V m , is set to the difference between the first two motor measurements divided by the sampling period T. 
     Thus, the initial estimates for weight and mass flow states and for motor position and motor rate, based on measured weight and based on measured motor position, are found using the last weight and motor signals and their simple time derivatives. Also in block 48, the predicted estimate of weight state at time k=3 is set to the estimated weight state at time k=2 plus T multiplied by the estimated mass flow state at time k=2. Similarly, the predicted estimate of motor position at time k=3 is set equal to the estimated motor position at time k=2, plus T multiplied by the estimated motor rate at time k=2. Also, the predicted estimate of mass flow state and predicted estimate of motor rate, based respectively on weight and motor measurements at time k=3, are set to the respective estimated mass flow and motor rate at time k=2. 
     After the estimates and predictions of states are initialized in block 48, control is transferred to block 49 where the entries of the error covariance matrices P m  and P w  are initialized. 
     The error covariance matrices Pm and Pw take the forms: ##EQU1## where: σx,w 2  is the variance of the weight error based on weight measurement; 
     σv,w 2  is the variance of the weight rate error based on weight measurements; 
     σx,w,v,w 2  is the covariance of the weight and mass flow errors; 
     σx,m 2  is the variance of the motor position error based on motor position measurements; 
     σv,m 2  is the variance of the motor rate error based on motor position measurements; and 
     σx,m,v,m 2  is the covariance of the motor position and motor rate errors. 
     After error covariance matrices P w  and P m  are initialized in block 49, control is transferred to block 47 where counter k is incremented and the next samples are taken in block 44. Once the filters are initialized, k+1 will be greater than 2 and decision block 45 will transfer control to block 51 of FIG. 3B. 
     In block 51, motor plant noise covariance matrix Q m  (k) is set equal to Q 0 ,m where: ##EQU2## Control is then transferred to block 52, where a motor measurement residual, Z m , is calculated in using the equation: 
     
         Z.sub.m (k+1/k)=Z.sub.m (k+1)-X.sub.m (k+1/k) 
    
     where: 
     Z m  (k+1/k) is the motor measurement residual at time k+1 given motor measurements up to and including time k; 
     Z m  (k+1) is the motor position measurement at time k+1; and 
     X m  (k+1/k) is the estimated motor position at time k+1 given measurements up to and including time k. 
     Control then transfers to block 53 where motor error covariance matrix P m  is updated using the matrix equation: 
     
         P.sub.m (k+1/k)=F P.sub.m (k/k)F&#39;+Q.sub.m (k) 
    
     where: ##EQU3## F&#39; is the transpose of F; and Q m  (k) is the motor plant noise covariance matrix at time k. 
     Control is then transferred to block 54 where the motor measurement residual variance is calculated using the matrix equation: 
     
         σz,m.sup.2 =H P.sub.m H&#39;+r.sub.m 
    
     where: 
     H=[1 0]; 
     H&#39; is the transpose of H; 
     P m  is calculated in block 53; and 
     r m  is the motor measurement noise variance. 
     Control then passes to decision block 56 where the square of the motor measurement residual, calculated in block 52, is compared with nine times the motor measurement residual variance calculated in block 54. If the square of motor measurement residual is greater than nine times the motor measurement residual variance, control passes to block 57 where q 1 ,m is set equal to four times the square of the measurement residual variance calculated in block 52 divided by 12. It is to be noted that q 1 ,m is the 11 entry of the Q m  matrix, i.e.: ##EQU4## 
     From block 56 control passes back to block 53 where the motor error covariance matrix P m  is recalculated using the new value for Q m . Also on the second back pass through block 54, the motor measurement residual variance is recalculated. On the second pass through decision block 56, the measurement residual variance should be large enough so that control passes from block 56 to block 58 in FIG. 3C. 
     Thus, the magnitude of the motor measurement residual is compared against a quantity calculated from the variance of the motor measurement residual, and if the motor measurement residual is large enough, the motor plant noise covariance matrix Q m  is changed to reflect the larger motor measurement residual. This adjustment aids in the accommodation of large perturbations which affect the motor measurements. 
     Turning now to FIG. 3C, a similar process is executed with respect to weight plant noise covariance matrix, Q w , and weight error covariance matrix P w . Specifically, in block 58, motor plant noise covariance matrix Q w  (k) is set equal to Q 0 ,w where: ##EQU5## 
     Then, in block 59, the weight measurement residual, Z w , is calculated using the equation: 
     
         Z.sub.w (k+1/k)=Z.sub.w (k+1)-X.sub.w (k+1/k) 
    
     where: 
     Z w  (k+1/k) is the weight measurement residual at time k+1 given measurements up to and including time k; 
     Z w  (k+1) is the weight measurement at time k+1; and 
     X w  (k+1/k) is the estimated weight at time k+1 given measurements up to and including time k. 
     Control then passes to block 61 where the weight error covariance P w  is updated using the equation shown, which is similar to the equation described above with respect to block 53. Control then passes to block 62 where the weight measurement residual variance is calculated using the equation shown i.e., σzw 2  =H P w  H&#39;+r w , which is similar to the equation described above with reference to block 54. 
     Control then passes to decision block 63 where the square of the weight measurement residual calculated in block 59 is compared with nine times the weight measurement residual variance calculated in block 62. If the square of the measurement residual is greater than nine times the measurement residual variance, control passes to block 64 where flags Zthf %, perf % and Zperf % are all set equal to one. Control then passes to decision block 66. If the comparison in decision block 63 is not satisfied, control is passed directly to decision block 66. 
     In decision block 66, the condition of flags Zthf %, perf % and Zperf % are checked. If all flags agree with indicated conditions as shown in block 66, control passes to decision block 67 where the condition of flag Zthf % is checked against 0, and if true, control passes to block 68 where flag Zperf % is reset to 0, and control is transferred to block 76 of FIG. 3D, entry point &#34;D&#34;. 
     If flag Zthf % is determined by decision block 67 not to be set to 0, control passes to block 69 where the q 1 ,w entry of the Q w  matrix as set equal to four times the square of the weight measurement residual calculated in block 59 divided by 12, i.e.: ##EQU6## Control then passes to block 70 where flag Zthf % is reset. Also in block 70 counter Calpert is incremented and quantities Z A ,w and Z B ,w are set equal to 0. Counter Calpert and quantities Z A ,w and Z B ,w are used during the tuning of the noise parameters of the system, which is described in more detail below with reference to FIG. 6. 
     From block 70, control returns to block 61 where weight error covariance matrix P w  is again calculated using the adjusted value of Q w . The weight measurement residual variance is then recalculated in block 62, which should cause decision block 63 to transfer control around block 64 directly to block 66 on this pass. In block 66, since flag Zperf % was set during the previous pass through block 64, control passes to block 67. Since flag Zthf % was reset in block 70, block 67 will transfer control to block 68 which will reset flag Zperf %, and transfer control to block 76 of FIG. 3D, entry point &#34;D&#34;. 
     On the next pass through the portion of the program shown in FIG. 3C, if decision block 63 determines that the square of the weight measurement residual is less than nine times the motor measurement residual variance, decision block 66 (due to perf % =1) will transfer control to block 71, where flag Zperf % is set. Control then passes to block 72 and 73 where counter Calpert is incremented and variables Z A ,w and Z B ,w are set to 0. Then, in block 74, ql,w of the present time cycle, k, is set equal to q 1 ,w calculated during the previous time cycle, k-1 (in block 69). In addition, flag perf % is reset to 0 in block 74. 
     Control then passes through block 61, 62, 63, 66, 67, 68 and eventually to block 76 of FIG. 3D. 
     Thus, the program shown in FIG. 3C, in addition to recalculating weight plant noise covariance matrix Q w  based upon the magnitude of the weight measurement residual, also forces a second artificial perturbation following every real perturbation. The forced second perturbation is represented by the loop comprising block 71-74. Forcing this second perturbation is necessary in order to allow the weigh feeding system to have an improved response to step weight measurement perturbations, like those due to refill, and the like. 
     Referring now to FIG. 3D, in block 76, motor Kalman gains K m  and weight Kalman gains K w  are calculated using the equations. ##EQU7## K 1 ,m (k+1) is the motor position Kalman gain at time k+1; K 2 ,m (k+1) is the motor rate Kalman gain at time k+1; 
     K 1 ,w (k+1) is the weight Kalman gain at time k+1; 
     K 2 ,w (k+1) is the weight rate Kalman gain at time k+1; and 
     all other variables have been previously defined or calculated. 
     The estimated motor position and motor rate and weight and weight rate are then updated using the previously calculated values for these variables, and using the Kalman gains calculated in block 76 and motor and weight measurement residuals calculated in blocks 52 and 59, respectively, using the equations shown. Control then passes to block 78 where the error covariance matrices P m  and P w  are updated using the equations shown, wherein I is equal to the identity matrix, and wherein all other variables have been previously defined or calculated. Control then passes to block 79 where new predictions for motor position X m , motor rate V m , weight X w , and weight rate V w , are calculated using the equations: 
     
         X.sub.m (k+2/k+1)=X.sub.m (k+1/k+1)+T V.sub.m (k+1/k+1)+u.sub.1,m (k+1) 
    
     
         V.sub.m (k+2/k+1)=V.sub.m (k+1/k+1)+u.sub.2,m (k+1) 
    
     
         X.sub.w (k+2/k+1)=X.sub.w (k+1/k+1) T V.sub.w (k+1/k+1)+u.sub.1,w (k+1) 
    
     
         V.sub.w (k+2/k+1)=1/k+1)+u.sub.2,w (k+1) 
    
     where: 
     u 1 ,m (k+1) is the value of motor control applied at time k+1 which is predicted to affect the motor position at time k+2; 
     u 2 ,m (k+1) is the value of motor control applied at time k+1 which is predicted to affect the motor rate at time k+2; 
     u 1 ,w (k+1) is the value of motor control applied at time k+1 which is predicted to affect the weight at time k+2; 
     u 2 ,w (k+1) is the value of motor control applied at time k+1 which is predicted to affect the weight rate at time k+2; and 
     where all other variables have been previously defined or calculated. 
     Control is then transferred to block 81 where the combining coefficient, C, is calculated using the equation: 
     
         C=(A.sub.c.sup.2 σ.sub.v,m.sup.2 +σ.sub.nc.sup.2)/(σ.sub.v,w.sup.2 +A.sub.c.sup.2 σ.sub.v,m.sup.2 +σ.sub.nc.sup.2) 
    
     where: 
     A c  is the coefficient correlating motor rate to weight rate (correlation coefficient); 
     σv,m 2  is the 22 entry of the P m  matrix; 
     σv,w 2  is the 22 entry of the P w  matrix; and 
     σnc 2  is the variance of the correlation noise (set during the tuning procedure of FIG. 6). 
     Control then passes to block 82 where the motor rate prediction and weight rate prediction calculated in block 79 are combined using correlation coefficient A c  and combining coefficient C using the equation shown to arrive at a total weight rate estimate, V T . 
     Control then passes to block 83 of FIG. 3E, entry point &#34;E&#34;. In the process of FIG. 3E, the correlation coefficient, A c , is updated every N c  (for example N c  =10) measurement cycles. Specifically, in block 83, weight rate error, V e , is set equal to the difference between the weight rate calculated in block 79 and the motor rate, also calculated in block 79, multiplied by correlation coefficient, A c . Control then passes to block 84 where the weight rate error calculated in block 83 is accumulated in variable V e ,sum. 
     Control then passes to block 85 where counter V ec  is incremented and then checked in decision block 86. If N A  cycles have not yet passed, control is transferred to block 90 of FIG. 3F. If, however, decision block 86 determines that N A  cycles have passed (i.e., that N A  calculations of V e  have accumulated in V e ,sum), control passes to block 87 where Ve,e,ave calculated, the average of the N c  weight rate errors. Then, in block 88, the correlation coefficient, A c , is updated using the equation: 
     
         A.sub.c =A.sub.c +K.sub.g V.sub.e,ave /V.sub.m 
    
     where: 
     A.sub. c is the correlation coefficient; 
     K g  is the A c  update gain, for example K g  =0.1; 
     V e ,ave is the average of N A  cycles of the difference calculated in block 83; and 
     V m  is the motor rate calculated in block 79. 
     Accumulated sum, V e ,sum, and counter V ec , are each set to 0 in block 89, and control is transferred to block 91 of FIG. 3F entry point &#34;F&#34;. 
     Thus, every N c  cycles, correlation coefficient, A c , is recalculated based upon the difference between the estimate of the weight rate based on weight measurements V w , and the estimate of weight rate based upon motor measurements, A c  V m . 
     Referring now to FIG. 3F, the material bridge detecting process of the present invention is described. Beginning in block 91, velocity variable, Z v , w(k) is calculated as a simple time derivative using the weight measurement taken during the present cycle Z w  (k), less the weight measurement taken during the past cycle, Z w  (k-1), divided by sampling period T. 
     Control then passes to decision block 92 where the condition of tri-state flag B % is checked. If flag B % is 0, the bridge checking routine of FIG. 3F is skipped and control passes immediately to the motor control process shown in FIG. 4. This would be the case for example during start-up. If material bridge checking is to be performed, flag B % will be set equal to 1 and decision block 92 will pass control to decision block 93 where counter Bc is checked. As mentioned later, counter Bc is incremented each pass. On the first pass, counter Bc is equal to 1 and control will pass to block 94 where variable V wr  is set equal to Z v ,w calculated in block 91. On the second and subsequent passes, decision block 93 will determine that counter Bc is greater than 1 and will pass control to block 96 where variable V wr  is calculated using the equation: 
     
         V.sub.wr =V.sub.wr +K.sub.ri (Bc)(Z.sub.v,w =V.sub.wr) 
    
     where 
     V wr  is the rapid estimated weight rate; 
     K ri  are the rapid identification gains calculated in FIG. 7, blocks 147-151; 
     Bc is the bridge counter; and 
     Z v ,w is measured weight velocity. 
     Control then passes to block 97 where bridge counter Bc is incremented. Then, in decision block 98, bridge counter Bc is compared with flag BcFlag which, in the preferred embodiment is equal to 13. In addition, decision block 98 compares the variable incrementally calculated in block 96 with, preferably, onehalf of the total weight rate estimate, V T , calculated above in block 82. If both conditions checked by decision block 98 are satisfied, this means that an initial bridge detection has occurred, and control passes to block 99 where flag B % is set equal to 2. Passage of control to block 99 indicates detection of a material bridge, however, in order to insure accurate material bridge detection, a second material bridge test is performed, and is described below. 
     If either condition checked by decision block 98 is not satisfied, control passes to decision block 101 where it is determined whether counter Bc is equal to BcFlag. If so, control passes to block 102 where counter Bc is reset to 1 before passing control to the process shown in FIG. 4. Otherwise, control passes directly from decision block 101 to the procedure of FIG. 4. 
     On a subsequent pass, if it is determined by decision block 92 that flag B % has been set to 2, control passes to decision block 103. Decision block 103 and blocks 104, 106, 107 and 108 perform functions identical to the functions of decision block 93 and blocks 94, 96, 97 and 98. Thus, together blocks 103, 104, 106, 107 and 108 constitute a second material bridge detection. If the two conditions checked by block 108 are satisfied, control passes to block 109 which indicates that the existence of a material bridge has been confirmed. In block 109, appropriate steps are taken, for example, sounding an alarm and/or stopping the weigh feeding system, and flag B % is set to 0 . Control then passes to block 111. If both conditions tested by decision block 108 are not satisfied, control passes directly to decision block 111 where counter Bc is compared with limit BcFlag, and the variable V wr  is compared with one-half of the total weight rate estimate V T , as in block 98. If both conditions tested by decision block 112 are satisfied, control passes to block 112 and 113 where flags B % and counter Bc are both reset to 1. Otherwise, decision block 111 transfers control directly to the process of FIG. 4. Passage of control by decision block 112 to blocks 112 and 113 indicates that although a material bridge was detected (by satisfying the two conditions tested by block 98), a bridge could not be confirmed by decision block 108, and therefore no material bridge exists and no corrective measures need be taken. Turning now to FIG. 4, the motor control procedure will be described. First, in block 114, the set point error is calculated by subtracting the total estimated weight rate, V T , calculated in block 82, FIG. 3D, from the desired set point, V d . Then, decision block 116 compares the set point error with, preferably, 75% of the desired set point, and appropriately transfers control to either block 117 or 118 to adjust control gain, G. G c  in block 117 is less than 0.9 and is preferably 0.1, although other values are acceptable. Thus, a two-step proportional control is employed. Of course it will be understood by those of ordinary skill in the art that any number of steps could be used to accomplish this proportional control. 
     Control then passes to block 119 where motor control, I m , is calculated integrally from the set point error, V c , control gain, G, and feed factor, FF. Control then passes to block where the control effects, used in block 79, FIG. 3B to calculate new predictions, are updated using the equation: 
     
         u.sub.1,w (k)=b.sub.1,w V.sub.c (k-1) 
    
     
         u.sub.2,w (k)=b.sub.2,w V.sub.c (k-1) 
    
     
         u.sub.1,m (k)=b.sub.1,m V.sub.c (k-1) 
    
     
         u.sub.2,m (k)=b.sub.2,m V.sub.c (k-1) 
    
     where 
     b 1 ,w is the position compensation factor of weight; 
     b 2 ,w is the small signal velocity gain of weight; 
     b 1 ,m is the position compensation factor of the motor; 
     b 2 ,m is the small signal velocity gain of the motor; and 
     Vc(k-1) is the product of control gain, G, and set-point error V d , calculated in block 119 the previous cycle. 
     It should be noted that the position compensation factors and small signal velocity gains used in block 121 are calibrated using the procedure in FIG. 5, during system calibration. In addition, it should be noted that the quantity V c  (k-1) is used to calculate the control effects u 1  and u 2  in order to compensate for time delays in the control system of the preferred embodiment. It will be appreciated by those of ordinary skill in the art that more or less time delay can be used, without departing from the scope of the present invention. 
     Control then passes to block 122 where the motor signal, I M , is output to control the motor. Control then passes from FIG. 4 back to block 47 of FIG. 3A where k is incremented and the entire control loop is retraced. 
     Turning now to the calibration routines shown in FIGS. 5, 6 and 7, and beginning with the control parameter calibration routine of FIG. 5, it has been observed that a step response of the weigh feeding system can be used to calibrate the control models of the stochastic controllers. Specifically, if a series of step functions (i.e., a square wave having a period that is long relative to the sampling interval T) is applied as a control signal by parameter calibration and control generator 24 (FIG. 1), and the uncompensated weigh feeding machine is measured, two series of measurement residuals can be calculated, one for weight measurements and one for motor measurements. From these series of measurement residuals, weight and motor compensation factors b 1 ,w and b 1 ,m, and small signal weight and motor velocity gains b 2 ,w and b 2 ,m are then calculated, and are output to the appropriate Kalman filters (14 or 17, FIG. 1) for use in controlling the weigh feeding system. 
     Specifically, and with reference to the flow chart of FIG. 5, in block 123 a square wave signal, offset from 0 by a desired set-point, is generated as control signals u(k) or equivalently, V c  (k) and is applied to the weigh feeding machine. The square wave has a peak-to-peak signal amplitude of 2A and a signal period of 20T where T is the sampling period. 
     The applied square wave creates a high valued motor signal of magnitude I high  which lasts for a time 10T, followed by a low valued motor signal of magnitude I low  which also lasts for a time 10T. The difference between I high  and I low  is 2A/FF, A being chosen to allow determination of system operation in the vicinity of a desired operating point (i.e., the offset of the square wave). Preferably, A is approximately 25% of the desired set-point. 
     During application of the square wave, control resides in block 124 where an average high mass flow estimate V w ,H, and an average high motor rate, V m ,H are calculated from a series of estimates each determined just before the square wave, u(k) makes the transition from high to low, i.e. at the end of the 10T duration of the high portion of the square wave u(k) where the filter has settled. Also in block 97, an average low mass flow estimate, V w ,L and an average low motor rate, V m ,L are determined from a series of estimates each determined just before the square wave, u(k), makes the transition from low to high, i.e., at the end of the 10T duration of the low portion of square wave u(k) also where the filter has settled. 
     Control then passes to block 126 where a sum of the measurement residuals are calculated. The residuals, Z w  and Z m , are generated by the difference between the actual weight measurement Z w  and Z m  and the predicted weight and motor position predicted by the filters without compensation where the measured response is first observed due to the step change of the square wave u(k). In producing the sums ΣZ w  and ΣZ m , residuals calculated for each high portion of the square wave are multiplied by 1, and residuals calculated for each low portion of the square wave are multiplied by -1. 
     Control then passes to block 128 where the small signal gains b 2 ,w and b 2 ,m are calculated using the equation: 
     
         b.sub.2,w =(V.sub.w,H -V.sub.w,L)/2A 
    
     
         b.sub.2,m =(V.sub.m,H -V.sub.m,L)/2A 
    
     In other words, the respective small signal gains are equal to the difference between the high and low estimates, divided by the peak-to-peak input magnitude 2A. 
     Then, in block 129, weight composition factors, b 1 ,w and b 1 ,m are calculated using the equation: 
     
         b.sub.1,w =ΣZ.sub.w /2N A 
    
     
         b.sub.1,m =ΣZ.sub.m /2N A 
    
     where 
     ΣZ w  is the sum of the weight measurement residuals calculated in block 127; 
     ΣZ m  is the sum of the motor measurement residuals calculated in block 127; and 
     N and A are the number of cycles and amplitude, respectively, of the applied square wave. 
     In other words, the weight compensation factors are the average of the respective measurement residuals normalized by magnitude A. 
     Then, in block 131, weight compensation factors b 1 ,w and b 1 ,n, and small signal gains, b 2 ,w and b 2 ,m are sent to the Kalman filters (and are used specifically in block 121 of FIG. 4). 
     Turning now to the tuning of noise parameters r m , r w  and q m  and q w , and variance of the correlation noise σnc 2 . Use is made of the known linear relationship existing between the plant and measurement noise variances to the predicted measurement residual variances in order to calculate estimates of the actual plant and measurement noise variances. Specifically, the weigh feeding system is controlled by parameter calibration and control generator 24 to run the weigh feeding machine at a constant speed (i.e., each value of control vector u(k) is the same, and two corresponding series of measurements Z w  (k) and Z m  (k) are taken and are respectively fed to two pairs of constant gain filters, A w  and B w , and A m  and B m , each with a different set of fixed known gains. In the preferred embodiment, filter A m  has gains K1 A ,m =0.8 and K2 A ,m =0.4; filter B m  has gains K1 B ,m =0.4, and K2 B ,m =0.2; filter A w  has gains K1 A ,w =0.8 and K2 A ,w =0.4; and filter B w  has gains K1 B ,w =0.4 and K2 B ,w =0.2. From each of the filters, corresponding measurement residual variances are calculated and from these, estimates for the measurement noise variances r m  and r w  and plant noise variances q m  and q w  are calculated. 
     In addition, the two Kalman filters of the regular control loop are also run during this constant speed open-loop calibration interval, and a series of mass flow estimates and motor rate estimates are generated. From this series of mass flow estimates and motor rate estimates, a series of residuals are calculated form a difference between the estimated mass flow rate based upon weight measurements, and the estimated mass flow rate based on the product of the motor rate estimates multiplied by a nominal correlation factor A c ,nom. From this series of residuals, a correlation noise variance, π nc   2 , is calculated. This correlation noise variance is used in the cyclic calculation of correlation factor, C (see block 81, FIG. 3D). 
     Referring to the flow chart of FIG. 6, the noise calibration algorithm of the present invention is shown. To initiate the algorithm, the weigh feeding system is run with a constant speed beginning in block 132. Decision block 133 determines if two consecutive perturbation free measurements have been taken. If so, filter initiation (similar to the filter initiation shown above in FIG. 3A and supporting text) is done for all four filters A w , B w , A m  and B m  in step 134. Next, preferably 35 measurement cycles are allowed to lap by use of looped decision block 136 in order to allow the outputs of filters A w , B w , A m  and B m  to settle. Then preferably 100 measurement cycles are performed and the residuals Z A ,m ; Z B ,m ; Z A ,w ; Z B ,w ; and V w/m  are calculated in blocks 137 and 138. Then in block 139, the sum of the residuals ΣZ A ,m ; ΣZ B ,m etc., as well as the sum of the square of the residuals, ΣZ A ,m 2  ; Σ Z B ,m 2  ; ΣZ A ,w 2  ; ΣZ B ,w 2  ; and ΣV w/m   2  are are calculated in block 139. Decision block 141 allows 100 measurement cycles. 
     As mentioned above, the regular Kalman filters are also operated for these 100 measurement cycles. This allows data editing for the weight measurements. Specifically, and referring once again to FIG. 3C, if a weight measurement perturbation is detected, counter Calpert is incremented and residuals Z A ,w and Z B ,w are each set to 0 in block 70 and also in blocks 72 and 73. By this process, weight measurement perturbations can be ignored during the tuning procedure. 
     After the condition tested by decision block 141 in FIG. 6 is satisfied, control passes to block 142 where quantity Nc is set equal to 100 less counter Calpert. Control then passes to block 143 where the measurement residual variances for each of the four filters A m , B m , A w  and B w  are calculated using the equations shown, as is the noise correlation variance, σ nc   2 . Control then passes to block 144 where measurement noise variance r m  and plant noise variance q m  are calculated from the variances produced by filters A m  and B m , and measurement noise variance r w  and plant noise variance q w  are calculated from the variances produced by filters A w  and B w , as presented in detail in U.S. Ser. No. 344,458, filed Apr. 28, 1989. In block 146, the measurement noise variances, plant noise variances and correlation noise variance are sent to the appropriate Kalman filters of the stochastic controller. 
     The present invention has provisions to noise calibrate in the mass mode. To calibrate in the mass mode, the weight compensation factors b 1 ,w and b 1 ,m and small signal gains, b 2 ,w and b 2 ,m, calculated in FIG. 5, are first calibrated and are included in the four filters A m , B m , A w  and B w . The control u(k) is then allowed to vary as in the previously described set-point control manner. The noise calibration procedure of FIG. 6 then follows. Noise calibration in the mass mode aids in enhancing the versatility of this invention and allows for noise calibration or recalibration during mass mode control. 
     Turning now to the flow chart of FIG. 7, tuning of correlation factor, A c , is described. As mentioned above with reference to FIG. 6, the Kalman filters used for control are allowed to run for 100 cycles which requires 100 weight and 100 motor measurements to be taken. These two series of 100 measurements are used in the rapid identification process of FIG. 7. 
     Specifically, in the first loop comprising blocks 147-151, a vector of length 100 is obtained for rapid identification gain, K ri . In block 147, seeds for the rapid identification equation used in block 150 are entered and, with the aid of blocks 149 and 151, the equations of block 150 are cyclically performed to generate the 100 element rapid identification gain vector, K ri . 
     Of course, since the individual entrys in the rapid identification vector, K ri , are determined once the seeds entered into block 147 are determined, the rapid identification gain calculation routine executed by blocks 147-151 will always result in the same sequence for rapid identification gain vector K ri . Thus, rather than recalculating vector, K ri , each time correlation factor, A c , is calculated, the rapid identification vector, K ri , could be prestored. 
     After calculation of rapid identification vector, K ri , counter I is reset in block 152 and the loop comprising blocks 153-158 is cyclically traversed using the two series of 100 measurements, Z w  and Z m , produced by the Kalman filters. 
     More particularly, in block 153, simple estimates for weight rate Z v ,w, and motor rate Z v ,m, are determined by taking the simple time derivative of adjacent measurements. Then, in block 156, quantities V w  and V m  are accumulated using the equation shown, including rapid identification gains, K ri . After 100 cycles through block 156, decision block 157 transfers control to block 159 where correlation factor A c  is calculated as V w  divided by V m , each determined after 100 cycles through block 156. 
     The following is a commented source code listing of a source code program for computer 15 of the preferred embodiment including self-tuning calibration and weight and motor measurements. As presented in detail in Table II, this program incorporates the steps shown in the flow charts of FIGS. 3A-3F and 4-7. 
     
                       TABLE II______________________________________FIGURE            Program Statements______________________________________FIG. 3A           3700-6900, 9600             31300-31800FIG. 3B           25400, 25950             26450-26900FIG. 3C           25300             25960-27050FIG. 3D           24300-25360             25400-26250             27000-28120FIG. 3E           27800-28126FIG. 3F           25350-25399FIG. 4            24600-25280             28200-28400FIG. 5            28600-29700             30470-31200FIG. 6            25100-25280             25700-27875             27200-27350, 23760             32200-33000             34400-37200FIG. 7            915-970             25350-25360             35100-35120             36140-36430______________________________________ 
    
     While the invention has been described by reference to a specific illustrative embodiment thereof, many changes and modifications of the invention may become apparent to those skilled in the art without departing from the spirit and scope of the invention. For example, rather than using two Kalman filters for conditioning the weight measurements and motor measurements, a single Kalman filter could be employed. The main idea behind the use of one filter is based on the physical relationship between the weight rate, V w  and the motor rate, V m  : 
     
         V.sub.w =A.sub.c V.sub.m +nc 
    
     where A c  is the coupling coefficient and n c  is the associated noise process. 
     In the combined formulation, the systems&#39;s dynamics can be expressed by the equations: 
     
         X.sub.w (k+1)=X.sub.w (k)+T A.sub.c V.sub.m (k)+w.sub.1 (k) 
    
     
         X.sub.m (k+1)=X.sub.m (k)+T V.sub.m (k)+w.sub.2 (k) 
    
     
         V.sub.m (k+1)=V.sub.m (k)+w.sub.3 (k) 
    
     where w 1 , w 2 , and w 3  are the state noise. It is noted that the weight rate is not explicitly given, but is implicitly given by the physical relationship to the product A c  V m  as given above. It will be appreciated by those skilled in the art that an extended Kalman Filter would be constructed to estimate the states X w , X m , V m  and the parameter A c . FIG. 8 contains the sequence of steps necessary to process the weight and motor measurements, Z w  and Z m  in an efficient manner. 
     The compensation and tuning parameters can be obtained either by the method described hereinabove or by corresponding techniques well known to those skilled in the art. Noise and abnormal influences which cause the weight and/or motor measurements to vary can be processed with the techniques described hereinabove. For motor control, the implicit weight rate estimate V w  =A c  V m  is used in the integral control process the same way as V T  has been shown hereinabove.