Cruise control systems have become mostly standard now on automobiles. These systems are a good example of PID control systems in use, using cruise control is very simple for the driver. For example, a 2012 Honda Accord is showed on the left of this slide. And the cruise control buttons on the steering wheel are shown on the right side. Push the Cruise button, and the cruise control system is ready for programming. Accelerate to your desired setpoint, and then press the button labeled Decel/Set. Take your foot off the accelerator pedal and relax, but don't fall asleep. You will cruise at a constant speed on the highway, at or below the speed limit if you want to avoid risking a speeding ticket. If you press the Cancel button, the cruise control is disabled and you will decelerate unless you press your foot back on the accelerator. Pressing the brake pedal with your foot does the same thing as pressing the Cancel button. Right after that, you can press the button labeled Res/Accel to re-enable the system at the same speed you were cruising at before. If you're already cruising at a constant speed, you can make small adjustments to the setpoint in the following way. Press the button labeled Res/Accel for each increase in your desired setpoint of one mile per hour. In Europe or Asia, your setpoint would go up by one kilometer by hour. Press the button labeled Decel/Set for each decrease in your desired setpoint of one mile per hour. Some people say that Cruise Control Systems are the first example of autonomous driving, but I don't think so. With Cruise Control, the driver still needs to stay awake and steer the car. With autonomous driving, the driver is welcome to fall asleep, but after that, all bets are off. You might wake up in time to avoid the oncoming traffic, but then again, you might not. PID control is an abbreviation for proportional integral derivative control. In cruise control systems, the proportional control is the dominant system. The vehicle calculates the difference between the setpoint and actual speed. And automatically depresses the accelerator pedal to speed up the car. The system eases up on the accelerator pedal the closer you get to the setpoint. The integral control is the second most dominant system. On steep hills, it opens up the throttle a little more than the proportional control would. Again, by depressing the accelerator pedal. It also helps the car settle in slowly to the correct speed without overshoot. Essentially, it enables critical damping as discussed in the last video. The derivative control senses the deceleration going up a steep hill earlier than the integral control is able to do. Giving it the fastest ability to keep the car from slowing down. The derivative control also senses acceleration due to gravity when going downhills. On some later cars, it will downshift the automatic transmission in order to provide braking power from the transmission. This can keep the car from accelerating rapidly. And prevent the driver from pressing the brake pedal in order to avoid getting a speeding ticket. The proportional factor in PID control is the product of gain and measured error E. A large proportional gain or error gives a large output from the proportional factor. And the output can catch up quickly to the setpoint. However, setting the proportional gain too high causes a controller to repeatedly overshoot the setpoint, leading to oscillation. If you make the proportional factor too small, the loop output becomes very small. And the signal may not catch up to the output, we will show you in the next four slides why this is the case. Let's go back to our series RLC Circuit and apply proportional control. We already showed that the Laplace transform of the natural solution is given by s squared + R over L s + 1 over LC = 0. Which simplifies to s squared + alpha omega n plus omega n squared = 0. Once you substitute in the definitions for omega n and alpha. The plant model for our second order circuit is taken by dividing the Laplace transform of the output voltage. Across the capacitor by the Laplace transform for the natural solution. This gives us our plant transfer function Gp of S. Where Gp of s = omega n squared divided by s squared + alpha omega ns + omega n squared. The diagram on the bottom of this slide shows our PID controller placed in front of our plant model in our loop. A sensor would measure our output voltage and our summing junction would feed the error into the front end of the controller. If we are using only proportional control, then the gains, Ki for integral control, and Kd for derivative control, are set to 0. The controller model is U of s = Kp times the error signal E of s. The Open Loop Transfer Function is the product of the plant and controller transfer functions. So that Gp of S times Gc of S = omega n squared Kp slash s squared + alpha omega n + omega n squared. The Closed Loop Transfer Function is given by the equation. G of s = Gp of S times Gc of S divided by the quantity 1+ Gp of S times Gc of S. Which is the standard way of formulating a Closed Loop Transfer Function given the Open Loop Transfer Function. Now let's calculate the Closed Loop Transfer Function. We formulate an algebraic expression for G of S by substituting in our Laplace transforms for the plant and proportional controller. This gives us that the Closed Loop Transfer Function G of S = omega n squared Kp. Divided by the quantity s squared + alpha omega nS + 1 + Kp times omega n squared. We can calculate an effective closed loop solution for omega n and alpha. This can be done by inspecting the terms in the denominator of our Closed Loop Transfer Function. The term, 1 + Kp times omega n squared is the square of the closed loop natural frequency, as it is the constant term in the denominator. Solving for the closed loop natural frequency, we get omega n closed loop = omega n times the square root of 1 + Kp. If we want to find alpha for the closed loop solution. We need to divide by the ratio of the closed loop to open loop natural frequencies, which is the term square root of 1 + Kp. And then alpha for the closed loop solution equals alpha divided by square root of 1 + Kp. As you increase Kp, the closed loop natural frequency increases and the closed loop damping ratio decreases. This results in larger and faster oscillations, which will greatly increase your overshoot. You can optimize your rise time, settling time, and peak times if you don't increase Kp too much. However there is still one problem left that you can't solve solely by using proportional control. Our Closed Loop Transfer Function, G of S, is shown at the top of this slide. For a step function R, the error is simply R minus R times G of S. You can find the steady-state error by letting S approach 0. Unfortunately, the steady state error does not come out to 0, it is calculated as E of S = R divided by 1 + Kp. The only way to get steady state error very close to 0, the goal of any control system is to make Kp a very large number. But as you saw on the prior slide, this would cause a great deal of overshoot. So now we need to study how to use our integral and derivative terms. To get close to zero overshoot and zero steady state error at the same time. Let's look at how integral control works. The output of an integral loop is equal to the integral gain, Ki, times the integral of the error. Which means that the loop is looking mostly backwards in time. The loop stores all of the integrated error, whether positive or negative. This means that when the proportional term runs out of gas attempting to close the error to 0. The integral term is still attempting to reduce error. It functions best when absolute error is kept very small, as its main purpose is to take the error from close to zero to actually zero. Most of the control loop action at steady state is due to integral control. It acts to make very small adjustments to keep the process in control. On the downside, the integral control error contributes strongly to overshoot of the setpoint. Which is why we need differential control to overcome this problem. The derivative term looks at the rate of change of the error. The more the error changes or the longer the derivative of time, the larger the derivative factor becomes. The effect of the derivative term is to counteract the overshoot caused by P and I. When the error is large, the P and I terms increase the output u of t. This aggressive response can cause overshoot, the derivative then acts more aggressively to reduce the overshoot. This slide summarizes the relative effects of the P, I, and D control terms. High proportional gain allows you to come close to the setpoint quickly. But too much of it causes overshoot when you attempt to get to zero steady state error. You counter this problem with integral control, as the means of having zero steady state error. But then you will get some overshoot, you counter the overshoot by using a modest amount of derivative control. But make sure you don't use too much of it, the system can become unstable if you do. Now let's derive the Closed Loop Transfer Function for full PID control of a series RLC Circuit. The plant model Gp of S is the same as in our transfer function for proportional control. The controller model is more complex now, as it includes the full P, I and D terms. The controller model U of S is given by Up of S, plus Ui of S + Ud of S, all times E of S. Where E of S is the Laplace transform of the arrow. The Open Loop Transfer Function is the product of the plant model, Gp of S and the controller model, Gc of S. Of course, the algebra is much more complex. Now that the controller model has the integral term, Ki divided by S, and the derivative term, Kd multiplied by S. In the last row of the formula, we multiply numerator and denominator by S over S. So that we have no terms multiplied by 1 over S. This gives us a third order equation in the denominator, which is going to complicate the solution greatly. The Closed Loop Transfer Function takes the same form as that for the proportional only transfer function. G of S = Gp of S times Gc of S divided by 1 + Gp of S times Gc of S. When you plug in terms, you get the complex equation shown on the left side of the slide. Which reduces somewhat to the equation on the right side of the slide. The Closed Loop Transfer Function is a third order system with two zeros. Kp, Ki, and Kd give complete control over the three poles of the system. This equation can be solved analytically using an iterative approach. A specific example of how to do this is given in one of the references cited in the course. It is too long to go over here, but let me summarize quickly. First you let Ki equal to 0 and reduce the third order equation to a second order equation. You then solve for Kp and Kd to give satisfactory rise time and overshoot specs. And then you would just Ki until a satisfactory settling time is met. Graphically, you would be using your analytical method to find the satisfactory solution for the rise time, overshoot, and settling time. Of your response to a step function. These are three independent output parameters for which you can set targets in terms of seconds, or milliseconds. You have three independent tuning parameters, Kp, Ki, and Kd, so you have the proper match of output and inputs. Back in 1942, two employees of the Taylor Instrument Company named John Ziegler and Nathaniel Nichols. Came up with a rule of thumb method for finding reasonably accurate tuning parameters without having to do all the algebra. Being very useful in an age where nobody had calculators. And the first computer was still a couple of years away from being invented, it was widely copied. Today, their method of tuning bears their names and is known as the Ziegler Nichols method. It is still the most common method for manual tuning of controllers. Their method for full PID control is adequate where stability is achieved after a quarter wavelength of time. It works like this, first set, Ki and Kd to zero, and increase Kp until the loop output oscillates. Second, document the critical gain, Kc, and the period of the output, P sub c. Third, adjust Kp to 0.6Kc, Ki to 2 times Kp divided by Kc and Kd to Kp times Pc divided by 8. Let's recap, now you understand the basics of PID control, which teaches you how to prepare one process controller for production. But what if you need to control an entire plant full of equipment? That's where plant control methods come in, the subject of our next video.