An Industrial Automation Course: Common Infrastructure for Physical, Virtual and Remote Laboratories for PLC Programming

— This work describes the development of a teaching strategy to leverage current simulation tools and promote learning of industrial automation systems. Specifically, Programmable Logic Controller (PLC) programming in an industrial automation course. We propose an infrastructure where it is possible to work with physical, virtual and mixed laboratories.


Introduction
The teaching-learning process in engineering programs requires a balanced combination of theory and practice since students should be able to, correctly, establish the relationship between theory concepts and its application in real systems. Moreover, it must be valid for different sectors where the application of engineering has demand. The programming of industrial automation systems is essential for many engineering programs: electronics, mechatronics, industrial engineering, process industry, etc. One of the main goals for the courses related to PLC programming consist on the learning of adequate control procedures applied to different engineering fields and real automation plants to be controlled and monitored using these industry-wide standard controller.
The creation of automation plants for student practice is a difficult task for schools as it is very complex and requires heavy investment. Laboratories should include industry-grade equipment to cover different areas as chemical plants, food industry, packaging, manufacturing, mining, oil & gas, and many others, which is unaffordable for schools. Similarly, if the number of students is large, facilities should be commen-surate to size and cost; operation and maintenance could be very high. The difficulty becomes even greater when the school offers on-line education programs, as it is not possible to, remotely, bring a real plant to the student connected from home or workplace. To overcome the problem, one possibility for laboratory work in PLC programming courses is to use simulation tools that allow students to explore the experimental part of the proposed courses. In the case of on-line education, the use of these tools is limited when the software requires a license or a computer with top specifications not easily satisfied by the hardware of the remote student and it is always limited to simulation tasks. A possible solution for these students is the development of remote laboratories with thin interfaces allowing participants to carry out their activities using more powerful resources available in the school. This remote connection proposal can be used in certain laboratories but its application is limited to a reduced number of users since it is not possible to address them simultaneously and then, only a reduced amount of usage time can be allocated to each remote user.
Given these conditions, a strategy that has been gaining acceptance is the development of virtual laboratories [1 -5] where the materials and equipment to be used is available to the student at any time. It allows them to study and practice at their own pace repeating once and over again the experiment and exploring different options, changing elements and encouraging their curiosity and desire to learn beyond what a classical or rigid experiment can offer. The availability of such laboratories is desirable for both on-site and on-line cases [6 -10]. Likewise, the use of current computer or other gadgets (tablets, smartphones, etc.) is more attractive for the current generation of students. Thus, being able to offer laboratory courses compatible with new devices is also an advantage.
In this paper, we propose a teaching strategy that uses the development of virtual labs to enhance learning materials in a course of basic industrial automation. The paper proposes to use software tools developed over the years and are now very solid, reliable and accessible to many users at a very low cost due to the existence of student or demo versions, which are sufficient for the development of the proposed experiments. This fact allows users not to depend on the software license that the institution can offer in their own facilities or be accessed via special connections (e.g. VPN), making it very attractive for both on-site and on-line students. With the proposed teaching strategy, real plants and automation devices are modelled so that students can program the PLC and test its behavior as if connected to a real plant or device as in virtual commissioning environments; which is a common practice now, when developing a new industrial process: a full virtual plant simulation is developed to test the programming of controllers, avoiding potential problems and saving time during real commissioning. Thus, students can have access to similar methodologies currently used in industry.
It is important to mention that the proposal presented here not only serves as part of a virtual laboratory since it can also use real devices or a mixed approximation where, e.g. the student can program a real PLC connected to a virtual plant, or control a real plant by using a simulated PLC. In addition, the proposed approach can also be used to develop SCADA systems (Supervisory Control and Data Acquisition), thereby complementing the training of the students. This issue is of great application in iJOE -Vol. 14, No. 8, 2018 modern industry where control, monitoring, and data exchange is the trend, especially with the advent of Industrial Internet of Things (Industry 4.0 or IIoT).
The organization of the paper is as follows: Next section describes the different available possibilities to perform experimental work at engineering schools: physical, remote and virtual laboratories, discussing the possibilities offered in each option. Following section shows the proposed infrastructure enabling laboratories for physical, virtual, mixed and remote use. Section related with materials details the used software in this work to support the experiments that have been raised for the proposed course of Industrial Automation. OPC standard to communicate data generated by each of the tools tool is also presented in this section. In section titled experiments, we explain three initial experiments developed for this teaching strategy. The level of complexity increases gradually and allows the students to explore cases from simple to more complex automation cases. The obtained results in each of the experiments and their application in the industrial automation course are discussed next with a proposal on the possibilities of developing more experiments to explore other control systems is done, also the learning results and the impact of apply this methodologies in the learning process are discussed too . Finally, conclusions of the developed work and achieved synergies between institutions during the development of this work are addressed in the last section.

Physical, Virtual or Remote Laboratories
In engineering schools, the experimental part of learning requires working in a laboratory to interact with real physical systems, completing the students training and grounding theoretical concepts. Traditionally, students attend a laboratory and conduct an experiment. In some areas of engineering, this is required since it is considered to be the only way to reproduce the experiment under study and provide the students real situations as they will face during their professional career. However, real engineering experiments require complex and costly laboratories which are not possible to emulate in an educational environment due to some reasons: each engineering problem requires a different experimental setup, the required space (area) is extensive, and the cost of equipment, installation and maintenance is very high. As an alternative, the development of specialized software allows reproducing experiments through simulation and that makes it possible for students to perform laboratory work on a virtual lab [11 -14]. In addition, the possibility of remote on-line connection allow students to conduct experiments remotely using equipment located in the university facilities while they are in a remote place.
Nowadays, three laboratory options exist: physical, virtual or remote [1], all of them seeking to promote the development of certain skills in students: building knowledge, strengthening concepts, teamwork, discussion of results, creativity, etc. where each type of laboratory might contribute.
A traditional laboratory with physical facilities is the place where students develop their manual skills to build and test experiments, reinforcing the theory of the course. In this place, students acquire skills to handle equipment and collect data used to build models or verify previously established theories. Physical laboratories require a large space and a strong investment by the institution, including human resources (lab professors or technicians) to assist students in their work. The costs of maintenance and updating is also very high. It is important to mention that, even if the experiment is performed in a controlled environment, there exist some factors as noise, dust, temperature variations, etc. that will affect (positively or negatively) the outcome, allowing the student to learn about the experiment Another option is the virtual laboratory where extensive use of specific software developed for simulations of an experiment can be used by students to draw conclusions about the behavior of the physical process. This is the alternative to a physical laboratory when space, resources and investment are scarce. In a virtual laboratory, students can invest more time to explore different variations of the experiment and generate broader conclusions since the experimental conditions can be easily modified. However, it is important to mention that the mathematical models included in the software and simulation options limit the results obtained from these simulations. Moreover, the opportunities for the students to handle real equipment are low and, typically, the same software is responsible to configure the settings for the experiment without student intervention limiting the acquisition by the students of those skills that should be developed to handle actual equipment. It is also very common that, in many cases, the use of simulations causes users not to discuss about results deeply and build false conclusions about the behavior of a system. On the other side, a virtual simulation allows to generate critical situations or abnormal behavior not easily reproducible in real situations due to the high risks: plant explosion, equipment damages, etc.
Finally, remote laboratories are the alternative that has been generated to meet the needs of students attending on-line education and cannot be present in physical laboratories [14]. Using a remote laboratory, students can use a physical laboratory. They are able to remotely manipulate the experiment and obtain results that support the training. The use of these laboratories is limited by the number of connections that can be established and it is common that only one user at a time can use the system. Thus, time availability is a limiting factor and the quality of the connection can also be a factor playing against the safety of the equipment. In this case, the investment cost remains high although the impact on the number of students that can be addressed is higher, together with 24/7 availability. Currently, many institutions provide remote laboratories and users have expressed favorable opinions regarding its use. Students gain access to experiments and equipment that is not easy to acquire and the results obtained support their learning.
As the main goal of this work is to develop an industrial automation course, we have created a common infrastructure to support different experiments and possibilities, allowing physical, virtual and remote laboratories to be proposed to students. In addition, the infrastructure is mainly based on low cost software (free, demo or student versions used) and internet based communications.
In addition, if the use of the proposed experiments is complemented by other tools, such as discussion forums, educational videos, variations of the experiment, etc., students can obtain better learning outcomes than those who only use the physical version of the same learning experiment. This is also the trend in industry where the development of new automation systems is performed using software for simulation to reduce the risk of failures and mistakes in the final automation process. As proposed in this work, it accelerates the design process and it is common to find industries demanding students being proficient in the use of these tools.

Infrastructure and Software Tools
As stated before, we used specialized software to support the simulation of automation systems as part of a course in Industrial Automation. Specifically, the aim of the course is to learn PLC programming and plant monitoring through HMI and SCADA since they are the most common in industry. Thus, the goal is to provide laboratory exercises consisting on automation processes currently existing in real industries, ranging from simple automation tasks to more complex systems as a complete automation plant. The student must learn PLC and SCADA programming for control and monitoring of industrial plants. The learning of all of these processes can be physical, virtual or remote according to availability of equipment, space, specific goals of the course, investment, etc. In all cases, the proposed infrastructure can be adapted.
The main element used for data exchange among different software and/or hardware is an OPC server (OLE for Process Control). This piece of software is responsible for data exchange using a client-server scheme. The OPC server collects data from different sources and provides those data to others (clients). Data can be obtained/supplied from/to other software programs or any hardware equipment communicated with the OPC server such as a PLC, industrial robot, machine vision, or any external controller. Configuring OPC data exchange appropriately, different options for the learning process can be obtained: from full software simulation and monitoring without external hardware (virtual lab) to a physical laboratory with real PLC and automation plant equipment where the OPC is used for data collection and monitoring. Figure 1 shows the use of the proposed infrastructure in a physical laboratory where a real industrial plant and a controller (typically, a PLC) exist. In this case, the student must use standard controller programming tools to program the equipment which is physically connected to the plant by a communication bus and/or direct sensor/actuator lines. The student can monitor and control the automation plant by developing HMI/SCADA programs communicated with the controller and plant through the OPC server. In this case, the student must be present in a real laboratory to develop and program the proposed tasks which will be run in a real PLC and its behavior evaluated in a real plant.
As a mixed option, Figure 2 shows another possibility for the learning of industrial automation. Real controllers can be programmed by the students. However, the most expensive part and often unavailable in schools, which is the industrial plant, can be simulated by mathematical models in the computer. The OPC server exchanges digital and analog data with the real controller and the student can verify the controller  programming under different plant situations. This is a desirable situation since the heart of an automation plant (the PLC controller) is used by the student who must face the real problems arising in the use of real hardware. By a proper modelling of the industrial plant, the student will receive the inputs from the simulated plant and send the control signals (outputs) to the real plant as in a real environment. The OPC server is responsible to provide plant inputs with controller outputs and send plant outputs to the controller responsible for proper plant operation. Figure 3 shows the use of the proposed infrastructure for the deployment of a fully virtual laboratory. In this case, the controller can be programmed using the standard software according to the manufacturer as in a real case but the program execution is made by a PLC software simulator. The automation plant is also simulated by mathematical models evolving according to a real plant, providing plant information using output signals as in the real case (digital and analog outputs), and being controlled by inputs in the form of standard inputs as in a real plant (digital and analog signals). In addition, an SCADA software can be present for process monitoring and control using the OPC to exchange data with the controller. This is the cheapest and flexible option since multiple industrial plants can be defined according to a mathematical evolution model. Actually, the key factor is the correct definition of the plant model to be able to resemble a real plant, adequately evolving according to the digital inputs and provide accurate outputs for the controller.
Currently, virtual commissioning is very common for those engineering companies dealing with complex automation plants. During this process, a detailed model of the real plant is developed so that the automation control devices (typically, PLC's) can exchange data with the virtual plant as in a real case. This leads to a better refinement of the programming and reduces commissioning time since many possible issues have already been corrected in the simulation phase. Additionally, in all proposed cases, a remote laboratory can be directly generated. Figure 4 shows the additional equipment required. The computer with the OPC server is also connected to a web server (also connected to the OPC server) where the student will be remotely connected. Using a specific user interface, the student can program the controller, the SCADA system, and execute orders to the plant (start/stop, generate alarms, change working conditions, etc.) and the user interface receives information about the evolution of the plant. As the user is in a remote location, the plant and the controller can be real or simulated, it is transparent for the user, who can test the behavior of the controller program by the proposal of different control actions to be programmed in the PLC.You may mention here granted financial support or acknowledge the help you got from others during your research work.

Materials
For the specific case of the proposed industrial automation laboratory we have used software tools and equipment commonly used by industry and, at the same time, we have considered that a free demo or student version is available to students. Concerning the selection of an OPC server, LabView has a very complete OPC (NI OPC server) [15] that enables communication in a simple way to various manufacturers including many PLC brands (Siemens, Omron, Rockwell, etc.). In addition, we have chosen LabView [16] as the tool for the simulation of mathematical models of a physical plant in some of the proposed simulated plants in section of experiments. LabView has been widely accepted in different industrial sectors and it can also be an option to build a SCADA due to its easy and powerful visual interface.
Siemens TIA-PORTAL [17] is the simulation environment used for PLC programming. This software is widely used for all new Siemens PLC controller families (S7-1200, S7-1500, and also S7-300) which are used to control automation systems in many industries around the world. In addition, TIA-PORTAL includes a PLC simulation tool which can be directly connected to an OPC server. Thus, using the same software, a real or simulated controller can be used according to the type of approach to be employed in the learning laboratory (virtual or physical lab).
FluidSIM Pneumatics [18] is used to virtually display the behavior of a sequence of movements performed by pneumatic actuators. This software allows users to build and test sequences controlling basic automation tasks that are present in the industry. The software belongs to FESTO Company and communicates with the OPC server to exchange information of input and output values which are used to simulate the pneumatic system. As in the case of FluidSIM, different software packages can be used for OPC connection, showing that the proposed infrastructure can be enlarged by different options according to the laboratory aims.

Proposed Student Experiments
Experiments developed in this work gradually evolve from the automation of a simple sequence of movements to a PID (Proportional, Integral and Derivative) control loop of a continuous system.
The first example is a virtual laboratory, which uses FluidSIM as the automation plant simulator modelling a physical pneumatic system. TIA-Portal software is the tool to program the pneumatic control sequence in ladder language, and LabView is used as the SCADA to perform monitoring and user interaction. A Virtual Instrument (VI) was created in LabVIEW serving as the HMI to operate the virtual system as if physically built: pneumatic cylinders. The programmed sequence is a basic operation where two double action cylinders (A and B) are used to implement an automation task as for example, a box elevator. The operation sequence is the following: first, cylinder A expands (A+) to elevate the band when the box arrives; next, cylinder B expands (B+) to move the box to another band; then, cylinder A retracts (A-) to bring back the first band and finally, cylinder B retracts (B-). The logic to control this process, should be, proposed by the students and programmed into the PLC using ladder language. A systematic method or a cascade method could be used to do this. Figure  5 shows screenshots with the operating system and graphical interface able to verify if the student has successfully done the programmed sequence. As this proposal is virtual, using the PLC simulator, the student can perform the task out of the laboratory as an assignment.
The reader can also watch a video (Video-01) describing more details about the experiment and the operation thereof is shown.
So that the student increases programming abilities, additional work to the student by changing the cylinder sequence is proposed. In addition, the increase in the number of elements is a variation of the experiment, which can be easily carried out by modifying the pneumatic plant with FluidSIM. Received comments by students who have used this simulation are favorable and indicate that it is useful to explore the theory of motion sequences to automate the operation of printing machines, drilling, bending or similar tasks. In addition to PLC programming, the student can modify the automation plant and the visualization, dynamically. This fact provides more possibilities to increase the knowledge and competences of the student in the automation plant control. The second proposed laboratory experiment is the automation of a tank filling. In this case, the plant model is developed in LabView so that the virtual system is composed of the PLC programming software, the PLC simulator and LabView as the plant model and SCADA. The tank has an inlet and an outlet for liquid, both have ON/OFF valves to allow or block the flow to/from the tank. An analog signal provides information to the PLC about the current volume of liquid in the tank. This signal (volume) is updated according to the inflow and outflow of liquid controlled by manual controls included in the front panel of the VI.   Figure 6 (right) shows the tank model serving as plant model. In this case, a state machine program has been used as method to program the simple model of the tank performance. The control of the process is an ON-OFF control programmed in the PLC, the main contribution of this experiment is the use of analog signals to implement a simple digital controller which the student must learn how to deal with and make the PLC program. The SCADA includes two buttons allowing to start the operation in automatic mode. Additionally, the user can make changes to update the communication time between the process and the controller so that the student can observe the effect of this parameter on the system behavior.
By modifying the plant model, different variations can be proposed to the students. They must modify the PLC program to correctly solve the new plant conditions, for example: increase in the number of tanks, level control instead of volume control, increase in the number of inlets and outlets to the tank or number of tanks integrating the system, the shape of the tank can also be changed, asking the student to create a script where the volume of the new shape must be obtained. The PLC program must control the system and can also explore changes so that an ON-OFF control with dead-band may be required or even using a proportional valve controlled by a proportional control system. A video showing the operation of this experiment can be seen in Video-02.
With a few changes in the 'vi' (virtual instrument), it is possible to convert this virtual laboratory experiment into a physical system where the tank and the PLC are real, and the 'vi' becomes an SCADA for user interaction. This can be done by redirecting the PLC inputs and outputs from the virtual plant model to physical PLC inputs and outputs where the real signals from the plant are connected.
Finally, the third laboratory experiment implements a PID control of a DC motor. The mathematical model of the plant is presented in equation 1. The space-state model is done within LabView using the MathScript structure. Parameters of the DC Motor are: J for the Inertia moment, b the frictional damping coefficient, R resistance armature, L inductance, and K for the electromechanical constant. In the model, ! represents the angular speed, i the electrical current, V the applied DC voltage and y is the output which is the angular speed. Numerical for the parameters values are taken from [19].
! ! ! ! ! ! The actual variables are generated using the method of forward integral (ZOH approximation) which allows to generate the current state of the process by using the previous sample of the state variables and the current sample of the input signal. The student must design the controller taking into account the mathematical model of the DC motor and using a classic method, program the PID control in the PLC with TIA-Portal software using the PID-CP technology block which allows to modify the control parameters in a simple way. Figure 7 shows the performance of this example; in the figure, the actual speed for the DC Motor is continuously controlled for the PID Block of the PLC. The use of this block facilitates the programming of the controller and enables the student into the application of technological blocks of wide use in the industry. The communication between the two software environments allows to transfer analog values of the process efficiently. In addition, a real DC motor could be easily replaced by the 'vi' model and we could also verify the same results from other simulation programs as MATLAB/Simulink and the real motor.
In this laboratory experiment, when using the virtual plant model, the student can modify the motor data or change the process variable to control, for example position or current, so that the student can observe how changing, that conditions, affect the behavior and how they must modify the PLC program to account for these situations. Additionally, the plant model can changed by modifying the space state model so that different PID control must be applied and thus, it promotes the student to learn the ef- fects of various parameters of the controller depending on the plant. In the following video (Video-03) it is possible to observe the operation of the experiment in detail, results of this experiment are excellent and better than previous work showed in [20].
According to the aim of this work, we have proposed three laboratory experiments as part of the activities in an industrial automation laboratory. We have evaluated how students learn PLC programming for different situations coming from virtual or real plants. Moreover, the instructor or the student can easily modify the virtual automation plant according to a real model so that they have to program the PLC controller and observe the results, accordingly. They can also observe how certain real and virtual plants behave the same.

Discussion about the Experiments' Application
The laboratory work is a very important task for an industrial automation course, students need to be hands-on implementing automation tasks by applying different methodologies taught in the course. However, due to the wide variety of automation processes, devices, and manufacturers of equipment used in the industrial area, it is very difficult for an institution to provide all materials and equipment to students.
The strategy of creating virtual laboratories is beneficial and its impact is greater than a physical or remote laboratory. Nowadays, the software modelling tools have reached a high level of precision and are capable of reproducing the behavior of a real automation plant. They allow to impact a large number of users with the advantage of high flexibility in modifications, providing additional opportunities for the exploration of different parameters or configurations in a short time with no economical cost by using free, student versions or demo software.
Students using the virtual experiments earn a higher level of understanding of the processes and they do not have to waste time in installation, connection and start-up procedures. If the use of a virtual laboratory is accompanied by other tools such as discussion forums, online surveys and blogs, it will be possible to achieve all the objectives sought in real laboratories.
Moreover, the use of this strategy is not only valid to increase the skills in automation plant programming but also aligns with the current trend in industrial systems used by many companies in their production plants [21]. The creation of new production plants by virtual modelling avoids the physical construction of experiments or prototypes which are expensive and time consuming to build. This is possible to be achieved by the proposed infrastructure in this work where industrial tools can be used (PLC programming software, SCADA systems, etc.) as if a real industry existed but the expenses associated to the physical construction are avoided. This technique achieves very good and reliable results in less time.
However, we must not forget that the use of physical equipment is also recommended as it is the final goal of any industrial automation. For this reason, the proposed infrastructure allows the use of real equipment, mixed, and virtual equipment, with a straightforward modification of the infrastructure.
Providing these skills to students provides more real environment for them, similar to those that they could find in their future work [22], and thus, students will be more appreciated by employers.

Conclusions
The teaching-learning process in an engineering degree program is not a simple task since the theoretical part should be complemented by a set of laboratory experiments to reinforce the skills taught in the theory classroom. Laboratory experiments are not always possible, especially for those courses requiring highly specialized equipment and materials. The situation is even worse when moving into online courses where traditional courses need to be adapted and the use of an industrial laboratory is not possible for students who do not have the possibility of attending to a physical laboratory.
This work describes a flexible infrastructure where three types of teaching for an industrial automation laboratory can be done: physical, virtual and remote/online. Using an OPC server as the basic data exchange tool, the instructor can use simulated or real data for an industrial plant and the student must use PLC programming to control the proposed automation system. The PLC in turn can also be real hardware or simulated but, in any case, the PLC programming is valid for both cases since it is transparent to it due to data exchange arisen from the OPC server. Furthermore, a visualization interface for the industrial plant can also be created by standard tools linked to the OPC server. This proposal allows students to work as in a real environment by using industry standard tools for programming and monitoring. It also allows more interaction and testing of extreme or unusual conditions in the industrial plant which are not easy to obtain if a real plant is used.
Using these software tools favorably completes the development of skills for students and they become familiar with software tools widely used in industrial companies where its use is extensive.