# Model Predictive Control for Flexible Job Shop Scheduling in Industry 4.0 +
## 3 Model Generation
### Generation of the Discrete Time Petri Net Model
In order to determine the input, i.e., the manufacturing decisions, for the following time step, the current system state is measured and the optimization is conducted based on the true system state. The measurements are assumed to be readily available through the digital twins of the machines and products. By this, a feedback mechanism is introduced that naturally makes the scheduling strategy more robust and flexible than simply trying to apply an optimal open loop strategy. This general approach of MPC seems particularly suited under the assumption of frequent changes of FMSs in Industry 4.0. The optimization problems (6) and (16) are MPC formulations for the scheduling of a given production problem in a JMPMSF provided in the form described in Section 2 and modeled as Petri Net. If the production problem is given, the MPC formulations can be parametrized such that the completion of the production problem is guaranteed by employing the results in Theorem 1 and the Corollaries 1-3. Those guarantees are obviously given with respect to the model of the system. However, due to the way they are determined, for the case of differences between the model and the real system, the controller will at least apply an input to the system and attempt to complete the scheduling problem. As long as disturbances and changes in the real system with respect to its initial model are perceived through measurements, they can be considered through the feedback mechanism. If they do not lead to the violation of the required assumptions and conditions, the guarantees are retained. Changes of this kind could be the breakdown of a machine, which is fed back by removing a token from the respective idle place in the Petri Net. As long as at least one of the other machines in the manufacturing system, which is still functional, can take over all the tasks of the broken machine, Assumption 2 is still true. If the precondition of Theorem 1 is still fulfilled for all operations taken over by another machine, the convergence guarantees can be retained or at least restored by adapting the prediction horizon \(N\). Furthermore, changes in the cost function, which might be caused by decisions made on the management level or changing energy or material cost, can be handled as long as condition (8) in Theorem 1 is not violated. However, in order to retain the convergence guarantees of the proposed MPC schemes, a re-evaluation of the used prediction horizon \(N\) with respect to Theorem 1 is required. Due to its modular structure, the model offers the possibility to include new jobs or new machines, as required in Section 2.2 and motivated by real production scenarios. This modularity is maintained through the model generation to the formulation of the control problem, and therefore it is easily possible to analyze whether the required properties are preserved despite changes in the problem description. The introduction of a new machine changes the convergence guarantees of the MPCs given with Theorem 1 and the Corollaries 1-3 only in exceptional cases. Generally, a new machine introduces further flexibility and thereby additional possibilities to perform manufacturing tasks in an efficient way without restricting existing ones. To be precise, it is unlikely that a new machine influences the production cost \(c_{\text{P}}(\tau,M)\) of a task \(\tau\) on an existing machine \(M\), or the relation between the cost of existing steady states \(x^{O,S}\) and \(x^{O,C}\). If it is assumed that the propertiesof the existing parts of the production problem do not change, the introduction of a new machine does not change the convergence properties of the MPCs. For the introduction of a new job \(\hat{J}\), analogous arguments hold and the modular structure of the production problem can be exploited. Its completion can be guaranteed, by only analyzing the new job \(\hat{J}\).