Empirical PID gain tuning (Kevin Lynch)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
the best way to find the gains for your PID controller are to derive the equations of motion of your system and then use systematic methods from linear control theory to find good choices of the gains now often we can still design a good PID controller even without a good model of the system and the way we do that is doing empirical gain tuning so we're going to try an example of that right now so first you might want to choose some reasonable gains for your system based on how much control effort you know is available and how much error you can expect to have so we're going to start with some reasonable gains but first let's take a look at our system over here this yellow line represents what we're trying to control maybe it's the position of a robot arm this white line represents our reference signals so initially the reference is 0 and then it jumps up to some value and stays constant let's call this step input to our controller and therefore what we're going to be looking at is the step response of our controller so what's this is a simulation written in MATLAB let's try some gains for this unknown system so PID tests and I'll start out with a a negative value for my proportional gain zero for the integral zero for the derivative and if I have wires to the motor hooked up backwards for example maybe I need positive gains maybe I need negative gains so this will just be a test to see whether I need positive or negative gains so I press ENTER and you can see here that the response of the motor went the wrong way it's not going up it's going away from the desired value so that means I need positive gains so let me try again with a value of 1 for the proportional contain and zero and zero for the integral and derivative and now we can see that the the output rises closer to the reference value but it's still not doing very well so this is my first guess and a mark that with one so this is my case of P axis for our proportional gains K sub D for derivative gains and my first guest here was at K sub P with a 1 K sub D equal to 0 since I'm still far away from my desired value I need to increase my proportional gain so let me raise it to 10 and now you can see that we're coming closer to the desired value so this is my guest number 2 but we're still pretty far away let's try increasing it by another factor of 10 ok now we're getting closer but we still have a lot of ringing and overshoot here so let me mark this as guess 3 for the heck of it let's try increasing the gain by another factor of 10 okay and now we're not getting any improvement in behavior in fact if we took a look at our control signal we would see that because we have such large gains for K sub P that the control signal is always saturating it's always at its maximum or minimum limit so we're getting this kind of strange-looking behavior here and that says we've probably gone too far just in the case of P direction so let's backtrack a little bit and try adding some damping so will reduce our proportional gain to 100 make the derivative gain 1 and I see that there's not much of an effect so this is guest number 5 let's try increasing that by a factor of 10 so we're going to increase the derivative gain by a factor of 10 you can see if damps out a little bit but still not very much we're getting a lot of oscillation in overshoot let's increase by another factor of 10 ok now we're starting to see more damping still oscillating a little bit so that's up here let's try increasing the damping by another factor of 10 okay now we're getting something that looks pretty good so we're getting this smooth rise and settling so this is guest number 8 so this respond doesn't look bad we still have some steady-state error let's try increasing the stiffness and increasing the damping together hopefully thereby keeping the good shape of our response and this is called the transient response while hopefully reducing this steady-state error so I'm going to double both the proportional and the derivative of game so K sub P is 200 K sub D is 2,000 okay now I'm getting even better performance still the good transient response less steady-state error so this is guest number nine we've increased in both case of P in case of D so let's stop there with our PD game tuning and by the way we can't make our gains arbitrarily high or else we're going to see chattering behavior now let's try adding a little bit of integral action so let's start out with ki is equal to one so keep Pete and D as they are and if you notice here now the response starts slowly heading towards the desired steady state value so we're seeing some effect of that case of I let's increase by a factor of ten okay now we're seeing that we're getting essentially zero steady-state Val but we've introduced a little bit of overshoot and that's what integral gain will do while it tries to reduce steady-state error it may induce some instability and if we wanted to emphasize that we could increase that gain to 100 and now you're seeing lots of overshoot and oscillations so we've gone too far with K sub I so if we go back here it looked like one was pretty good look like 10 was pretty good but maybe somewhere in between let's try five and now this is a this is a nice looking response we get the 0 steady state error fairly quickly and there's no overshoot so things you care about in your response are how much steady state error do you have here and do you overshoot and how long does it take to settle so here it settles to say within two percent of the final value by around here or so so the faster that happens the better the less overshoot the better and the less steady-state error the better if you're working with the second-order system like a force controlling a mass it's almost always best to start by tuning the proportional gain and then go to the derivative gain and to save the integral for last again it can have a destabilizing effect so you have to be careful with its use
Info
Channel: Northwestern Robotics
Views: 106,019
Rating: undefined out of 5
Keywords:
Id: uXnDwojRb1g
Channel Id: undefined
Length: 7min 7sec (427 seconds)
Published: Mon Dec 07 2015
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.