Вы находитесь на странице: 1из 14

Gregory Gengler, Alexander Gratton, Nerissa Hanson Submitted to: Dr.

Pakkala Date Submitted: 11/11/2011 ME 431-021 Cylinder Position Control with PID Tuning Introduction This lab was conducted in order to demonstrate how variance of certain inputs effects the output or response of a system in Proportional (P), Proportional + Integral (PI), and Proportional + Integral+ Derivative (PID) controllers. In part 1 of the lab, a hydraulic position control system based on the use of a nonlinear hydraulic actuator including saturation and dead-zone effects was simulated in MATLAB. The parameters of the block diagram, as seen in Figure 1, were varied and the effects on the response were noted. This gave a general understanding of how each parameter within the system affected aspects of the response such as steady state error and roots of the system transfer function.

R(s)

Signal R(s) Generator (ref signal)


E(s)

Scope PID 100


U(s)

s2 +16s+100 Valve Dynamics Valve Dead Zone Spool Limits (volts)

40 Flow Gain

9.4
Q(s)

5s+1 Cylinder and Load 58 Piston Area/Kp V(s) (inches/sec)

1 s Integrator Y(s) (inches)

PID Controller (with Approximate Derivative)

Position Measurement Uncertainty (Band-Limited White Noise)

Figure 1: Simulink block diagram of a hydraulic position control system using a P, PI, or PID controller

In part 2 of the lab, the same block diagram was used. The Ziegler-Nichols tuning method was applied to this simulation to determine what values should be used for the proportional gain (Kp), integral gain (Ki), and derivative gain (Kd) within the P, PI, and PID controllers. As part of this tuning method the MATLAB functions rlocus and rlocfind were used to develop the root Table 1:Ziegler-Nichols method equations for locus for the systems closed loop poles. This graphical setting P, PI, or PID parameters representation of the root locus was then used to Kp Ti Td determine where a root locus would cross the imaginary axis and become unstable. That location determined the P 0.50 Ku proportional gain value, Ku, which was to be used in the PI 0.45 Ku 0.83 Tu Ziegler-Nichols tuning method to determine Ki, as seen in Table 1Error! Reference source not found.. Inputting PID 0.60 Ku 0.50 Tu 0.125 Tu he value of Ku to achieve at least marginal stability in the system, Tu was found from the response. Tu was then used to calculate Ti, Td as seen in Table 1. Finally, the values found for Kp, Ti, and Td were subbed into Equations 1 & 2 to determine the other gain values that should produce a tuned controller.

Page 1 of 14

Ki

Kp Ti

(1) (2)

Kd = Td Kp

These values were used to set the parameters in the Simulink block diagram to achieve the best PID controller for the given case. A more thorough description of finding the values and their effects on the systems response can be seen in the Appendix of this report. For part 3 of the lab, the Ziegler-Nichols tuning method was investigated for its use on tuning the controller for a nonlinear electro-hydraulic device. A proportional valve and Simulink block diagram were connected to a hydraulic cylinder via a test stand to create a closed loop feedback system. This hydraulic cylinder was connected to the lower portion of metal arm, like that seen in Figure 2, to actuate the arm forward and back according to the input from Simulink. The center of gravity changed location as the arm moved and was often far over the base. This movement of the center of gravity acted as a disturbance in the system and adds a point of nonlinearity to the system. The Ziegler-Nichols method was used as a starting point to tune the controller in the system to achieve the best response from the moving arm, but it was discovered that it did not work as well in this nonlinear system as it had in the linearized system used in Part 2 of this lab.

Figure 2: Metal arm actuated by a hydraulic cylinder

The effects on the system stability from varying the controller gain were observed and recorded throughout this lab. Procedure Part 1: Simulated Cylinder Position Control Using MATLAB/Simulink Using Simulink, the block diagram shown in Figure 1 was created with the following parameters [1]: Signal Generator: Square wave, amplitude = 3, frequency = 0.1 Band limited white noise: First set tc to 0.05. Then initially set the power amplitude to zero and experiment with other settings afterwards PID controller with approx. derivative: Proportional = 5, Integral = 0, and Derivative = 0, N = 100 Valve Dynamics (TF block): numerator = 100, denominator = [1 16 100] where the numbers are the coefficients of the polynomial Dead zone: Start = -2 volts, End = 2 volts Valve Position Limits (saturation block): Upper limit = 9.5 volts, lower = -9.5 volts Page 2 of 14

Flow Gain (Ky/Kp): 40 volts/gpm Piston Area (gain block): 9.4 Piston model (TF block): numerator = 1, denominator = [5 1] Piston Area/Kp = 58

Choosing ODE23T as the integration method, the simulation was run. After an initial simulation was completed, different parameters were used in the blocks to experiment with the response of the system based off the changes. These parameter changes included setting the deadband to zero, increasing the proportional gain until the response was oscillatory, decreasing the derivative gain, changing the input from a square to sine wave, ramp input, and sawtooth wave, and changing the integral gain. The varied system responses based off the multiple input changes were then analyzed to help determine the effects that specific inputs can have on the final response. Part 2: PID Controllers and Ziegler-Nichols Tuning For this portion of the lab, the same block diagram as seen in Figure 1 was built in Simulink again and the same parameters as listen in Part 1 were applied. The proportional gain value was incrementally increased until the step response shows marginally stable behavior, or close to it. The proportional gain value where this occurs was recorded as Ku. This value was used in the Ziegler-Nichols tuning equation as seen in Table 1, Equations 1 and 2, to perform the following tasks [1]: Plot the original response, i.e., Kp=1 Plot the response with Kp set to achieve marginal stability Plot the response with P control Plot the response with PI control Plot the response with PID control Plot the response using personally determined PID control settings Plot the response using a personally determined best PID controller with a sawtooth input Plot the step response using the best PID controller when the deadzone is set to 2.0 volts and the saturation limits to 10 volts

Next, the block diagram was modified as seen in Figure 3 to include In and Out ports and the dead-band block was set to zero to ensure that MATLAB would produce a linearized model correctly.

100 1 In1 s2 +16s+100 Valve Dynamics Valve Dead Zone Valve Limits Ky/Kp Piston Area 40 9.4

1 5s+1 Piston, m,b

1 s Integrator

1 Out1

58 Piston Area, Kp

Figure 3: Modified block diagram

Page 3 of 14

Using the linmod and rlocus commands in MATLAB, a state model and root locus were developed from the forward path system seen in Figure 3. Then using the rlocfind command in MATLAB, the gain margin, or amount of gain possible before the system starts to go unstable, was determined. This value was then compared to the ultimate gain value, Ku, for qualitative purposes. Part 3: Cylinder Position Control For this portion of the lab, the testing and experimentation occurred on a physical system. On a test stand, a proportional valve and Simulink block diagram were connected to hydraulic cylinder #2 on the test stand to create a closed-loop feedback system. This hydraulic cylinder was connected to a metal arm like the one seen in Figure 2. The whole apparatus configuration can be seen in Figure 4. A Simulink file within MATLAB called DiscretePID.mdl (See Appendix for graphical model) served as the block diagram that provided the necessary PID controller and reference input signal.

Figure 4: Test apparatus configuration

First, the signal generator within the block diagram was set to provide a square wave reference signal that caused the cylinder connected to the metal arm to move about 2 inches in either direction. A gain associated with this part of the system was estimated in order to set the magnitude of the input signal in Simulink. To do this, the proportional gain was set to a low value and the integral and derivative gains in the block diagram were set to zero. This resulted in a P controller configuration. With the system pressure set to 500PSI, the proportional gain was increased until the metal arm began to oscillate. The gain that caused oscillatory motion was recorded as Ku, meaning that this gain caused one or more of the systems poles to move along its root locus towards the region of instability and get so close that the system displayed marginal stability. From this response with the Ku value, the ultimate cycle period Tu was determined using an oscilloscope (HP 54600). With these two values, Ziegler-Nichols tuning method was used to tune the PID controller in order to achieve a desired system response.

Page 4 of 14

Results Part 1: Simulated Cylinder Position Control Using MATLAB/Simulink The open or forward loop in Figure 3, was transformed in to a linear time invariant (LTI) system using linmod and a root locus plot was generated from the data. The plot shown in Figure 5, shows the poles of the system to be 0,-109, and 8 6i.

Figure 5: The root locus of the system found in Figure 3, whose pole positions match those found from the characteristic equation: 0, -109, 86i

Part 2: PID Controllers and Ziegler-Nichols Tuning Plots and comments of the system undergoing various stages of tuning are located in the appendix. The ultimate proportional gain Ku was found using the rlocfind command in MATLAB and selecting a point on the imaginary axis where the poles crossed. The root locus plot shown in Figure 5 was used, and the resulting Ku was 20.478. This value was used to perform Ziegler-Nichols (ZN) tuning for the nonlinear system in Figure 1 via SIMULINK and the results are again shown in the appendix. Part 3: Cylinder Position Control Using the methods described in the procedure section, the proportional gain was increased until the system began oscillating and vibrating during each cycle. The recorded Ku and Tu for the system is 24, and 130 ms respectively. The ultimate cycle period was found using the oscilloscope, a screenshot of the marginally stable system is shown in Figure 6.

Page 5 of 14

Figure 6: Cylinder position (in purple) when Kp = 24

From the data collected via the oscilloscope, the parameters for ZN tuning can be found using Table 1 and Equations 1 and 2, the results are tabulated in Table 2.
Table 2: Gains for various controller schemes

Controller P PI PID

KP 12 10.8 14.4

Ki 0.1079 0.065

Kd 0.01625

When applying the parameters suggested for a ZN tuned PID controller, the system transient behavior was closely monitored. Again using the oscilloscope important characteristics are captured and recorded, the scope output is shown in Figure 7. The percent overshoot, peak time and settling time are found using the data cursors and the damping ratio and natural frequency are calculated using previously derived relationships in earlier experiments [2]. The results are shown in Table 3.

Table 3: System characteristics when ZN tuned Figure7: Scope output of ZN tuned system

tp [ms] 340

ts [ms] 1280

%O.S. 95.38

0.150548

n 9.3465 rad/s

S.S. Voltage [V] 6.0

Several other configurations of the PID controller were also tested. All three gain values were tweaked and adjusted in an attempt in reduce the amount of overshoot as well as decrease settling time. The transient responses are shown in Figures 8 and 9. Page 6 of 14

Figure 5: Cylinder output with PID set to: Kp=7.20, Ki=10.009, and Kd=0

Figure 6:Cylinder output with PID set to: Kp=4.80, Ki=0, and Kd=0.100

Discussion Since this system contained nonlinearities within the components, the Ziegler-Nichols tuning parameters resulted in an extremely high percent overshoot. To achieve a nearly critically damped response, the control settings for P, I, and D were then experimented with. The system with Z-N tuning was plotted in Figure 5, and the poles of the system were then further experimented with to minimize both the percent overshoot and steady state error. The proportional gain of the system was adjusted using the Z-N tuning, resulting in faster peak times with lower steady state errors as the gain increased. However, the percent overshoot increased as well with the increase in gain. The Z-N tuning gave a peak time of 340ms, settling time of 1.28s, and a 95% overshoot. The cylinder in part three is moved in both directions when it is controlled and during this process it exhibits slightly different properties. These small differences could be attributed to the small difference in pipe length due to the diagonal piping, and to the turbulence that going through those turns would cause. However, it is more likely that the differences are caused by much larger influences, such as the arm not moving symmetrically in relation to gravity, falling faster on the way down, and making it hard Page 7 of 14

to push back up. This would cause larger overshoots on the way down, and a larger steady state error on the way back up, both of which were observed. Conclusion The three gains associated with the PID controllers affect the system in different ways. The goal of the changing of the gains is to bring the system closer to critically damped. The method explored for adjusting the gains was Ziegler-Nichols tuning. However, although this was not enough to create a critically damped system, further tuning from this point was able to approach critically damped. The overall effect from tuning the gains was a much faster system, both peak and settling time, with less steady state error and no overshoot.

Page 8 of 14

References [1] Dr. John Pakkala, 2001, Simulated Cylinder Position Control Using Matlab/Simulink, Milwaukee School of Engineering, Milwaukee, WI [2] Alexander Gratton, 2011, Frequency Domain Analysis of a RLC Circuit, Milwaukee School of Engineering, Milwaukee, WI Appendix Construct the Simulink system of Figure 1. Set the command signal frequency generator to construct a square wave with frequency 0.2 Hz and amplitude 1.0. Set the dead zone of the valve to zero, and the saturation limits to a high value (much higher than the +/- 10 volts present in the physical valve) for Z-N Tuning. Experiment with the various controllers by adjusting the gains and by utilizing the ZieglerNichols method. 1) Plot the original response, i.e., Kp=1.

2) Plot the response with Kp set to achieve marginal stability. Kp = 20.478.

Page 9 of 14

3) Plot the response with P control using Ziegler-Nichols. Kp = 10.239.

4) Plot the response with PI control using Ziegler-Nichols. Kp = 9.2151, Ki = 15.7973.

5) Plot the response with PID control using Ziegler-Nichols. Kp = 12.2868, Ki = 35.1051, Kd =1.0751.

Page 10 of 14

6) Plot the response using your own PID control settings. Kp = 10.2207, Ki = 4.8216, Kd = 1.6064.

7) Change to a sawtooth waveform as the input. Plot the response using your best PID controller. Kp = 10.2207, Ki = 10.2207, Kd = 1.6064.

Page 11 of 14

8) Briefly describe the criteria used to determine your best PID controller with reference to the various inputs anticipated in the cylinder and load device. The best PID controller was setup with a minimum amount of overshoot in mind, and having little steady state error. The preliminary setup for the best PID controller was using the builtin tuning available in the PID controller block in SIMULINK. The software determined a good setup and allowed additional tweaking via graphical methods (plotting step response interactively). 9) Set the dead zone to 2.0 volts and the saturation limits to 10 volts, thus more accurately simulating the nonlinearities of the physical set-up. Plot the step response using your best PID controller and comment.

Page 12 of 14

10) Comment on the ultimate gain found and on the gain calculated using the rlocfind command in MATLAB. The ultimate gain found was 20, but the gain found using rlocfind was slightly higher. This is due to resolution error and not being able to pick a point exactly on the imaginary axis.

Page 13 of 14

4 Kd z Kd Deriv. Gain Ki z-1 Saturation min-max speed volts Discrete Transfer Fcn Kp Kp Prop. Gain Ki Integral Gain Integration Factor Ts/2 z+1 Saturation Gain1 Difference 1/Ts z-1

SIMULINK Diagram of DicretePID.mdl

Constant RPM bias =100 x value

Analog Output Analog Output


Measurement Computing PCI-DAS1002 [auto]

Signal Generator max Amp = 0.1

Product

Constant1 0=SG off 1=SG on

0.0177+0.0177z-1 1-0.9647z-1 Discrete Filter Scope

Analog Input Analog Input


Measurement Computing PCI-DAS1002 [auto]

Scope1 simout To Workspace

Page 14 of 14

Вам также может понравиться