International
Carpathian Control
Conference ICCC’ 2002
MALENOVICE,
CZECH REPUBLIC
May 27-30, 2002VIRTUAL MODELS AS AN AID OF LOGIC CONTROL TRAINING
Jiřina KRÁLOVCOVÁ1 and Miloš HERNYCH21 Department of Software Engineering,
TUL - Technical University of Liberec, Liberec, Czech Republic, [email protected]
2 Department of Control Engineering,
TUL - Technical University of Liberec, Liberec, Czech Republic, [email protected]
Abstract: This paper describes our work we have done within range of construction visual
models of robots, automatic manipulators, manufacturing lines etc., that are developed for the sake of their logic control. The aim of the work is enriching education of logic control and giving the possibility to programmers of PLC to test their programs without need of having the real machine in a period when the real machine cannot be disposed of.
Key words: Logic control, visualization.
1 Introduction
Since the time PLCs (i.e. Programmable Logic Controller) were first introduced, the employment of them has got spread out. PLCs are used in many “real world” applications. If there is industry present, chances are good that there is a PLC present. They are involved in machining, packing, material handling, automated assembly or countless other industries. Almost any application that needs some type of electrical control has a need for a PLC.
In accordance to the enhancement of PLCs in industry, there is ascendant need of specialists that would be able to quickly develop and maintain control programs for PLCs. That’s why the education of the subject “Logic control” (or similar) is involved in many engineering courses.
In the process control program development, the correct behaviour of the controlled device is the essential evidence of reasonable control. So there is high need of various models of devices for logic control training. Actually different kinds of diminished models simulated models of devices or are used.
The main aim of our work was to develop a set of virtual models (including 3D visualisation) of robots, manipulators, parts of manufacturing lines etc. that could be well
used in the process of logic control education and by the same mail they could be appropriate replacement for physical models. As a result, the spectrum of miscellaneous tasks could be enriched and therefore students could gain much more experience just during the training process.
This paper presents some of the models we have actually developed as well as it describes our general approach to building of them. Some issues of the work were introduced before in [Královcová, 2000].
2 Main issues
The PLC works by looking at its inputs and depending upon their state, turning on/off its outputs. The user enters a program that gives the desired result. (Editing, loading, debugging and entering programs are performed via programming environment of the PLC.) It is supposed inputs and outputs of PLC are binary values.
On the other hand the behavior of a real device (or its model) depends on settings of actuators that are adjusted during the control process in accordance to the state of the device, which is presented by means of values of sensors.
As a virtual model of a real device is developed, some important condition have to be taken into account.
• The model has to preserve substantial geometric and dynamic properties of the particular real machine.
• It has to real-time display the device.
• It has to comprise models of all actuators and sensors.
• It has to offer values of sensors as inputs of PLC in a reasonable way. • It has to set up values of actuators in accordance to outputs of PLC. • It has to be able to run on a common PC
In general the final model has to be complete from view of logic control and has to be fully attachable to desired type of PLC.
3 Virtual model architecture
Despite of particular system (whose model is created), every model should comprise subsequent particular parts
• Functional model • Graphical model • Communication module • User interface
Next the separate parts are discussed.
3.1 Functional model
The functional model is fundamental part of the whole virtual model. It assures correct functionality – i.e. setting values of properties in accordance to the actual values of actuators and internal state, and consecutive setting values of sensors by virtue of new arisen internal state. It specifies the general activity step of the model.
Generally, a real machine is assembled from individual devices (they cooperate with each other in desired manner according to their facilities and their mutual interconnection).
Our virtual model construction follows similar approach. During the process two main steps are performed
• Models of all relevant components are created at first.
• Model of whole system is assembled from prepared components with the respect on their mutual restriction and influence and the global functionality is completed.
During the decomposition, that precedes the first step, several basic groups can be point out. Those are
• Manipulators – basic parts of machines, they are driven by actuators. • Things – the objects of manipulation, those are passive parts. • Sensors – they give notice of internal state of machines. • Actuators – they drive manipulators.
• Indicators – they can indicate values of some sensors or actuators.
Universal taxonomy of reusable components was created to enable fast derivation of models of particular ones. Subsequently an empty virtual machine (with the capability to maintain separate parts and their influence) as an ancestor of particular virtual model was constructed. Those general tools were employed during construction of eventual virtual models.
3.2 Graphical model
Graphical model provides visualisation of modelled system. As models of separate parts are realised, rendering procedure is implemented to every visible parts (i.e. manipulators, things and indicators). Rendering procedures assures drawing 3D pictures of the objects.
3.3 Communication module
It is presumed the virtual model to be controlled by PLC. So the model must support the communication between itself and PLC. Practically, the real equipment inputs and outputs of controlled system are physically linked to physical outputs and inputs of PLC. Such straightforward interconnection is not applicable to virtual models since the virtual model has no physical inputs and outputs.
There are several possibilities of connection of PLC and virtual model. The connection through the serial port of PC, the virtual model is running on, is preferred, because every PLC has serial connector for the sake of loading control programmes.
Some additional problems are affiliated with that approach.
• Values of sensors and actuators of model are connected to virtual inputs and outputs of PLC (not to physical inputs and output), so the conditions for PLC programming are a bit different in contradiction to controlling physical model.
• Implementation of unique communication protocol for every type of PLC is needed.
• Thereunto the communication protocol is unknown for some type of PLC (for example the firm SIEMENS doesn’t publish the protocol except for the simplest types).
The article [Tůma, 1999] offers partial solution some of these problems – the interface board inserted between the PC and PLC connected trough serial port of PC. The board has got 32 physical inputs and 32 physical outputs to the PLC.
The realised virtual models were built in such a case that they offer make a choose one of the possible communication:
• Communication trough interface board (arbitrary type of PLC can be connected then).
• Direct communication with PLC TECOMAT • Direct communication with PLC OMRON
So three different communication protocols were implemented at all. The concrete types of PLC were selected with respect to actual requirements.
3.4 User interface
The virtual models were built with respect to serve as an aid of education process so the user interface has to be adjusted to that application and therefore the next main parts were included
• 3D view on the modelled system.
• View on values of all sensors and actuators.
• Controls for accomplishing individual actions and choices. Controls offer execution of next actions
• Running, stopping and proceedings of control.
• Selecting concrete type of control mode – user can choose demo mode, manual control or PLC control.
• Selecting of kind of PLC connected (if PLC control is demanded) – as it was mention before user can choose PLC OMRON, PLC TECOMAT, PLC connected trough the interface board.
• Serial port settings (if PLC control is demanded) – in accordance to different type of currently used PLC the appropriate parameters of serial port must be assigned.
4 Virtual model examples
In accordance to the mentioned approach and conditions several virtual models were implemented. As there are some practical experiences with controlling manufacturing lines for plate-glass production some parts of that production were implemented as virtual models for logic control. Figure 1 shows user screen of one of these virtual models that presents part of manufacturing line for putting glasses into palettes.
As controlling of lights of semaphores on crossroads is one of typical problems for logic control, some models of that type were also implemented. Figure 2 shows user screen of virtual model of PLC controllable model of crossroads.
Figure 1. Virtual model of particular manufacturing line
5 Employment of virtual models
Two different motivations triggered the work off
• Giving the possibility to PLC programmers to test their programs without need of having the real machine in a period when the real machine cannot be disposed of or when the equipment could be damaged by incorrect control. • Enriching the logic control education and training
Actually, all the resultant virtual models are used in education of “introduction of logic control”. The experience is positive. Implemented models offer putting out several different tasks for solving – from the simplest to the much more sophisticated ones. Involvement of mentioned virtual models enriches the education of that subject.
6 Implementation
Virtual models were implemented as a computer programs running on common PC’s. The programming language Delphi was used. 3D graphical models were built using the OpenGL graphical library, so the graphical card of PC should aid OpenGL to get reasonable performance of model rendering.
Acknowledgement
The work is supported by MŠMT grant CEZ:J11/98242200001.
References
Královcová, J. 2000. Virtual Machines for Logic Control. In Proceedings the 4th International Scientific - Technical Conference Process Control 2000. Kouty nad Desnou, Czech Republic, pp 60.
Tůma, P. 1999. Interface pro virtuální realitu. In: Praktická elektronika A Radio. ISSN 1211-328X.