## Servicios Personalizados

## Articulo

## Indicadores

- Citado por SciELO

## Links relacionados

- Similares en SciELO

## Compartir

## Latin American applied research

##
*versión impresa* ISSN 0327-0793

### Lat. Am. appl. res. vol.39 no.3 Bahía Blanca jul. 2009

**Control of a production-inventory system using a pid and demand prediction based controller**

**S. Tosetti ^{†}, D. Patiño^{†}, F. Capraro^{† }and A. Gambier^{‡ }**

^{†}* Instituto de Automática, Universidad Nacional de San Juan, Argentina {stosetti, dpatino, fcapraro}@inaut.unsj.edu.ar*

^{‡}* Automation Laboratory, Universitt Heidelberg, Germany agambier@ieee.org*

*Abstract* — The need of reducing inventory levels as much as possible without loosing sales opportunities is an important goal not only for small but also for mid-size and large companies, on account of the high costs associated with large inventory stocks. In general, the performance of inventory systems is also affected by the *Bullwhip* effect caused, among other factors, by non-zero lead times. This paper proposes an automatic pipeline feedback order-based production control system (APIOBPCS) considering a demand with cyclic and stochastic components. The dynamics and delays of the production process are modeled as a pure delay. The control system structure consists of a PID controller and demand prediction based on an Extended Kalman Filter (EKF). The main objective of the controller is to stabilize and regulate the inventory levels about a desired set-point. The extended Kalman Filter estimates the parameters of a Volterra time-series model to predict future values of the demand. The control system is evaluated by simulations, showing a good performance and better results than those achieved by using traditional inventory control techniques.

*Keywords* — Production-Inventory Systems. Control. Prediction. Extended Kalman Filter.

**I. INTRODUCTION**

Until recently, production and sales managers used to control inventory levels by means of two powerful but limited tools: intuition and experience. However, the size and complexity of modern production and sale operations have grown in such a way that it is not anymore convenient to regulate stock levels without having a quantitative assessment of the involved factors. This means making a smart or optimal decision not only on what or how much to order, but also, on when to do it.

Inventories are resources needed for production or commercialization processes, that are kept idle, waiting to be used when necessary. These resources can be of any kind: men, machines, raw material, money, graduates from the educational system, etc. Inventories are used to compensate the imbalances of the normal sequence of activities in production and sales processes. In other words, inventories should have a stabilizing effect on material flow patterns (Disney and Towill, 2003). Due to the fact that demand is usually unknown and stochastic in nature, it is not an easy task to keep inventories on an appropriate and regular level. If the level is set too low, maintenance costs may go down: there is no need for large storage spaces, the insurance costs decrease; devaluation costs are lower. However, there persists the risk of losing sales when demand grows beyond the expected Figures. On the other hand, if inventory levels are kept too high, maintenance cost are usually higher: the volume of resources kept in stock increases, the required space is larger, and the devaluation and maintenance costs are higher. Therefore, an effective supply chain should be managed with an aim at keeping a high level of costumer satisfaction while minimizing costs and maximizing proFits (Rivera and Pew, 2005). Results of savings achieved by best-in-class companies, as a result of improving their supply chain operations, amount 5-6% of sales (Simulation Dynamics, 2003).

Although research in this area is not novel, it was only recently when the control systems community have paid attention to this topic. This is described thoroughly in the excellent revision of Ortega and Lin (2004). Previous research works have proposed systems to stabilize the inventory level as is the case of the articles of John *et al.* (1994) and Disney and Towill (2003). More recently, the works of Grubbström and Wikner (1996), Samata and Al-Arami (2001) and Rivera and Pew (2005) have explicitly included dynamic controllers, such as PID, on the supply chain, and have obtained promising results. The present work proposes a simple control system whose main objective is to keep the inventory at a desired level in spite of fluctuations in the demand, taking into account lead times of the production system. The controller is based on an APIOBPCS model and uses a PID controller and demand prediction, to keep stationary inventory levels. Therefore, the inventory level set-point can be lowered without loosing sales opportunities. It is assumed that demand signal has two components: a cyclic one and a Poisson stochastic perturbation. The demand is predicted by a dual joint EKF, which identiFies the parameters of a Volterra model used to model it.

** II. PRODUCTION-INVENTORY MODEL**

The underlaying theory of the open-loop model to describe inventory systems is briefly explained below. The dynamics of an inventory system is represented by a simple difference equation:

(1) |

where *i*_{(k)} is the net inventory level, τ represents the order fulfilment time, *o*_{(k−τ)} represents the prior orders made τ-days before, and *d*_{(k)} is the demand signal. The order *o*_{(k)} is generated by a reorder policy.

Traditionally, reorder policies have been based on Economic Order Quantity (EOQ) approaches:

**Continuous review systems**

- (,
*Q*) policy - When the inventory level reaches level ,*Q*units are ordered. - (, ) policy - When the inventory level becomes equal to or less than , order up to the level .

**Periodic review systems**

- (
*nQ*, ,*R*) policy - If at a review time, the inventory level is less than or equal to , a multiple*nQ*is ordered (*n*= 1, 2, 3 ...); where*n*is chosen so that inventory reaches a level in the interval [, ( +*Q*)]. - (,
*R*) policy - At each review time, a sufficient quantity is ordered to bring the level of the inventory up to . - (, ,
*R*) policy - If, at a review time, the inventory is less than or equal to a sufficient quantity is ordered to bring the level up to .

EOQ approaches are widely used but they are not efFicient enough, mainly because they do not have into account demand fluctuations.

On the other hand, APIOBPCS models have shown to perform well, stabilizing the system and reducing the bullwhip effect. Bullwhip effect refers to the scenario where orders to the suppliers tends to have larger fluctuations than sales to the buyer and this distortion propagates and ampliFies itself when going upstream (Disney and Towill, 2003). A basic productioninventory systems based on the APIOBPCS scheme have four main components: the *inventory*, that can be modeled as an integrator, the *production process* that has been modeled in this paper as a finite time delay, the *reorder policy* and the *demand predictor*.

In addition, there are four fundamental information flows (Grubbström and Wikner, 1996), namely *demand*, *inventory level*, *work-in-progress* (WIP) and *demand prediction* (). Most of the order decision rules are based on one or more of these flows. That is:

(2) |

These components are shown in Fig 1.

**Figure 1**: Basic production-inventory model.

In this work, demand is suppose to be cyclic, simulating a seasonal demand, with a stochastic component given by the addition of Poisson noise. For simplicity, a fixed order fulfillment time is assumed.

In contrast to the APIOBPCS analyzed in Disney and Towill (2003), where a filter acts as demand estimator and there is not a dynamical controller, our approach includes in the control loop a PID controller and the demand prediction generated by a joint dual EKF. We call this approach a PID-APIOBPCS model.

** III. DEMAND PREDICTION**

**A. Volterra Models**

Demand over time can be thought as a time-series, represented by a nonlinear autoregressive model. One way to model it is by means of a Volterra equation. The finite-dimensional discrete-time Volterra model used in this paper is a single-input, single-output model, relating an input sequence {*u*(*k*)}, to an output sequence {*y*(*k*)} (Doyle *et al.*, 2002). This relationship is deFined by the equations:

(3) |

where *y*_{0} and *θ _{i}* are the model parameters. It is convenient to introduce the notation

*V*

_{(N,M)}, where

*N*denotes the

*nonlinear degree*of the model and

*M*denotes its

*dynamic order*. In our particular case a

*V*

_{(1,30)}model is used. Changing the name of the input and output signals, and taking the mentioned values for

*N*and

*M*, Eq. 3 is reduced to:

(4) |

where *d*_{0} and *θ _{i}* are the model parameters,

_{(k)}is the actual estimated demand and

*d*

_{(k−1)}are past values of the demand. The values of the unknown parameters will be found by a Kalman Filter, as shown in the next subsection.

**B. Joint Extended Kalman Filter**

The Kalman Filter is characterized by a set of equations that synthesizes an optimal estimator of predictorcorrector type in the sense of minimizing the estimate error covariance **P**_{(k)}. In this particular case, a Joint Extend Kalman Filter (Ljung, 1979; Wan and van der Merwe, 2000) was used to solve the dual problem of simultaneously estimating the state and the model parameters *θ* from the noisy demand signal.

To make the Volterra time-serie into a Markovian process its necessary to model the demand given by a the Volterra equation Eq. 4 as that given by the nonlinear auto-regression system Eq. 5.

(5) |

Then the model is rewritten as the state space system of Eq. 6:

(6) |

where *f*(*x*_{(k−1)} ...,*x*_{(k−M)},*θ*_{(k−1)}) is the mentioned Volterra model, and υ and η are the process and measurement noises respectively. The output *y*(*k*) is the estimated demand _{(k)} and the elements of the state vector **x**_{(k)} are the past values of the demand. The joint EKF approach to determine the unknown parameters *θ* consists in augmenting the state vector **x** with the parameters vector *θ*_{(k)}. By doing this, a new state vector **z**_{(k)} = [,]^{T} is obtained . Then, estimation is done recursively by writing the state-space equations for the *joint* state as

(7) |

and running a EKF on the joint state-space to produce the simultaneous estimates of the states **x**_{(k)} and *θ*. The EKF equations can be synthesized as follow (Wan and Nelson, 2000). Initialize with:

(8) |

where *E* means the expected value. Then, for *k* = 1,..., ∞, the time update equations of the EKF are:

(9) |

and the measurement update equations are:

(10) |

In the EKF equations, **F _{J}**(·) stands for the new joint model of Eq. 7,

**P**is the estimate error covariance, is the Kalman gain and

_{z}**R**

^{υ}and

**R**

^{η}are the process and measurement noise covariance respectively.

Once the model parameters *d*_{0} and *θ* have been estimated, they are used together with the model to get a prediction of on step ahead. This predicted state vector is then used for the PID-APIOBPCS reorder policy.

**IV. PROPOSED CONTROLLER**

As mentioned, the control approach proposed in this paper is to use some kind of APIOBPCS, namely PIDAPIOBPCS.

APIOBPCS has the main advantage of including in the decision rule the value of the WIP. A basic diagram of a PIOBPCS model is shown in Fig. 2. In this case, the reorder policy equations are presented in Eq. 11:

(11) |

where, _{(k)} is the estimated demand, and *i _{ref}*(

*k*) is the inventory level reference. Constant

*T*is related to the time to adjust the inventory level, is the estimate of the production lead time, and

_{i}*T*is the time needed to adjust WIP.

_{w}

**Figure 2**: Ordering system incorporating WIP feedback.

On the other hand, the approach of using only a PID as suggested in Grubbstöm and Wikner (1996), and in Rivera and Pew (2005) to model an order decision rule does not involve an explicit forecasting unit to estimate demand. So, fusing both controllers, a new and more complete controller is obtained. The proposed control schema is shown in Fig. 3.

**Figure 3**: Proposed PID-APIOBPCS controller.

(12) |

Equations 12 represent the reorder policy for the PIDAPIOBCS case. As it can be seen the reorder policy involves the same variables as the APIOBCS method, with the advantages of a PID action. The inclusion of a PID controller is not a capricious choice. According to Kunreuther (1969), top level managers are found to act in a three-terms-control mode, similarly to a PID controller, using memory of past results (integral term) and anticipating trends (derivative term) as well as a proportional term for their future decisions.

So, as shown in Fig. 3, the proposed controller has the basic elements of a APIOBPCS: demand forecast and WIP compensation. In addition, we use a PID controller as decision rule. It is worth to note that reorder policies are physically limited: control actions should not take values above 200 or below 0. That is because we assume that the production system saturates when orders are greater than 200 and order with negative values do not have a real meaning for inventory systems.

**V. SIMULATION RESULTS**

To evaluate the performance of the proposed controller a Matlab-Simulink model was mounted. The joint Dual Extended Kalman Filter was implemented in a Matlab S-Function, using the model presented in Eq. 7, and equations of the EKF, Eq. 8, 9 and 10. Parameters **R**^{υ} and **R**^{η} are used as design parameters and were set to 10 and 40 respectively.

The model to be estimated by the EKF is the one presented in Eq. 4. Demand signal was simulated by a sum of *sin* and *cos* terms of different amplitude, phase and frequency. Poisson noise with λ = 10 was also added. This noise has also a negative component, so variations on demand can be positive or negative. For all simulations, the inventory level set-point has been set to 20 units and the PID action has been limited to a maximum of 200 units assuming that this is the capacity of the production system. In addition, an extra term has been added to the demand signal to represent sudden stochastic changes on the value of demand.

After the Simulink model was set, the joint EKF was tested. Figures 4 and 5 show the estimated parameters and the predicted demand. As these Figures show, after a short transitory, the coefficients of the identiFied Volterra model became stable and the demand signal is estimated.

** Figure 4**: Parameters estimated by the joint EKF.

**Figure 5**: Demand signal.

**A. EOQ reorder policy**

In order to evaluate the advantages of using the proposed PID-APIOBCS controller, a simulation of a production-inventory system controlled by the EOQ (, ) policy was performed. Simulation was run for 365 days (one year) and results are presented in Fig. 6 and Fig. 7. This is an acceptable policy for controlling and ideal inventory production system, but in presence of delays in the production line the performance of the system gets worse. In Fig. 6 it is clear that the EOQ used is far from being effective: inventory level often falls below zero, meaning that there are many lost sales. In Fig. 7 the bullwhip effect cannot be appreciated due to the form of the reorder policy. However, although the production system is always working at his maximum capacity, the inventory falls a number of times in stock-out situations.

**Figure 6**: Inventory level using an (ˆs, S) policy

**Figure 7**: Order generated by an (ˆs, S) policy.

**B. PID reorder policy**

The next step was to test a production-inventory system with a PID reorder policy but without demand forecast and WIP feedback. PID parameters for this experiment were set to *K _{P}* = 0.5,

*K*= 0.1,

_{I}*K*= 0.1. These values were found by heuristic and the criterion for the selection of these values were to obtain a smooth but fast response to demand and inventory set-point level variations. As in the previous experiment, inventory level set-point was 20 units and the maximum control action available was 200 units. In this case, simulation was run for 730 days (2 years). Results are presented in Fig. 8 and Fig. 9. For this experiment, results are a little bit better: bullwhip effect is not as obvious but it can be seen in those peaks that appear in Fig. 9. In this case, however, the inventory level is still oscillatory and falls below zero too many times. In addition, when demand changes abruptly, the system present large positive and negative peaks of around 10-day length.

_{D}

**Figure 8**: Inventory level using only a PID controller.

**Figure 9**: Generated orders by a PID controller.

**C. APIOBCS reorder policy**

The already mentioned APIOBCS method was also tested. Gain values were all set to one, due to the fact that these values are related to production and lead times, which were suppose to be one in this work. Desired inventory level was set to 20. Results are presented in Fig. 10 and 11. These Figures show a good performance. The inventory level stays stable around 20 units and compared to the previous case, inventory level seldom falls below 0. The bullwhip effect is appreciated in some peaks, caused by abrupt changes in demand, but they are canceled in around 7 days.

**Figure 10**: Inventory level for the APIOBCS method

**Figure 11**: Demand and Orders for the APIOBCS method

**D. PID-APIOBCS reorder policy**

Finally, the proposed control system was tested. PID parameters were set to *K _{P}* = 1.3,

*K*= 1.1,

_{I}*K*= 1. As in Subsection B., these values were found by heuristics. In this case the criterion was to find values that result in a fast but damped response to demand and inventory set-point level variations. The desired inventory level was, again, set to 20 units. Results are presented in Fig. 12 and 13. As it can be seen on these figures, the inventory level is more stable. Peaks still exist, but they are smaller and are canceled in around 5 days. Bullwhip effect is almost the same than in the previous PID and APIOBCS cases. Although there are some inventory level values below zero, these are not as many as in previous experiments. So, when comparing the different experiments, it can be said that to keep an acceptable level of lost sales, desired inventory level should be higher in the case of using a EOQ policy, or only a PID controller, or with the APIOBCS method.

_{D}

**Figure 12**: Inventory for PID-APIOBCS controller.

**Figure 13**: Orders from PID-APIOBCS controller.

**E. Results evaluation**

Results can be compared with the following procedure. Suppose the cost functional:

(13) |

where *LS _{i}* means

*Lost Sales*and represent the number of units below zero in the inventory level and

*IL*is the inventory level at any sample time. The first term of the functional is the cost of lost sales, and represent not only an economic quantity but also a measure of the service quality and customer satisfaction level. The second one, represent the cost of inventory daily maintenance. Table 1 shows the results after applying this cost funcional, with

_{i}*T*= 730 = 2 years.

_{f}**Table 1**: Cost comparison.

As it was supposed, the proposed controller shows the lowest cost. This result agrees with conclusions obtained from previous experiments, where the PIDAPIOBCS showed to perform better than other approaches.

**VI. CONCLUSIONS AND FUTURE RESEARCH**

In this paper a reorder policy based on an APIOBCS model was proposed. The new reorder policy includes a PID controller and an estimate of the demand made with a joint dual EKF. The performance of the proposed controller was tested in simulations. The proposed policy was compared to classical reorder policies such as an (, ) policy, a PID based reorder policy and an APIOBCS policy. Simulation results show a good performance of the proposed controller that reduces the bullwhip effect and keeps lower costs than with other classical controllers. Future research will include more complex models for the production stage and the inclusion of optimum operative conditions in the controller as well as in the desired inventory level planning. The use of intelligent optimal controllers such as Adaptive Critic Designs is also an open Field in this area. Control of multiple-echelon and multipleproducts production-inventory systems could be addressed using this type of controllers.

** ACKNOWLEDGEMENTS**

This work was supported by the National Council for ScientiFic and Technical Research (CONICET), the National Agency for ScientiFic and Technological Promotion (AN-PCyT) under grants PAV-TIC-076 and PICT/04 25423.

** REFERENCES**

1. Disney, S.M. and D.R Towill. "On the bullwhip and inventory variance produced by an ordering policy. *The International Journal of Management Science,* **31**, 157-167 (2003). [ Links ]

2. Doyle, F.J., R.K. Pearson and B.A. Ogunnaike, *Identification and Control Using Volterra Models,* Springer Verlag (2002). [ Links ]

3. Grubbström, R.W. and J. Wikner, "Inventory trigger control policies developed in terms of control theory, *International Journal of Production Economics*, **45**, 397-406 (1996). [ Links ]

4. John, S., M.M. Naim and D.R. Towill, "Dynamic analysis of a wip compensated decision support system, *International Journal of Manufacturing System Design*, **1**, 283-297 (1994). [ Links ]

5. Kunreuther, H., "Extensions of bowmans theory on managerial decision making, *Management Science*, **15**, 421-439 (1969). [ Links ]

6. Ljung, L., "Asymptotic behavior of the extended kalman filter as a parameter estimator for linear systems, *IEEE Transactions on Automatic Control*, **AC-24**, 36-50 (1979). [ Links ]

7. Ortega, M. and L. Lin, "Control theory applications to the production-inventory problem: a review, *International Journal of Production Research*, **42**, 2303-2322 (2004). [ Links ]

8. Rivera, E. and M.D. Pew, "Evaluating pid control for supply chain management: A freshman design project, *44th IEEE Conference on Decision and Control*, (2005). [ Links ]

9. Samanta, B. and S. A. Al-Araimi, "An inventory control model using fuzzy logic, *International Journal of Production Economics*, **73**, 217-226 (2001). [ Links ]

10. Simulation Dynamics, Importance of supply chain management. http: //www. simulationdynamics. com /Sc /SupplyChainImportance. htm, (2003). [ Links ]

11. Wan, E.A. and A.T. Nelson, *Dual EKF Methods*, Willey (2000). [ Links ]

12. Wan, E.A. and R. van der Merwe, "The unscented kalman filter for nonlinear estimation, *Proc. of IEEE Symposium 2000 (AS-SPCC)*, Lake Louise, Alberta, Canada (2000). [ Links ]

**Received: October 18, 2007. Accepted: July 2, 2008. Recommended by Guest Editors D. Alonso, J. Figueroa, E. Paolini and J. Solsona.**