logopic

 

  PID Controller Design [12]

 

Control Theory has evolved over the past 75 years. There has been the classic control era, modern control era and post modern (such as robust …etc) control era. Thus there are many practical solutions for designing a controller specific to this system. Though when implementing these solutions, the DSPIC30F3011 may impose constraints in timing and calculation ability which need to be considered.

 

A fixed configuration PID Controller of the form as shown in figure (29) will be used to stabilize the IP System.

 

 

Figure 29 : Closed loop system using a PID Controller


The control law generated from the PID Controller is given by

............................................................... (31)

Where e(t) is the deviation or error signal K P , K I and K D are the controller gain parameter.

 

The controller transfer function maybe generated using Laplace transforms.

................................................................ (32)

 

 

Figure 30 : PID controller structure

 

The PID Controller introduces one pole at the origin and two zeros. Hence it increases the system type by one, which results in zero steady state error. It also increases the damping in the system through K D in the s-term, while controlling the overshoot through the K P term.

 

 

Figure 31 : PID controller structure

 

The error signal is formed by subtracting the desired setting of the parameter to be controlled from the actual measured value of that parameter. This sign of the error indicates the direction of change required by the control input.

A PID controller attempts to adjust the controlled quantity in order to achieve the desired system response. The output of the PID controller can control one or more system parameters that will affect the controlled system quantity. The benefit of the PID controller is that it can be adjusted empirically by adjusting one or more gain values and observing the change in system response.

A digital PID controller is executed at a periodic sampling interval and it is assumed that the controller is executed frequently enough so that the system can be properly controlled.

The Proportional (P) term of the controller is formed by multiplying the error signal by a P gain. This will cause the PID controller to produce a control response that is a function of the error magnitude. As the error signal becomes larger, the (P) term of the controller becomes larger to provide more correction.

The effect of the (P) term will tend to reduce the overall error as time elapses. However, the effect of the (P) term will reduce as the error approaches zero. In most systems, the error of the controlled parameter will get very close to zero, but will not converge. The result is a small remaining steady state error.

The Integral (I) term of the controller is used to fix small steady state errors. The (I) term takes a continuous running total of the error signal. Therefore, a small steady state error will accumulate into a large error value over time. This accumulated error signal is multiplied by the (I) gain factor and becomes the (I) output term of the PID controller.

The derivative term is crucial in order to bring the inherently unstable system into stability. In any PID control the derivative terms acts as an anticipator. By checking the current error against the previous error, the controller can tell if the error term is getting bigger or smaller.

 

 

PID Controller Simulation

 

After incorporating the PID Controller into the system loop as shown in figure (32). We are ready to simulate the system using MATLAB Simulink. The idea behind running the simulation was to get a good understanding of how the IP dynamical system behaves. Also, to get an initial guess values for the controller parameters. Finally, to validate our work before implementing it into the controller platform (DSP).

By adding a PID block which is shown in figure (32), and choosing a suitable PID parameters, the system is stable, and the best parameters were found; p=150, I=10, D=20.the output is shown in figure (33).

Figure 32 : Close loop system with a sinulated PID controller

 

   

Figure 33 : Response with a simulated PID controller

 

 

If the error term is getting larger, the derivative term adds to the output of the controller much like that of the proportional and integral terms, but to a lesser effect. If the error term is getting smaller, this term will subtract from the output of the control in anticipation of an overshoot condition. Without the derivative term the system will always be unstable because there is no way to compensate for the overshoot condition. The effects of changes in parameters of the PID is shown in table (3), it should be noted that not all PID controllers will implement the (D) or, less commonly, the (I) terms.

 

Table 3 : Effects of PID parameters  

Parameter

Rise Time

Overshoot

Settling Time

S.S. Error

P

Decrease

Increase

Small Change

Decrease

I

Decrease

Increase

Increase

Eliminate

D

Small Change

Decrease

Decrease

Small Change

 

 

The flow chart in figure (34) shows how we implement the Digital PID Controller using C-language.

Figure 34 : Flow chart of Digital PID Controller using C-language


The following is the actual C code that is used to calculate the proportional, derivative, integral terms and the total error.