**root locus matlab** This is a topic that many people are looking for.

**thevoltreport.com**is a channel providing useful information about learning, life, digital marketing and online courses …. it will help you have an overview and solid multi-faceted knowledge . Today,

**thevoltreport.com**would like to introduce to you

**Gain a better understanding of Root Locus Plots using Matlab**. Following along are instructions in the video below:

welcome back to control system lectures in this video lets walk through several ways to draw and analyze a root locus plot in MATLAB and discuss some of the benefits and drawbacks of each method now this video is like the sixth or seventh video in my root locus series so if youd like to see the previous videos before watching this one you can go to my channel and find the root locus playlist there now this is not a MATLAB tutorial video in terms of how to use the software its intended to be a video on how to use MATLAB to help you solve your root locus problems and with MATLAB there are plenty of ways to solve a problem and so Im just going to be going through a few of them alright so what is our problem well one of my followers on Twitter sent me this transfer function from his exam where he was asked to draw the root locus plot and based on how this transfer function is written with a G of S and an H of s we can assume that the form of the block diagram is probably something like this where K is the gain we have control over G of s is the forward transfer function and H of s is the feedback transfer function which are just standard letter nomenclatures now I didnt mean to write K before G of s times H of s here instead what Im trying to show is that G of H can be thought of as everything other than the gain K now the problem doesnt state which part of this remaining transfer function is G of s and which is H of s but for drawing the root locus it doesnt matter because if you recall the closed-loop transfer function for this system is K times G of s divided by 1 plus K times G of s times H of s and to draw the root locus we only need the characteristic equation in the form that its already in exactly the way the problem provided it we would need to know G of s by itself if we were concerned with system response and not just the pole locations and the root locus okay so we have our G times H and now before we do anything in MATLAB we should attempt to draw this transfer function by hand just to see how close we get now first thing I do is plot the locations of the poles and zeros of G of H and we can see that there are 4 poles at 0 minus 4 minus 2 plus 4 J and minus 2 minus 4 J and since there are no 0s wed expect four lines to go off to infinity let me draw the s-plane and then mark out the four open-loop poles and if you watched my other videos you know to fill in the real access to the left of the odd critical frequencies and now we can determine the angle of the four asymptotes which are always 45 135 225 and 315 degrees and that these asymptotes cross the real axis at the center of gravity of the poles of zeros and thats easy for us to figure out since there are so symmetric its just at minus 2 now we know these lines eventually end up on these asymptotes but how to get to them either require some more math or some more experience in drawing root locus but we do know that the two poles on the real axis crash into each other and leave at 90 degrees and then head towards the other poles where they split off and go to the asymptotes perhaps its something like this dashed line or perhaps like this solid line but these two different ways to draw the lines arent actually that different and we still get the general idea so with the hand drawing complete lets go to MATLAB and see how to duplicate it there for this demonstration Im using MATLAB 2014 B but both slightly older and newer versions of MATLAB should work just fine now Im going to build up the root locus slowly at first to show you what its doing behind the scenes and then well progress through

easier ways to visualize it so please stay with me through it now the first thing we want to do is build our transfer function object and like Ive said in past videos there are many ways to do this my favorite is just to define a simple transfer function called s and then I can use that transfer function to build out more complicated functions and here Im using s to write out our transfer function gh now Ive left off the variable K but I essentially assigned K equals 1 as you can see in the numerator but by multiplying gh by again we can adjust what K is for example if I set K equals 2 and multiply gh by K you can see that the numerator is now 2 so by multiplying gh by various Ks we can see the impact that the gain has on the system but before we get to that a second way to define the transfer function is by using the T f function let me bring up what our GH was again as a reminder now I define the numerator and denominator polynomial coefficients the numerator is easy its just 1 and the denominator is 1 8 36 80 and 0 now we can set G H to the transfer function thats built from our numerator and denominator coefficients and we got the same result but it did require us to have to multiply out the polynomial so we can get the coefficients in the first place which is fine if you start with a transfer function in polynomial form at the beginning now the last way I want to show you is to create a transfer function using the function zpk which stands for zeroes poles and gain now you specify where you want your zeros and your poles and what the gain should be and then it just builds the transfer function Ill bring up G H again for reference and we have no zeros so we pass in an empty matrix and we have for poles 0 minus 4 and the roots of the second-order equation which are minus 2 plus 4 I and minus 2 minus 4 I and again it is the exact same transfer function now Im going to go back to the representation earlier though because Id like to look a bit more and I want to show you how to find the poles and zeros if you didnt already know where they were so if you have the transfer function you can use the function pole to find the poles and 0 to find the zeros and if we do that we can find that there are 4 poles and no zeros just like we solved for before or if youre not into simple functions like that you could also use the function roots which as you might have guessed solves for the roots of a polynomial you just have to pass in the coefficients of the polynomial exactly like we did for the function TF and no surprise we found the exact same four poles but finally you might not want to solve for the poles and zeros and instead just want to see them visually plotted in the S plane and we can do that with the function PZ map or the pole-zero map let me dock this plot so its easier to see and increase the line width because they start out so small and here you can see the four poles of the open loop function G H plotted out in the S plane and we can use this function to also plot the poles and zeros for the closed-loop transfer function this requires using the function feedback to show you how to use feedback lets write a really small script to plot the pz map for the closed-loop system as we sweep the game from 0 to 10 Ill write a for loop to cycle through the games now I want to use pz map on the closed-loop system for each of those games the function feedback will take your feed-forward transfer function and your feedback transfer function and create a closed-loop system from them as I explained earlier we dont know how to split up G and H so we have no choice but to assume gh

is just the forward transfer function which will multiply by our gain K and the feedback transfer function is 1 or unity feedback Ill hold the figure so I can plot multiple times on it without overwriting the previous plot and then Ill end the for loop and there it is on the plot now its really hard to see I should have made the markers larger but the poles are starting at K equal 1 and as the gain increases the two poles on the real axis are moving in towards each other and maybe the two imaginary poles are coming down its too hard to see since we didnt fill in the entire plot so lets try that again but this time from K equals 1/2 a hundred and one jumping every 10th number Ill rewrite the exact same script changing just the for loop part and rerun it ah thats a little better its starting to take shape and its starting to look exactly like what we drew at the start of the video but you can see with this method of drawing the root locus its really hard to figure out the right range of gains so that the entire plot is filled out luckily there is an easier way to draw the root locus and that is with the function our locus first let me unhold the figure so we can erase whats already on there next time we plot and instead of that script I wrote I can just say our locus of GH and like magic the root locus shows up and if I zoom in on the area of action we can see that the locus starts at the four open-loop pole and since there are no open-loop zeros they go off to infinity in the manner that we predicted and that was pretty easy plus we can also add a gain marker to see what value of K it would take to place a root at a certain point and we do that by clicking on the line where we want to see it let me make the font a bit bigger so you can hopefully see it also and this pop-up tells us some important information like the gain the pole location and the damping ratio and if we grab it we can drag it along the locus and watch those values change real time so you can use this to find the game needed for certain damping ratio or to see when the system will go unstable but you can also add more gain markers and move them all individually which is cool but the downside of our locus is that you cant see how all of the roots move at the exact same time you only have control over one root also you cant easily see the effect of your compensator design on the system for this we need to use the sigh so tool which is also called the control system designer to run this isoh tool youre going to need the control system toolbox now theres a few ways to open up this tool one way is through the apps tab now my screen capture cut off the top of the screen but if you click on the apps tab up at the top you can see a list of the applications you have installed and if you have the control system toolbox you should be able to find the control system designer clicking on that brings up the tool and two windows theres the design window on the right and the manager window on the left and I know this looks daunting at first but its easy to get started with it and then you can explore all of the additional features from there well start with the manager window and the architecture tab you can see a block diagram of the architecture that the system designer is using and this matches the one we have for our system there is a compensator C which is just gain K for us theres the feed forward path G which is G times H for us and the feedback path H which is one but if you had a system architecture thats different than the one that were using you can change it using this control architecture tab

to any one of the preset diagrams but were going to go back to where it was because thats what we had now after you choose your architecture the second step is to assign transfer functions to each block in the diagram you can do that by clicking on system data by default you can see each one is set to one which is a pretty boring system but we can update it for our system by selecting the forward path G and a signing in our transfer function gh and once I hit okay the design window instantly updates to reflect the new system but by default as you can see there are a bunch of plots in the design window that we dont want to look at so we can customize what we see using the graphical tuning tab so it looks like we have three plots turned on and since Im only concerned with the open-loop root locus Im going to set the other two plots to none and theyll go away well get into how this plot differs from our locus in a second but first I want to show you two more ways to open this tool you can call it directly with the function sigh so tool and again it will default all of the system data to ones or you can pass in the forward transfer function and it will automatically set it for you so you dont need to mess with the system data its completely up to you how you want to launch the tool okay so now we can finally check out the root locus plot you can see the four roots in this magenta color and when you grab one of them and drag it along the locus all four of them move at the exact same time and once you move it the new gain of the system is displayed in the lower left here it has a value of 116 and as you move the roots the pole location damping and natural frequency are shown in real time so the same information as our locus but heres where the tool really shines you can click on analysis plots and open the number of plot types and up to six different plots I want to see what the step response looks like for my closed-loop system so in plot one I select step which opens up a new figure now I need to select what the input and output is for my step plot and my options have letters like r2 Y and D u 2y to figure out exactly what that means we can go back to the architecture tab open up control architecture and this diagram explains all of the different signal names so for us we want the step from the input R to the output Y which is this first plot and the really cool thing about this analysis plot is that is updates real-time as you move the gain root locus so you can see instantly the affect your compensator changes are having on your system and you can see what your compensator looks like by clicking on the compensator editor tab at the moment I just have a gain of about 89 which I can update from here as well and see everything change accordingly but I can also add poles and zeros to my compensator by right-clicking in the dynamics area and selecting whatever I want to add Ive added a real pole at minus 1 and you can see how the root locus and the step response changed because of it also it added the transfer function of the pole to my compensator design and once I add that pole I can drag it dynamically in the root locus or set a new value from the compensator editor and if I delete it everything goes back to its original value but lets add something a bit more complicated like a notch filter again everything updates real time but since a notch filter is a little harder to visualize we can go back to our analysis plots tab and add a bode plot for our compensator design this will allow us to see the frequency response of our compensator and its effect on the step response of the system at the exact

now if we go back to the compensator editor and we make a few changes of some of the values you can see the notch width and the depth change in the bode diagram thats pretty cool right okay let me remove that plot and again remove the notch filter from our design so we go back to the way we were at the beginning and finally you can also add poles and zeros directly to the root locus using the Xs and Os button at the top of the plot so this is all really cool ways of seeing the relationship between your compensator design your root locus plot and the system response for a single transfer function but let me show you something that is probably my favorite feature of this isoh tool stacked functions ill start by creating a series of different but similar transfer functions then i can use the stack function to combine them all into a single object that Ill call gh stacked the one in the transfer function just means that I want a table that has width of 1 so basically a column of transfer functions and there you can see we have our transfer function array now you cant see what Im doing because my screen capture cut off again but I typed size OTool and passed it in the new transfer function gh stacked Ill bring up and rearrange my windows once again at this point it might not look that much different than it was before but if I zoom in on the root locus you can see faded dots for all of the poles of all of the different systems and if I move one of the poles all of them move this is because I have multimodal display set but it gets better because I can also set that in my step response either to individual responses where you can see the step response of each transfer function or to bound which just shades in the region between the extreme responses and all of this updates real time the reason this is so cool is that you can use it to design a single compensator that will work for multiple transfer functions sort of like a makeshift robust controller for example you could add design requirements to the step response plot like it must have rise time less than two seconds and settling time less than four seconds with no more than 20% overshoot then you can see graphically whether youre meeting your requirements not just for a single transfer function but across all of your stacked transfer functions here you can see that some of my responses meet the requirement but not all of them so I need to work on my compensator now the first thought might be to adjust gain only so I try that but as you can see as I lower the gain eventually the rise time requirement isnt met on one function before the overshoot is met on the other so perhaps we can solve this with a lead compensator now I have to admit that Im just trying things based on what I think will work Im not putting any mathematical effort into designing this system so this is not necessarily the best design just one that might work now I can play with the lead compensator a bit and then adjust the gain until I get something that works and thats pretty close I think you can see that Im not really meeting my requirements just for a bit but I think I can get an exception for that now I think if you play around with a couple of transfer functions and the sigh so tool youll gain a better understanding of what the root locus plot looks like for various systems as well as how adding poles and zeros affect the shape of the plot also you get to see real time the affect your compensator design has on the response of the system if you have any questions or comments please leave them below and I or hopefully another viewer will try to answer them dont forget to subscribe so you dont miss any future videos and dont forget to check out the links in the description for more information on these MATLAB demos and thanks for watching

tags:

feedback, control system lectures, theory, flight controls, education, matlab, lecture, lesson, brian douglas, automatic control, control theory, control sys…

Thank you for watching all the articles on the topic **Gain a better understanding of Root Locus Plots using Matlab**. All shares of thevoltreport.com are very good. We hope you are satisfied with the article. For any questions, please leave a comment below. Hopefully you guys support our website even more.