Hi, I'm Smirti Chopra again, and I'm your instructor for the Glue Lectures for the duration of this course. This is Glue Lecture Two, and let's get into it. This lecture is titled Robot Models, because this week you guys focused a lot on different models for the robots specifically. And as usual pay attention because this lecture will help you guys with quiz two okay, with that. So, we saw at this week in Dr. [UNKNOWN] lectures that he introduced two models for the robots. That's your robot, and then one model was with respect to, you know, the angular velocities Of the wheels of the robot, which is the differential right model. And then another model that we saw was with respect to the sine of v and omega inputs. So why these two different models are, why, why is it that you know, we have a One model that's actually your angular as and the other model that's your b and they go. Well, he went over it, and he explained to you guys that, you know, this differential drive model, which is actually the one that is used with the robot, or actually the model for the robot, it's a two-wheel differential drive Thing is very important because when your implementing your controller onto the robot you have to use the correct model. It has to two wheels, so obviously you need to give it inputs with, for both the wheels. But when we are designing our controller and we are designing our controls, in that time we don't want to, you know, think in terms of wheel velocities etc., we'd rather just Think in terms of, you know, okay, me walking and I'm walking with a linear velocity and an angular velocity, and it's kind of much easier than, you know, thinking about each wheel and how it turns, et cetera. So we have these two models here, the differential drive and the simpler model, which is used for design. Okay, so I just want to show you guys this Model in action, or you know, this whole thing of how you design controllers based on the different model and then you use something else for implementation. And that's. Watch this video, it's a really interesting video. It's my work. And it's robots playing music. And they're playing Beethoven's Fur Elise, actually. The point here that I want to make is that [MUSIC] All the control that is designed for this visual box is done using the model, the simplified model that we saw, the v omega model, but then when you are implementing it onto these robots and actually converting my v omega into, you know, angular velocities for each robot and that is the input that they are getting. [SOUND] Here. So in [INAUDIBLE] it's a differential drive robot, and that's what, how we are doing it. Okay, so, how do you do that? If you really simplify and see, this was my robot, and basically what I'm saying is, you know, you go from point A to point B in time ten seconds. This is a simple thing you'll, here, this At this point it's playing note A on the piano and here it's playing some G sharp or something, let's say, on the floor piano and it needs to go from here to here in ten seconds. That is the basic problem for one robot if you really simplify it. Okay. This is the model I'm using, like I said, to calculate my V and omega to make them actually do this. That's how or however whatever trajectory they take, straight line, move like this, whatever they are doing this input that I am giving them is based of the model shown here. Choose the high level task and then control design is done here. But then the Cmd that I am going to be sending to the robots Are going to be found using this model which is the differential model. You guys have seen all this before. Okay, what happens is when you use this guy and this guy together, you can actually derive these solutions. So all I'm saying is that, I'm going to find V comma Omega based on this guy. And then I'm going to convert it and put it into this equation here to get v r and v l. Which is what then i'm going to send to the robots. And that is exactly what you saw in that, Music playing robots thing as well. So okay that is one more we'll do another. And an intuitive example, let's go really quick over it. Let's say my velocity input that I'm giving to my robot is zero and my omega or my angular velocity is constant, what are the corresponding angular wheel velocities? So again, v and omega is what I have found out But when I send the commands to the robots, I'm going to find Vr and Vl using these equations right here. Right? So, when you plug this stuff in, you see that Vr is going to be this value here. Vl is going to be this value here. Where C is just some constant which is actually the Omega. Okay, now intuitively, do you understand what's happening here? Let's see that my robot let's its units point and I'm saying that you know it's not going straight at all it's just going to keep moving you know on its' own like I'm saying my velocity is zero but my omega is constant so I have a constant angular velocity, okay That means that my robot is not moving forward, it's just spinning in place. And that makes sense because now what we've found out, in terms of, you know, right and left wheel angular velocities. One, is simply the negative of the other. So one wheel is getting, let's say, plus five and the other is getting negative five. So they're just going to, going to make the robot spin in place. It's not going to make it go forward at all. So that was the whole intuitive example. But basically you guys should be pretty comfortable going between this,you know, mapping or transformation, from v [UNKNOWN] to v r u. Okay, with that, I'm back to our musical bot. So you guys remember this? Of course you do, it happened two slides ago. This musical bot example My Rova having to go from A to B in, let's see, ten seconds. Now I want to go a little deeper into the control. So earlier we, when we showed the mapping between, you know, v and omega and vr vlv, assume that somehow magically I really had v and omega, right. Now I want to go a little deeper and say okay. This whole finding the control V and Omega. Based on the model that I said. How, what does it actually mean? This is the model I have. Now I'm asking you guys this. That [SOUND] Let's make it really simple. My robot is here and it's looking also in this direction. Okay? It needs to go from here to here. Let's say even my Theta is perfect. It's already looking here. It wakes up at A. It needs to reach it, at 10 seconds. So why can't I just say? Guess what? Omega can be zero. And V can be, B minus A over 10. Right? And we know all of us know from Physics, Geometry from the model et cetera, that if I was to give my robot this velocity, and this omega, and at every time instant for 10 seconds, I can, I'll in fact reach this point, over here. It's simple maths, right? So why don't we do that? Why do we make such a big deal about, oh, we have to design the control V, omega et cetera, like. Is this what the robot is doing actually in that music video that we just saw etcetera? Well the answer is no. Why? Because we don't live in a perfect world. So in our world of simulation this would be perfect, yeah sure, in my computer and in my, you know. Mind, it works perfectly, but actually when I put it onto the robots, what's going to happen is there will be friction. There will be other problems. Maybe my wheels don't move at the same rate that they should or maybe the encoders are slightly off, or maybe I come and kick the robot off while it's moving. Whatever. I need - To know that let's say while I'm moving here I wear off slightly by V and omega at this point needs to know that I have gone off the path. In other words we need to have feedback, if there is no feedback of where I am in the world then, then it's so easy for me to just veer of because of, you know, problems like friction, etc. When I'm actually moving the robot and then my v and omega has no idea that I want to. So let's say while walking I come here, I'll just keep going straight instead. I'm not doing any kind, kind of you know, feedback on, on how I should be moving. So this, I think this a very key concept in controls that And kind of motivates why it is that we need state information or we need Feedback or even all the stuff that you studied about you know, PID regulators, PI everything. When you are minimizing the error you need Feedback, you need output, you need to know where you are in order to find even the error, how far you are from, what you need to be doing. For all this Feedback is a very important thing that you need. So hopefully with all this, I have kind of explained to you guys, the motivation behind why you need to know where you are in the world. And as you saw in the lectures Dr. Edgarson goes over this whole thing of wheel encoders, right. because if you have wheel encoders you will be to measure where you are. Okay, for that again real quick. this is how the wheel encoder works. Each encoder has N ticks, and a total of N ticks that means if you over haul N ticks you would have moved one revolution on the wheel which is two pi r on, you know, your distance, and then you have Dl, Dr, Dc. What is Dl, Dr, Dc is basically how much Your wheel is moving how much distance the distance of this arc, for example, based on the number of ticks. So that I have got 5 ticks how much I move? what is this distance? that is given by Dl, Dr, Dc. Dc is this. You see all this before and then okay once we had this of this is what you know, the wheel encoders give us now what, how do we find where we are in space? Okay, I know where I am in the beginning let's say I this is where I wake up. Now I use DL, DR, DC in this form, in this update equation and now I get my new position X prime, Y prime, and V prime. And remember, X, Y, and V is my state, or where I am in place, like X, Y, and looking there. That kind of a thing. Okay, cool. So this whole thing is the wheel encoders. This is how they work. So just for your general you know, knowledge or curiosity if you are wondering where did this model come from, well we could go back to our, you know concepts in physics really quick and we could be like, all right. If this is a circle, if this is me walking on the circle with radius Small r here. And I have a speed of lets say, you know, some v, linear speed. Well, I must have some angular velocity, right? For b to be walking on this circle. Otherwise, I would just keep walking straight. So how do these 3 variables, kind of you know, match up? So, There is this very famous formula we use, omega R, that kind of relates the fact that if somebody is walking or if you are tracking this point on a circle of radius R, how does the linear velocity, which is V, and the angular velocity, which is omega relate to one another? And now if I wanted to see how much distance I moved in let's say time delta t, well, what I'm simply going to do is I'm going to say, multiply this with my speed, and my distance then becomes omega r delta t. That's the distance. And I want you guys to like, kind of Understand that the same concept can be thought of in terms of the, each wheel of the robot. So if my angular velocity for each wheel is vr and my radius is r, I can actually calculate the distance moved as r times vr times dt. And from here, I'm going to let you guys figure out How it is that we'll reach this model. And as hence, I'm going to say, okay, we already found out how we got this. We know this as our model for the robot. And now can we do something to you know, kind of get this equation using The update law that we know that if we ever want to find the position of the next time is when we simply say position of previous plus x dot time. So it's a nice exercise find out how we get this model and then, all is good. With that let's go to the next example. So this is an odometry example. Just to kind of you know make it again really clear the concept of wheel-encoders again very important for the quiz. So let's say my robot starts at the origin. When I say origin, I mean my position and orientation both are zero. And it is located after the 0.1 seconds what you have to find. Now, where is it? And now it is given that your left wheel or your right wheel of the car, then takes your left wheel of the car six ticks, blablabla. All the stuff is given. How will you do it? Okay. These are the set of equations that you are going to use. First, because you know the numbers of ticks, you're going to find out how much each wheel has moved. Based on these equations right here, right. And then you're going to use them in this update law to find out finally where your x, y, and pi land up. And a real quick note just for my satisfaction here is that it's nice to wonder If I'm the robot, or if I have the robot, I know the input I'm giving it, I know the angular velocities I'm giving it, right? So why can't I myself find out through my model, which is this, right, this guy here, why don't I find out By updating using this where my next position is going to be based on just my VR and VL? Why is that that I'm using the encoder in the first place like why don't I just simulate based on my inputs where I'm going to be in the time insteasd. Well, that's exactly the point that we're trying to make here that Even though I'm giving it a certain input, I don't know that it's actually going to be doing that. So when I update my equation, I don't want to do it based solely on the model. I actually want to get feedback, physical feedback from the robot, and that's how I want to update my equation. That's why we do this whole in quarter thing instead of just simply saying, you know what? I'm going to find it myself through my update equation because I know [INAUDIBLE] And I'm going to find out where my x, y, and z line up. No, that's why we don't want to do this. We want feedback. We want to see if it actually translated into that much motion or not. That's why we use the [INAUDIBLE]. And with that, we will In this lecture and good luck with quiz two. Keep checking the forums. Bye bye.