## 4 Conclusions  
The article presents an extension of the PNEditor named PN2 ARDUINO; able to communicate with microcontrollers supporting the Firmata protocol. The new software tool enables us to control discrete-event and hybrid systems using timed interpreted Petri nets thus supporting the control paradigm when in the microcontroller only the communication protocol is implemented. Petri nets control logic is stored in the computer which communicates with the microcontroller and sends control commands. The main benefit of the developed SW tool is the possibility to control complex discrete-event and hybrid systems exploiting the advantages of Petri nets formalism which can support many challenging scenarios in modern manufacturing systems within Industry 4.0.  
Scientific and application contribution of the research can be summarized in the following points:  
* **Development of the software application PN2 ARDUINO supporting modeling and control of discrete-event and hybrid systems** A new software application named P2 ARDUINO based on the open-source Petri nets editor PNEditor was developed to support systems modelling by using timed interpreted Petri nets. Consequently, it enables us to realize control algorithms on Arduino-type microcontrollers as well as on other compatible microcontrollers which support the Firmata protocol used for communication between the computer and the microcontroller.
* **Verification of the newly developed application software system for control of discrete-event systems on a laboratory model** To verify and demonstrate possibilities to control discrete-event systems using the developed application P2 ARDUINO, a laboratory fire alarm model was proposed. The Arduino-type microcontroller Arduino Uno was chosen for control purposes. The respective Petri net was  
Figure 19: Possible architecture for small enterprises consists of storages, hybrid control, cognitive robots, CNC machines and laser quality testing.  
modeled in the original software PN2 ARDUINO. Finally, control of the laboratory discrete-event system was demonstrated.
* **Development and verification of the developed hybrid system control methodology based on high-level Petri net** To verify the developed hybrid system control methodology, it was necessary to set up a laboratory physical model of such type. A DC motor was chosen with an encoder realizing the feedback. Two working points on the steady state I/O characteristics were selected and two respective control algorithms (PID controllers) were designed. The optimal solution was to switch between the two control algorithms depending on the motor speed (working point). The developed software application PN2 ARDUINO showed to be appropriate for this purpose. Switching between individual control algorithms (controllers) and setpoints was realized via SYSEX messages offered by the Firmata protocol. It is the author's original solution which can be considered to be an important scientific and application contribution. Using the Firmata protocol, SYSEX type messages and possibility to implement user code on the microcontroller side enable us to apply any control algorithm realizable by the microcontroller. Scientific and application contributions as declared in the three above points describe the original modeling and control procedures and solutions for discrete-event and hybrid systems, and can further be modified for next research and practice in Industry 4.0. The next research will focus on the Petri net-based control methodology with the control logic directly implemented in the microcontroller.