Simulator of Dynamical Systems and PID Control based on Java Language

In this paper, a Java-based simulator of dynamical systems and PID control is presented. This simulator implements linear low-order process models, open-loop architecture and closed-loop architecture with a PID linear feedback controller. The main contribution is a Java application that can be used by the instructor / user in a blended learning environment to teach / learn the basic notions of dynamical systems behavior, some notions of systems stability, perform time domain analysis and frequency domain analysis, and also analyze the effect of PID control in the closed-loop system.


INTRODUCTION
Dynamical systems modeling and control are main topics of automatic control.Automatic control is a major field in almost every engineering subject and is an important module of the respective engineering curricula [1,9,10].In the last years, high schools developed great efforts to make available new virtual and real laboratories for the students, and also some remote laboratories, in order to facilitate the teaching / learning process [1,2,3,4,5,6,7].In engineering education activities, the role of experimentation is a very important key concept.Experimentation in a physical laboratory is very expensive mainly due to the need of a number of similar equipment's, and also is very costly to operate and maintain.Simulators and remote laboratories present a solution to some of these problems and are typically available most of the time [7].Computer simulation plays an important role in the teaching / learning engineering process, mainly because is one of the few ways to deal with linear processes.In general, hardware setups are nonlinear systems.
This paper focuses on simulation of dynamical systems and control using a Java-based simulator developed in our laboratory, named JAVA_SIST.At the moment, version 2.6 is available, running as a stand-alone Java application.More details about the simulator can be found in the references [11,16].

II. SIMULATION PLATFORM
The Java application was implemented using JAVA SE Runtime Environment 7. JAVA allows a simple way to interact with the user by means of an intuitive interface, running on all the most popular operating systems [8,12].
There exist a lot of simulators Java-based on the web mainly in the fields of mechanics and physics, some based on Java applets and few based on Java stand-alone applications.The simulator implements models of the dynamical systems described in Fig. 1.The software can simulate PID control of dynamical systems of first-order, second-order or third-order; the respective transfer functions are the following, see equations ( 1), ( 2) and ( 3).In this project, one novelty is a stand-alone Java application able to be used in a blended learning approach, as described in Fig. 2, for teaching/learning automatic control, [2,11,14].
The coefficients of the transfer functions used are: For implementation the transfer functions were discretized with a sampling period of !"#$%&$ using the ZOH discretization method.
At the present stage of development, the main functionalities of JAVA_SIST application are the following, depicted in Fig. 3: a) open-loop and closedloop simulation of low order (first, second and third order) systems; b) time domain analysis (impulse response and step response); c) frequency domain analysis (frequency response for a sinusoidal input signal); d) controller testing (P, PI, PID with and without anti-windup mechanism); e) noise addition to reference signal, control input and/or plant output; f) Fast Fourier Transform (FFT) computation for reference signal, control input and/or plant output, [15].These application features permit the support of an introductory course on Systems and Control Theory at high schools.
2 nd order 1 st order 1 st order In the software, a discretized version of the PID controller was implemented, using an anti-windup mechanism with parameter Tt and a derivative parameter N; more details can be found in the book [13].A simplified version of the pseudo-code of the discretized PI controller is presented in the next lines:

III. EXPERIMENTAL RESULTS
Some simulation results, obtained with the proposed Java_SIST 2.6 simulator, are described in this section.In Fig. 4, the second order model defined in (2) was first selected and tested in closed-loop architecture.A set-point (reference) signal of 40% was chosen.The static error tends to zero, as expected accordingly to the specification of unitary static gain for the closed-loop.The notions of open-loop and closed-loop stability and instability can also be study using the simulator.Fig. 5 shows the impulse response of the 2nd order system.
In order to do a frequency response analysis of the first order system a sinusoidal input signal (with amplitude A, frequency f and DC value d given by 10, 10 Hz and 20) was generated and the fast Fourier Transform (FFT) was applied to it, as shown in Fig. 6.The equation of the input signal is the following: u(t) = A * sin(2 * pi * f * t) + d.
Finally, Fig. 7 depicts the response of the first order signal to an input command signal with DC value of 50% and with white noise.This kind of experiment can be used for system identification purposes.

IV. CONCLUSIONS
The application JAVA_SIST for linear control systems simulation was presented in this paper.The simulator presents a solution to the problem of allowing students to share expensive laboratory experiments in the systems and control field, in an efficient way.At the moment, the simulator can only deal with low-order linear models (first, second an third orders).Impulse response of the 2 nd order system.
SHORT PAPER SIMULATOR OF DYNAMICAL SYSTEMS AND PID CONTROL BASED ON JAVA LANGUAGE Open-loop control and closed-loop control architectures can be simulated.Time domain analysis and frequency domain analysis can be done.Noise and FFT transform can be applied to the signals.
The future work will be oriented to evaluate the pedagogical impact and to improve some functionalities, such as: a) addition of perturbations; b) allow changing the sampling period; c) implementation of algorithms for control loop performance analysis (CLPA) based on the Harris index; d) enable remote monitoring and control using the TCP/IP protocol and web services.