Lab3 Alternative - Demo based on OpenPLC

 

Industrial Automation - IST MEEC/MEGE

 

J. Gaspar

 

 

 

In this assignment the objective is to make a demonstration of a low cost device running the LADDER language, using the OpenPLC freeware and off the shelve hardware. This assignment is educative as a number of internal OpenPLC programming instructions are implemented in readable code and therefore allow to obtain an inside view of the construction of the hardware and software of the PLCs. In addition, some acquaintance is obtained with common microcontroller and SOC devices as the Arduino and Raspberry-pi.

 

Figure1: Arduino, Raspberry-pi and Raspberry-pi display.

 

 

Assignment details

 

The demonstration of running LADDER is carried by combining a low cost microcontroller / SOC device with a freeware software package implementing the language OpenPLC. In this assignment each group of students is allowed to choose one of two hardware options:

(i) Using one Arduino to do IO operations and one laptop for running high level code

(ii) Using one Raspberry Pi to do IO operations and run local code, plus one laptop for the human-to-computer interface

 

The two options are both in OpenPLC. Please see the list of supported platforms in:

https://openplcproject.com/docs/openplc-overview/

 

As it is common practice in the lab3 assignment, each group of students does a 20min presentation for the class. The objectives of the presentation are expected to include the following:

- Description of the setup running the demo.

- Show the OpenPLC code implementing a bistable block (SR, RS) or one of the timer types (TON, TOF, TP). Draw a state machine to explain the code.

- Running a simple demo, e.g. reading a pushbutton and turning on a LED for three seconds by using a timer in LADDER, or using two pushbuttons to act on a bistable block.

- Indicate the maximum switching frequency of a digital output considering the setup that was used. One of the oscilloscopes available in the laboratory can be used to measure the frequency and then, in the presentation, telling the value read. Note: While in pandemic situation is convenient to minimize laboratory usage; Therefore measuring the scan cycle is advised to be done with a counter and a clock, e.g. by counting scan cycles in a 10sec period.

 

 

Disclaimer

 

This assignment is in essence educative. It must be noted that the Arduino and the Raspberry-pi are not, in general, PLC replacements. Reasons are found on hardware and software differences, electro-mechanic reliability, and legal issues. The next statement exposes a fundamental point of view:

 

"If something does go wrong, there is generally a company behind the product which can assume liability, especially in cases of a major industrial accident involving such controls. To that end, an insurance company for such an industrial concern will likely want such assurances about the industrial controls; the Arduino (as-is) has none of this."

 

in https://forum.arduino.cc/index.php?topic=236945.0 (last visited September 2016)

 

 

References

 

[OpenPLC_www] "The OpenPLC is the first fully functional standardized open source PLC", http://www.openplcproject.com/

 

[Raspberry_display] Display for the Raspberry-pi https://www.raspberrypi.org/blog/the-eagerly-awaited-raspberry-pi-display/