logopic

 

  Tuning the PID Controller [12]

 

By using close loop Ziegler-Nichols method, we first set K I = 0 and K D = 0. Using the proportional control action only (see equation 24), we increase K P from 0 to a critical value K cr at which the output first exhibits sus­tained oscillations. (If the output does not exhibit sustained oscillations for whatev­er value K P may take, then this method does not apply. Thus the critical gain K cr and the corresponding period P cr are to be determined experimentally. Ziegler and Nichols suggested that we set the values of the parameters K P, K I and K D according to the formula shown in table (4), where P cr is depicted in figure (35).

 

Figure 35 : Sustained oscillation with period Pcr

 

Table 4 : Cloosed loop Ziegler-Nichols tuning paramaters

Type of controller

K P

T I

T D

P

0.5 K cr

infinity

0

PI

0.45 K cr

P cr /1.2

0

PID

0.6 K cr

0.5 P cr

0.125 P cr

Note that:

T I = K P /K I

T D = K D/K P

 

We have utilized the following steps to tune the PID parameters: [6]

  • Turn the K P, K I and K D potentiometers counter clockwise as far as they will turn. This sets all the constants to zero.
  • Power the device using a 7.2V rechargeable battery.
  • The pendulum should start from the vertical position, and should free fall and the car will not move. This verifies that all constants are properly read as zeros.
  • Increase the K P constant by turning the potentiometer counter clockwise and repeat step 3.
  • Keep repeating steps 3+4 until there is a little oscillation in the car. If the K P term is too small, the base platform will chase the top of the pendulum while θ continues to increase. K P will be too large if the drive wheel breaks free or the base oscillates at a high rate of speed.
  • Start increasing the K I the same way as K P until the pendulum can be balanced for several seconds under a constant oscillating condition. When the K I is added, the car will now accelerate faster than the pendulum causing θ to change from a positive angle to a negative angle (or vice versa). The pendulum will begin to fall backwards. The car should change directions and, again, accelerate faster than the pendulum until θ changes signs and the whole cycle repeats. This is known as the Overshoot condition.
  • Increase K D in the same manner as K P and K I until the Overshoot condition is gone and the pendulum remains balanced.
  • Once all overshoot is gone, the PID controller is tuned.

 

By using the DSPIC30f3011 device’s PWM and A/D modules we are able to demonstrate how to implement a PID controller to bring an inherently unstable system into stability. The keys to implementing this control is to have a basic understanding of the mechanical system, and identifying the derivative term would be a critical factor in the overall stability of the system. The other keys, with respect to the software, were making sure our registers never overflow.