Sei sulla pagina 1di 30

KIIT UNIVERSITY,BHUBANESWAR PROJECT REPORT ON

ANALYSIS AND SIMULATION OF VARIOUS PID CONTROLLERS FOR DESIGN OF THE CONTROLLER OF A SMART CAR USING SIMULINK

Submitted By:MANISHA TRIPATHY (904114) MANISH KUMAR SINGH (904112) M NAGA PRAVEEN (904109) INDRAJEET UPADHYAYA (904090) HIMANSHU (904086)

Under The Guidance Of (Mr. Rajiv Mishra)

ACKNOWLEGDEMENTS

We are thankful to Mr. Rajiv Mishra, our mentor for this project. He has been an immense help to us since the beginning of the project. He guided us and helped us to complete this project. We would also like to extend our thanks to our Director, Mr. A. K. Sen, for his support has been the reason we could complete this project. We would also like to thank all the faculties of electronics department for their immense support and cooperation.

BONAFIDE CERTIFICATE
Certified that this project report is the Bonafide work of Manisha Tripathy, Manish Kumar Singh, M Naga Praveen, Indrajeet Upadhyaya and Himanshu who carried out the project work under my guidance.

Signature

Signature

DIRECTOR OF THE DEPARTMENT ( Mr. A. K. SEN)

PROJECT GUIDE (Mr. Rajiv Mishra)

CONTENTS

1. Introduction 2. Structure of a general controller 3. Modes of controllers Proportional controller Proportional plus integral controller(PI) Proportional plus derivative controller(PD) Proportional, integral and derivative controller(PID) 4. A brief introduction to Simulink 5. Analysis of linear PID Controller Detailed analysis of proportional, integral aand derivative terms Manual Tuning of a PID Controller Simulations of linear PID Controller Defects of linear PID Controller 6. Analysis of Non-linear PID Controller Simulations of Non-linear PID Controller Defects of Non-linear PID Controller 7. Analysis of Non-linear Feed-forward PID Controller Simulations of non-linear feed-forward PID Controller 8. Conclusion 9. References

Abstract: This report discusses the design of a linear PID,non-linear PID and non-linear feed-forward PID controller with reference to the control system of a smart car. A simulation about traditional PID, non-linear PID and non-linear feed-forward PID is given to show that the non-linear PID dramatically enhances both the dynamic performance and the stability. The results also indicate that the smart car controlled by a non-linear feed-forward PID controller has a good performance both in speed and stability as compared to the other two models.

INTRODUCTION
A control system is a device, or set of devices to manage, command, direct or regulate the behaviour of other device(s) or system(s).Almost all appliances that we use have a control system to monitor their functioning and to ensure that the desired result is obtained. A traditional (or linear) PID controller is one of the earliest developed control strategies. These controllers have proven to be robust and extremely beneficial in the control of many important applications. A proportionalintegralderivative controller (PID controller) is a generic control loop feedback mechanism (controller) widely used in industrial control systems a PID is the most commonly used feedback controller. However, in certain applications, such as a smart car which is vulnerable to outside disturbance, the traditional linear PID system cannot meet the requirements for a high performance, and it is difficult to gain good results. Hence, non-linear PID controllers are developed .Here the parameters can be changed according to the controlled system. Another new approach, called the non-linear feed-forward PID is also adopted in cases where the non-linear PID controller cannot achieve satisfactory results in time regulation and speed response.

STRUCTURE OF A GENERAL CONTROLLER A controller is a device that generates an output signal based on the input signal it receives. The input signal is actually an error signal, which is the difference between the measured variable and the desired value, or set point.

This input error signal represents the amount of deviation between where the process system is actually operating and where the process system is desired to be operating. The controller provides an output signal to the final control element, which adjusts the process system to reduce this deviation. The characteristic of this output signal is dependent on the type, or mode, of the controller.

MODES OF CONTROLLERS The mode of control is the manner in which a control system makes corrections relative to an error that exists between the desired value (set point) of a controlled variable and its actual value. The mode of control used for a specific application depends on the characteristics of the process being controlled. For example, some processes can be operated over a wide band, while others must be maintained very close to the set point. Deviation is the difference between the set point of a process variable and its actual value. This is a key term used when discussing various modes of control

FOUR MODES OF CONTROLLERS Broadly, there are four modes of controllers on which the characteristic of output signal depends. These four modes of control commonly used for most applications are: Proportional (P) Proportional plus Reset (PI) Proportional plus Rate (PD) Proportional plus Reset plus Rate (PID)

Mathematically, these are stated as:

Each mode of control has characteristic advantages and limitations. The modes of control are discussed in this and the next several sections of this module. PROPORTIONAL CONTROLLERS Proportional control is also referred to as throttling control. In the proportional (throttling) mode, there is a continuous linear relation between value of the controlled variable and position of the final control element. Three terms commonly used to describe the proportional mode of control are proportional band, gain and offset. Proportional band, (also called throttling range), is the change in value of the controlled variable that causes full travel of the final control element. Gain, also called sensitivity, compares the ratio of amount of change in the final control element to amount of change in the controlled variable.

Mathematically, gain and sensitivity are reciprocal to proportional band. Offset, also called droop, is deviation that remains after a process has stabilized. Offset is an inherent characteristic of the proportional mode of control. In other words, the proportional mode of control will not necessarily return a controlled variable to its set point. DISADVANTAGE OF THE PROPORTIONAL CONTROL The main disadvantage of the proportional control mode is that a residual offset error exists between the measured variable and the set point for all but one set of system conditions. PROPORTIONAL PLUS INTEGRAL CONTROL (PI) Proportional plus integral control is a combination of the proportional and integral control modes. It is also called as proportional plus reset control. The proportional control mode has already been discussed. Let us now discuss the integral control mode. Integral control describes a controller in which the output rate of change is dependent on the magnitude of the input. Specifically, a smaller amplitude input causes a slower rate of change of the output. This controller is called an integral controller because it approximates the mathematical function of integration. The integral control method is also known as reset control.

Combining the two modes results in gaining the advantages and compensating for the disadvantages of the two individual modes.

PI CHARACTERISTICS It combines the immediate output characteristics of a proportional control mode with the zero residual offset characteristics of the integral mode.

DISADVANTAGE OF PI CONTROLLER An inherent disadvantage to proportional plus reset controllers is the possible adverse effects caused by large error signals. The large error can be caused by a large demand deviation or when initially starting up the system. This is a problem because a large sustained error signal will eventually cause the controller to drive to its limit, and the result is called "reset windup." Because of reset windup, this control mode is not well-suited for processes that are frequently shut down and started up. PROPORTIONAL PLUS DERIVATIVE CONTROL (PD) Proportional plus derivative (rate) control is a control mode in which a derivative section is added to the proportional controller. Proportional plus rate describes a control mode in which a derivative section is added to a proportional controller. This derivative section responds to the rate of change of the error signal, not the amplitude; this derivative action responds to the rate of change the instant it starts. This causes the controller output to be initially larger in direct relation with the error signal rate of change. Let us discuss the derivative control mode in brief. A device that produces a derivative signal is called a differentiator. Figure below shows the input versus output relationship of a differentiator. The differentiator provides an output that is directly related to the rate of change of the input and a constant that specifies the function of differentiation. The derivative constant is expressed in units of seconds and defines the differential controller output.

Derivative cannot be used alone as a control mode. This is because a steady-state input produces a zero output in a differentiator.

If the differentiator were used as a controller, the input signal it would receive is the error signal. As just described, a steady-state error signal corresponds to any number of necessary output signals for the positioning of the final control element. Therefore, derivative action is combined with proportional action in a manner such that the proportional section output serves as the derivative section input. Proportional plus rate controllers take advantage of both proportional and rate control modes.

PD CONTROLLER CHARACTERISTICS

DISADVANTAGE OF PD CONTROLLER Rate action cannot be employed with fast responding processes such as flow control or noisy processes because derivative action responds to any rate of change in the error signal, including the noise. PROPORTIONAL PLUS INTEGRAL PLUS DERIVATIVE CONTROL (PID) Proportional plus reset plus rate controllers combine proportional control actions with integral and derivative actions. For processes that can operate with continuous cycling, the relatively inexpensive two position controller is adequate. For processes that cannot tolerate continuous cycling, a proportional controller is often employed. For processes that can tolerate neither continuous cycling nor offset error, a proportional plus reset controller can be used. For processes that need improved stability and can tolerate an offset error, a proportional plus rate controller is employed. However, there are some processes that cannot tolerate offset error, yet need good stability. The logical solution is to use a control mode that combines the advantages of proportional, reset, and rate action. When an error is introduced to a PID controller, the controllers response is a combination of the proportional, integral, and derivative actions, as shown in Figure below.

Assume the error is due to a slowly increasing measured variable. As the error

increases, the proportional action of the PID controller produces an output that is proportional to the error signal. The reset action of the controller produces an output whose rate of change is determined by the magnitude of the error. In this case, as the error continues to increase at a steady rate, the reset output continues to increase its rate of change. The rate action of the controller produces an output whose magnitude is determined by the rate of change. When combined, these actions produce an output as shown in Figure in previous page. As we can see from the combined action curve, the output produced responds immediately to the error with a signal that is proportional to the magnitude of the error and that will continue to increase as long as the error remains increasing. PID CONTROLLER RESPONSE CURVES

Figure above demonstrates the combined controller response to a demand disturbance. The proportional action of the controller stabilizes the process. The reset action combined with the proportional action causes the measured variable to return to the set point. The rate action combined with the proportional action reduces the initial overshoot and cyclic period.

A BRIEF INTRODUCTION TO SIMULINK MATLAB is a high-level language and interactive environment for numerical computation, visualization, and programming. Using MATLAB, you can analyse data, develop algorithms, and create models and applications. For multi domain and Model based design, Matlab has a block diagram environment called Simulink, which supports system-level design, simulation, automatic code generation, and continuous test and verification of embedded systems. Simulink, developed by MathWorks, is a commercial tool for modelling, simulating and analyzing multidomain dynamic systems. Its primary interface is a graphical block diagramming tool and a customizable set of block libraries. It offers tight integration with the rest of the MATLAB environment and can either drive MATLAB or be scripted from it. Simulink provides a graphical editor, customizable block libraries, and solvers for modelling and simulating dynamic systems. It is integrated with matlab, enabling you to incorporate matlab algorithms into models and export simulation results for further analysis. The Simulink Library Browser has many commonly used blocks and toolbars which can be used to design any desired model. New blocks and models can also be added to the library browser. These can further be used for designing other complex models. Every model must have a signal source , block(s) representing the desired system and a sink for displaying the result obtained. The results can be analysed graphically which helps us to obtain a satisfactory response of the given design model or system.

ANALYSIS OF LINEAR PID CONTROLLER A PID controller calculates an "error" value as the difference between a measured process variable and a desired setpoint. The controller attempts to minimize the error by adjusting the process control inputs. The PID controller calculation (algorithm) involves three separate constant parameters, and is accordingly sometimes called three-term control: the proportional, the integral and derivative values, denoted P, I, and D. Heuristically, these values can be interpreted in terms of time: P depends on the present error, I on the accumulation of past errors, and D is a prediction of future errors, based on current rate of change. The weighted sum of these three actions is used to adjust the process via a control element.

The PID control scheme is named after its three correcting terms, whose sum constitutes the manipulated variable (MV). The proportional, integral, and derivative terms are summed to calculate the output of the PID controller. Defining as the controller output, the final form of the PID algorithm is:

where : Proportional gain, a tuning parameter : Integral gain, a tuning parameter : Derivative gain, a tuning parameter : Error : Time or instantaneous time (the present) : Variable of integration; takes on values from time 0 to the present .

First, let's take a look at how the PID controller works in a closed-loop system using the schematic shown above. The variable (e) represents the tracking error, the difference between the desired input value (r) and the actual output (y). This error signal (e) will be sent to the PID controller, and the controller computes both the derivative and the integral of this error signal. The control signal (u) to the plant is equal to the proportional gain (Kp) times the magnitude of the error plus the integral gain (Ki) times the integral of the error plus the derivative gain (Kd) times the derivative of the error. This control signal (u) is sent to the plant, and the new output (y) is obtained. The new output (y) is then fed back and compared to the reference to find the new error signal (e).

Proportional term The proportional term produces an output value that is proportional to the current error value. The proportional response can be adjusted by multiplying the error by a constant Kp, called the proportional gain constant.

. Plot of PV vs time, for three values of Kp (Ki and Kd held constant) The proportional term is given by:

A high proportional gain results in a large change in the output for a given change in the error. If the proportional gain is too high, the system can become unstable. In contrast, a small gain results in a small output response to a large input error, and a less responsive or less sensitive controller. If the proportional gain is too low, the control action may be too small when responding to system disturbances. Tuning theory and industrial practice indicate that the proportional term should contribute the bulk of the output change.
Integral term

Plot of PV vs time, for three values of Ki (Kp and Kd held constant)

The contribution from the integral term is proportional to both the magnitude of the error and the duration of the error. The integral in a PID controller is the sum of the instantaneous error over time and gives the accumulated offset that should have been corrected previously. The accumulated error is then multiplied by the integral gain (Ki) and added to the controller output. The integral term is given by:

The integral term accelerates the movement of the process towards setpoint and eliminates the residual steady-state error that occurs with a pure proportional controller. However, since the integral term responds to accumulated errors from the past, it can cause the present value to overshoot the setpoint value.
Derivative term

Plot of PV vs time, for three values of Kd (Kp and Ki held constant) The derivative of the process error is calculated by determining the slope of the error over time and multiplying this rate of change by the derivative gain . The magnitude of the contribution of the derivative term to the overall control action is termed the derivative gain, . The derivative term is given by:

The derivative term slows the rate of change of the controller output. Derivative control is used to reduce the magnitude of the overshoot produced by the integral component and improve the combined controller-process stability. However, the derivative term slows the transient response of the controller. Also, differentiation of a signal amplifies noise and thus this term in the controller is highly sensitive to noise in the error term, and can cause a process to become unstable if the noise and the derivative gain are sufficiently large. Hence an approximation to a differentiator with a limited bandwidth is more commonly used.

MANUAL TUNING If the system must remain online, one tuning method is to first set and values to zero. Increase the until the output of the loop oscillates, then the should be set to approximately half of that value for a "quarter amplitude decay" type response. Then increase until any offset is corrected in sufficient time for the process. However, too much will cause instability. Finally, increase , if required, until the loop is acceptably quick to reach its reference after a load disturbance. However, too much will cause excessive response and overshoot. A fast PID loop tuning usually overshoots slightly to reach the setpoint more quickly; however, some systems cannot accept overshoot, in which case an over-damped closed-loop system is required, which will require a setting significantly less than half that of the setting that was causing oscillation.

Effects of increasing a parameter independently

Parameter Rise time Overshoot Decrease Increase

Decrease Increase Minor Decrease Decrease change

Settling time Small change Increase

Steady-state error Decrease Eliminate No effect in theory

Stability Degrade Degrade Improve if small

SIMULATION OF LINEAR PID CONTROLLER Using Simulink, a linear pid controller is designed with reference to the control system of a smart car. By choosing suitable parameters, the transfer function of the object (controlled motor) is given as 2 2 S +S+1 Block Diagram of linear pid controller :

Here PID Controller block given in the Simulink library is used. This block implements continuous- and discrete-time PID control algorithms and includes advanced features such as anti-windup, external reset, and signal tracking. We can tune the PID gains automatically using the 'Tune...' button (requires Simulink Control Design). By choosing different values of KP,Ki and Kd,the output of pid controller can be tuned by the pid tuner.

All the characteristics of step response are plotted. They are: -peak response: time required for the response to reach the first peak of the o overshoot -settling time: time required for the response curve to reach and stay within 2% of the final value -rise time:time required for the response curve to rise from 10% to 90% of its final value. -steady state response:time after which the response becomes steady and transient effects no longer occur Block diagram of linear pid (without using the pid controller block) is:

The controlled output is as follows:

The simulation step size is 0.01s.

DEFECTS OF LINEAR PID CONTROLLER The principle of the traditional PID controller is to make use of the reference input, the error and the linear combination of differential coefficient and integral, to generate the control signal

u=kpe+ kiedt+ kd de/dt


where e(t) = r (t) - y(t) . This form of pure linear is very effective in relatively simple practical process. However, it is not effective to control the scope of the changes in the parameters of the larger or non-linear object, the reasons are as follows: Above all, r(t), as the reference input, is often not smooth or continuous, and y(t), as the system output, has to be smooth. With y(t) as the direct target of the output, the inertia effect of the controlled object is not considered, which easily causes overshoot oscillation in practical applications. In addition, the reference input r(t) is usually non-differentiable signal, which makes it difficult to obtain the differential signal of the error, and even if the signal is obtained, the effect is not good because of the strong noise. Lastly, there is conflict between the high speed and the overshoot variable caused by the "linear combination" of the traditional PID. In actual application, we hope three parameters will adjust in response to the response process of the system. In the initial phase, for example, a larger Kp can increase the systems response speed, but with the decrease of the e(t), we hope Kp can be reduced accordingly and thus reduce the overshoot. When e(t)<0 and de (t)/dt> 0, we hope K will gradually increase in Kp in order to reduce the overshoot through the increase of the reverse effect. When e(t)<0 and de (t)/dt<0, we hope Kp will gradually decrease, so that there is no big overshoot when the system is back to the balanced state. This is however impossible in case of linear pid. In the certain systems such as a smart car system, the type of track or path to be taken is unknown, which may involve many possibilities: straight, S curve, small S curve, round, and so on. In order to ensure that these systems work properly in worst case scenarios, the intelligent control system must have strong adaptability, which requires the control system parameters change in response to the course accordingly.

However, if only the linear PID controller is used, the regulation parameters of the PID will be a constant value. It will be difficult for the controller to meet the system requirements when both speed and stability are to be guaranteed. Therefore such a method has some flaws, which makes it necessary for us to find a new control method to meet the needs of the system control. ANALYSIS OF NON- LINEAR PID CONTROLLER It is the linear combination that causes the contradiction between overshoot and high speed. In the non-linear control, for the purpose of solving this contradiction, it is necessary to shake off the restraint of the mathematical model. The function of a nonlinear module is shown as: f(e,,)=IeI sign(e), =e/ 1

> <

where sign(e)=1 ,e>0 =-1 ,e<0 f(e,,)is a function that can be a greater range of non-linear characteristic function. e is the error signal, determines the size of the linear range of the function f(e,,), and determines the non-linear shape of the function. Thus, we can get the specific form of the control law of the non-linear PID

u=kp.e. fp(ep,0,0)+ ki. fi(ei,1,1)edt+ kd . fd(ed,2,2)de/dt

fi fp

Linear
Combina

r(t)

e
d/dt

-tion

u(t)

Object

y(t)

fd

SIMULATION OF NON- LINEAR PID CONTROLLER The parameters of the non-linear PID will be K P =8, K I =1.3, K D =2.1.The Simulink integration tools of the Matlab simulation environment is used in the simulation control system.The block diagram of non-linear pid using

Simulink is as follows:

The simulation result of non-linear pid for simulation step size of t=0.01s is shown below:

DEFECTS OF NON-LINEAR PID CONTROLLER The non-linear PID is more robust and adaptable than the linear PID, but it should be noted that the entire system remains a closed-loop control system. As for some special objects such as the delay control systems, high-end systems, non-minimum phase systems, especially for smart car system, the system's response time will be affected, showing a longer time to adjust. If the feed-forward is joined, that is, to introduce an open-loop, the system's dynamic performance and steady-state performance will be further improved. ANALYSIS OF NON-LINEAR FEED-FORWARD PID CONTROLLER

The structure of a non-linear feed-forward control system is shown below.


Feed-forward control

r(t)

Non-linear PID

Control object

y(t)

As can be seen from the figure, the whole system is compounded of feedforward and feedback control system, reflecting the thinking of combination of the open-loop and the closed-loop, and also a combination of the advantages of both. The open-loop control has a higher speed, but it has difficulty in achieving steady-state error while the nonlinear feedback PID control can achieve better steady state performance. Therefore, the combination enhances the dynamic performance of the system, while the steady-state performance is not affected. The specific form of non-linear feed forward controller is as follows:

u=kp.e. fp(ep,0,0)+ ki. fi(ei,1,1)edt+ kd . fd(ed,2,2)de/dt+ kf.r(t)


where kf is the gain constant of feed-forward control. Thus the above equation has an additional term( kf.r(t)) as compared to the non-linear PID.

SIMULATION CONTROLLER

OF

NON-LINEAR

FEED-FORWARD

PID

The transfer function of the object (controlled motor) is given as

2 S +S+1
2

The design of non-linear feed-forward pid using Simulink is shown below:

In order to get a satisfactory response, the values of the gain constants are chosen after testing the response with a trial and error method. The parameters of the non-linear feed-forward PID will be K P =8, K I =1.1, K D =2.6, KF=0.6. The control system performance can be improved by combining the feedback (or closed-loop) control of a PID controller with feed-forward (or open-loop) control. Knowledge about the system (such as the desired acceleration and inertia) can be fed forward and combined with the PID output to improve the

overall system performance. The feed-forward value alone can often provide the major portion of the controller output. The response curve of non-linear feed forward pid whose reference signal was a simulation step with step size of t=0.01s is given below:

The adaptability and robustness of the system is thus improved by using a nonlinear feed-forward pid controller.

CONCLUSION
In this report, with reference to the design of the controller of a smart car system, we discuss the contradiction which the linear PID controller itself cannot overcome. By introducing the non-linear PID, we effectively solve the contradiction between speed and stability of the linear PID controller. The final simulation results show that the nonlinear PID, compared with the linear PID, dramatically enhances both the dynamic performance and stability. On the basis of this, we add the feed-forward control system so that the dynamic performance and stability is further enhanced. As for some special systems, the non-linear feed-forward PID controller reduces the system's response time, allowing the system to further accelerate the response speed.

REFERENCES
Non-linear PID control method with feed-forward in Smart Car, Ma Shuhua 1, LiWei2 1.Northeastern University at Qinhuangdao, China, Qinhuangdao 066004 2.Northeastern University, Shenyang 110004,China www.mathworks.in/products/simulink/ http://ctms.engin.umich.edu/CTMS/index.php?example=Introduction&section=Simul inkControl Classical PID controller ppt,Eng R L Nakumba, School of technology, Copperbelt University Microstar laboratories,technical note on tuning PID by simulations http://www.mstarlabs.com/docs/tn031.html http://www.docstoc.com/docs/53326867/An-Application-of-Nonlinear-PID-Control Control Systems Engineering book by Nagrath and Gopal

Potrebbero piacerti anche