E-Learning in Mechatronic Systems Supported by Virtual Experimentation

Due to its origin, Mechatronics, consisting of symbiosis of Mechanical Engineering and Electrical Engineering, presents a complex science. Synergistic effects in mechatronic systems and mutual interactions among subsystems of various nature cause considerable difficulties at their teaching and learning. There are plenty of mechatronic systems of various kind, size and complexity which the specialist has to deal at their design with – starting from miniature ones up to large industrial mechatronic systems presented e.g. by continuous production lines.


Introduction
Due to its origin, Mechatronics, consisting of symbiosis of Mechanical Engineering and Electrical Engineering, presents a complex science.Synergistic effects in mechatronic systems and mutual interactions among subsystems of various nature cause considerable difficulties at their teaching and learning.There are plenty of mechatronic systems of various kind, size and complexity which the specialist has to deal at their design withstarting from miniature ones up to large industrial mechatronic systems presented e.g. by continuous production lines.
In every system, regardless its nature, we are interesting in its performance and behaviorwhether it is linear or non-linear, oscillating or non-oscillating, which are its time constants, time response, frequency response, placement of system poles and zeros in the plane, how to control the system, which control method to apply, and finally, how to realize control algorithm and its debugging.When designing control algorithms for a complex mechatronic system, students should know and verify behavior of individual subsystems, i.e. they should possess satisfactory knowledge from mechanical, electrical and control engineering.
Like in other fields, also in mechatronic engineering education, the concepts taught through lectures should be completed by practical laboratory experimentation (Cheng & Chiu, 2010).
Here the students observe phenomena that are rather difficult to explain by written material.The students are interested in experiments with real models.During experimentation they get practical experience, skills and also a self-confidence that are necessary to solve real problems.But experimentation on real industrial systems usually is out of question.A lot of effort was made in searching new methods -how to create enough space for students' better acknowledgement with the systems and how to train them for practical problems solutions.One way how to fully substitute a physical system consists in system dynamics emulation, as shown in (Potkonjak et al., 2010), but this method requires an ample equipment.Another way consists in sharing expensive equipment by more institutions and creating distance experiments.Well elaborated description of distance experimentation in power electronics is shown in (Bauer, 2008, 1) or a more general approach to a set of distance experiments in several fields of electrical engineering is presented in (Bauer, 2008, 2).Although such distance laboratory satisfies needs for training of students, its development is enough time-consuming and labor-intensive.It requires special equipment connected to internet, good organization of booking system, maintenance of the server, and usually, after several years with changing the staff, the distance laboratory interrupts its activity.
These are reasons why in the first step very often we confide in the simulation resources where the mathematical model in form of differential equations is applied to calculate dynamics and by simulation provides the data that would otherwise be measured on a real system.This approach is rather sophisticated, knowledge demanding, and also time consuming.It requires analytical approach -a good knowledge of the system to be analyzed, mathematical background, and skills programming the simulation model, solving the equations, and finally -visualization of results.
A way to save time and burden at maintenance consists in development of virtual models.They can create an intermediate stage prior accessing students to experimentation on laboratory models, without any special knowledge about their background, mathematical and simulation model development.Numerous projects are running there that are focused to development of virtual models and laboratories and many examples are available nowadays.A general approach to virtual laboratories is described by (Babich & Mavrommatis, 2004) and specially, to virtual laboratory in mechatronics by (Cheng & Chiu, 2010;Pipan et al, 2008).Most effort was done for robotics (Bianchi, 1999;Potkonjak, 2010;Faculty of Electrical Engineering in Belgrade, n.d.) but also many others could be mentioned.In the electrical and control engineering some successful solutions are known, e.g.(Saadat;Petropol-Serb, 2007, Educational Matlab GUIs).Such virtual models are undamageable and their screen can be designed so that they look like apparatus.They can also serve for staff training in system control.The virtual models are accessible via internet and thus, the student can utilize all the features of e-learning -self study, regardless the place and time.
To be effective in design of virtual models there is need for a simple development process of the virtual purpose-oriented model that can run online, directly on the student's computer, and gives enough graphical and numerical information the student requires.The requirements in our case are met by developed virtual models that are based on Graphic User Interface (GUI) MATALB.This is a powerful data-processing tool allowing simulation of dynamic systems in a simple way having user friendly graphic environment.
The organization of the contribution is as follows: after general description of design methodology for virtual models in GUI MATLAB (chapter 2) in the third chapter we describe development of several typical models of simple mechatronic subsystems starting from kinematic diagram, showing briefly their mathematical and simulation models.Emphasis is put on development of the virtual model itself and description of its features.Finally in the fourth chapter we share some experiences from training of students by virtual models and in conclusion we present ideas for our future work.

Procedure at designing GUI MATLAB
The developed virtual models are based on GUI MATLAB.Their development starts from a kinematic scheme of the system and its description by mathematical equations.Manipulating them the mathematical and simulation model are derived.Its dynamics is verified by simulation in Simulink.The GUI MATLAB itself is developed in Graphic User Development Environment (GUIDE), which practically presents a graphic editor.GUIDE contains a set of tools (objects) for user environment design.The development procedure is depicted in Fig. 1.Fig. 1.Procedure of activities in development of virtual model (here based on example of the 2 nd order dynamical system) The editor enables the user to interact directly with elements presented on the screen.These elements (called objects) replace the keyed entry of commands and menus.Users typically select screen objects and actions by using a mouse.The objects navigate the screen and execute commands by using menu bars, buttons, sliders, pull-down menus and editing windows that enable to input characters (incl.numbers).MATLAB automatically generates a relative M-file (GUI.m)containing callbacks interconnected with the objects in the adjoining file GUI.fig.The program written into the callbacks is realized immediately after the object activation (by pressing a button, shifting a slider, inserting a value into editing window, etc.).In the background of GUI a function (Function.m in Fig. 1) collects variable parameters from the GUI screen and sends them into the system model that is built-up in the Simulink environment (Model.mdl).The obtained time response is displayed on a graph placed in a frame on the GUI screen.Similarly, using suitable MATLAB commands it is possible to obtain frequency characteristics, system poles placement and many other features that can be programmed in MATLAB.

Principles of Imaging and Ergonomics of the Virtual Model GUI Control Screen
The GUI providing human-computer interaction is one of the most important parts in the functional virtual model.To make learning easier, the learner should interact with the computer easy, intuitively, without any learning a complex control of the virtual model and he should get required information in a transparent, well-arranged form.
The GUI for a virtual model has two components:


Input, where the user inputs system parameters, chooses mode of calculation and displays the figures (pictures like kinematic scheme, sketch/photo of device/ mechanism etc., block diagram, mathematical model -equations, etc.) and chooses number and form of required outputs -alphanumerical values and/or graphs.They are usually controlled by buttons/radio buttons, sliders, and alphanumerical editing windows.


Output, where the information is displayed in usable form: in the graphic one (in our case time responses, frequency responses, zero-pole map but also figures as mentioned above) or in an alphanumeric form (values of transfer function coefficients, values of system poles and system zeros, tables, etc.).
To develop a suitable GUI screen for the mechatronic system virtual model, whose visual appearance could be enough complex, the designer must understand principles of good interface and screen design.Generally, the rules are described in (Galitz, 2007).Based on the general rules we adapt and extend them for design of virtual model GUI MATLAB screen.Some rules can be kept intuitively but for proper design, the designer should know all features and possibilities.The most important principles, when designing the placement objects on GUI screen, are:  Legibility -information should be noticeable and distinguishable. Readability -information is identifiable and interpretable.


Coloring display features -in order to attract and call attention to different screen elements.


Guiding the eye by placement and grouping command objects by visual lines.
Further the designer should deal with the user considerations, as follows:  Visually pleasing (user friendly) composition of the screen. Organizing screen elements. Screen navigation and flow.


Choice of implicitly pre-setting the system parameters and their range (so that virtual models can be generally used in large ranges of parameter changes). Changing the system parameters by sliders, inputting numerical values into text editing windows.
Finally, the designer has to maintain a top-to-bottom, left-to-right flow through the screen.
Visually pleasing composition of objects on the screen should keep the following qualities (where it is advantageous and meaningful):  Balance -the design elements have an equal weight, left to right, top to bottom.Balance is most often informal or asymmetrical, with elements of different colors, sizes and shapes being positioned to strike the proper relationships.
 Symmetry -duplication across horizontal or vertical axes occurs.


Regularity -uniformity of elements based on some principle or plan which is achieved by establishing standard and consistently spaced columns and rows starting points for screen elements, but it is also achieved by using elements similar in size, shape, color, and spacing.The opposite of regularity, irregularity, exists, when no such plan or principle is apparent.A critical element on a screen will stand out better, however, if it is not regularized.


Sequentiality is a plan of presentation to guide the eye through the screen in a logical order, with the most important information significantly placed.It can be achieved by alignment, spacing, and grouping. Unity and uniformity -using similar sizes, shapes, or colors for related information. Proportion of the graphs (time responses, frequency characteristics, zero-pole placement in the plane) using the following ration of sides: square (1:1), square root of two (1:1,414), golden rectangle (1:1,618), square root of three (1:1,732), double square (1:2).


Simplicity consists in combination of elements that result in ease of comprehending and well-arranged objects (inputs, outputs, control) on the screen.


Alignment -in sense of horizontal or columnar alignment of the objects on the screen.


Functional groupings of associated elements -grouping screen element aids in establishing structure, meaningful relationships, and meaningful form.


Proper screen-based controls.From view of ergonomics, the controlling elements should be placed in bottom or on the right side of the screen (avoiding to cross the screen by the mouse pointer when changing the input parameters or mode of the output).


Provide effective internationalization so that people speaking different languages may use the developed virtual models.

Virtual models of mechatronic systems
As already mentioned in the Introduction, the mechatronic systems are of complex nature, and consist basically of mechanical, electrical and control subsystems (but also those of other nature, e.g.hydraulic and pneumatic systems are not excluded).Perfect understanding of mechanical subsystems behavior at various combinations of mechanical and technological parameters presents a presumption for further correct design of the control strategy.Thus, there exists a variety of subsystems the learner should learn to be able to understand their behavior and mutual effects.
In this subchapter we are going to present a set of virtual models and describe the screens that were designed applying the principles shown in the precedent subchapter.Some screens of virtual models are more-or less sophisticated but their use and control of modes are intuitive.After presenting system and its virtual model, more examples and variations of applications are presented there.

Multi-mass rotating systems with elastic connection
In the first phase we have developed virtual models of simple mechanical systems, starting from mechanical multi-mass oscillating systems (in our case 2-and 3-mass rotating and translation ones), which occurs often in industry, like:  in flexible joints of robots and manipulators,  in case of drive systems connected with the load by a long flexible shaft,  in multi-motor drive systems with flexible connection through processed strip,  at cranes and lifts with elastic rope, etc.
A system with two rotating masses connected by an elastic coupling element presents a very schematic and visual example of an elastic connection (Fig. 2).The system dynamics is described easily by three differential equations: Motion equation on the motor side: .
Motion equation on the load side: .

  
and mm dt The corresponding block diagram is shown in Fig. 3.This creates basis for Simulink scheme and core for the virtual model.Finally, the button Close closes the virtual model window.The described virtual model is relatively simple.It enables to observe system dynamical analysis in time and frequency domains at varying mechanical parameters and thus the student learns influence of the system parameters to time response, frequency characteristics and position of system poles.

Variations of mechanical systems with elastic connections
Based on previous example variations of virtual models of multi-mass elastic joints were developed.As a practical example of such system a model of a car axle suspension is shown here (Fig. 6) that consists of a wheel (a simplified model of a car -so called one-quarter car model), its passive suspension and driver seat.As the input variable to the system a disturbance in form of a harmonic signal occurs there that presents a cart-track.The output variables are: vertical position and speed of oscillating masses -of the seat with driver, chassis and wheel itself.Fig. 7 shows a block diagram.The simplified model of the car suspension presents a highly oscillating linear system of the 6th order.

Single mathematical pendulum
In many institutions, a mathematical pendulum presents one of basic mechanical subsystems for verification of properties of advanced control structures.There are several modifications of the mechanical system -simple pendulum, double pendulum, single pendulum on the chart, single pendulum on the chart with a tension spring, reverse pendulum and many other arrangements that make the mechanical subsystems more complex.
Let's present briefly its mathematical model, and based on this, the properties of its virtual model.The kinematic scheme is shown in Fig. 9. .sin The mathematical model is derived using the 2 nd order Lagrange equation.Firstly, the equations for the kinetic T and potential V energy of the system are derived: The 2 nd order Lagrange equation is in the form After a sort calculation and manipulation of equations we get the final differential equation describing pendulum oscillations, incl.its damping: From this equation it is easy to get the value of the angle  .After completing it by the equations ( 4), (5) describing the system kinematics we can get the block diagram (Fig. 10).Here, the screen consists of 5 parts.Let's describe their functionality in detail:  Mechanical model of system.In this section there occur pictures describing mechanical system model.In the left part there is a block diagram (compare with that in Fig. 6).In the right part the button Equation/Kinematic scheme it is possible to switch between the equations describing the mechanical system and kinematic scheme of the system (Fig. 9).The button Mdl File serves to show Simulink program scheme (Fig. 11 Fig. 12. GUI screen for a simple mathematical pendulum

variations of pendulum model
To get a more complicated system (in order to verify a more complex control algorithms) there were developed some modifications of the basic pendulum model.

Pendulum on the Cart
The pendulum is coupled to a moving cart.This is a principle of a crane trolley and the subsystems serves do develop a control algorithm preventing oscillation of the arm with a load at moving the trolley.The kinematic scheme is shown in Fig. 13.
In comparison with the previous subsystem the simple mathematical pendulum on a cart presents the 4 th order non-linear system.In comparison with the previous model the virtual model contains more parameters to be set.Its functionality is similar to that of a simple pendulum; the model only contains more parameter to be set.

Double Mathematical Pendulum
This mechanical subsystem consists of two pendulums where the second one is connected to end of the first one.The kinematic scheme is shown in Fig. 14.It is the 4 th order non-linear system but more complex that the previous one.The complexity of the system follows up also from the virtual model screen (Fig. 15).

Control of a direct current drive in frequency domain
Let's start to develop a virtual model in GUI MATLAB for a speed controlled direct current (DC) motor supplied by DC converter and two control loops: current and speed ones.The design is performed in the frequency domain.Although this is a simple and generally known example, we shall show some features of virtual model construction and enhance model features.The principal scheme of connection the motor (in linear region without a limiter serving for calculation of controllers only) is shown in Fig. 16 and principal connection of the speed controlled DC drive is in Fig. 17.Block diagram (the picture on the right side) displays the system block diagram.In other virtual models here can be switched between kinematic diagram, mathematical model, etc.). Change of the system parameters by sliders or numerical value in the bottom part of the screen.The details of these panels are shown in Fig. 21.
Before starting the model, implicit parameters are set up and they can be changed later.
After pushing the button Computed value the parameters of controllers are calculated from the set values of parameters.There simultaneously appears a small window with the question if the calculated values of controller parameters are acceptable or not.If not, the learner can set up the own parameters and can try to tune them according to the time responses of the drive.To be returned to starting values, the learner pushes the button Default (similar to the system restart).The advantage of the virtual model consists in the fact that the learner does not need to know the mathematical model running in background and he can concentrate himself to analysis of properties of the drive -to observe influence of a parameter on the system behavior.As shown, the learner can set up his own parameters of the controller (to tune the controllers) or used the pre-calculated parameters based on the pre-set criteria.responses.The computing algorithm is different from the previous one and belongs to more complex one.The computation starts from the state-space model of the DC motor having the block diagram in Fig. 16 that is in the form of the state equation ( 13) and the output equation ( 14).
where A is system matrix, x -state vector, b -input vector, c T -output vector e-disturbance vector, u -input variable, y -output vector.The motor parameters correspond to the Fig. 16.The control structure with the feedback through the state controller -vector r T is shown in Fig. 22 (the integrator at the input serves to reject constant or slowly changing disturbances what is a common case).The core of the virtual model consists in numerical calculation of the parameters K i , r 1, r 2 by the pole placement method: for a prescribed position of poles (usually a triple negative root giving the fastest system response on the aperiodicity boundary) the required polynomial is compared with the system polynomial and missing parameters of the controller are calculated from a set of linear algebraic equations.
The control structure in Simulink to simulate time responses is shown in (Fig. 23).

Experiences with virtual models
Except of presented virtual models a series of further ones was developed to suit institutional needs in mechatronic systems teaching.The virtual modules are collected in the Virtual Laboratory of Mechatronic Systems that is available on the website (KEM TU Kosice, 2010).
A set of tens virtual models from all fields of mechatronics are used by the departmental staff as e-learning support in teaching of various subjects (just list several of them: Mechatronic Systems Modeling, Control Theory, Electrical Actuators and Drives, Servodrives, Motion Control, Control of Robots, Mechatronics of Production Systems, and others).
In order the students would get more skills and practical experiences we have divided the student laboratory work into three phases: 1. Design and simulation -for a given plant the student has: -to derive the mathematical model, -to compose the block diagram, -to design control, -to verify system behavior by simulation.2. Verification and analysis -for a designed control algorithm the student has: -to verify the design using a virtual reference model and -to perform system analysis (small experiments round a working point) in order to get the system responses (in time and frequency domains) and to investigate system behavior at various values of system parameters and in various working points.3. Final verification of the design on the laboratory model (by programming the embedded control system).
The first two phases are performed outside of the laboratory.The student has to his/her disposal guidelines and reference virtual models that are available through internet for 24/7 hours.Within the institution network they run online (due to limited SW licenses) and outside of the institution the student has to download them and run on own computer (having installed MATLAB).
The reference virtual models also facilitate the teacher review of the student projects -the teacher does not need to check in details the simulating diagrams and search for eventual errors.On other side, the student has a model (i.e. a template) to verify whether he derived and designed a proper solution (e.g.proper parameters of controllers).
Let's note that the third phase of his projects is usually done in the laboratory on the laboratory model under teacher's supervision -for complex systems we prefer the presence of the students in the lab and consultations with the teacher.
The virtual models are also used in lectures to describe and explain principles of complex system behavior at various values of parameters.

Conclusion
The chapter describes principles of virtual models development of electromechanical systems that support eLearning in field of mechatronics.The developed virtual models enable to perform analysis of the real system in various working points and to observe influence of the parameters changes to system behavior.The shown virtual models are of various complexity -the simpler ones enable virtual analysis of system and complex virtual models deals also with synthesis of system controllers.Using them, the students can compare and verify their own design performed on basis of design rules application.
Development procedure and features of the virtual models are presented on several typical examples.Here, MATLAB/Simulink software was chosen as one of the best and widespread programming tools for development of virtual models that enables relatively simply programming of even complex systems.Based on the procedure a whole series of virtual models (more than 30) designed in GUI MATLAB was developed at the author's institution in recent years.They are accessible trough internet -through the website of the Virtual Laboratory for Control of Mechatronic Systems (KEM TU Kosice, 2010).
A big advantage of developed virtual models consists in the fact the students do not need to know the complexity of dynamical system which simulation scheme is working in the background of; they change only system parameters on the screen -e.g.mechanical parameters in case of mechanical subsystems (moments of inertia, constants of the elasticity and damping of the flexible joints), parameters of electrical systems (resistance, capacitance, inductance, gains, …), etc., select form and input signals (shape and amplitude of forcing and load signals) and select mode of calculation and outputs (graphs displaying).The parameters of virtual models can be changed by a slider or inputting numerical values into editable boxes.
A shortcoming of developed models consists in the fact they run on computers having installed the MATLAB program.To overcome this difficulty our future work will be concentrated to application of the browser plugins, which are necessary to run MATLAB application on computers not having installed the MATLAB program, e.g. by using VCLab plugin (Ruhr-Universität Bochum, 2011).It must be noted that this application enables to run MATLAB operation without simulation (i.e.without a Simulink scheme), without 3D virtual reality views and without animation, so the advantage on one side will complicate development of the virtual modules by application more mathematical subroutines.But this restriction does not make any serious problem and can be easily solved by application several subroutines.
The developed virtual models are in intensive use and they complete basic e-learning support in various subjects from field of mechatronics.They also serve at lecturing basic subjects from fields of modeling mechanical subsystems, electrical drive systems, system control, and various electrical systems up to mechatronic ones.

Fig. 2 .
Fig. 2. Kinematic diagram of a rotating system with elastic connecting shaft The left side consist of a mass disk of the driving motor (moment of inertia J m and the driving torque M m ) and the load side disk on the right side with the load moment of inertia J z is loaded by a load torque M z .The connecting torsional shaft is characterized by its torsional elasticity k and torsional damping b.Similarly, mechanical losses on the driving side are characterized by damping b m and on the load side by damping b z ).

Fig. 3 .
Fig. 3. Block diagram of two-mass rotating system with elastic connectionThe GUI screen of the virtual model is shown in Fig.4.The virtual model response starts immediately after any parameter change.The GUI screen (Fig.4) consists of several parts:

Fig. 6 .
Fig. 6.Kinematic diagram of a car suspension simplified model

Fig. 7 .
Fig. 7. Block diagram of a car suspension simplified model Finally, Fig. 8 shows the virtual model.Here the students can tune the parameters of the springs and dampers (for prescribed masses and character of the road surface) and to observe position oscillation of the seat with driver.

Fig. 8 .
Fig. 8. GUI screen of the virtual model of car suspension simplified model

Fig. 9 .
Fig. 9. Kinematic scheme of a simple mathematical pendulum From the geometry of the pendulum there are easily derived basic equations for position of the simple pendulum:

Fig. 10 .
Fig. 10.Block diagram of the simple mathematical pendulum It creates a base for the virtual model.From control point of view, it is a nonlinear 2 nd order system.The corresponding Simulink scheme is shown in Fig. 11.
) -by opening the proper mdl file. Output characteristics.Here are two sub-screens to display output characteristics.Graph A: Time responses serves to show time responses, in this case the variables x, y and φ.Graph B: Functions serves to show functionsy = f (x) a a course in some of the graphs, one has to start simulation by pushing a button in the section Simulation. Simulation.The section serves to control the simulation.The buttons trigger the graphs.It consists of two subsections, namely Graph A and Graph B.  The subsection Graph A contains the buttons x , phi , y and x y , that triggers the time courses in the graph Graph A: Time responses in the section Characteristics.Each button triggers the time course of the depicted variable, i.e. the button buttons x triggers the time course of the variable x, etc. Similarly there works the buttons y = f (x) and  φ=f φ  in the subsection Graph B, but with the distinction, there are not displayed any time responses but the functions depicted on the button that are draw in the Graph www.intechopen.comE-Learning -Engineering, On-Job Training and Interactive Teaching 96 B: Functions.It should be noted that prior simulation the actual input parameters are read and after this the simulation starts. Control Panel.In this section there are only two buttons to control the whole screen.The first one button Default serves to reading pre-set values of the mechanical system parameters and their immediate writing into the section Input parameters (pre-setting the position of sliders and numerical values in the editing screens).The button Close finishes the work and closes the GUI screen. Input parameters.The section serves to system parameters entry.Each variable has a starting value and a limited range (the limits are set separately), that can be re-activated by pushing the button Default .The value can be changed either by a slider or inserting numeric value into the editing.

Fig. 13 .
Fig. 13.Kinematic scheme of a simple mathematical pendulum on a cart

Fig. 16 .F
Fig. 16.Block diagram of a DC motor

Fig. 20 .
Fig. 20.shows the basic view on the virtual GUI model of speed controlled DC drive.

Fig. 20 .
Fig. 20.GUI screen for the virtual model of the speed controlled DC drive

Fig. 21 .
Fig. 21.Panels with sliders to change system parameters, configuration parameters (parameters of simulation and motor load), and mode of the output

Fig. 22 .
Fig. 22.Control structure with the state-space controllerThe control structure is described in the state-space by the known state equation:

Fig. 23 .
Fig. 23.Simulink model of the state-space control of DC drive This work was supported by Slovak Cultural and Educational Agency of the Ministry of Education of Slovak Republic under the contract KEGA 103-039 TUKE-4/2010 "Students' Skills Development for Mechatronic Systems Control".