There is debate on the feasibility of employing Android on Industrial Automation applications.
Big companies contend the market share and most of the time constrains customers to use their proprietary software.
The world is changing and the Internet allows users to benefit from almost infinite availability of information, technical specifications and even to find people that freely share their knowledge and expertise.
Our vision is that in the close future, more industrial automation applications will benefit from the open community and they will lay the foundation to a new revival of this sector.
In this post, I want to show you how the integration of Android in industrial automation applications is possible. I also noted that is surprisingly straightforward.
Goals: the main aim is to create an HMI interface by which I can
- Act to modify digital outputs.
- Read analog values of temperature probes (such as PT100)
Before delving into the details of this project, I would like to present the video that pictures my final industrial automation project. Even though this is a basic project, it is common situation in many small to medium sized industrial applications.
The project consists of the following parts:
- A development board and in particular I chose the Ltouch F board
- One I/O expansion module for digital inputs/outputs (bm_03)
- One I/O expansion module for analog inputs (bm_05)
- Wires and resistors.
As you can see from the previous drawing, these three components are connected by means of a RS485 bus, terminated by a 120-Ohm resistor. I chose RS485 because it is widely used in industrial automation and because of its resilience to interferences.
The HMI industrial automation interface I created features:
- a group of buttons that once clicked modify the digital outputs in the remote I/O expansion module,
- set of labels that contains the temperature read from remote probes.
All the requests and replies are exchanged by means of modbus RTU protocol. The Ltouch development board is the master and the expansion modules are the slave devices.
I Googled for long times to find a modbus library for Android, without any good results. Fortunately, the Ltouch board has a native library that abstracts from the details of the protocol and let to embed directly the high-level modbus functions into the Java code of your Android app.
To be more concrete, the code that I used for modifying one remote digital output is the following:
ModbusLib.PresetMultipleRegisters(fid, node_to_write, starting_address, no_of_registers, holdingRegs);
where I used the PresetMultipleRegisters modbus function 16. The fid is the file id corresponding to the serial port, node_to_write is the slave node number, starting_address is the first register to start writing and holdingRegs is the array containing the source registers to write.
I found these suggestions on how to start creating apps with Android modbus a good reference to lay down a performance aware industrial automation project.
The refresh frequency in this industrial automation demo is 250ms, and I found that the ARM Cortex A8 at 1 GHz is very fast to handle this rate. This is also achieved by setting the replay delay of the I/O modules to zero. Indeed, the baudrate is 38400 bps.
This project is easy to create and as I explained above it is common in many industrial automation applications. Another possible situation I found is having a PLC that manages the whole logic of the system and communicates through I/O modules. In order to present data such as temperatures values, statues etc to the user the PLC will be interfaced for instance with touch terminals.
This project is also ready for this latter situation. The master, i.e., the Ltouch development board can be interfaced to PLC instead of the I/O modules. Indeed, more advanced projects can use the Ltouch development board together with a theoretical number of 128 slave devices.
Industrial automation is a broad and complex field that cannot be described in detail with a single article. Even though this post is only a glimpse of this rich area, I hope to shed new light on the future trends and how to embrace them into industries.
As usual, comments and suggestions are welcome! 🙂