## 1. Introduction

A virtual laboratory for Automatic Control Engineering can provide easy access to university students with regard to engineering applications at anytime and from any computing environment. This interactive learning environment, consist of simulations, demonstrations and exercises, which can fulfill the role of a bridge from passive learning to active engagement and accordingly stimulate deeper thinking; grounding a problem based-learning environment. The applications are also very important for relating theory to practice, so that the students develop engineering judgment and understand how process behavior can be captured using mathematical models. The undergraduate control engineering at engineering colleges is based on a strong “hands-on” laboratory experience. Regardless of how many fine lectures are given or how many homework problems assigned, the students do not see how control systems work in the real world until they get into the laboratory.They do not understand that they can modify the performance of a physical system to meet design specifications. Only after they complete the laboratory course do they understand the power that they have to become “control gods.” After completing the lab experiments on virtual laboratory, the students first characterize the performance of a second order system (a dc servomechanism ES-130).Virtual Laboratory (VLab) has been developed to control Engineering by using MATLAB/SIMULINK. This chapter will also emphasize on the use of Mathematical Modeling and simulation of Feed back Servo trainer (33-100) and study their behavior by using the MATLAB/SIMULINK models and Graphical User Interface (GUI). A graphical user interface is developed which is user friendly and does not require the knowledge of MATLAB. This user can change the parameters of the systems as per his choice or required condition, this computational tool as a part of laboratory experiments will enhance laboratory experience by providing students with the opportunity to compare the practical results with those obtained by computer simulation. Such an opportunity helps the students of all courses to realise the limitations of hardware.

With the growing popularity and possibilities of the Internet, web-based teaching is becoming more and more popular in education. The new trend focuses on developing more effective and efficient teaching methods for large groups of students by using interactive web based material. Control systems curricula are often viewed by students as theoretical and highly mathematical. Students are often unable to relate theory to applications in the real world. The obvious solution to this problem, is to include the virtual lab experiment in the control curriculum. Simulation tools are frequently used as an educational aid in automatic control courses. Initially, analog computers with electronic circuits were used for simulating different types of physical processes. When digital computers were present several simulation packages based on numerical techniques were obatinable. Personal computers with low price are universally acknowledged. MATLAB/SIMULINK is a Windows based engineering and science toolbox, which offers valuable interactive demonstrations or the possibility to easily create different simulations related to the theory. It is an integrated technical computing environment that combines numeric computation, advanced graphics and visualization, through powerful Graphical User Interface (GUI). The undergraduate(UG) level engineering lecture class are co- requisites with the lab experiments selected to support and complement the lectures. Most of the universities cover the following lab experiments at UG level:

Modeling mechanical, electrical and electromechanical systems.

Transfer function, Block diagram and Manson’s rules.

DC Servo Mechanism: Open loop and Closed loop systems.

Steady state and transient time response analysis.

Root locus and introduction to root locus design.

Frequency response analysis: Bode and Nyquist plots etc.

The above listed experiments are performed with the help of feedback mechanical unit 33-100 and feedback analog unit 33-002 which are as shown in fig.1 and Fig.2.

It is usually recognized that, by studying and experimenting the simulation model a student can experiment with systems that are impossible. He can also work in a laboratory which are being potentially dangerous or huge dimension or very a expensive processes. By using a virtual laboratory, it is possible to obtain some knowledge about its model, operation or stability of the system without using a actual hardware.

## 2. Mathematical modelling and simulation

Modeling a system and writing the simulation program contributes to better understanding of its physical principles and properties. By defining the equations of the different parts of the system and how they interact with each other, a student can obtain the clear understanding about the system structure and the way it operates. The feedback mechanical unit 33-100 is a electromechanical unit which comprises of a dc motor, analog tachogenerator, analog input and output potentiometers, absolute and incremental digital encoders and magnetic break as shown in fig.1. The main component of feedback mechanical unit is a DC motor. The mathematical model of DC motor in armature control mode has been carried out by writing differential equations which are as follows:

The air gap flux is proportional to field current,

Where K_{f} is a constant.

The torque T_{m} developed by the motor is proportional to the product of the armature current and air gap flux,

Where K_{1} is constant. In the armature controlled DC motor field current is kept constant, so the above equation can be written as

Where K_{T} is known as motor torque constant. The motor back emf being proportional to speed is given as

where K_{b} equals to back emf constant.

The differential equation of the armature circuit is

The torque equation is

Thus, from above equations, the transfer function of DC motor is as follows:

The simulink model of DC motor is derived from the equation 1 is shown in fig. 4. It is the universal model for performing the control system engineering practical in virtual laboratory.

The front end user interface is created to perform the control system practicals with the help of GUI platform of the MATLAB as shown in fig. 5.

### 2.1. Open loop characteristics

The aim of this experiment is to acquaint the user with Open Loop control system characteristics. The circuit diagram for performing this experiment on Analog Servo trainer – Analog unit 33-110 is as shown in fig. 6.

The simulation model created with the help of SIMULINK is shown in fig. 7. The response of the open loop system is shown in fig. 8.

by modeling and simulating of each experiment with the help of MATLAB/SIMULINK. A complete Virtual Laboratory has been developed and successfully implemented. The Virtual Laboratory performs the following experiments:

Open Loop Control System.

Closed Loop Control System

Steady State Characteristics of DC Motor.

Transient Response of DC Motor.

Position Control with Controller (P, PI, PD, PID).

Speed Control of DC Motor with Controller (P, PI, PD and PID).

An interactive user interface has been developed using GUI feature of MATLAB to ease and help the user in better understanding and performing of above mentioned practicals. The following are the graphs generated to show the system response in the above mentioned practicals.

## 3. Need of controller (P, PD, PI & PID)

Every practical system takes finite time to reach its steady state and during this period, it oscillates or increases exponentially.The behaviour of the system gets decided by the type and location of closed loop poles in s–plane. The closed loop poles are dependent on selection of the parmeters of the system. Every system has a tendency to oppose the oscillatory behaviour of the system which is called as **damping.** Now this tendency controls the type of closed loop poles and hence the nature of the response. This damping is measured by a factor called damping ratio of the system. Damping ratio indicates how much dominant the opposition from the system is to the oscillations in the output. In some systems it will be low where system will oscillate but slowly i.e. with damped frequency. If damping ratio is high, system output will not oscillate at all and not only it will be exponential, but also so slow that it will take a very long time to reach a steady state. That is why all practical systems are designed for the damping ratio less than 1 i.e. underdamped.

A Proportional, Integral, Derivative controller (PID controller) is a controller which attempts to correct the error between a measured process variable and a desired set point by calculating and then outputing a corrective action that can adjust the process accordingly. The PID controller calculation (algorithm) involves three separate parameters; the Proportional, the Integral and the Derivative values. The Proportional value determines the reaction to the current error, the Integral determines the reaction based on the sum of recent errors and the Derivative determines the reaction to the rate at which the error has been changing. The weighted sum of these three actions is used to adjust the process via a control element. By "tuning" the three constants in the PID controller algorithm, the PID can provide control action designed for specific process requirements. The response of the controller can be described in terms of the responsiveness of the controller to an error, the degree to which the controller overshoots the set point and the degree of system oscillation. The use of the PID algorithm for control does not guarantee optimal control of the system or system stability. Some applications may necessitate using only one or two modes to provide the appropriate system control. This is achieved by setting the gain of undesired control outputs to zero. A PID controller will be called a PI, PD, P or I controller in the absence of the respective control actions.

A proportional controller (K_{p}) will have the effect of reducing the rise time and will reduce, but never eliminate, the steady-state error. An integral control (K_{i}) will have the effect of eliminating the steady-state error, but it may make the transient response worse. A derivative control (K_{d}) will have the effect of increasing the stability of the system, reducing the overshoot, and improving the transient response. Effects of each of controllers K_{p}, K_{d}, and K_{i} on a closed-loop system are summarized in the table shown below:

CONTROLLER | RISE TIME | OVERSHOOT | SETTLING TIME | STEADY STATE ERROR |

K_{p} | Decrease | Increase | Small Change | Decrease |

K_{i} | Decrease | Increase | Increase | Eliminate |

K_{d} | Small Change | Decrease | Decrease | Small Change |

The transfer function for PID controller is

----(2)### 3.1. Simulation results & analysis

The simulation results which are obtained by virtual laboratory for DC motors with controller are as follows.

The simulation results of transient behavior of DC motor are shown from Fig. 12 to Fig. 33. The following inferences are drawn from the simulation results of DC Servomechanism:

From the output response of the DC motor, it is observed that for every increase in input voltage the output response (i.e. Current and Speed) also increases and reaches its steady state value faster as shown in Fig. 12

When proportional controller is used the response is oscillatory and underdamped. It takes more settling time to reach the steady state value as shown in Fig. 13. By using PD controller, the peak overshoot is reduced and thus transient response is improved as shown in Fig.14. System without controller is type I system. The integral controller of the system increases from I to II. As type of system is increased, steady state errors are reduced as shown in Fig. 15. Transient response as well as steady state response can be improved by adjusting value of derivative gain and integral gain as shown in Fig. 16.

By using PID controller the transient as well as steady state response improves as shown in Fig. 14, Fig. 15 and Fig. 16.

The comparison of the transient response of DC motor is shown in Fig. 33 with P, PI, PD and PID controller. As the Integral gain is increased the system response becomes more sluggish, however the tuning of the controller can be judged by deciding on the proper gain of Derivative and Integral Controller.

## 4. Integration of Virtual laboratory into Control Engineering courses

The Virtual laboratory for control system has been developed using MATLAB/SIMULINK and integrated into the Control Engineering Curriculum of UG courses. It consists of the complete details of mathematical modeling using the modules available in SIMULINK for open loop, closed loop, PID control, Transient, frequency response of DC Motor, Position and speed control of DC motor using controller experiments. Then the programming of each selected module is carried out. For the ease of an user, a graphical user interface is modeled for all the above said experiments on a single platform as shown in Fig. 5. The platform includes

Buttons to perform all the experiments.

Controls to change the system parameters.

View the results of the experiments in the graphical form.

Compare system response such time and frequency domain.

A menu bar on activation of which brief description along with the transfer function of the experiments performed can be viewed.

A menu bar to simulate directly the SIMULINK circuits diagrams and see the results in separate window.

SIMULINK diagram of the current experiment.

An EXIT button to come out of the GUI page of project.

A refresh button to clear all the graphs and diagram displayed earlier.

A button to see the SIMULINK diagram of each experiments.

Menu bar to see different values in the graph, to zoom in/out and other controls.

A course ware for each experiment is prepared and successfully integrated into the control engineering laboratory. Vlab is very useful for performing experiments and understanding the basic concepts of feedback systems in the control system laboratory. It is a fundamental system which is useful to any course of instruction including basic subjects in electronics and mechanical at undergraduate level.

### 4.1. The educational use of the model

The mathematical model of DC Motor is very useful for carrying out transient and steady state analysis and understanding the basic concepts of control systems with and without the controller. It is a fundamental system useful to any course of instruction including basic subjects in Engineering at undergraduate courses. The MATLAB/SIMULINK model and GUI representation of DC motor using controller will definitely work as a teaching tool and support the classroom teaching by enabling the faculty, with the computer-generated graphics, to illustrate transient and steady-state performance and stability analysis of DC motor under various parameter controls. The user can change the parameters of the system as per his/her choice or required condition. Thus this computational tool as a part of laboratory experiments will enhance laboratory experience by providing students with the opportunity to compare the results of laboratory experiments with those obtained by computer simulation. Such an opportunity helps students of all courses realise the limitations of hardware.

## 5. Conclusion

The MATLAB/SIMULINK models and GUI representation of closed loop, open loop, PID Control, etc. of Feedback Control System 33-001 will definitely work as a teaching tool and support the classroom teaching by enabling the faculty, through the computer-generated graphics, to illustrate transient and steady-state performance and stability analysis of control system under various parameter controls. The user can change the parameters of the systems as per his choice or required condition. Such an opportunity helps students of all courses realise the limitations of hardware. A Virtual laboratory for Automatic Control (AC) allows students an easy access to different applications, simulations related to the theory they studied. These interactive demos present in a tutorial manner the influence of the different parameters of the mathematical model to the system behavior. These simulations provide a more intuitive and more practical approach for the abstract theory of Automatic Control. The advantage of the approach presented here is the use of the available simulation tools. The user can focus on the learning and understanding of problems and concepts, as he/she doesn’t have to master the MATLAB programming environment. The scope of this Vlab is extending to the remote control laboratory using MATLAB /SIMULINK applications to control system engineering. The MATLAB/SIMULINK models and GUI representation of DC Motor using controller will definitely work as a teaching tool and support the classroom teaching by enabling the faculty, with the computer-generated graphics, to illustrate transient and steady-state performance and stability analysis of DC motor under various parameter controls. The user can change the parameters of the system as per his/her choice or required condition. Thus, this computational tool, as a part of laboratory experiments will enhance practical experience by providing students with the opportunity to compare the results of laboratory experiments with those obtained by computer simulation. Such an opportunity helps students of all courses realize the limitations of hardware.