Lab 2- Linear Plant AMME3500- System Dynamics & Control Thursday Week 7 AMME3500 LAB 2- PROPORTIONAL & PD CONTROLLER Aim To demonstrate the key concepts involved with proportional plus derivative (PD) control, and as a result, the effects of adding integral action (PID) to the system. Procedure 1. A model of the plant was constructed using four 500g masses and carriage 1 from Lab 1, with no springs or damper attached. 2. Observed the behaviour of the system as a √2 Hz spring-mass oscillator by executing the system after displacing the mass carriage approximately 3cm and releasing. 3. Predicted the effect of doubling the proportional gain and verified the result experimentally. 4. Observed the effect of an increased value of derivative gain. 5. Designed controllers with a system natural frequency of 4Hz and three different damping cases: under damped (ξ = 0.2), critically damped (ξ =1.0) and over damped (ξ = 2.0). 6. Implemented the under damped, critically damped and over damped controller (via PI + Velocity Feedback) and set up a trajectory for a 2500 count closed loop Step with 1000ms dwell time and 1 rep. 7. Added integral action and executed a 2500 count closed-loop step of 2000ms duration. 8. Observed the effect of increasing integral action. Figure 1. Rigid body PID control – control block diagram Lab 2- Linear Plant AMME3500- System Dynamics & Control Thursday Week 7 Calculations- Proportional and Derivative Control Actions Use Eq. 6.2-3 to determine the value of kp: kp ∗ khw 𝜔𝑛 = √ 𝑚 Where khw = 13505.2 (from Lab 1 results) ωn = √2 Hz m = (2 + 0.766) kg = 2.766kg (from Lab 1 results) We get a value of kp = 0.016. Figure 2. Step Response with kp = 0.016 We note that the plot is quite under damped because our value for kp is significantly small. The frequency of oscillation for the above plot is determined as follows: 𝜔𝑛 = 10 𝑐𝑦𝑙𝑒𝑠 = 1.4286 𝐻𝑧 7 𝑠𝑒𝑐𝑜𝑛𝑑𝑠 If the proportional gain kp is doubled, we expect the natural frequency to increase by √2 based on the relationship between kp and ωn in Eq. 6.2-3. To verify this claim, we execute the system with kp = 0.032. Lab 2- Linear Plant AMME3500- System Dynamics & Control Thursday Week 7 Figure 3. Step Response with kp = 0.032 The frequency is now found to be: 𝜔𝑛 = 5 𝑐𝑦𝑙𝑒𝑠 = 2.083 𝐻𝑧 2.4 𝑠𝑒𝑐𝑜𝑛𝑑𝑠 The frequency has indeed increased by a factor of approximately √2, thus verifying our claim. It can therefore be concluded that the natural frequency ωn is directly proportional to the gain kp. If kp is increased by a factor, ωn will increase by the root times 2 of that factor. 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 may become unstable. A small gain meanwhile results in a small output response to a large input error, and a less sensitive controller. However, if the proportional gain is too low, the control action may be too small when responding to system disturbances. To achieve kdkhw = 50 N/(m/s)4, the value of the derivative gain has to be: 𝑘𝑑 = 50 = 0.003702 13505.2 Increasing kd by a factor of 5 yields kd = 0.0185. All group members in turn felt the damping of the system while trying to manually displace the carriage. It was agreed that the system physically felt more damped and the carriage was harder to move with a larger value of kd. Lab 2- Linear Plant AMME3500- System Dynamics & Control Thursday Week 7 Calculations- PD Control Design Using Eq. 6.2-3 and Eq. 6.24, and given that ωn = 4Hz, we design controllers for three different cases: Case 1- ξ = 0.2 (under damped) 𝑘𝑝 ∗ 13505.2 4 ∗ 2𝜋 = √ 2.766 0.2 = 𝑘𝑑 ∗ 13505.2 2 ∗ 2.766 ∗ 8𝜋 ∴ 𝑘𝑝 = 0.1294 ∴ 𝑘𝑑 = 0.002059 Case 2- ξ = 1.0 (critically damped) 𝑘𝑝 = 0.1294 1.0 = 𝑘𝑑 ∗ 13505.2 2 ∗ 2.766 ∗ 8𝜋 ∴ 𝑘𝑑 = 0.0103 Case 2- ξ = 2.0 (over damped) 𝑘𝑝 = 0.1294 2.0 = 𝑘𝑑 ∗ 13505.2 2 ∗ 2.766 ∗ 8𝜋 ∴ 𝑘𝑑 = 0.0205 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, however it slows the transient response of the controller. Calculations – Step Response Implementing the under damped controller (via PI + Velocity Feedback) and setting up a trajectory for a 2500 count closed loop Step with 1000ms dwell time and 1 rep, we observe the following plot: Lab 2- Linear Plant AMME3500- System Dynamics & Control Thursday Week 7 Figure 4. Step Response with ξ = 0.2 (under damped) Repeating the process for the critically damped and over damped cases respectively, we get: Figure 5. Step Response with ξ = 1.0 (critically damped) Lab 2- Linear Plant AMME3500- System Dynamics & Control Thursday Week 7 Figure 6. Step Response with ξ = 2.0 (over damped) We can see from the plots that as the damping ratio increases, the oscillations decrease and the steadystate error also decreases. Calculations – Adding Integral Action To achieve kikhw = 7500 N/(m-sec), the value of ki has to be: 𝑘𝑖 = 7500 = 0.5553 13505.2 Implementing a controller with ki, kp = 0.1294 and kd = 0.0103, and executing a 2500 count closed-loop step of 2000ms duration, we obtain the plot: Lab 2- Linear Plant AMME3500- System Dynamics & Control Thursday Week 7 Figure 7. Step Response with ki = 0.5553 Increasing ki by a factor of two (ki = 1.11), we plot the step response: Figure 8. Step Response with ki = 1.11 Manually displacing the mass by roughly 5mm, it is noted that the restoring force increases with time as a result of the integral action. When the mass is let go, the system overshoots and oscillates, eventually returning to its original position. Lab 2- Linear Plant AMME3500- System Dynamics & Control Thursday Week 7 It is concluded that adding an integral controller increases the overshoot, as the system tries too hard to return it to its steady-state position. In doing so, it also results in more oscillations. However, steadystate error is minimized and rise time is decreased for large values of ki. Discussion (a) Lab preparation questions are attached at the beginning. Any questions posed in the method are answered throughout the calculations. (b) Natural Frequency kp ∗ khw 𝜔𝑛 = √ 𝑚 𝜔𝑛 ∝ √ 𝜔𝑛 ∝ √𝑘ℎ𝑤 1 𝑚 𝜔𝑛 ∝ √𝑘𝑝 Kd has no effect Damping ratio 𝜁= 𝜁∝ 𝑘ℎ𝑤 √𝑘ℎ𝑤 𝜁∝ kd ∗ khw 2√m ∗ kp ∗ khw 1 √𝑚 𝜁∝ 1 √𝑘𝑝 𝜁 ∝ 𝑘𝑑 khw = system hardware gain m = the mass kp and kd = the control gains (c) The effect of natural frequency is inversely proportional to damping ratio. Now for a damping ratio of zero: Using equation 6.2.4 kd must be zero Therefore both equations 6.2.1a and 6.2.1b read: 𝐶(𝑠) = Using Matlab to generate root locus: 𝑠3 4883(𝑘𝑝 𝑠) 𝑤ℎ𝑒𝑟𝑒 𝑘𝑖 = 0 + 4883(𝑘𝑝 𝑠) Lab 2- Linear Plant AMME3500- System Dynamics & Control Thursday Week 7 Root Locus 300 Figure 9. 200 Imaginary Axis 100 0 -100 -200 -300 -30 -20 -10 0 10 20 30 Real Axis Similarly for damping coefficient of infinity for equation 6.2.1a: Using equation 6.2.4 kp must be 0 Therefore equation 6.2.1a reads: 4883(𝑘𝑑 𝑠 2 ) 𝐶(𝑠) = 3 𝑊ℎ𝑒𝑟𝑒 𝑘𝑖 = 0 𝑠 + 4883𝑘𝑑 𝑠 2 Using Matlab to generate root locus: Root Locus Figure 10. 800 600 400 Imaginary Axis 200 0 -200 -400 -600 -800 -18000 -16000 -14000 -12000 -10000 -8000 Real Axis -6000 -4000 -2000 0 2000 Lab 2- Linear Plant AMME3500- System Dynamics & Control Thursday Week 7 Finally for damping coefficient of infinity for equation 6.2.1b Kp=0 𝐶(𝑠) = 4883 𝑤ℎ𝑒𝑟𝑒 𝑘𝑖 = 0 𝑠 3 + 4883𝑘𝑑 𝑠 2 Using Matlab to generate root locus below: 4 1 Root Locus x 10 0.8 Figure 11. 0.6 Imaginary Axis 0.4 0.2 0 -0.2 -0.4 -0.6 -0.8 -1 -14000 -12000 -10000 -8000 -6000 -4000 -2000 0 2000 4000 Real Axis It is clear from both equations 6.2.1a and 6.2.1b that for a damping coefficient of ξ=0 the characteristic roots initially start on the imaginary axis and progress outward to infinity. However as ξ approaches infinity, the root locus changes. For 6.2.1a the characteristic roots have shifted from the imaginary axis to the negative real axis. This is a similar case also for 6.2.1b however there are additional roots that extend beyond the positive real axis, hence making the system unstable at ξ=∞. (d) & (f) – a combined response The integral action behaves as an error correction factor in that it minimizes the steady state error as quickly and precisely as possible. In step 14 when we set the integral factor Ki equal to zero, the integral factor played no role in affecting the response by introducing an overshoot, but instead an amount of error was reflected in the rise time and settling time. Comparing Ki =0 to steps 15 and 16 for a critically damped scenario where ki = 0.5553 and then was doubled to ki = 1.11, a noticeable and predictable change could be seen in the response curve for the carriage. Since the integral action Ki will reflect the amount of error in the response, which can be visualized by the area under the overshoot curve, an increase or decrease for the rise and settling time will be directly influenced. Overshoot and unwanted oscillations are products of the integral action and are characteristics that are inherent to the use of this property, but are dependent on how much error is present. Lab 2- Linear Plant AMME3500- System Dynamics & Control Thursday Week 7 Even though these characteristics are undesirable, the use of Ki also is favorable in that it increases the rise and settling time of the response in order that it can reach its steady state position more quickly. An increase in Ki (doubling), as carried out in step 16, reflects an increase in error, thus there will be more of an overshoot as the integral action is working to adjust the rise time, which will have a steeper slope thus a shorter time response, and settling time, which will also take less time to achieve a 5% range about its final steady state. (e) Static or Coulomb friction may be modeled as some disturbance force acting on the output as shown in Figure 12. Using equation 6.2-1b, and the fact that Disturbance force y(s) = s/m, we obtained the transfer function between the disturbance and the output when the integral action is present to be: 𝑦(𝑠) 𝑠/𝑚 = 𝑘 𝑇(𝑠) 𝑠 3 + ( ℎ𝑤 )(𝑘𝑑 𝑠 2 + 𝑘𝑝 𝑠 + 𝑘𝑖 ) 𝑚 Applying the Final Value Theorem, we find y as s approaches zero: lim 𝑦(𝑠) = lim ( 𝑠 →0 𝑠 →0 𝑠/𝑚 𝑢) = 0 𝑘 ℎ𝑤 𝑠3 + ( 𝑚 )(𝑘𝑑 𝑠 2 + 𝑘𝑝 𝑠 + 𝑘𝑖 ) The effect of such a step function on the PD controlled system is that the final value will reduce according to the size of the proportional gain, but it will never equal zero. Figure 12. Friction modeled as disturbance force at output