An affordable and modular development environment for PLC-Training

This paper focuses mainly on educational programs in the fields of mechatronics and electrical engineering. Building, programming and testing electrical circuits with programmable logic controllers (PLC) is an integral part of practical final exams in this sector.


Introduction
In Austria as well as in many other countries vocational qualification programs are heavily subsidised by tax money.Those programs aim to increase the amount of skilled workers needed by the industry while decreasing the unemployment risk of the already employed individuals that achieved additional qualifications.This type of training mainly takes place at technical schools ("HTL", vocational schools) and other educational facilities managed by Austrian commercial institutions like the WIFIrepresented by the chamber of commerceand the BFIrepresented by the chamber of labour.As the majority of all training programs are free, they almost completely rely on the aforementioned subsidies.This paper focuses mainly on educational programs in the fields of mechatronics and electrical engineering.Building, programming and testing electrical circuits with programmable logic controllers (PLC) is an integral part of practical final exams in this sector.

Goal
PLC training is mainly performed on the following systems due to their availability at training facilities as well as their wide spread use in the industry: Educational facilities offer laboratories in which the listed PLC systems can be used for the duration of an exercise.Unfortunately, it has shown that trainees mostly lack basic programming skills that in turn mean that they need intensive training in order to reach a level that allows them to successfully pass their final exams.For this reason, trainees often feel the need to work on additional exercises at home.This can be done using software simulating different types of PLC systems but in many cases, real hardware would be more adequate to improve effectively.Because of the usually high cost of PLC systems equipping trainees with the needed hardware normally is not a sustainable option.The following table lists the cost for both new as well as refurbished control units (the prices include only the control units and not any needed extension units).For this reason, the author tries to outline cost efficient alternatives that can be used to increase the amount of practical education for trainees.

Approach
In order to make it possible for trainees to work on additional exercises without the need of a laboratory it was necessary to find components that could be used in a way that stays close to the normal usage in the industry while staying affordable.The easiness to acquire the necessary equipment is another main issue.
The maker movement that established itself in the technical society during the last couple of years uses many components for home automatization, small-scale mechatronic projects and quite sophisticated electronical engineering endeavours while staying extremely cost effective.So-called single board computers (SBCs) are broadly used by this group and offer open computing platforms with very comfortable hardware access.SBCs like the Beagle Board and Raspberry Pi as well as simplified micro controller platforms as the Arduino are widely used and cheap enough for amateur usage.
The Raspberry Pia product produced by the Raspberry Pi Foundation in Great Britainwas developed in order to offer students an affordable computing platform for the use in 1 For schools Loxone offers a 90% discount 2 Since there are various models within this family prices can be higher computer science and electrical engineering.Being well documented, affordable (the model 2 costs around € 30.-) and easy to integrate in a various array of projects the Raspberry Pi was chosen as a key element for the affordable training platform.
Using the SBC peripheral devices like switches, light emitting diodes, sensors and so on can be controlled via the programmable general purpose input and output pins (GPIO).Unlike other microcontrollers like the Arduino the Raspberry Pi can only sustain an output voltage of 3.3 V in contrast to an output Voltage of 5 V or 24 V which is more often used in the industry.The way in which to solve this will be outlined in a following paragraph.
As the Raspberry Pi is a fully functional computer (one of the reasons why the author favours it over the Arduino which is merely a micro controller) it can be used with different operating systems (OS).In this case Raspbiana derivative of the Debian GNU/Linux distributionis used as it is well documented, freely available, modifiable and compatible with a wide range of software packages.The OS is installed on a micro SD card using another computer or bought with a preinstalled OS image.
The SBC can be used to program automation tasks in different programming languages, environments such as C/C++, Python and JavaScript but as trainees in this field normally do not have computer sciences, and no substantial programming background another more suitable software environment had to be found.that CodeSys can be used free of charge on an unlimited amount of development computers as long as it is not used in a productive commercial embedded systems context are of advantage for the goal of providing a cost effective solutions for technicians in training.In order to simulate, test and run the programs on a Raspberry Pi a CodeSys plugin is required.This adapted runtime can be downloaded free of charge and used without functional limitations for two consecutive hours at a time before it has to be restarted.Unlimited usage can be acquired through the purchase of a licence currently costing € 35.-.
As mentioned above the Raspberry Pi only offers 3.3 V output voltage at the GPIOinterface.In order to work with an output voltage of 5 V which is more widely utilized in the industry and is therefore more suitable when standard sensors and actuators are to be used.The easiest way in accomplishing this task is converting the GPIO-interface to the standard I2C bus.This is done using a special interface board provided by the German company Horter & Kalb shown in Fig. 1.Fig. 2 shows the interface attached to the Raspberry Pi.It is extremely helpful that the status of the inputs and outputs are signalized via lowcurrent LEDs in order to help students to get a quick overview of the external connections.

Analogue I/O-Cards
All the five above-mentioned cards can be either bought as assembly kits or already assembled and fully tested.Buying the kits is a good idea, if the students should also train their skills in reading technical drawings and in soldering.Buying the kits also helps cutting the costs down.
For demonstration, purposes there are three more very convenient cards available.
Beyerle, W. With the help of these cards, one can very quickly set up demonstrations for different input and output situations.There is no need that the students have these cards at home, because at home they have time enough to work with real signals at the analogue inputs and for instance with LEDs at digital outputs.
In a real industrial environment normally all components including the PLC are mounted on a DIN-rail.In order to achieve the normal look and feel, corresponding brackets are available at very moderate costs.Regarding the transformation from knowledge achieved in this environment to professional usage it has shown that the acquired skills translate well to the most systemsonly STEP7 for SIMATIC needs additional training as this system uses a lot of terms differently than they are trained using the new development environment.
In the meantime, it became more apparent that Codesys enters more fields within the automation industry.The newest member of this family are the new ASI-bus-controllers, which only can be programmed using Codesys and will therefore also be used during the final exams starting summer 2017.

Summary
In conclusion, the so far observed results offer promising prospects for the future.
Participants have already given positive feedback and stated to be glad to have an affordable solution to gather experience at home.This solution will become especially productive when the time of intensive preparation for the final exams is due to begin.The trainees will be able to repeat exercises at their own pace and repeat relevant topics in order to prepare for their examinations.This offers much more available time for practice than under the current system where practical exercises can only be held during a view modules spent in laboratory environments.
As the system actively proves trainees that PLC projects can be realized on a relatively small budget and offers them the possibility to work on their own.It encourages them to play around with the different possibilities and have fun while learning exciting new technologies.
Being low cost this development offers great opportunities for schools and other educational institutions which normally operate on tight budgets and cannot make a lot of investments in technical infrastructure for additional laboratories and the refurbishment of already existing practice environments.
In preparatory courses financed by the participants without subsidies it would even be possible to outfit them with a set of their own which could be used in distance-and elearning sessions which would have been unthinkable in programs where practical exercise is bound to laboratories.This would make it easier for trainees with packed working schedules to attend such programs.

Acknowledgment
I want to thank Mr. Horter from Horter & Kalb for the permission to use the photographs of the various cards.
CoDeSys (Controller Development System) developed since 1994 by the German company 3S Smart Software Solutions GmbHoffers a IEC 61131-3 conform programming environment which is compatible with the Raspberry Pi running Raspbian as well as very close to the development processes used by the most PLC systems.The development environment supports the following programming methods:  IL (Instruction List)  ST (Structured Text)a programming language similar to Pascal  LD (Ladder Diagram)  FBD (Function Block Diagram)  SFC (Sequential Function Chart)Additional useful features included in the CodeSys development environment are an implementation of a continuous function charta SFC extensionas well as a powerful visualization tool that would be lacking in the software solutions offered by Eaton-Möller and Mitsubishi alpha.In the most cases trainees would have to solve problems programmatically using FBDs which during their final exams targeting one of the listed usual PLC environments.The transition from CodeSys to those platforms utilizing FBDs is easy because the programming environment strictly adheres to the standards and best practises.The strict implementation of normed automation workflows as well as the fact Beyerle, W.