Control of Hydraulic Pulse System Based On The PLCand State Machine Programming
Control of Hydraulic Pulse System Based On The PLCand State Machine Programming
Article
Control of Hydraulic Pulse System Based on the PLC
and State Machine Programming †
Juraj Pančík 1, * and Pavel Maxera 2
1 Institute of Forensic Engineering, Brno University of Technology, Purkyňova, 464/118, Brno 61200,
Czech Republic
2 Institute of Forensic Engineering, Brno University of Technology, Purkyňova, 464/118, Brno 61200,
Czech Republic; pavel.maxera@usi.vutbr.cz
* Correspondence: juraj.pancik@gmail.com; Tel.: +421-908-963-289
† This paper is an extended version of paper published in the International Conference Applied Electronics
2015, University of West Bohemia, Pilsen, Czech Republic, pp. 175–180, ISBN 978-80-261-0386-8.
Received: 17 September 2018; Accepted: 14 November 2018; Published: 20 November 2018
Abstract: In this paper, we deal with a simple embedded electronic system for an industrial
pneumatic–hydraulic system, based on a low-cost programmable logic controller (PLC) and industrial
electronic parts with 24 V logic. The developed system is a hydraulic pulse system and generates a
series of high-pressure hydraulic pulses with up to a max. 200 bar output pressure level and with
up to a max. 2 Hz output hydraulic pulses frequency. In this paper we are describing requirements,
the concept of the embedded control system in a diagram, security features and its industrial
network connectivity (CAN bus, MODBUS). In description of the software solution we describe the
implementation of the program threads approach in this low-cost PLC. The PLC programming with
threads generate two layers of services—physical and application layer, and as a result, the threads
create the main control state machine. In conclusion, we describe the calibration method of the system
and the calibration curves. For further study we offer readers the full programming code written in
sequential function charts to be used as PLC language. The cost of the described industrial networked
control system with industry standard optoelectronic insulated interfaces and certified industrial
safety relay does not exceed €1000 Euros.
1. Introduction
Our built-in embedded system for the pneumatic–hydraulic pulse system is based on the use of a
modern low-cost programmable logic controller (PLC). A modern PLC allows you to program parallel
running programs (threads), each of them being programmed for PLC programmers well-known
ladder diagrams or as functional block diagrams [1,2]. In our work, we prepared for the PLC robust,
external error-free control program, so as to control the series high pressure hydraulic pulses based at
one PLC. Each thread represents a separate task and independent state of system. Parallel running
threads cooperate with each other and this set of independent threads creates a unique reactive control
state machine [3,4].
duration (T1) and the duration of the pause between pulses (T0). Each WAGON of this TRAIN has
duration (T1) and the
four passengers: N, duration
p, T1, T2,of the
see pause
Figurebetween
1, wherepulses (T0). Each
WAGONs WAGON
build of this “PNEUMATIC–
a so-called TRAIN has four
passengers: N, p, T1, T2, see Figure 1, where WAGONs build a so-called “PNEUMATIC–HYDRAULIC
HYDRAULIC PULSE TRAIN”. The pneumatic–hydraulic pulse train can cyclically repeat its defined
PULSE TRAIN”.
circle path by theThe pneumatic–hydraulic
number of times which ispulse train
set in the can cyclically
TRAIN SESSIONrepeat its defined
number. The circle
number pathof
by the number of times which is set in the TRAIN SESSION number. The number
WAGONs may be set by the user from 1 to 4. The embedded control system allows each user to of WAGONs mayset
be
theset by theofuser
output from 1 to 4.
the hydraulic The embedded
pressure control
in bars within thesystem
range allows eachthe
0–200 bar, user to set the
number output of
of WAGONS,
the
andhydraulic
number of pressure in barsof
cyclic reruns within the range
the train’s path.0–200
The bar, the system
control numbermustof WAGONS,
allow systemand number of
calibration
cyclic reruns of the train’s path. The control system must allow system calibration (dependence
(dependence of the output hydraulic pressure in units of [bar] at the user's desired hydraulic pressure of the
output
in [ADU] hydraulic pressure
units (ADU unit =inAnalog
units ofDigital
[bar] at the user’s
Unit)). It must desired
ensurehydraulic pressure
the generation in [ADU]
of system andunits
error
(ADU unit
messages. = Analog Digital Unit)). It must ensure the generation of system and error messages.
N No.2
WAGO Count 2
re 2, Pr WA
Pressu 0,T1 es GO
su
T re N N
3 o
T0 , Co .3
,T1 un
t3
t1
,T o 1
T0 1, C No.
1 un
re N
su O
es AG
TIME of
Pr W
Pre
PULSATION
WA re 4, C
ssu T0,T1
GO
N N unt 4
Th
co e ac
o.4
o
un
t, p tual
r e s s ta
su tus
tim re, of
e o tim hyd
f p e o rau
au f p l
se uls ic pu
(T1 e (
) T0 lse :
)a
nd
Figure1.1.Pneumatic–hydraulic
Figure Pneumatic–hydraulicpulse
pulsetrain-schematic
train-schematic represents
represents of cyclic
of cyclic repeating
repeating sequence
sequence pulses
pulses for
for hydraulic
hydraulic pulse
pulse system
system as cyclic
as cyclic paths
paths of train
of train withwith
fourfour wagons,
wagons, eacheach
withwith
four four passengers.
passengers.
3.
3. Hardware
Hardware Solution
Solution
Hydraulic tank
SWITCH :
AUTO-0-MANUAL
Hydraulic pressure
BUTTON : START Air presence sensor EMERGENCY indicator (meter) WIKA
BUTTON : EMERGENCY
Hydraulic pressure
POTENTIOMETER : sensor ATE PS 60
air pressure in manual control
mode Linear displacement
sensor
Opto relay
Hydr.press.sensor(0..5V)
Q0, DIGITAL OUTPUT:
Optorelay pneumatic
pneumatic valve
DIST_ERR
ERROR
LIQ_ERR
AIR_ERR
pump
PHOENIX Nanoline USB
PHOENIX Nanoline base unit controller, PHOENIX Nanoline I/O PHOENIX Nanoline RS- communication module,
24 V DC input power, 6 digital inputs,4 expansion module, 2 analog 232 communication
NPN transistor outputs inputs, 2 analog outputs, module, PHOENIX Nanoline
Ethernet module
USB communication
communication
protocol server
programming or
communication
over MODBUS
over internet
over MODBUS
Customer
protocol
protocol
RS232
CAN communication
with proprietary protocol
PHOENIX Nanoline operator panel
LCD display and keypad CAN bus OLIMEX, uController
module Atmel AVR-
CAN )
USB bus
ETHERNET
Figure 3. The photo of the functional prototype of the pneumatic–hydraulic pulse system.
Figure 3. The photo of the functional prototype of the pneumatic–hydraulic pulse system.
3.4. Electrical
3.4. Electrical Parts
Parts of
of System
System
Electrical parts
Electrical parts of
of system
system consist
consist aa 24
24 VVpower
powersupply,
supply, aa safety
safetyrelay,
relay, electrical
electrical and
and optical
optical relays,
relays,
switches, terminals and wires as is seen in Figures 2 and
switches, terminals and wires as is seen in Figures 2 and 3. 3.
Designs 2018, 2, 48 5 of 10
4. Software Solution
24 V logic at input) or by internal programming flag with boolean data type (it can be set by another
PLC program thread). Each PLC program thread can be programmed with ladder diagram or graphic
functional block diagram programming approach and the PLC programmer may not to know about
the concurrent program techniques or about the use of special concurrent program library for PLC.
Table 1. List of programmable logic controller (PLC) hardware inputs and outputs and their responsible
processing layer.
Name of Signal Signal is Processed in the
n. Description of Physical Signal
Hardware Signal Direction/Digital/Analog Independent Thread
1 ERROR I0-input Physical layer 4_ERROR From safety relay
2 MANUAL I1-input Physical layer 1_MANUAL User input, manual control
3 AUTO I2-input Physical layer 2_AUTO User input, pulse gen.
4 PULSE I3-input Physical layer 3_PULSE User input, start of pulsing
5 RESET I4-input Physical layer 5_RESET User input, stop of pulsing
Application layer
6 AIR_ERROR I5-input From pressure air tank switch
4_State_Func
Application layer
7 LIQUID_ERROR I6-input From hydraulic tank switch
4_State_Func
Application layer
8 DISTANCE_ERROR I7-input From distance contact switch
4_State_Func
Application layer
9 PNEU_PUMP Q0-output 1_State_Func and For pneumatic pump control
3_State_Func
Application layer
10 PULSE_RELAY Q1-output For pulse control generation
3_State_Func
11 HYDR_PRES_SENSOR AI0-input All application layers From hydraulic pressure sensor
Application layer
12 MANUAL_PRES_SET AI1-input From user man. potentiometer
1_State_Func
Application layer
13 PNEUMATIC_VALVE AU0-output 1_State_Func and For proportional valve control
3_State_Func
we obtained a linear relationship, which leads to the linear Equation (1) derived by regression analysis
from the graph of the measured values:
PW IKA [bar ] = AATE PS60 × PATE PS60 [ ADU ] + BATE PS60 (1)
By the calibration-determined value of the constant AATE PS60 for pressure sensor ATE PS60 is
0.1021 [bar/ADU] and the value of the constant BATE PS60 is equal to 4.8074 [bar] (Figure 5).
Designs 2018, 2, x 8 of 11
Figure4.4.Master
Figure Mastercontrol
control state
state diagram
diagram for hydraulic
for hydraulic pulsepulse
systemsystem consists
consists of 7 separate
of 7 separate threads
threads running
running in the application layer, each thread represents the individual state of pneumatic–hydraulic
in the application layer, each thread represents the individual state of pneumatic–hydraulic pulsing
pulsingand
system system and is described
is described in Table 3.in Table 3.
The secondofdependence
4.5. Description is the static
the Master Control State transfer
Machine function of the entire pneumatic–hydraulic system.
This is the curve which represents output hydraulic pressure (in bar unit, measured by WIKA
The main control state machine (Figure 4) for hydraulic pulse system consists of 7 separate
equipment [12]) at the values of the input control voltage for proportional pneumatic valve (measured
threads running in the application layer, each thread represents the individual state of pneumatic–
in ADU units via PLC A/D extension module). Measurement leads to the next linear equation:
hydraulic pulsing system and is described in Table 3. Transitions between states in the application
layer is controlled by PWthe IKA
program
[bar ]flags and they
= ASYS are isolated from
× PSetInputValve the ]hardware
[ ADU + BSYS inputs signals (Table (2)
1) processed by the physical layer (Table 2). This solution allows for the reliable function of high-
pressure
where thehydraulic
value of pulse system,Awith
the constant SYS isreliable answers to and
0.053 [bar/ADU] user the
inputs or of
value to the
the constant
error status.
BSYSWe
is
observed
0.0626 the(Figure
[bar] reliable
6).automatically generated(1)
Both linear Equations ends
andof(2)each hydraulic
provide train
of four pulsation
calibration cycle. which
constants,
user can enter in to the control system (in the thread 6_State_Func). Then, after the static calibration of
4.7. Auxiliary
pneumatic Functions
hydraulic pulse system, the user input entered value are in bar units obtained at the output
of pneumatic–hydraulic system,
The control of pulses as is required
sequences in both
according states—MANUAL
to saved parameters inand
thePULSE STATE.
hydraulic pulse train
ensures thread 7_State_Func in the 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 the hydraulic pulse train and is called from AUTO STATE (2_State_Func).
150
[bar]
WIKA [bar]
100
PP WIKA
y = 0.1021x + 4.8074
50 R² = 1
0
0 200 400 600 800 1000 1200 1400 1600 1800
P ATE PS60 [ADU]
Figure 5.5.Measured
Figure Measuredpressure
pressure system
system transfer
transfer curve
curve for pressure
for pressure sensorsensor ATEdependence
ATE PS60, PS60, dependence
between
between sensor
pressure pressure sensor
ATE PS60ATE PS60
output output
voltage in voltage in ADU
ADU (Analog (Analog
Digital Digital
Unit) units Unit) units and
and pressure in pressure
bar from
in bar from
portable portable measurement
measurement device WIKA device
CPH WIKA CPH
6200 (see 6200 (see
Equation Equation (1)).
(1)).
250
200
[bar]
WIKA [bar]
150
PP WIKA
100
50
y = 0.053x - 0.0626
0
0 500 1000 1500 2000 2500 3000 3500 4000 4500
P SetInputValve [ADU]
Figure 6. Measured
Figure 6. Measuredtransfer
transfercurve
curvebetween
between output
output of pneumatic–hydraulic
of pneumatic–hydraulic system
system pressure
pressure in barinunits
bar
units and control voltage for proportional pneumatic valve as input of system in ADU units (see
and control voltage for proportional pneumatic valve as input of system in ADU units (see Equation (2)).
Equation (2)).
5. Discussion
The pneumatic–hydraulic system developed by us is 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 the education of young technicians. All necessary software solutions
(running at “nanoNavigator” IDE (Integrated Development Environment) from Phoenix Contact [13])
are provided by authors for study purposes as Supplementary Materials (Source code S1). Mutually
communicating threads can be studied in the software simulator provided by nanoNavigator IDE and
is not necessary to study or program with buy any PLC hardware.
6. Conclusions
We developed an embedded control for pneumatic–hydraulic system which produces a series of
high-pressure hydraulic pulses (up 200 bar). The pneumatic–hydraulic system can be calibrated, it is
networked in industrial networks (MODBUS over TCP/P and CAN bus) and generates accurately
hydraulic pulses (time and pressures characteristics). The system proved to be reliable. This hydraulic
impulse unit is a part of a test machine and it can be used in the industry for hydraulic parts dynamic
testing by series of pulses with maximal frequency pulses 2 Hz. From the point of view of software
Designs 2018, 2, 48 10 of 10
architecture, the embedded control system is based on a low-cost PLC architecture and control program
is a set of parallel program threads. Each programming thread can be identified as one state in a master
control state diagram. The PLC multi-thread program is not designed as one large and opaque linear
program, but rather as a group of mutually communicating PLCs programs, which ultimately forms
one master control state diagram. The cost of the described industrial networked control system with
industry standard optoelectronic insulated interfaces and certified industrial safety relay does not
exceed €1000 Euros.
References
1. Lamb, F. PLC Hardware and Programming Multi-Platform; AuthorHouse: New York, NY, USA, 2016;
ISBN 13 978-1524648183.
2. Collins, K. PLC Programming for Industrial Automation; Exposure Publishing: New York, NY, USA, 2007;
ISBN 13 978-1846854965.
3. Harel, D.; Lachover, H.; Naamad, A.; Pnueli, A.; Politi, M.; Sherman, R.; Shtull-Trauring, A.; Trakhtenbrot, M.
STATEMATE: A working environment for the development of complex reactive systems. In Proceedings of
the 11th International Conference on Software Engineering, Singapore, 11–15 April 1988.
4. Harel, D. A Visual Formalism for Complex Systems. 1987. Available online: https://www.fceia.unr.edu.ar/
asist/harel01.pdf (accessed on 19 November 2018).
5. Merritt, H.E. Hydraulic Control Systems; John Wileys & Sons: Cincinnati, OH, USA, 1967.
6. Phoenix Contact. Nanoline Base Units. Available online: https://www.phoenixcontact.com/online/
portal/us/?uri=pxc-oc-itemdetail:pid=2700464&library=usen&pcck=P&tab=1&selectedCategory=ALL
(accessed on 19 November 2018).
7. Safety Relays-PSR-SCP-24UC/ESAM4/3X1/1X2/B-2900509. Available online: https://www.
phoenixcontact.com/online/portal/us?uri=pxc-oc-itemdetail:pid=2900509&library=usen&pdfmode=
direct&pdflanguage=en (accessed on 19 November 2018).
8. Communication Module-NLC-COM-ENET-MB1-2701124. Available online: https://www.phoenixcontact.
com/online/portal/us?uri=pxc-oc-itemdetail:pid=2701124&library=usen&pcck=P-21-03-03-01&tab=1
(accessed on 19 November 2018).
9. OLIMEX. AVR-CAN Development Board Based on AT90CAN128. Available online: https://www.olimex.
com/Products/AVR/Development/AVR-CAN/ (accessed on 19 November 2018).
10. John, K.-H.; Tiegelkamp, M. IEC 61131-3: Programming Industrial Automation Systems: Concepts
and Programming Languages, Requirements for Programming Systems, Decision-Making Aids;
Springer: Berlin/Heidelberg, Germany, 2010; ISBN 978-3-642-12015-2.
11. Lewis, R.W. Programming Industrial Control Systems Using IEC 1131-3; The Institution of Electrical Engineers:
New York, NY, USA, 1998; ISBN 0852969503.
12. Wika Instruments. Hand-Held Pressure Indicator Model CPH 6200. Available online: http://www.wika.us/
upload/DS_HPCPH6200___CPH6200_S2_en_us_17152.pdf (accessed on 19 November 2018).
13. Phoenix Contact. Software-NLC-NAV-01–2701221. Available online: https://www.phoenixcontact.com/online/
portal/us?uri=pxc-oc-itemdetail:pid=2701221&library=usen&tab=1 (accessed on 19 November 2018).
© 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access
article distributed under the terms and conditions of the Creative Commons Attribution
(CC BY) license (http://creativecommons.org/licenses/by/4.0/).