Control of Hydraulic Pulse System Based on the PLC and State Machine Programming †

. Abstract: In the paper is described the control electronics for an industrial pneumatic – hydraulic system based on a low-cost PLC. The developed system is a hydraulic pulse system and it generates series of high pressure hydraulic pulses (max. 200 bar). We describe requirements, an overall concept of the embedded control system, user interface, security features and network connectivity. In the description of the software solution we describe implementation of hierarchical ordered program threads (multithreaded program) and main control state machine. At the conclusion, we describe the calibration method of the system and calibration curves and we present the schematic diagram and a photo of a functional prototype of the system.


Introduction
Our built-in control system for the hydraulic pulse system is based on the use of a modern lowcost programmable controller (PLC).A modern PLC allows you to program of parallel running programs (threads) each from them is programmed in for PLC programmers well-known as ladder diagram or as flow chart diagrams [1].In our work we prepared for teh PLC robust, external errors free control program, for control of series high pressure hydraulic pulses based at one PLC.The PLC has ability to run of independent programming threads.Each thread in our case implements a specific activity (or task).Parallel running individual threads cooperate with each other so that the result is the creation of a reactive master control state machine [2].

Requirements for control of the hydraulic pulse system
Since we have limited space in this contribution, we are only trying to describe the need for creating a specific series of impulses.

Hydraulic pulse train
Our task was to create an embedded system for controlling the generation of hydraulic pulses series.The system controls up to four independent series each of them is defined by four adjustable parameters; the number of pulses (N), the maximum hydraulic pressure (p), the hydraulic pulse duration (T1) and the duration of the pause between pulses (T0).Each WAGON of this TRAIN has four passengers: N, p, T1, T2, see Figure 1, where WAGONs build a so-called "HYDRAULIC PULSE TRAIN".The hydraulic pulse train can cyclically repeat its orbit circle by set number of times (TRAIN SESSION).The number of WAGONs may range from 1 to 4. The embedded control system shall allow the user to set the output of the hydraulic pressure in the bar (0-200 bar), the set parameters of

Pneumatic -hydraulic parts
This section describes the diagram in Figure 2 and the photo on Figure 3. Input air pressure is regulated by the proportional pneumatic valve.Regulated air is then fed into pneumatic four-way valve circuit and it controls the two-position pneumatic pump.This pneumatic circuit controls the two-direction movement of the hydraulic cylinder with resulting amplified hydraulic pressure at its output [5].This section is described by the scheme in Figure 2 and it was implemented on a cheap programmable logic controller type (PLC) Nanoline from Phoenix Contact [6] and on certain additional PLC's modules (used modules: analog input -output, user interface LCD display and keypad, USB, RS232 and Ethernet).Input and output logic of the digital signal has two levels 0 and 24V, analog outputs are in the range 0-10V, and analog inputs are in range 0-5V.The used PLC is built on the basis ARM 32 processor and its operating system offers running of several independent program threads simultaneously.The run of each thread is conditional on any particular value, e.g. by the value of the hardware input signal or by the program setting of value of the internal program flag.So parallel programming in the PLC is based on the running separated threads.Program for PLC can be identified with the parallel implementation of separate running and independent threads.This interesting ability of PLC's operating system we used in the creation of master program for control of hydraulic pulses.

User interface elements
The user interface consists from keypad, LCD display (4 rows x 20 characters), the manual switch between two basic modes of equipment (MANUAL mode and AUTO mode), the potentiometer for manual adjustment of output hydraulic pressure, the button to start of series hydraulic pulsation (PULSE mode), button to stop of pulses (the RESET button), security (or emergency) button to turn off the power of the appliance (EMERGENCY).The required values for WAGON and TRAIN parameters and the choosing of other equipment modes (e.g.calibration of the system) are entered from the in the PLC build keypad.

Electrical parts of system
Electrical parts of our system are formed by a 24V power supplies, safety relay [7], electrical and optical relays, switches, terminals and wires and it well be seen in Figure 2 and in Figure 3.

Safety features
The basis of ensuring the safety operation of high pressure pneumatic -hydraulic system is in use of certified safety relay [7].The safety relay can in the case of detecting of system errors switched off the power for the whole electrical power part of the equipment (but not for control PLC).Key safety sensors are connected in the series.In the case of detection of problems with any media (hardware signals AIR or LIQUID) or detection of mechanical problems (hardware signals as DISTANCE ERROR or COVER EMERGENCY SWITCH), the series of connected contacts is interrupted, the safety relay responds and set the signal ERROR and switch off the power for hydraulic -pneumatic system in order to automatically reduce the output hydraulic pressure to minimum.The mechanical error with name DISTANE ERROR is generated by contact switch mounted near hydraulic cylinder and servers to indicate to attempt the generation of high pressure.

Network connectivity
Network connectivity of our control system is based on the PLC expansion module for connection to Ethernet LAN [8].This communication module supports access to all program elements in the PLC multithreaded program (e.g.signals, flags, registers ...) via MODBUS protocol based on the TCP-IP protocols.As part of our PLC system we use also the MODBUS communication modules for both RS232 and USB.For our special purposes, we have developed the communication embedded server -the BUS and protocol converter between CAN bus (it uses the proprietary testbench protocol) and RS232 (MODBUS protocol) (Figure 2).The CAN converter works on the hardware module OLIMEX occupied with 8bit ATMEL AVR-CAN microcontroller [9].The developed by protocol and BUS converter allows us to manage and to monitor hydraulic pulses unit even through CAN bus.The programming approaches for modern PLC are well described in [3][4].Modern low-cost PLC, which allows running of several program threads gives the possibility to program main control state machine without having to create one long and complicated PLC program (ladder logic diagram or flowchart diagram).Each independent program thread can be initiated by hardware signal(s) (the PLC use 24V logic at input) or by internal programming flag with boolean data type (it can be set by another program thread).

List of PLC hardware inputs and outputs
Table 1 lists of all digital and analog inputs and outputs are used in the project.Signals from the hardware inputs ERROR, WAIT, MANUAL, AUTO, PULSE and RESET are processing in the PLC by individual program threads (see Table 2) grouped in so called physical and application layer.Some hardware signal inputs are used for indicating of error's cause in the safety power shutdown of the pneumatic -hydraulic system via safety relay (Figure 2, schematic diagram).
Table 1.List of PLC hardware inputs and outputs and their responsible processing layer

Physical layer threads
Threads of physical layer (Table 2) run in the PLC's operating system after their initializing by hardware input signals.Physical layer ensures processing of hardware signals and as a result this layer sets of outputs flags which are processed in the application layer.These outputs flags manage transitions between states in the master control state machine (literally by start or by stop of respective threads in the application layer).These programs threads also process of above mentioned inputs hardware signals and set of hardware output signals by align the required settling time or also n. Name

Application layer threads
The start of running of the application layer threads (Table 3) are initiated by changes of program flags received from the physical layer.Some threads from this layer create of individual states in the master control state diagram (Figure 3).In addition, these program threads enable the realization of sub states.For example, thread 2_State_Func ensures to call of sub state 6_State_Func.This thread ensures the manually set of parameters in the hydraulic pulse train.Next thread underpins subroutine for user input interaction such the 22_State_Func.This sub state provides possibility manually input of calibration constants.Master control state diagram for hydraulic pulse system consists from 7 separate threads running in application layer, each thread represents individual state of pneumatic-hydraulic pulsing system and is described in Table 3.

Description of the master control state machine
The main control state machine (Figure 4) for hydraulic pulse system consists from 7 separate threads running in application layer, each thread represents individual state of pneumatic-hydraulic pulsing system and is described in Table 3. Transitions between states in application layer is controlled by the program flags and they are isolated from the hardware inputs signals (Table 1) processed by physical layer (Table 2).Thanks to this solution we met with reliable functions of high pressure hydraulic pulse system, with reliable answers to user inputs or to error status.We observed the reliable automatically generated ends of each pulsation cycle or hydraulic pulse train.Peer-reviewed version available at Designs 2018, 2, 48; doi:10.3390/designs2040048

Auxiliary functions
The control of pulses sequences according to saved parameters in the hydraulic pulse train ensures thread 7_State_Func in application layer which is called from the state PULSE (3_State_Func).The thread 6_State_Func ensures the users inputs for controlling of the actual content of hydraulic pulse train and is called from AUTO STATE (2_State_Func).

Input -output calibration of the system
The thread 6_State_Func ensures the manual input of calibration constants from user.The reason for calibration is simple: user works with pressure units in [bar] but PLC works with an internal representation of pressure in ADU units.The user calibration process is implemented within the MANUAL STATE, in the static mode (no pulse condition, manually controlled output hydraulic pressure).The user can obtain by measurements two calibration curves.The first calibration curve is adjustable characteristic between the output hydraulic pressure (measured with portable calibrated hand held hydraulic pressure measurement equipment from WIKA [10]) and the output voltage in ADU (measured via PLC itself) from the sensor output hydraulic pressure ATE PS60 (commercial produced hydraulic pressure sensor used in the cars, the manufacturer is ATE).In our case, we obtained a linear relationship, which leads to the linear equation ( 1) derived by regression analysis from the graph of the measured values: (1) The by calibration determined value of the constant AATE PS60 is 0.1021 [bar / ADU] and the value of the constant BATE PS60 is 4.8074 [bar] (Figure 5).
The second dependence is the static transfer function of the entire pneumatic -hydraulic system and its dependency output hydraulic pressure (in bar, measured by the same equipment [10]) depending on the values of the input voltage (measured in ADU units via PLC itself) for proportional pneumatic valve.Measurement leads to the next linear equation: where the value of the constant ASYS is 0.053 [bar/ADU] and the value of the constant BSYS is 0.0626 [bar].Both linear equations (1) (2) provide of four calibration constants, which user can enter in to the control system (in the thread 6_State_Func).Then, after calibration, according to the user entered value (therefore desired output hydraulic pressure in bar) is thus obtained at the output of pneumatic -hydraulic system as is required in both states -MANUAL and PULSE STATE.Peer-reviewed version available at Designs 2018, 2, 48; doi:10.3390/designs2040048 Figure 6 Measured transfer curve between output of pneumatic -hydraulic system pressure and input of system (see equation ( 2))

Discussion
The developed by us pneumatic-hydraulic system is a one part in an industrial test bench.Our possible benefits are in the introduction of co-operating layers (physical layers and application layers) on a low-cost PLC platform (without the need for high-level programming like C++).This may be our possible contribution to education of young technicians.All necessary software solutions (running at "nanoNavigator" IDE (Integrated Development Environment) from Phoenix Contact [11]) are provided by authors for study purposes as supplementary material (the link see below).Mutually communicating threads can be study in the software simulator provided by nanoNavigator IDE and is not necessary to study or program with buy any PLC hardware.

Conclusions
We have built an embedded control system as a high-pressure hydraulic pulse control unit that can be calibrated, accurately, robustly and networked.This hydraulic impulse unit is part of a test machine that can be used in the industry for hydraulic parts testing.From point of view of software architecture, the control system is based on a basic low-cost PLC architecture and a set of parallel program threads.Each thread can be identified using a single logic scheme or schema.The PLC multi- Peer-reviewed version available at Designs 2018, 2, 48; doi:10.3390/designs2040048thread program is designed as one large and opaque linear program, but as a group of mutually communicating PLCs, which ultimately form one master control state diagram.The cost of the described industrial networked control system with industry standard 24 V optoelectronic insulated interfaces does not exceed 300 Euros, all control systems (certified safety relay, PLC + electrical parts) amount to € 1,000.

Preprints
(www.preprints.org)| NOT PEER-REVIEWED | Posted: 17 September 2018 doi:10.20944/preprints201809.0308.v1 the wagons, the number of wagons and the cyclic sessions of the train.It must allow system calibration (the dependence of the output hydraulic pressure in [bar] on the user's desired hydraulic pressure in [ADU] (ADU unit = Analog Digital Unit)) and it must ensure the generation of system and error messages.

Figure 1 .
Figure 1.Hydraulic pulse train -the schematic of sequence pulses control for hydraulic pulse system represented as train's cyclic sessions

Figure 2 .Figure 3 .
Figure 2. Schematic diagram of the developed hydraulic system and PLC based control system

Figure 4 .
Figure 4.Master control state diagram for hydraulic pulse system consists from 7 separate threads running in application layer, each thread represents individual state of pneumatic-hydraulic pulsing system and is described in Table3.
PULSE STATE, measurement of the maximum of the hydraulic pulse peak during PULSE MODE (during the pause time and during the pulse time) 7 6_State_Func State_FLAGS_21_QSET Sub state of AUTO STATE, user setting of parameters for four TRAIN (T0, T1, COUNT, PRESSURE) 8 7_State_Func State_FLAGS_7 Sub state of PULSE STATE, actual modification of parameters after one TRAIN SESSION Preprints (www.preprints.org)| NOT PEER-REVIEWED | Posted: 17 September 2018 doi:10.20944/preprints201809.0308.v1

Table 2 .
List of implemented physical layer threads

Table 3 .
List of application layer threads