A GEMMA-GRAFCET Generator for the Automation Software of Smart Manufacturing Systems
Abstract
:1. Introduction
2. Related Works
3. GEMMA-GRAFCET Methodology
3.1. GEMMA-GRAFCET Representation
3.2. Hierarchical Design Pattern
3.3. Application Example
4. GEMMA-GRAFCET Generator
4.1. Requirements
- GEMMA-GRAFCET Representation: an online Graphical User Interface (GUI) must be developed for the definition of the automation software specifications. A ‘default’ template model containing the ‘GEMMA families’, and all the ‘GEMMA states’ and transitions must be available. Then, users must instantiate the template model by changing the typology of the states (initial step/step/macro-step/enclosing step), and hiding the states and transitions that are not necessary for the case study. Furthermore, they need to declare the different variables that will be utilized to define the conditions of the transitions, along with their data type and optional default value. Finally, they must be able to specify the conditions, tokens, priorities, and negation operators of the transitions;
- Hierarchical Design Pattern: once the automation software has been specified through the GG-Representation, users must be able to trigger the transformation of the instantiated model into PLC code. Then, the generator must implement the HDP following the rules illustrated in Section 3.2;
- Generator Output: PLCopen XML code (https://plcopen.org/technical-activities/xml-exchange accessed on 1 October 2021) must be generated to be compatible with the different PLC vendors available in the market. Furthermore, a serialized model representation must be provided to save, import, and export the model of the automation software specifications;
- Input validation: different analysis must be performed to detect errors that may be implemented by the users during the specification of the automation software. These must include the search of: (i) syntax errors such as typos in the definition of the data type of a variable; (ii) semantics errors such as the utilization of an undeclared variable within the condition of a transition. Nevertheless, in case of user approval, PLC code must be generated also in presence of errors, since the control practitioner may prefer to fix errors on the PLC code than the GG-Generator.
4.2. Design
4.3. Implementation
4.3.1. Metamodel
- GEMMA-GRAFCET: the main actor of the metamodel that contains steps and variables. Furthermore, it constrains the states within the ‘F family’ to act as enclosing steps. In this way, these states can move the system towards the ‘Emergency stop’ state (i.e., D1), independently from the active step of the nested behavior [10];
- Step: belongs to a ‘GEMMA family’ (i.e., failure, operation, or stop family) and can be either simple, enclosing, or macro-step. Only one step can be selected as the initial one;
- Transition: directed line that connects a source step to a target one. A priority—integer number—is specified when the source step has more than one outgoing transition. A transition has an associated condition that indicates when the transition to the target state can take place. A ‘negate’ option can be selected for enclosing and macro-steps to change the behavior of the source step with respect to the one illustrated in the representation—when the negated transition is evaluated;
- Variable: either a physical input or a software variable utilized to define the conditions of the transitions. It is characterized by a data type, a size, and an optional default value. A memory can be set to generate a token of the associated variable. The token can either be normally open or normally closed. In the first case the token is generated when the associated variable turns TRUE, while in the latter when the associated variable turns FALSE.
4.3.2. Model and GUI
- Toolbar: upper bar (see Figure 5) through which the user can generate a PLC code, and save, import, and export the model. The RESET button enables to restore the model to the state of the template model. Finally, the HIDE DELETED button is used to hide the steps and transitions not necessary for the case study, since by default these are displayed in opaque color;
- Model: canvas in which the model is represented. The first time the web application is opened and after the reset of the model, the template model is available to the user. The template model contains all the ‘GEMMA states’ and transitions. Steps appear with arbitrary typologies, while transitions with arbitrary priorities and without conditions. The user can select steps and transitions, and personalizes them through the options available in the other regions. It must be noticed that the steps and transitions are fixed in the canvas. Since the GG-Representation implements the GEMMA guideline, it was not necessary to provide to the user the possibility to add further states and transitions, and to modify their spatial positions;
- PLC Code: region that illustrates a preview of the GEMMA program that would be generated with the actual state of the model;
- Step: region through which the user can hide steps, change their typology, and select the initial one;
- Transition: region through which the user can hide transitions, specify their priorities and conditions, and select negated transitions. In the case of macro-steps, the Boolean variables of the conditions can be defined as tokens;
- Variables: region through which the user creates the variables utilized to define the conditions of the transitions. Data type and size must be specified for each variable, while the default value is left as optional.
4.3.3. Model Transformation
4.3.4. Input Validation
- Initial step: due to the missing of the initial step specification;
- Deadlock: step without output transitions;
- Unreachable state: step without input transitions;
- Boolean expression: due to the use of invalid operators and/or variables in the condition of the transition;
- Variable name: due to the use of duplicate or empty names;
- Default value: due to the specification of a default value that is not compliant with the variable data type.
4.3.5. Software Technologies
- Web Technologies (HTML, CSS): chosen for the implementation of the GUI due to their popularity, extensibility, flexibility, and ease of distribution;
- TypeScript (https://www.typescriptlang.org/ accessed on 1 October 2021): main programming language utilized for the functionalities of the GG-Generator. TypeScript is selected for its maturity, popularity, and similarity with JavaScript: the final transpilation target of most web applications. With respect to JavaScript, TypeScript provides compile-time static typing which improves maintainability and reduces common typing errors;
- ReactJS (https://github.com/facebook/react/ accessed on 1 October 2021): framework for creating web applications. One of the first to propose declarative mapping from the application state to the GUI. It is selected due to its popularity and the TypeScript support;
- MobX (https://mobx.js.org/ accessed on 1 October 2021): used as a dependency library needed for the implementation of the web application. It provides tools for incremental computation and for the reaction to changes observed in the application state;
- Material Design (https://material-ui.com/ accessed on 1 October 2021): main tool adopted for the styling of the GUI;
- Antlr (https://www.antlr.org/ accessed on 1 October 2021): tokenizer and parser generator for language grammars. This tool is adopted for the parsing of the Boolean expressions specified within the conditions of the transitions. In particular, the Antlr open-source TypeScript library (https://github.com/tunnelvisionlabs/antlr4ts/ accessed on 1 October 2021) is utilized as dependency.
5. Case Study
6. Results and Discussions
- Sequences: state evolution through different paths of the GEMMA guideline;
- Macro-steps and enclosing steps: triggering of the outgoing transitions based on the active step of the nested behavior;
- Priorities: the order in which conditions are evaluated;
- Negated transitions: the change of the source step behavior in case of negated transitions.
- GEMMA-GRAFCET Representation→ a web application has been implemented, enabling users to instantiate a default template model for the specification of the automation software of SMSs through the GG-Representation;
- Hierarchical Design Pattern→ a PLC code has been generated following the HDP through a M2T transformation. VC and Dynamic Software Testing have been applied to verify the consistency between the specifications of the automation software and the obtained PLC code;
- Generator Output→ the generated PLCopen XML code has been imported into the CoDeSys programming environment without the need of modifications. Furthermore, the GG-Representation has been saved, imported, and exported through a JSON file;
- Input Validation→ different syntactical and semantical analysis have been implemented to detect and notify errors during the user instantiation of the template model.
7. Conclusions
- Quantitative Metrics: in this work, the GG-Methodology has been applied to a virtual lab case study and validated based on the feedback of designated users. To further validate it, the approach will be implemented in a physical SMS and quantitative metrics will be computed; e.g., McCabe, Halstead, Kafura, etc.
- Round-trip Transformation: the presented tool allows to convert a model into PLC code. However, consistency between the model and the generated code is not maintained in case of manual changes to the code. How to propagate changes from the code to the model will be investigated;
- Usability Test: the presented GG-Generator should be tested with control practitioners to evaluate its usability.
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
Abbreviations
Acronym | Description |
CPS | Cyber-Physical System |
FB | Function Block |
GUI | Graphical User Interface |
HDP | Hierarchical Design Pattern |
GEMMA | Guide d’Etude des Modes de Marche et d’Arrt |
GG-Generator | GEMMA-GRAFCET Generator |
GG-Methodology | GEMMA-GRAFCET Methodology |
GG-Representation | GEMMA-GRAFCET Representation |
MDE | Model-Driven Engineering |
M2M | Model-to-Model |
M2T | Model-to-Text |
OM | Operational Mode |
OPC | Open Platform Communication |
PLC | Programmable Logic Controller |
SMS | Smart Manufacturing System |
ST | Structured Text |
VC | Virtual Commissioning |
References
- Mindas, M.; Bednar, S. Mass customization in the context of industry 4.0: Implications of variety-induced complexity. In Advanced Industrial Engineering; Plinta, D., Ed.; Fundacji Centrum Nowych Technologii: Bielsko-Biała, Poland, 2016; Chapter 2; pp. 21–38. Available online: https://www.priemyselneinzinierstvo.sk/wp-content/uploads/2017/07/AIE-2016-Industry-4.0.pdf (accessed on 1 October 2021).
- Hu, S.J. Evolving paradigms of manufacturing: From mass production to mass customization and personalization. Procedia Cirp 2013, 7, 3–8. [Google Scholar] [CrossRef] [Green Version]
- Qin, J.; Liu, Y.; Grosvenor, R. A categorical framework of manufacturing for industry 4.0 and beyond. Procedia Cirp 2016, 52, 173–178. [Google Scholar] [CrossRef] [Green Version]
- Qu, Y.; Ming, X.; Liu, Z.; Zhang, X.; Hou, Z. Smart manufacturing systems: State of the art and future trends. Int. J. Adv. Manuf. Technol. 2019, 103, 3751–3768. [Google Scholar] [CrossRef]
- Lu, Y.; Liu, C.; Kevin, I.; Wang, K.; Huang, H.; Xu, X. Digital Twin-driven smart manufacturing: Connotation, reference model, applications and research issues. Robot. Comput.-Integr. Manuf. 2020, 61, 101837. [Google Scholar] [CrossRef]
- Sanchez, M.; Exposito, E.; Aguilar, J. Autonomic computing in manufacturing process coordination in industry 4.0 context. J. Ind. Inf. Integr. 2020, 19, 100159. [Google Scholar] [CrossRef]
- Chen, D.; Doumeingts, G.; Vernadat, F. Architectures for enterprise integration and interoperability: Past, present and future. Comput. Ind. 2008, 59, 647–659. [Google Scholar] [CrossRef]
- Sisinni, E.; Saifullah, A.; Han, S.; Jennehag, U.; Gidlund, M. Industrial internet of things: Challenges, opportunities, and directions. IEEE Trans. Ind. Inform. 2018, 14, 4724–4734. [Google Scholar] [CrossRef]
- Lu, Y. Industry 4.0: A survey on technologies, applications and open research issues. J. Ind. Inf. Integr. 2017, 6, 1–10. [Google Scholar] [CrossRef]
- Barbieri, G.; Gutierrez, D. A GEMMA-GRAFCET methodology to enable digital twin based on real-time coupling. Procedia Comput. Sci. 2021, 180, 13–23. [Google Scholar] [CrossRef]
- Hernandez, J.D.; Gutierrez, D.; Barbieri, G. A GEMMA-based Decentralized Architecture for Smart Production Systems. In Proceedings of the 1st Latin-American Workshop on Service-Oriented, Holonic and Multi-agent Manufacturing Systems for Industry of the Future, Bogptá, Colombia, 27–28 January 2021; pp. 17–29. [Google Scholar]
- Vogel-Heuser, B.; Fay, A.; Schaefer, I.; Tichy, M. Evolution of software in automated production systems: Challenges and research directions. J. Syst. Softw. 2015, 110, 54–84. [Google Scholar] [CrossRef] [Green Version]
- Mohagheghi, P.; Gilani, W.; Stefanescu, A.; Fernandez, M.A.; Nordmoen, B.; Fritzsche, M. Where does model-driven engineering help? Experiences from three industrial cases. Softw. Syst. Model. 2013, 12, 619–639. [Google Scholar] [CrossRef]
- Anda, B.; Hansen, K.; Gullesen, I.; Thorsen, H.K. Experiences from introducing UML-based development in a large safety-critical project. Empir. Softw. Eng. 2006, 11, 555–581. [Google Scholar] [CrossRef]
- Hutchinson, J.; Rouncefield, M.; Whittle, J. Model-driven engineering practices in industry. In Proceedings of the 33rd International Conference on Software Engineering, Honolulu, HI, USA, 21–28 May 2011; pp. 633–642. [Google Scholar]
- Whittle, J.; Hutchinson, J.; Rouncefield, M. The state of practice in model-driven engineering. IEEE Softw. 2013, 31, 79–85. [Google Scholar] [CrossRef] [Green Version]
- Wehrmeister, M.A.; Pereira, C.E.; Rammig, F.J. Aspect-oriented model-driven engineering for embedded systems applied to automation systems. IEEE Trans. Ind. Inform. 2013, 9, 2373–2386. [Google Scholar] [CrossRef]
- Vyatkin, V.; Hanisch, H.M.; Pang, C.; Yang, C.H. Closed-loop modeling in future automation system engineering and validation. IEEE Trans. Syst. Man Cybern. Part C (Appl. Rev.) 2008, 39, 17–28. [Google Scholar] [CrossRef]
- Vyatkin, V. Software engineering in industrial automation: State-of-the-art review. IEEE Trans. Ind. Inform. 2013, 9, 1234–1249. [Google Scholar] [CrossRef]
- Lukman, T.; Godena, G.; Gray, J.; Heričko, M.; Strmčnik, S. Model-driven engineering of process control software–beyond device-centric abstractions. Control Eng. Pract. 2013, 21, 1078–1096. [Google Scholar] [CrossRef]
- Koziolek, H.; Burger, A.; Platenius-Mohr, M.; Jetley, R. A classification framework for automated control code generation in industrial automation. J. Syst. Softw. 2020, 166, 110575. [Google Scholar] [CrossRef]
- Drath, R.; Fay, A.; Schmidberger, T. Computer-aided design and implementation of interlock control code. In Proceedings of the IEEE Conference on Computer Aided Control System Design, Munich, Germany, 4–6 October 2006; pp. 2653–2658. [Google Scholar]
- Steinegger, M.; Zoitl, A. Automated code generation for programmable logic controllers based on knowledge acquisition from engineering artifacts: Concept and case study. In Proceedings of the 17th International Conference on Emerging Technologies & Factory Automation (ETFA), Krakow, Poland, 17–21 September 2012; pp. 1–8. [Google Scholar]
- Vogel-Heuser, B.; Witsch, D.; Katzke, U. Automatic code generation from a UML model to IEC 61131-3 and system configuration tools. In Proceedings of the 2005 International Conference on Control and Automation, Budapest, Hungary, 26–29 June 2005; Volume 2, pp. 1034–1039. [Google Scholar]
- Estévez, E.; Marcos, M.; Orive, D. Automatic generation of PLC automation projects from component-based models. Int. J. Adv. Manuf. Technol. 2007, 35, 527–540. [Google Scholar] [CrossRef]
- Witsch, D.; Vogel-Heuser, B. PLC-statecharts: An approach to integrate UML-statecharts in open-loop control engineering–aspects on behavioral semantics and model-checking. IFAC Proc. Vol. 2011, 44, 7866–7872. [Google Scholar] [CrossRef] [Green Version]
- Thramboulidis, K.; Frey, G. An MDD process for IEC 61131-based industrial automation systems. In Proceedings of the ETFA2011, Toulouse, France, 5–9 September 2011; pp. 1–8. [Google Scholar]
- Hästbacka, D.; Vepsäläinen, T.; Kuikka, S. Model-driven development of industrial process control applications. J. Syst. Softw. 2011, 84, 1100–1113. [Google Scholar] [CrossRef]
- Thieme, J.; Hanisch, H.M. Model-based generation of modular PLC code using IEC61131 function blocks. In Proceedings of the International Symposium on Industrial Electronics, L’Ayuila, Italy, 8–11 July 2002; Volume 1, pp. 199–204. [Google Scholar]
- Vogel-Heuser, B.; Diedrich, C.; Fay, A.; Jeschke, S.; Kowalewski, S.; Wollschlaeger, M. Challenges for software engineering in automation. J. Softw. Eng. Appl. 2014, 2014, 46096. [Google Scholar] [CrossRef] [Green Version]
- Julius, R.; Schuerenberg, M.; Schumacher, F.; Fay, A. Transformation of GRAFCET to PLC code including hierarchical structures. Control Eng. Pract. 2017, 64, 173–194. [Google Scholar] [CrossRef]
- Årzén, K.E. Grafcet for intelligent supervisory control applications. Automatica 1994, 30, 1513–1525. [Google Scholar] [CrossRef]
- Cloutier, G.; Paques, J.J. GEMMA, the complementary tool of the Grafcet. In Proceedings of the Fourth Annual Canadian Conference Proceedings, Programmable Control and Automation Technology Conference and Exhibition, Toronto, ON, Canada, 12–13 October 1988; p. 12A1-5. [Google Scholar]
- ADEPA. GEMMA (Guide d’Étude des Modes de Marches et d’Arrets); Technical Report; Agence Nationale pour le Developpment de la Production Automatisée: Luxembourg, 1981. [Google Scholar]
- Parshall, J.; Lamb, L. Applying S88: Batch Control from a User’s Perspective; Instrument Society of America: Durham, NC, USA, 2000. [Google Scholar]
- Arens, D.; Hopfgartner, T.; Jensen, T.; Lamping, M.; Pieper, M.; Seger, D. Packaging Machine Language V3. 0 Mode & States Definition Document; OMAC Motion for Packaging Working Group: Washington, DC, USA, 2006. [Google Scholar]
- Alvarez, M.L.; Sarachaga, I.; Burgos, A.; Estévez, E.; Marcos, M. A methodological approach to model-driven design and development of automation systems. IEEE Trans. Autom. Sci. Eng. 2016, 15, 67–79. [Google Scholar] [CrossRef]
- IEC. IEC 60848: Grafcet Specification Language for Sequential Function Charts; Technical Report; International Electrotechnical Commission: Geneva, Switzerland, 2002. [Google Scholar]
- Barbieri, G.; Quintero, G.; Cerrato, O.; Otero, J.; Zanger, D.; Mejia, A. A mathematical model to enable the virtual commissioning simulation of wick soilless cultivations. J. Eng. Sci. Technol. 2021, 16, 3325–3342. [Google Scholar]
- Da Silva, A.R. Model-driven engineering: A survey supported by the unified conceptual model. Comput. Lang. Syst. Struct. 2015, 43, 139–155. [Google Scholar]
- Brambilla, M.; Cabot, J.; Wimmer, M. Model-driven software engineering in practice. Synth. Lect. Softw. Eng. 2017, 3, 1–207. [Google Scholar] [CrossRef]
- Lee, C.G.; Park, S.C. Survey on the virtual commissioning of manufacturing systems. J. Comput. Des. Eng. 2014, 1, 213–222. [Google Scholar] [CrossRef] [Green Version]
- Rösch, S.; Tikhonov, D.; Schütz, D.; Vogel-Heuser, B. Model-based testing of PLC software: Test of plants’ reliability by using fault injection on component level. IFAC Proc. Vol. 2014, 47, 3509–3515. [Google Scholar] [CrossRef] [Green Version]
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Castillo, J.M.; Barbieri, G.; Mejia, A.; Hernandez, J.D.; Garces, K. A GEMMA-GRAFCET Generator for the Automation Software of Smart Manufacturing Systems. Machines 2021, 9, 232. https://doi.org/10.3390/machines9100232
Castillo JM, Barbieri G, Mejia A, Hernandez JD, Garces K. A GEMMA-GRAFCET Generator for the Automation Software of Smart Manufacturing Systems. Machines. 2021; 9(10):232. https://doi.org/10.3390/machines9100232
Chicago/Turabian StyleCastillo, Juan Manuel, Giacomo Barbieri, Alejandro Mejia, José Daniel Hernandez, and Kelly Garces. 2021. "A GEMMA-GRAFCET Generator for the Automation Software of Smart Manufacturing Systems" Machines 9, no. 10: 232. https://doi.org/10.3390/machines9100232
APA StyleCastillo, J. M., Barbieri, G., Mejia, A., Hernandez, J. D., & Garces, K. (2021). A GEMMA-GRAFCET Generator for the Automation Software of Smart Manufacturing Systems. Machines, 9(10), 232. https://doi.org/10.3390/machines9100232