REMOTE CONTROL OF NONLINEAR MOTION FOR MECHATRONIC MACHINE BY MEANS OF CoDeSys COMPATIBLE INDUSTRIAL CONTROLLER

Original scientific paper The given article describes the hardware-software complex aimed to teach students how to control the mechatronic mechanisms remotely by means of standard industrial automation. The purpose of this paper is to consider the following problems: the curved trajectory movement algorithm control, the corresponding software development for the industrial controllers using CoDeSys environment, CoDeSys software package usage for the development of interactive HTML-applications with WEB-interface.


Introduction
The idea of the technological emulator usage is not a new one.The theoretical background of emulators as separate devices was developed simultaneously with the theory of designing the regulators and separate chains of correction for the signal lines of automated control systems.The theory of lining and non-lining automated system modelling [1] was being developed from 1950 to 1960.At the same time the level of technology caused the concentration of scientific efforts on the development of electronic analogue models [2].This research could be performed only at the local level.
The advantages of modern digital devices are: compactness, high computing power and the large amount of address memory.These features determine design of the model based on programmed digital systems.Recent researches on this subject develop the theory of the utilization of personal computers (PC) and programmed microprocessor systems [3][4][5].However the system is modelled as a whole and there is no separate part of the model for neither control system nor the controlled object.The "human-computer" interaction is accomplished by the input of discrete signals, LED and semi-segment indicator units.The complexity of programming and the lack of human-computer interface significantly limit the application of such systems in industry and education.The development of PC based control systems was focused on their usage as a source of program models.The large amounts of an internal memory in modern computers allow the simulation of complex industrial objects [6][7][8][9].It is worth mentioning that there is high diversity of the emulators and mounted control systems.
Further development of the PC based training systems is reflected in the design of multifunctional interactive virtual visual models.The visual interactive images are developed mostly to provide visual effects when training the skills of setting and fixing the aggregates and nodes [10][11][12].The great advantage of these systems is their visual performance, as well as the separation of control and object part of the system by some functional units.The drawback of these systems is the lack of possibility to check how the algorithms are functioning with real object signals.The signal exchange is done in the virtual environment between the virtual model of the object and the virtual model of the control system.
The training complex hybrid modelling network systems [13,14] based on computer networks, physical models and real devices have been developed recently.These systems are aimed to support the remote learning.The systems have either digital or physical control models and the regulators act as the real devices and digital models.The Internet access allows to train the control skills remotely by learning the principles of control in combination of real and digital control devices with the physical and digital models.The authors of the article highlight the importance of this direction of development by including the devices and software for the real industrial control systems in the learning systems.It gives the opportunity for the students to learn the advanced experience in the field of automated control.The article considers the possibility to use the package CoDeSys, software produced by 3S Software Inc. CoDeSys compatible industrial programmed logical controller OWEN is recommended to be used as hardware.The features of remote control of CoDeSys system can be used for remote learning.

The task of a point movement with the given linear (ground) velocity in the curved trajectory
The movement of a point in the curved trajectory can be represented as the vector sum of little linear movements.But in this case the linear velocity value V(t) and movement direction (the angle) θ change.
The functional dependencies presented in parameter form have been recently used to set the trajectory point vector sum.They are also used to describe the smoothed curves (splines).The means of such curves setting have to be comfortable in terms of interaction.The function parameters set by the developer have to visualize the shape of a future curve.
Pierre Bezier suggested the method of creation of curves and surfaces of any form.His result is equivalent to Bernstain basis or polynomial approximation function.
The cubic spline (polynomial) of Bezier possesses the greatest visual features.It can be presented by only two segments.((X0, Y0), (X1, Y1)) and ((X2, Y2), (X3, Y3)).The parameter of presented Bezier third-order curve equations will get the form of: The segments initial points (X0, Y0) and (X2, Y2) and the segments directions set the spline initial points and its direction.The segment length determines the "pulling" degree of the areas near the intermediate points (X1, Y1) and (X3, Y3).

If a function is presented by means of functional dependency, the idea of control is limited by the cyclic calculation of the point coordinates and substitution of the intermediate parameter in the function of a new value (param = param + Δparam).
In case of a need to maintain the linear velocity Vact at the moment the algorithm adapted to solve this task looks like: specification of the coordinates of starting point, two intermediate points and the final point Х0, Y0, Х1, Y1, Х2, Y2, Х3, Y3; reading out the desired value of current linear velocity Vact from the memory; calculation of the parameter growth value Δparam; having the same cycle duration it is possible to calculate Δparam using the formula: where dX/d param and dY/d param are the derivatives, which are obtained by differentiation of parametric equations with respect to the parameter param.
calculation of the next value of coordinates of a moving point by means of substitution of the value param = param + Δparam in polynomial; repetition of the actions until the parameter value param is less than one.Note 1: The usage of parameter formulas for the curved trajectories allows to avoid the trajectory deviation caused by the accumulations in case of calculation by means of differential formulas of the type X = X + (dX/dt) • Δt.
Note 2: The moving point reaches the end of the trajectory being controlled by the equation to the parameter unit of the curve parametric form specification.
Note 3: By specifying the needed linear velocity Vact for every cycle and creating the common curve of movement combination of separate splines it is possible to get the coordinate control of the mechatronic mechanism movement on random trajectory and random changes of linear (ground) velocity.In order to work in CoDeSys environment this system has to be installed on a developer's PC.Since the CoDeSys installation is performed, it is important to install Target-files.The information about the resources of programmed controllers for CoDeSys is in Target-files and it is provided by the manufacturer.Target-files installation is done by means of InstallTarge utility, which is installed with the programming environment.
The CoDeSys compatible controllers produced by the OWEN company are used as the basic controllers, for example, PLC-1хх.The following software components are developed: "PLC_PRG" is the main component of the project, which is the source for other functional components of POU.The POU is exactly specified as a cyclic task in Task configuration.Task configuration is a hardware setting of the environment of the program performance, i.e. the controller.It also allows setting the program in a cyclic mode strictly following the duration of the specified cycle.
"moving" is an application that directly performs the coordinate changing in order to get the movement of 2 coordinates (developed in SFC language)."lowering_drive" is a component of calculation of extra lowering-raising motion of the position of the tool above the reference point.
"trends" is a component for the cyclic calculation of axial components and general value of the linear velocity of motion in order to represent them in the form of charts on the visualization components.
"offset_on_change" is a component used for cyclic changing of motion parameters in accordance with operator instructions by means of the components on the visualization forms.
"point_selection" is a component of the output of all the motion parameter settings in accordance with the selected number of the segment on the visualization form.
"velocity_settings" is a component of calculation in accordance with the operator instructions and the output of the interpolation chart of the curve of the linear velocity changing as the point is moving in the curved trajectory.
The "visualization components" are created to achieve the interaction with the operator: "PLC_VISU" is the main visualization, which is downloaded at the application launch.It shows the image of an industrial object, namely the two-coordinate machine with feed drives.The purpose is to show the result of control actions on the industrial object.points and the directing segments of the curved trajectory "PLC_VISU_CONTROL" is the visualization of form for the motion parameter setting, the coordinates of the trajectory bearing points and the curved trajectory part parameters.The form also contains the counter for the distance covered and the counter for the cycles, performed by the controller.
"PLC_VISU_PANEL" is the main panel of Master Layout view.This panel is shown on all visualization screens and functions as the main menu.
"PLC_VISU_POINTS" is a top view of the bearing and moving points (extra view).
"PLC_VISU_trends" is the chart visualization of the coordinate changes in time, axial components of the linear velocity and general linear velocity.
"PLC_VISU_VELOCITY" is the visualization of components for the setting of parameter of changing the linear velocity when traversing the specified trajectory.
"PLC_VISU_VELOCITY_SET" is an extra view of the linear velocity element specification.Some of the control elements are showed in the figures below.The temperature forecast can be used to correct the values of linear velocity on the segment of curved trajectory, which is related to the instrument working cycle.The developed application is downloaded to the controller by means of CoDeSys software environment.The main focus is the concrete hardware platform for the application.The signal is received by the interface elements and transmitted further.It is important to note that the usage of the definite control actuating hardware drive is not provided.But the download of application has to be performed into the real industrial logical programmed controller ILC.The ILC-150 produced by the OWEN company has plenty of memory storage and both analog and digital interface of the industrial ModBus.That is the reason why this controller was chosen.The ILC-150 interfaces can transmit the control signals to the hardware driver of coordinate engines in the situations of real practical application.
CoDeSys has the tools to set the output variables of the application to the physical interfaces.It is done by means of PLC Configuration.

The interactive WEB visualization
The CoDeSys environment gives the possibility to set the created visual HMI forms to represent them as the WEB resource of html page.
CoDeSys generates XML description from the visualization data.This description is downloaded with java-applet into the controller.The Web-server processes data in the controller and creates constantly updating visualization in XML format.This visualization is presented by TCP/IP in Web-browser.So, despite the computer platform, the visualization data will be interactively showed in order to perform the remote control.The target system has to support the given functionality.The system settings should include the "Web-Visualization" activated option.
Web-server has to be started.The configuration settings are added in the file webserver_conf.xml in the same catalog as webserver.exe.They are: WEB-server port, port and IP address of ILC and the link to the catalog with visualization data.
Due to the simplicity of ILC-150 there is no WEB server for it.
Starting Web server on a PC can cause some problems while using Proxi-server in local network.This problem can be solved by using the pair of target systems: the standard system of CoDeSys SP PLCWinNT V2.4 performance and ILV-150 controller.The connection is established by the specific element of CoDeSys Network Variables, which is compatible with two platforms.The router is used as a solution.Although the Web server is connected to the port of a local PC IP, there is a possibility to redirect the packages, which come to the reserved external IP, to the local IP and port.To avoid the problems connected with firewall, it is recommended to create the rules for the net exchange of Web server application via the linked port in it.

Conclusions and discussions
As a result, the software-hardware system for teaching the basics of mechatronic mechanism remote control by means of the standard industrial automation is developed.
The Internet access gives the possibility to train the control skills remotely by learning the principles of real devices and digital model control.Such system corresponds to the requirements of training process and can be applied to the industrial conditions to set the systems of automated control of the cyclic movement of the mechatronic device on the curved trajectory.
The practical training of students implies the system structure study.The training includes local or remote learning of system structure applying a WEB browser in the interactive mode, activating some elements, analyzing the control application functioning, checking the possibilities of the system and using the system for the specific tasks.All features mentioned above will improve both knowledge and practical skills of engineers in application of the modern control systems to solve the tasks of mechatronics.

Figure 1
Figure 1The movement of a point in the curved trajectory

Figure 2
Figure 2 Bezier curve presentation by means of directing segments

3
The development of control applications in environment CoDeSys V2.3 CoDeSys is a modern tool used to develop the software for the controllers (CoDeSys -Controllers Development System) in programming languages of IEC 61131-3 standard.-(IL) Instruction List (text based IEC language) -(ST) Structured Text (text based IEC language) -(SFC) Sequential Function Chart -(FBD) Function Block Diagram -(CFC) Continuous Function Chart -(LD) Ladder Diagram CoDeSys is unique due to its ability to create the interactive visualization unit.SFC and ST languages are used while designing the training application of curve trajectory movement control.The element of CoDeSys HMI Visualization from the package CoDeSys V2.3 is used to create the interactive visualization.The elements of CoDeSys WEB Visualization and CoDeSys WEB Server are used to create interactive visualization.

Figure 3
Initial -а) and final -b) the part of the application of motion in spline control

Figure 4 Figure 5
Figure 4The hardware visualization of the expected control object

Figure 6 Figure 7 Figure 8 Figure 9 Figure 10 Figure 11 Figure 12 Figure 13 Figure 14
Figure 6 The interactive form for specification of the coordinate of the bearing points on every segment of the curved trajectory and the specification of the beginning (extra lowering) and finishing (rasing) of the working cycle of the instrument

Figure 15 Figure 16 Figure 17
Figure 15The element of the chart visualization of changing the coordinates of the instrument when moving in the curved trajectory

Figure 18 Figure 19
Figure 18The hardware platform of the industrial ILC-150

Figure 20 Figure 21
Figure 20 CoDeSys structure of Web visualization

Figure 22
Figure 22The laboratory stand for the Internet remote control of the controller