*3.1. Flexible Manufacturing System Hardware*

The flexible manufacturing system (FMS) is composed of 7 interlocked workstations arranged in a linear manner (Figure 1). The FMS is equipped with three robotic systems, two robotic arms, placed in two of the workstations and a SCARA robotic transportation system (SRTS) placed parallel to the workstations. Each workstation is equipped with a PLC used in the individual control of the station (Figure 2). This also ensures the flexible integration of equipment into the manufacturing system. All PLCs are interconnected on a ProfiNet network, ensuring fast information transmission between PLCs. Having the possibility of PLC interoperability, decision making is made in two stages. This is composed of centralized decision making, centered on the optimization of production, and local decision making, which ensures the achievement of the proposed production durations.

**Figure 1.** Flexible manufacturing system.

**Figure 2.** Flexible manufacturing system structure.

Besides the flexibility given by the possibility of integrating new equipment with ease, the FMS presents flexibility in the production process, being able to produce a multitude of products with a minimum of equipment. This is ensured through two production concepts: flexible flow manufacturing (FFM) and flexible manufacturing in cells (FMC). On the FFM, the product travels in a linear manner through 5 workstations of the FMS, schematically represented in Figure 3, each station performing an assembly operation. In FFM production, one of the robotic arms will perform an assembly operation, placing a series of internal parts in a personalized manner, based on the client's request.

**Figure 3.** Workstation conveyor sensor placement.

In the FMS, two principal types of products are considered for production: a single internal layer product and a multiple internal layer product. For the multi-layered product, a series of assembly operations are repeated. Both products can be assembled in the FFM process using SRTS. For the multi-layer product, the SRTS transports the product back to one of the previous stations from where a new set of assembly operations are performed. This ensures that the assembly uses a minimal amount of equipment.

For the FMC process, the second robotic arm is used. At workstation 3, the robotic arm can perform some assembly operations on the FFM or perform a competing assembly of a product in a dedicated area. Workstation 3 is equipped with warehouses for each component, allowing for the assembly of any type of product. From the FMC assembly area, the SRTS transports the product on the FFM to the quality control (QC) area at the entry of workstation 6. The FMC is considered only the production of multi-layer products, as robotic arm flexibility gives the possibility of manufacturing more complex products in a much shorter time.

The intersection of the FFM and FMC processes in the QC area and the usage of the SRTS in both processes create some challenges in the optimization of the entire manufacturing system. To ensure the optimal transportation of products on the FMS, the SRTS is placed parallel to the FFM transportation conveyor. This ensures the usage of minimal workstations but also the minimization of some transportation durations.

The placement of the robotic arms is made considering the possibility of increasing the personalization of each product. To compensate for the increased complexity of the assembly process, a robotic arm was introduced in the specific personalization workstation, permitting the manufacturing of a multitude of products based on client requests. The client request is received directly by the FMS, the manufacturing system being connected to a local server. The server receives the client request and processes the information through an optimization algorithm. The output of the algorithm is represented by a production schedule based on assembly and transportation duration. To ensure these durations, a control algorithm is necessary in each station, especially on the transportation side, that can compensate for some of the assembly delays.

#### *3.2. Flexible Manufacturing System Production Process and Control Necessities*

Given the production flows of the two considered types of products (Figure 4), in some situations, we have intersecting paths for some products. To ensure optimal manufacturing, the products must arrive at designated locations at a certain time in the process. In the case of the SRTS transport of products, the transport duration is known to be ensured by the robot control system.

**Figure 4.** Manufacturing flow for (**a**) single-layer product on FFM and multilayer product on FMC and (**b**) multilayer product on FFM.

In the case of workstation transportation using conveyors, this duration cannot always be guaranteed with sequential control. On a workstation, the position of a product is measured in three key locations using binary location sensors (Figure 3). On a basic conveyor, the position of a product is measured at the entry of the station, the exit and the working area. At a certain moment on the conveyor, only one product is present. In the classic programming of the station PLC, a series of events starts when a certain sensor is activated and continues in a sequential manner until the next sensor is activated. This method of control cannot ensure the transportation of a certain product between two points in a predefined amount of time. To ensure that a product arrives at a certain point at a certain time, an adaptable control algorithm must be implemented.

In the case of a workstation, perturbations on the arrival of a product to a certain location can be introduced mainly by the assembly process. If the process has a longer duration, then the transportation system can compensate for the delay by varying the speed. The control algorithm must also consider some limitations. As a transportation system in a manufacturing process, the direction of transportation should be predefined, meaning that the product cannot travel backwards to a certain location. This can introduce some errors, as the product cannot be positioned at a precise point at the sensor location but position around it. In this case, the error is expected to be lower than the sequential control.

The second factor considered in the control algorithm is the minimal and maximal command values. To ensure that the command value is kept in the desired range, a saturation method is applied. This ensures that the system runs within the desired parameters.

#### **4. Event-Based PID Conveyor Control**

As the event-based error triggering method presented in the literature cannot be applied, some modifications were made to this type of control. Considering the number and type of sensors, one of the modifications to the control algorithm needs to be activated if the product is present at one of the sensors. This ensures that the position of the products is known with precision. This leads to a new control algorithm, which is presented in the next pages.

## *4.1. Event-Based PID Algorithm Structure*

Based on the literature on event-based PID with the error level as a trigger event, a new algorithm, Algorithm 1, was designed to replace the error level trigger with a product position trigger. This is accomplished by sending an activation signal to the control part of the algorithm. Based on the product position on the conveyor and the reference set by the production stage, the algorithm calculates the speed of the conveyor and sends it to the conveyor motor. Based on the sensors' positions, in key locations, after the first algorithm activation and arriving of the product to the second sensor, the system will wait for the completion of the production processes and then set the next position reference that starts the transportation. Additionally, between the sensors, the algorithm retains the last known position of the product. In the case of the workstation presented in Figure 3, the activation of the control algorithm is determined by the activation of the sensors present at the entry, assembly area and exit of the workstation. This results in the event-based control algorithm presented below, which calculates the control signal for the transportation of a product between two locations.


#### *4.2. Product Conveyor Transportation Simulation Study*

Considering conveyor transportation, the process has as output the product position and as an input the speed of the conveyor. In the S-domain, this translates into a simple transfer function *H*(*s*) = 1/*s*. Based on the transfer function, a series of simulations were made to observe the behavior of the system with event-based and continuous PID control. Two situations were considered, one in which the continuous PID controller output is saturated most of the time (Figure 5), resulting in a continuous speed output of the event-based PID (Figure 6). The other situation is considered so that the event-based PID controller changes the output value as the controller is activated the second time the product activates the same sensor.

**Figure 5.** Event-based and continuous PID-measured responses in two different speed conditions.

**Figure 6.** Event-based and continuous PID speed output in two different speed conditions.

The first activation of the event-based PID is determined by the product arriving in the sensor area, determining its activation. The second activation is determined by arriving at the end of the product in the activation area of the sensor. This allowed us to determine the position of the product given by the length of the product. Based on the second activation, a recalculation of the control output is made and an update is made.

It can be observed that the error between the proposed event-based PID and the continuous PID results bets larger with an increase in the transition time. This is determined by the greater speed at the start of the continuous PID, which is similar to the one in the event-based PID. However, in an event-based PID, the speed is calculated only when a sensor is activated; the speed will be kept constant until a new sensor activation occurs.

As the location of the product is usually measured by binary sensors on key locations on the conveyor, in the case of event-based control, the setpoint needs to take values from a discrete interval, given by the number of sensors. This represents the main case of even-based control, as if the setpoint is outside the discrete interval considered, then the product will stop at the next sensor after the setpoint. This is determined by the inability to measure the position of the product between sensors. This could be compensated for by the introduction of digital twins, but this represents future research on this subject. In Figure 7, the error between the setpoint and the event-base PID result can be observed if the setpoint takes a value outside the predefined discrete range. The stabilization of the event-based PID above the setpoint is also given by the introduction of saturation on the command value, assuming that the conveyor can only travel in one direction.

**Figure 7.** Event-based PID stationary error in the case of reference outside possible discrete points.

If saturation over the control value would not be implemented or the limitation would determine a bidirectional travel of the product, the system would become unstable. In the case of setting a setpoint outside the defined interval, the product would start to travel backward from the sensor after the setpoint to the wone before it. As the product could not settle on the desired setpoint, an infinite oscillation between the two sensors would start. This would also be possible in normal operation, as the setpoint takes values in the desired interval. As the product arrives at a certain sensor, the inertial forces and conveyor error determine the product to overshoot the sensor, triggering an oscillation between sensors (Figure 8). This problem is eliminated by limiting the control value so that the conveyor travels only in one direction, as bidirectional travel is not needed.

**Figure 8.** Event-based PID oscillations in the case of negative output signal limits (conveyor moving backward).

#### **5. Flexible Manufacturing System Conveyor Control**

Based on the simulation results, an event-based algorithm was implemented, and a series of measurements were made on one of the FMS workstation conveyors. In addition to the calculations of the control value, a series of information transmission durations introduce some delays in system operations. These can be observed in the differences between the algorithm computation durations and the measurements but also by model, using a Petri net (Figure 9). For the simplification of the model, only the first activation of the control algorithm and the corresponding durations for the computation and transport until arriving at the second sensor were considered. This permits more uniform modeling for all situations. The first operation in the conveyor process starts with the previous conveyor, with the transfer of the product and the activation of the first sensor. This is followed by the activation of the control algorithm and the calculation of the control value. This value is sent to the system, and product transportation starts. After the product arrives at the second sensor, assembly operation is started. After the assembly operation is finished, the control value calculation begins. With the control value updated, new transportation of the product is started. As the product arrives at the third sensor, the product is transferred to the next station.

**Figure 9.** Modeling of the control algorithm in workstation operation.

Figure 10 shows the duration of each step of the conveyor process, from the algorithm activation to the product leaving the workstation. From the control update duration, the time taken by the control value calculation and sending the obtained information to the conveyor can be observed. The value of this duration, even small, can influence the entire production system, especially the production optimization algorithms. This computation and information transmission duration also explain some of the differences between the control algorithm and the measurement duration.

As at a certain moment on the conveyor is present a single product, represented by the station-free signal in the Petri net, a non-Zeno behavior can be ensured. Zeno behavior is defined by the probability of the execution of an infinite number of events in a finite duration. This is represented in most cases as requiring the execution of two or more events at the same moment in time, as presented in [30,31]. As only one product is presented on the conveyor, the activation of the control algorithm is ensured in a sequential manner, as the product arrives at one of the three positions. As one of the sensors is activated, the controller start is triggered. As none of the events that are executed are considered instantaneous and the events are proposed in a sequential manner, the system has a non-Zeno behavior, as illustrated in [30]. Some Zeno behavior can be introduced by faults in the hardware of the system. As certain defects on the sensor side can determine the false activation of certain sensors, the system can interpret the fault as the product being at two positions at the same time, introducing Zeno behavior in the controller. This behavior can be used as a fault detector or eliminated by introducing certain precautions in the system software.

**Figure 10.** Model simulation duration results.

In Figures 11–13, the control algorithm and model implementation measurements can be observed. Figure 10 represents the control value sent to the conveyor based on the event-based control algorithm. In the graphic, the second update of the control value can be observed as the back of the product crosses the sensor, reducing the conveyor speed. This follows the pattern present in the control algorithm simulation, with minor modifications introduced by data transmission delays and calculation approximations. As the same algorithm is used on the first and second parts of the conveyor and the distances are similar, the results are identical, with minor differences.

**Figure 11.** Event-based control speed output in regular cases.

**Figure 12.** Event-based control product position results in a regular case.

**Figure 13.** Event-based control speed output in the maximum speed case.

Based on the control value transmitted to the conveyor, Figure 12 shows the position of the product on the duration between entering the workstation and waiting to leave it. Considering the small variation in speed between the product entering and leaving the sensor area, a notable modification in the product transition rate is not visually observable.

In cases in which some durations need to be compensated for based on assembly delays, the controller can set the control value for the conveyor at the maximal value for the entire transport duration between the two locations. These results can be observed in Figure 13, where, for the entire duration of transport, the conveyor speed is kept at the maximum value. This ensures compensation for possible delays.

The proposed algorithm presents control possibilities for a limited number of transportation cases. These cases cannot be controlled in the usual manner, as the measurement of the controlled value is made in a discrete manner. These discrete measurements, done mostly by binary sensors, cannot ensure an optimal number of measurements for a standard PID control. In most cases, and especially in industry, this type of system is controlled using a sequential algorithm. In these usual algorithms, a predefined value is set to the control value, depending on the algorithm step the system is at the given moment. This can be detrimental in some cases if a variable control value is needed.

One type of sequential control algorithm can be based on a Petri net model of the manufacturing system; this determines what actions need to take place at a certain sensor activation. As the resulting actions are predefined, the command values are mostly set at an optimal working speed. This determines a behavior similar to the system, as in the event-based maximal speed case in Figure 13, where the control output is kept at a certain level as the product is transported between the desired positions. This type of control cannot adapt easily to certain disturbances compared to other types of control.

In the case of the proposed event-based algorithm, the best results are obtained if the system is run as a faster process, as the saturation of the control value influences the output of the controller. This brings the event-based controller output closer to the continuous controller.

Another important aspect of the proposed event-based controller is the rapid increase or decrease in the control value. This can further limit the applicability of the controller. In the case of transporting products with a high inertial mass, this type of control can determine big positioning errors and hardware problems. However, in low mas product transportation, this type of problem should not have a definitive impact, permitting the implementation of such a controller.

#### **6. Conclusions**

In today's manufacturing environment, most product position measurements are made in an event-triggering manner. As the product arrives in a key position, its location is updated. In most cases, the control of transporting a product between two key locations is carried out by a sequential control algorithm. In this type of control, one sequence of events is activated as the previous sections finish, and some sensors have achieved predefined values. However, using a predefined sequence and value in controlling product transportation limits the possibility of duration compensation in case of product delays. As in flexible manufacturing systems, products need to be at key locations at predefined intervals, so a rigid control algorithm cannot cope with the necessary control requirements.

In this situation, an event-based PID controller is presented for the presented fabrication system. Most of the event-based PID controllers presented in the literature have an event trigger set based on the error value. This means that the output of the system needs to be measured in a sampled manner at regular intervals. This is not possible in most manufacturing systems because the sensors are placed only in key positions.

Starting from the literature algorithms, the main improvement proposed in this article is represented by the modification of the event-trigger from an error level to a position activation event. This is representative of systems where the output of the system, in this case the product position, cannot be measured in a sampled manner. In this case, the error level of the output cannot be determined because the product position is determined only in key positions. This determines the necessity of introducing a new type of event-triggered, as proposed in this paper.

Based on the obtained results, the event-based controller can achieve similar results with the continuous PID in cases in which the control value is limited in a predefined range. In addition, this saturation of the control value results in the stabilization of the event-based controller, as without limitation, the controller would be unstable.

This type of event-based control could be improved by introducing a digital twin in the calculation of the control value and compensating for the error between the digital twin and the real system based on event-triggered measurements. This represents further research on event-based control, with this research being a reference base. Based on the obtained results, further comparisons can be made in developing a digital twin of the system and integrating it into the control loop.

**Author Contributions:** Conceptualization, O.D., E.M., A.F., R.S., D.C. and C.B.; methodology O.D., E.M., A.F., R.S., D.C. and C.B.; software, O.D.; validation E.M., A.F., R.S. and D.C.; formal analysis E.M., A.F., R.S., D.C. and C.B.; writing—original draft preparation O.D. and E.M.; writing—review and editing E.M., A.F.; supervision E.M., A.F.; project administration E.M.; funding acquisition E.M., A.F. and O.D. All authors have read and agreed to the published version of the manuscript.

**Funding:** This article (APC) was supported by the Doctoral School of Fundamental Sciences and Engineering, "Dunarea de Jos" University of Galati.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Data availability is not applicable to this article as the study did not report any data.

**Acknowledgments:** The results of this work were presented to the 10th edition of the Scientific Conference organized by the Doctoral Schools of "Dunarea de Jos" University of Galati (SCDS-UDJG) http://www.cssd-udjg.ugal.ro/ (accessed on 10 May 2022), held on 9th and 10th of June 2022, in Galati, Romania.

**Conflicts of Interest:** The authors declare no conflict of interest.
