1 00:00:00,000 --> 00:00:02,520 The following content is provided under a Creative 2 00:00:02,520 --> 00:00:03,970 Commons license. 3 00:00:03,970 --> 00:00:06,330 Your support will help MIT OpenCourseWare 4 00:00:06,330 --> 00:00:10,660 continue to offer high quality educational resources for free. 5 00:00:10,660 --> 00:00:13,320 To make a donation or view additional materials 6 00:00:13,320 --> 00:00:17,170 from hundreds of MIT courses, visit MIT OpenCourseWare 7 00:00:17,170 --> 00:00:21,642 at ocw.mit.edu 8 00:00:21,642 --> 00:00:22,350 RUSS TEDRAKE: OK. 9 00:00:22,350 --> 00:00:25,120 Welcome back. 10 00:00:25,120 --> 00:00:27,120 So last time we talked about the cart-pole 11 00:00:27,120 --> 00:00:29,010 and the acrobat systems. 12 00:00:29,010 --> 00:00:30,450 Two of the model systems that are 13 00:00:30,450 --> 00:00:34,260 sort of the fundamentals of a lot 14 00:00:34,260 --> 00:00:37,378 of the underactuated control work in robotics. 15 00:00:37,378 --> 00:00:39,420 We really just talked about balancing at the top, 16 00:00:39,420 --> 00:00:41,430 showing that some of the linear optimal control 17 00:00:41,430 --> 00:00:45,420 things we've already done were consistent with balancing 18 00:00:45,420 --> 00:00:48,050 those underactuated systems at the top. 19 00:00:48,050 --> 00:00:51,690 And we said if we can, maybe today, design a controller 20 00:00:51,690 --> 00:00:54,247 to get as close to the top, then we could turn on something 21 00:00:54,247 --> 00:00:56,580 like a feedback controller based on the linear quadratic 22 00:00:56,580 --> 00:01:00,270 regulators to catch us. 23 00:01:00,270 --> 00:01:03,630 So we were basically able to do linear control at the top. 24 00:01:03,630 --> 00:01:09,240 And today we're going to do the swing up, which is in some ways 25 00:01:09,240 --> 00:01:11,580 easier, and in some ways harder. 26 00:01:11,580 --> 00:01:13,080 It turns out very simple controllers 27 00:01:13,080 --> 00:01:14,707 will get the job done. 28 00:01:14,707 --> 00:01:16,290 But showing that they get the job done 29 00:01:16,290 --> 00:01:18,570 is quite another story. 30 00:01:18,570 --> 00:01:22,080 And really my goal for today is to give you 31 00:01:22,080 --> 00:01:26,610 just a little glimpse into what the world of nonlinear control 32 00:01:26,610 --> 00:01:30,223 looks like for the other guys, for the people who 33 00:01:30,223 --> 00:01:31,390 really do nonlinear control. 34 00:01:31,390 --> 00:01:31,950 All right. 35 00:01:31,950 --> 00:01:34,230 We're going to mostly hurtle over this stuff 36 00:01:34,230 --> 00:01:36,670 and get to the computational versions, 37 00:01:36,670 --> 00:01:40,410 but if you were going to be sort of a nonlinear robotics control 38 00:01:40,410 --> 00:01:42,815 guy, you'll see a little bit of that today 39 00:01:42,815 --> 00:01:43,690 and just get a sense. 40 00:01:43,690 --> 00:01:45,270 I hope. 41 00:01:45,270 --> 00:01:50,340 And I'll finish the story with PFL, the partial feedback 42 00:01:50,340 --> 00:01:53,280 linearization, showing you the most general form 43 00:01:53,280 --> 00:01:55,590 and what it's good for in the swing up phase. 44 00:01:58,320 --> 00:01:59,280 OK. 45 00:01:59,280 --> 00:02:04,438 So non-linear control comes in a lot of varieties. 46 00:02:04,438 --> 00:02:05,980 I'm going to make this point a couple 47 00:02:05,980 --> 00:02:14,100 of times, but, roughly, one way to say what nonlinear 48 00:02:14,100 --> 00:02:17,160 control is that end up looking at your nonlinear 49 00:02:17,160 --> 00:02:20,130 equations of motion for a long time, 50 00:02:20,130 --> 00:02:23,380 and you try to find some tricks. 51 00:02:23,380 --> 00:02:27,780 So you can write down some non-linear controller, and then 52 00:02:27,780 --> 00:02:31,090 another trick just to prove that it works. 53 00:02:31,090 --> 00:02:31,590 OK. 54 00:02:31,590 --> 00:02:34,440 So one of the tricks that is pervasive 55 00:02:34,440 --> 00:02:37,740 in under actuated control, and other control, 56 00:02:37,740 --> 00:02:41,837 is to look at the energetics of the system. 57 00:02:41,837 --> 00:02:43,920 The energetics of-- the total energy of the system 58 00:02:43,920 --> 00:02:46,770 is obviously a very important quantity. 59 00:02:46,770 --> 00:02:51,780 You can imagine with our acrobat, or our cart-pole, 60 00:02:51,780 --> 00:02:57,540 we have one motor to work with, multiple state variables, 61 00:02:57,540 --> 00:02:58,680 right. 62 00:02:58,680 --> 00:03:00,460 But the energy is just a single quantity. 63 00:03:00,460 --> 00:03:03,720 So you can imagine with one motor possibly regulating 64 00:03:03,720 --> 00:03:06,120 the energy of the system, even if we 65 00:03:06,120 --> 00:03:08,860 can't regulate the entire trajectory of the system. 66 00:03:08,860 --> 00:03:09,360 OK. 67 00:03:09,360 --> 00:03:11,470 So that's one of the reasons it's important. 68 00:03:11,470 --> 00:03:14,130 So let's start by just thinking about 69 00:03:14,130 --> 00:03:16,620 if we can regulate the energy of the system, what good is 70 00:03:16,620 --> 00:03:18,520 that going to do us. 71 00:03:39,540 --> 00:03:40,200 OK. 72 00:03:40,200 --> 00:03:44,160 And again let's start simple. 73 00:03:44,160 --> 00:03:47,830 Let's do the derivation on the simple pendulum, 74 00:03:47,830 --> 00:03:52,020 then we'll do the cart-pole and acrobat immediately after that. 75 00:03:52,020 --> 00:03:55,030 So let's remember the phase portrait 76 00:03:55,030 --> 00:03:56,280 for the simple pendulum again. 77 00:04:08,270 --> 00:04:13,200 Let's say with no torque, no damping. 78 00:04:17,310 --> 00:04:18,870 We had a phase portrait-- 79 00:04:18,870 --> 00:04:21,613 I'm sure you remember-- which looked like this. 80 00:04:27,530 --> 00:04:29,900 And the way I had the coordinate system, 81 00:04:29,900 --> 00:04:34,940 we had a fixed point, unstable fixed point, fixed point. 82 00:04:43,370 --> 00:04:44,390 OK. 83 00:04:44,390 --> 00:04:46,303 If we started the system a little bit 84 00:04:46,303 --> 00:04:47,720 away from the fixed point, then we 85 00:04:47,720 --> 00:04:50,960 got these closed orbits, right. 86 00:04:50,960 --> 00:04:55,100 For the zero torque, zero damping case, 87 00:04:55,100 --> 00:04:57,260 we got these nice orbits. 88 00:04:57,260 --> 00:04:59,690 They were pretty circular, close to the origin. 89 00:04:59,690 --> 00:05:03,902 They got a little elongated as we went out. 90 00:05:03,902 --> 00:05:05,110 Look like an eyeball. 91 00:05:09,440 --> 00:05:11,870 And then there was this very special orbit. 92 00:05:11,870 --> 00:05:13,550 I didn't dwell on it before, but we're 93 00:05:13,550 --> 00:05:17,330 going to dwell on it now for a second. 94 00:05:17,330 --> 00:05:21,680 A special orbit which ends up going right 95 00:05:21,680 --> 00:05:25,480 to that unstable, fixed point. 96 00:05:25,480 --> 00:05:25,980 OK. 97 00:05:31,100 --> 00:05:33,590 What defines these orbits? 98 00:05:36,230 --> 00:05:38,240 Energy, someone said, right. 99 00:05:38,240 --> 00:05:42,930 These are lines of constant energy in the simple pendulum, 100 00:05:42,930 --> 00:05:43,430 right. 101 00:05:46,100 --> 00:05:49,280 And there is a particular line of constant-- orbit 102 00:05:49,280 --> 00:05:55,375 of constant energy here, which, if you have that energy, 103 00:05:55,375 --> 00:05:57,500 this system we know is going to go around this way. 104 00:05:57,500 --> 00:05:58,730 There's no other choice. 105 00:05:58,730 --> 00:06:01,730 If we have that energy, right, then it's 106 00:06:01,730 --> 00:06:06,260 going to find its way up to that fixed point. 107 00:06:06,260 --> 00:06:07,700 There's nothing else it can do. 108 00:06:07,700 --> 00:06:09,080 OK. 109 00:06:09,080 --> 00:06:22,280 So these orbits are called homoclinic orbits What's that? 110 00:06:27,820 --> 00:06:30,370 So a homoclinic orbit is something 111 00:06:30,370 --> 00:06:32,140 that goes from an unstable, fixed point 112 00:06:32,140 --> 00:06:34,180 to another unstable, fixed point. 113 00:06:34,180 --> 00:06:36,213 OK. 114 00:06:36,213 --> 00:06:37,630 Actually, homoclinic means it goes 115 00:06:37,630 --> 00:06:39,170 to the same unstable, fixed point. 116 00:06:39,170 --> 00:06:41,462 Heteroclinic means it goes to a different one, I guess. 117 00:06:44,110 --> 00:06:50,090 And in the simple pendulum with zero damping and zero actions. 118 00:06:50,090 --> 00:06:52,600 It's sort of easy to see that if we can design 119 00:06:52,600 --> 00:06:57,550 a trajectory which regulates the energy of the system, right, 120 00:06:57,550 --> 00:06:58,572 it's going to move. 121 00:06:58,572 --> 00:07:01,030 Let's say we set this as our desired energy for the system. 122 00:07:01,030 --> 00:07:03,790 If we can regulate the system's energy up to this, 123 00:07:03,790 --> 00:07:06,310 by applying a feedback law. 124 00:07:06,310 --> 00:07:09,550 That if we can get on that constant energy trajectory 125 00:07:09,550 --> 00:07:13,270 and stay there, then we're going to find ourselves getting 126 00:07:13,270 --> 00:07:14,870 to the unstable fixed point. 127 00:07:14,870 --> 00:07:15,580 OK. 128 00:07:15,580 --> 00:07:17,660 So that's an important observation. 129 00:07:17,660 --> 00:07:23,780 Now, regulating the energy isn't actually enough to stay there. 130 00:07:23,780 --> 00:07:26,410 Well is it? 131 00:07:26,410 --> 00:07:27,970 I should get to the-- if I really 132 00:07:27,970 --> 00:07:29,720 regulate my energy perfectly, I should get 133 00:07:29,720 --> 00:07:33,310 to the unstable, fixed point. 134 00:07:33,310 --> 00:07:36,160 But if I'm just doing energy regulation, 135 00:07:36,160 --> 00:07:38,710 then if someone were to knock me here, I'd be OK. 136 00:07:38,710 --> 00:07:40,330 I just come right back. 137 00:07:40,330 --> 00:07:42,670 If I knock me here, I'd actually go all the way around 138 00:07:42,670 --> 00:07:44,528 to this one. 139 00:07:44,528 --> 00:07:46,570 So it's not actually, doesn't actually stabilize. 140 00:07:46,570 --> 00:07:50,500 Regulating the energy doesn't actually stabilize this point. 141 00:07:50,500 --> 00:07:51,850 But it could get me there. 142 00:07:51,850 --> 00:07:53,550 OK. 143 00:07:53,550 --> 00:07:55,300 So the first thing we're going to do today 144 00:07:55,300 --> 00:08:00,460 is show that if I regulate the energy of my system, 145 00:08:00,460 --> 00:08:06,162 on the simple pendulum, to put myself on the homoclinic orbit 146 00:08:06,162 --> 00:08:07,870 then I can get myself to the fixed point. 147 00:08:07,870 --> 00:08:10,330 I turn on an LQR controller when I get there, 148 00:08:10,330 --> 00:08:14,380 and I've got a swing-up and balance controller. 149 00:08:14,380 --> 00:08:14,880 OK. 150 00:08:20,910 --> 00:08:21,450 All right. 151 00:08:21,450 --> 00:08:23,800 How do we regulate the energy of the simple pendulum? 152 00:08:28,430 --> 00:08:34,580 Let's just remember for the simple pendulum 153 00:08:34,580 --> 00:08:37,435 our equations of motion were m l squared 154 00:08:37,435 --> 00:08:41,340 theta dot plus m g l sin theta, according to the system I used, 155 00:08:41,340 --> 00:08:45,950 which was 0 down, equals my control input. 156 00:08:52,880 --> 00:08:57,350 And the energy is just 1/2 m l squared 157 00:08:57,350 --> 00:09:04,598 theta dot squared minus m g l cos theta, 158 00:09:04,598 --> 00:09:05,890 the total energy of the system. 159 00:09:11,350 --> 00:09:11,850 OK. 160 00:09:11,850 --> 00:09:16,260 So if I find myself in some theta theta dot configuration, 161 00:09:16,260 --> 00:09:19,050 what should I do to increase the energy the system? 162 00:09:22,946 --> 00:09:24,790 STUDENT: Push in the direction of theta dot 163 00:09:24,790 --> 00:09:25,582 RUSS TEDRAKE: Good. 164 00:09:25,582 --> 00:09:26,400 Yeah. 165 00:09:26,400 --> 00:09:28,030 Right. 166 00:09:28,030 --> 00:09:30,340 Whatever I want to do, whatever velocity 167 00:09:30,340 --> 00:09:33,430 I'm going at, if I push in the direction of theta dot, that's 168 00:09:33,430 --> 00:09:36,340 going to add kinetic energy to my system. 169 00:09:36,340 --> 00:09:37,130 OK. 170 00:09:37,130 --> 00:09:39,910 We can see that actually very explicitly, 171 00:09:39,910 --> 00:09:46,210 so what is the rate of change of e here? 172 00:09:46,210 --> 00:09:52,124 It's 1/2 m l squared theta dot theta double dot-- 173 00:09:52,124 --> 00:09:55,480 this half goes away-- 174 00:09:55,480 --> 00:10:03,978 minus m g l theta dot sin theta. 175 00:10:03,978 --> 00:10:05,020 I put my sin there again. 176 00:10:07,768 --> 00:10:15,250 And theta double dot is u minus m g l sin theta 177 00:10:15,250 --> 00:10:16,510 over m l squared. 178 00:10:16,510 --> 00:10:18,476 Can I do that? 179 00:10:18,476 --> 00:10:18,976 All right. 180 00:10:18,976 --> 00:10:28,050 So m l squared theta double dot is just u minus m g 181 00:10:28,050 --> 00:10:39,010 l sin theta plus m g l sin theta theta dot. 182 00:10:43,090 --> 00:10:43,800 All right. 183 00:10:43,800 --> 00:10:47,520 So that works out nice. 184 00:10:47,520 --> 00:10:50,130 It's just u theta dot. 185 00:10:56,600 --> 00:11:01,340 So it's exactly what we said. 186 00:11:01,340 --> 00:11:04,700 If you want to increase the energy of the system, 187 00:11:04,700 --> 00:11:09,733 right, then you better make u the same sign as theta dot. 188 00:11:09,733 --> 00:11:11,150 You can make it exactly theta dot. 189 00:11:11,150 --> 00:11:12,530 You can make it a constant. 190 00:11:12,530 --> 00:11:13,412 You can make it-- 191 00:11:13,412 --> 00:11:14,870 just as long as it's the same sign, 192 00:11:14,870 --> 00:11:17,270 you're going to increase the energy of the system. 193 00:11:17,270 --> 00:11:19,562 And similarly you can decrease the energy of the system 194 00:11:19,562 --> 00:11:21,068 by pushing against theta dot. 195 00:11:21,068 --> 00:11:21,860 And that's obvious. 196 00:11:21,860 --> 00:11:24,535 Really, that's just either damping the system 197 00:11:24,535 --> 00:11:26,660 with-- you're adding positive damping to the system 198 00:11:26,660 --> 00:11:29,250 or negative damping to the system right. 199 00:11:29,250 --> 00:11:30,110 OK. 200 00:11:30,110 --> 00:11:32,150 But seeing it out of these energy derivatives 201 00:11:32,150 --> 00:11:34,400 is the right way to see it if you want to do it 202 00:11:34,400 --> 00:11:36,660 for a more complicated system. 203 00:11:36,660 --> 00:11:37,370 OK. 204 00:11:37,370 --> 00:11:39,230 So good. 205 00:11:39,230 --> 00:11:46,070 So I can now imagine easily with my control torque 206 00:11:46,070 --> 00:11:47,510 regulating the energy the system, 207 00:11:47,510 --> 00:11:50,515 or increasing or decreasing it. 208 00:11:50,515 --> 00:11:51,890 So what do we want to do with it? 209 00:12:07,990 --> 00:12:10,333 Presumably we have some desired energy, 210 00:12:10,333 --> 00:12:16,210 e, which is the energy on that homoclinic orbit. 211 00:12:16,210 --> 00:12:17,170 Right. 212 00:12:17,170 --> 00:12:19,140 And what's that? 213 00:12:19,140 --> 00:12:20,890 What's the energy on the homoclinic orbit? 214 00:12:31,500 --> 00:12:32,250 M g l. 215 00:12:32,250 --> 00:12:32,750 Yeah. 216 00:12:35,390 --> 00:12:44,758 At the top it'll be [? cos of e ?] 217 00:12:44,758 --> 00:12:46,550 The only problem with this parameterization 218 00:12:46,550 --> 00:12:48,482 is I have negative energy. 219 00:12:48,482 --> 00:12:49,940 I could have done a little bit more 220 00:12:49,940 --> 00:12:52,910 carefully by putting zero potential at the bottom, 221 00:12:52,910 --> 00:12:54,110 but right. 222 00:12:54,110 --> 00:12:57,410 This one-- still our desired energy is positive 223 00:12:57,410 --> 00:13:00,080 and it's at the top, m g l. 224 00:13:00,080 --> 00:13:11,480 That's the energy you'd have if theta equals 225 00:13:11,480 --> 00:13:13,600 pi and theta dot equals 0. 226 00:13:19,500 --> 00:13:20,000 OK. 227 00:13:20,000 --> 00:13:23,780 So what we care about is regulating the difference 228 00:13:23,780 --> 00:13:29,580 between our actual energy of our system and the desired energy 229 00:13:29,580 --> 00:13:30,080 the system. 230 00:13:42,940 --> 00:13:44,550 The desired energy is constant. 231 00:13:44,550 --> 00:13:47,170 So this is just e dot. 232 00:13:47,170 --> 00:13:51,562 e tilde dot is just e dot, which is just e theta dot. 233 00:13:56,058 --> 00:13:57,600 So if I know to change e, I certainly 234 00:13:57,600 --> 00:13:59,710 know how to change e tilde. 235 00:13:59,710 --> 00:14:01,800 OK. 236 00:14:01,800 --> 00:14:04,920 So the cool thing here, let's choose u 237 00:14:04,920 --> 00:14:16,260 equals negative k theta dot e tilde, with k always greater 238 00:14:16,260 --> 00:14:16,760 than 0. 239 00:14:25,950 --> 00:14:32,570 The result then is e tilde is going 240 00:14:32,570 --> 00:14:36,620 to be negative k, which is positive, 241 00:14:36,620 --> 00:14:40,100 theta dot squared e tilde. 242 00:14:44,360 --> 00:14:45,748 Just a little manipulation. 243 00:14:49,870 --> 00:14:54,760 And that gives me that, as long as this thing is negative-- 244 00:14:54,760 --> 00:14:57,910 it's a linear equation in e-- then 245 00:14:57,910 --> 00:15:00,030 e tilde is going to go to 0. 246 00:15:08,940 --> 00:15:11,502 OK. 247 00:15:11,502 --> 00:15:12,210 And what is that? 248 00:15:12,210 --> 00:15:12,835 That's obvious. 249 00:15:12,835 --> 00:15:15,540 This is exactly the case of, I'm going to use u 250 00:15:15,540 --> 00:15:18,310 to add damping to my system. 251 00:15:18,310 --> 00:15:22,260 I'm going to add some negative damping. 252 00:15:22,260 --> 00:15:28,860 If e is greater than e desired, then this thing 253 00:15:28,860 --> 00:15:34,650 is positive, and the whole thing I'm adding, 254 00:15:34,650 --> 00:15:38,550 I'm going to be adding damping to the system to slow down. 255 00:15:38,550 --> 00:15:42,660 And if e is less than e desired, then I'm 256 00:15:42,660 --> 00:15:45,810 going to put in sort of negative damping. 257 00:15:45,810 --> 00:15:48,030 I'm going to invert the sign of this 258 00:15:48,030 --> 00:15:52,260 and add energy to the system until e is up to e desired. 259 00:15:52,260 --> 00:15:55,482 And this is going to give me a nice first order response in e. 260 00:15:55,482 --> 00:15:56,940 So that should really do the trick. 261 00:16:08,600 --> 00:16:11,470 And it doesn't take much looking at this, 262 00:16:11,470 --> 00:16:14,050 the proof would be a little bit harder, 263 00:16:14,050 --> 00:16:17,020 but it doesn't take much looking at this. 264 00:16:17,020 --> 00:16:20,350 If I did have something like bounded torque, 265 00:16:20,350 --> 00:16:22,210 bounded control input-- 266 00:16:22,210 --> 00:16:26,980 let's say I saturated u at some control limits-- 267 00:16:26,980 --> 00:16:30,790 as long as my sign is correct, I could still 268 00:16:30,790 --> 00:16:35,680 add or remove damping, according to the sine of tilde, 269 00:16:35,680 --> 00:16:38,100 and have this result that e tilde is going to go to 0. 270 00:16:40,780 --> 00:16:41,280 Yeah. 271 00:16:44,710 --> 00:16:47,230 OK. 272 00:16:47,230 --> 00:16:50,170 Even with bounded control inputs this is an OK. 273 00:17:07,010 --> 00:17:12,770 So what is the resulting phase portrait look like? 274 00:17:12,770 --> 00:17:19,220 OK so I have here exactly what we just said. 275 00:17:19,220 --> 00:17:23,839 e tilde is energy at the current state minus energy 276 00:17:23,839 --> 00:17:24,950 at the desired state. 277 00:17:24,950 --> 00:17:28,400 Let's just do negative k theta dot 278 00:17:28,400 --> 00:17:31,820 times e tilde as my control, with a pretty low k. 279 00:17:31,820 --> 00:17:36,350 And I remember what I called it here. 280 00:17:48,970 --> 00:17:50,720 That didn't stabilize it at the top. 281 00:17:50,720 --> 00:17:53,495 And so any small integration errors, 282 00:17:53,495 --> 00:17:55,370 or whatever is going to keep me from the top, 283 00:17:55,370 --> 00:17:56,740 is going to make me go around. 284 00:17:56,740 --> 00:18:00,647 But the phase portrait does exactly what we want it to do. 285 00:18:00,647 --> 00:18:02,980 This just started from two different initial conditions. 286 00:18:02,980 --> 00:18:04,420 One, that's the same one I've been 287 00:18:04,420 --> 00:18:05,670 using for all the phase plots. 288 00:18:05,670 --> 00:18:07,790 One just above the origin there. 289 00:18:07,790 --> 00:18:11,260 It adds energy up, goes to the homoclinic orbit, 290 00:18:11,260 --> 00:18:14,470 just misses the fixed point, goes around again. 291 00:18:14,470 --> 00:18:17,680 And then the other one started over here with too much energy, 292 00:18:17,680 --> 00:18:20,340 and actually slowed down to the homoclinic orbit. 293 00:18:20,340 --> 00:18:20,840 OK. 294 00:18:24,430 --> 00:18:25,840 Simple. 295 00:18:25,840 --> 00:18:30,430 So for the simple pendulum, we could design a nonlinear 296 00:18:30,430 --> 00:18:33,400 controller with pretty simple reasoning about the energy. 297 00:18:33,400 --> 00:18:37,810 And we know it's going to get as close to the up right. 298 00:18:37,810 --> 00:18:40,440 Does it also work for more complicated systems? 299 00:18:40,440 --> 00:18:45,790 What would it do for the cart-pole or the acrobat. 300 00:18:45,790 --> 00:18:49,270 It turns out it's a pretty general idea. 301 00:18:49,270 --> 00:18:49,770 OK. 302 00:18:52,375 --> 00:18:55,000 In fact, let's do the cart-pole, because the cart-pole actually 303 00:18:55,000 --> 00:18:57,160 has the pendulum dynamics embedded in it. 304 00:18:57,160 --> 00:18:59,610 It just happens to be coupled with the cart. 305 00:18:59,610 --> 00:19:00,310 OK. 306 00:19:00,310 --> 00:19:06,460 So if we, for instance, use our partial feedback linearization 307 00:19:06,460 --> 00:19:10,413 trick to decouple those dynamics, 308 00:19:10,413 --> 00:19:12,580 then we can really just keep thinking about pendula. 309 00:19:16,570 --> 00:19:17,620 OK. 310 00:19:17,620 --> 00:19:19,660 So here we go swing-up control-- 311 00:19:19,660 --> 00:19:22,825 non-linear swing-up control of the cart-pole system. 312 00:19:52,330 --> 00:19:54,923 So the dynamics were something I was 313 00:19:54,923 --> 00:19:56,340 willing to write on the board once 314 00:19:56,340 --> 00:19:59,760 and then set all parameters even gravity to one, 315 00:19:59,760 --> 00:20:04,993 and got some complaints but kept going. 316 00:20:04,993 --> 00:20:06,660 It turns out it would have been actually 317 00:20:06,660 --> 00:20:08,035 trivial for me to carry g around. 318 00:20:08,035 --> 00:20:10,930 I should have-- next time I'll do that next year. 319 00:20:10,930 --> 00:20:14,790 So I don't even have to write that today because we 320 00:20:14,790 --> 00:20:19,680 know if we apply a direct-- 321 00:20:19,680 --> 00:20:36,810 sorry, the collocated PFL, then the result of my little tricks 322 00:20:36,810 --> 00:20:40,950 with the equations is I can command a force. 323 00:20:40,950 --> 00:20:43,620 The collocated means I'm going to use 324 00:20:43,620 --> 00:20:45,753 the action to linearize the state, 325 00:20:45,753 --> 00:20:46,920 with that action associated. 326 00:20:46,920 --> 00:20:50,040 So here I'm going to linearize the dynamics of the cart. 327 00:20:50,040 --> 00:20:53,070 And the resulting system was x double dot 328 00:20:53,070 --> 00:20:55,650 equals my new control input. 329 00:20:55,650 --> 00:20:57,635 I could set that to be whatever I'd like. 330 00:20:57,635 --> 00:20:59,010 And what did it leave us with? it 331 00:20:59,010 --> 00:21:01,860 left us with theta double dot doing something 332 00:21:01,860 --> 00:21:06,450 a little funny but not too bad. 333 00:21:06,450 --> 00:21:09,660 ubar is sort of my desired acceleration here. 334 00:21:17,860 --> 00:21:22,092 OK so I've got some new, almost, pendulum dynamics here. 335 00:21:22,092 --> 00:21:23,800 And I've got obviously got this pendulum. 336 00:21:23,800 --> 00:21:25,300 And I've got this cart that I can do 337 00:21:25,300 --> 00:21:26,650 whatever the heck I want with. 338 00:21:26,650 --> 00:21:30,370 Because I've mastered the cart. 339 00:21:30,370 --> 00:21:31,280 So here's the idea. 340 00:21:31,280 --> 00:21:33,250 Let's make sure that the pendulum 341 00:21:33,250 --> 00:21:36,160 gets on the homoclinic orbit for the pendulum. 342 00:21:36,160 --> 00:21:39,593 That'll make sure it gets itself up to the top. 343 00:21:39,593 --> 00:21:41,260 And if we've done that, then we can just 344 00:21:41,260 --> 00:21:43,010 do a little bit of extra work to make sure 345 00:21:43,010 --> 00:21:44,300 that the car doesn't go crazy. 346 00:21:44,300 --> 00:21:44,800 OK. 347 00:22:30,203 --> 00:22:32,620 OK so you guys are actually going to-- on your problem set 348 00:22:32,620 --> 00:22:33,620 if you haven't already-- 349 00:22:33,620 --> 00:22:37,690 you're going to do the swing-up controller for the cart-pole. 350 00:22:37,690 --> 00:22:42,460 So I'm going to keep with my all parameters 351 00:22:42,460 --> 00:22:46,090 happened to be one lingo here, which 352 00:22:46,090 --> 00:22:48,520 forces you to handle the terms when you go 353 00:22:48,520 --> 00:22:52,690 to do it for the problems set. 354 00:22:52,690 --> 00:22:55,240 It's not bad, but it makes you think about it I think. 355 00:23:00,460 --> 00:23:00,960 OK. 356 00:23:00,960 --> 00:23:05,850 In my all parameters equal 1 land, 357 00:23:05,850 --> 00:23:15,820 the energy of the pendulum still it's just 1/2 m l squared. 358 00:23:15,820 --> 00:23:19,140 So it's just 1/2 theta dot squared 359 00:23:19,140 --> 00:23:22,080 minus m g l cosine theta. 360 00:23:22,080 --> 00:23:24,150 Just minus cosine theta now. 361 00:23:32,680 --> 00:23:38,740 And e desired is going to be 1. 362 00:23:47,960 --> 00:23:51,150 e tilde dot, that going to be theta 363 00:23:51,150 --> 00:23:59,250 dot theta double dot minus theta dot sine theta. 364 00:24:03,513 --> 00:24:04,930 theta double dot, though, is going 365 00:24:04,930 --> 00:24:08,740 to have a little bit different form than the simple pendulum. 366 00:24:08,740 --> 00:24:11,860 Because it had a few terms left over from the coupling 367 00:24:11,860 --> 00:24:13,300 with the cart. 368 00:24:13,300 --> 00:24:20,350 Right so if we stick those in we get theta dot negative u 369 00:24:20,350 --> 00:24:30,637 c minus s minus theta dot s 370 00:24:30,637 --> 00:24:33,698 STUDENT: Is it plus theta dot s or minus theta dot s? 371 00:24:33,698 --> 00:24:34,740 RUSS TEDRAKE: Good catch. 372 00:24:34,740 --> 00:24:35,240 Thank you. 373 00:24:39,010 --> 00:24:39,510 Thank you. 374 00:24:43,032 --> 00:24:44,740 I would have figured that out in a second 375 00:24:44,740 --> 00:24:46,280 when they things didn't cancel. 376 00:24:46,280 --> 00:24:59,230 Yeah so now this cancels leaving negative ubar cosine theta dot. 377 00:25:05,130 --> 00:25:05,630 OK. 378 00:25:05,630 --> 00:25:12,125 So we've got this slightly funky dynamics for the pendulum, 379 00:25:12,125 --> 00:25:14,000 now, because it's been augmented by the cart. 380 00:25:17,600 --> 00:25:19,077 But that's not too bad. 381 00:25:19,077 --> 00:25:19,910 So what should I do? 382 00:25:19,910 --> 00:25:23,690 What controller should I run to regulate this thing 383 00:25:23,690 --> 00:25:25,280 to the pendulum's homoclinic orbit? 384 00:25:42,350 --> 00:25:43,747 OK. 385 00:25:43,747 --> 00:25:44,580 So what do you want? 386 00:25:44,580 --> 00:25:45,260 You want ubar. 387 00:25:58,050 --> 00:26:00,720 It'll give us some constant. 388 00:26:00,720 --> 00:26:06,390 If I just make it, say, cosine theta dot. 389 00:26:06,390 --> 00:26:09,645 That'll make everything positive. 390 00:26:09,645 --> 00:26:12,270 There's a lot of ways to do it, but that's a pretty simple one. 391 00:26:12,270 --> 00:26:14,670 Yeah and I'll keep that e tilde there so 392 00:26:14,670 --> 00:26:16,920 that I regulate to the proper energy, 393 00:26:16,920 --> 00:26:17,940 not just to zero energy. 394 00:26:20,520 --> 00:26:21,450 And that should do it. 395 00:26:21,450 --> 00:26:29,100 So now e tilde dot should be negative k something squared, 396 00:26:29,100 --> 00:26:33,570 c theta squared e tilde, which means 397 00:26:33,570 --> 00:26:37,110 e tilde it's going to go to 0. 398 00:26:37,110 --> 00:26:39,150 Which means my pendulum's is going 399 00:26:39,150 --> 00:26:41,190 to get its homoclinic orbit, and get 400 00:26:41,190 --> 00:26:46,240 to its unstable, fixed point. 401 00:26:46,240 --> 00:26:47,590 OK. 402 00:26:47,590 --> 00:26:48,790 What about the cart? 403 00:26:48,790 --> 00:26:50,873 What's the cart going to be doing during all this? 404 00:26:55,770 --> 00:26:57,690 Yeah it's going to be going back and forth. 405 00:26:57,690 --> 00:26:59,440 Well it depends, I mean, it could actually 406 00:26:59,440 --> 00:27:01,830 wind up or something, depending on the trajectory. 407 00:27:07,210 --> 00:27:12,340 So for this system we actually have a simple-- 408 00:27:12,340 --> 00:27:14,290 if you know Lyapunov functions-- 409 00:27:14,290 --> 00:27:16,930 a simple Lyapunov function you construct from these energies. 410 00:27:16,930 --> 00:27:19,570 They would show that the pendulum gets to the top. 411 00:27:19,570 --> 00:27:23,860 If you want the pendulum and the cart to get to the origin, 412 00:27:23,860 --> 00:27:26,050 then we just get a little sloppy. 413 00:27:26,050 --> 00:27:38,230 And we say let's do, not u equals k theta e tilde c. 414 00:27:38,230 --> 00:27:40,280 We're missing a c. 415 00:27:40,280 --> 00:27:43,170 That's the first one. 416 00:27:43,170 --> 00:27:47,100 But let's add an extra term in minus k 2, 417 00:27:47,100 --> 00:27:51,860 the position of the cart, minus k 3, derivative of the cart. 418 00:27:54,780 --> 00:27:55,280 OK. 419 00:28:02,410 --> 00:28:03,580 All right. 420 00:28:03,580 --> 00:28:06,743 So sort of a sad fact, that actually doing this 421 00:28:06,743 --> 00:28:07,660 is what makes it work. 422 00:28:07,660 --> 00:28:09,100 It's trivial that, sort of, that it makes it work. 423 00:28:09,100 --> 00:28:11,620 Experimentally, you'll see it works just fine. 424 00:28:11,620 --> 00:28:13,150 It actually breaks all the proofs. 425 00:28:13,150 --> 00:28:17,750 There's a proof for a set of parameters of k. 426 00:28:17,750 --> 00:28:22,330 So someone found like if k equals 2 and k 3 equals 3, then 427 00:28:22,330 --> 00:28:25,930 I can design Lyapunov function. 428 00:28:25,930 --> 00:28:27,120 It's not very satisfying. 429 00:28:27,120 --> 00:28:28,422 OK. 430 00:28:28,422 --> 00:28:30,130 But let's see how this works in practice. 431 00:28:33,170 --> 00:28:35,530 So you remember your cart-pole system now. 432 00:29:00,210 --> 00:29:06,480 So these controllers were described very nicely 433 00:29:06,480 --> 00:29:09,330 by Mark Spong in a paper in '96 so that's 434 00:29:09,330 --> 00:29:13,950 my spot '96 controller. 435 00:29:13,950 --> 00:29:18,390 Basically, you can see I just check 436 00:29:18,390 --> 00:29:24,410 some distance between the current state 437 00:29:24,410 --> 00:29:28,400 and some sort of hand designed distance space there. 438 00:29:28,400 --> 00:29:30,980 I just see how close it is to the top. 439 00:29:30,980 --> 00:29:33,560 If it's close enough, I do LQR. 440 00:29:33,560 --> 00:29:36,350 If it's farther, I'm going to do this energy shaping control. 441 00:29:38,942 --> 00:29:40,400 The stuff that I commented out, I'm 442 00:29:40,400 --> 00:29:42,265 going to tell you about it later. 443 00:29:42,265 --> 00:29:43,640 But it turns out there's actually 444 00:29:43,640 --> 00:29:50,150 nice sort of analytical ways to get the basin of attraction 445 00:29:50,150 --> 00:29:53,120 using some semidefinite programming. 446 00:29:53,120 --> 00:29:55,320 We'll mention that later in the class. 447 00:29:55,320 --> 00:29:57,320 So you don't actually have to guess that metric, 448 00:29:57,320 --> 00:29:59,390 but to be fair, I guess that metric 449 00:29:59,390 --> 00:30:01,760 as something that is easy to guess. 450 00:30:01,760 --> 00:30:04,640 And that's good enough. 451 00:30:04,640 --> 00:30:05,920 OK. 452 00:30:05,920 --> 00:30:11,260 The LQR we did before, and the swing-up is just that simple. 453 00:30:11,260 --> 00:30:14,060 It's the pendulum energy. 454 00:30:14,060 --> 00:30:14,990 Not the total energy. 455 00:30:14,990 --> 00:30:16,490 It's just the energy of the pendulum 456 00:30:16,490 --> 00:30:21,800 on the system with a PD controller on the cart 457 00:30:21,800 --> 00:30:28,990 and the theta dot cosine theta e tilde 458 00:30:28,990 --> 00:30:31,460 dot controller on the pendulum. 459 00:30:31,460 --> 00:30:34,520 I put a saturation in there so it doesn't do crazy torques. 460 00:30:34,520 --> 00:30:35,510 Let's see what we get. 461 00:30:53,800 --> 00:30:55,480 Now linear control is easy. 462 00:30:55,480 --> 00:30:56,440 OK. 463 00:30:56,440 --> 00:30:59,920 And the phase plots exactly what you'd expect. 464 00:30:59,920 --> 00:31:01,930 It looks like my gains a little high maybe. 465 00:31:01,930 --> 00:31:04,540 But you know it's regulated itself pretty quickly 466 00:31:04,540 --> 00:31:06,970 out to that high energy orbit. 467 00:31:06,970 --> 00:31:09,430 And then it just missed its chance in the first one, 468 00:31:09,430 --> 00:31:10,930 but by the second time the energy 469 00:31:10,930 --> 00:31:15,298 was close enough, turn on the balance controller, grabbed it. 470 00:31:15,298 --> 00:31:17,590 And you saw that it actually grabbed it off to the side 471 00:31:17,590 --> 00:31:19,840 and then slowly pulled itself back towards the center. 472 00:31:25,390 --> 00:31:27,790 Different initial conditions. 473 00:31:27,790 --> 00:31:29,205 Yeah, so it works. 474 00:31:29,205 --> 00:31:30,050 It works well. 475 00:31:30,050 --> 00:31:30,970 It's easy right. 476 00:31:35,130 --> 00:31:35,820 OK. 477 00:31:35,820 --> 00:31:41,280 The reason I wanted to show you this, 478 00:31:41,280 --> 00:31:43,980 well first of all, it's cool. 479 00:31:43,980 --> 00:31:46,350 It's relevant. 480 00:31:46,350 --> 00:31:50,670 But I sort of want to give you a little glimpse 481 00:31:50,670 --> 00:31:54,435 into the world of nonlinear control. 482 00:31:59,520 --> 00:32:01,682 What tends to happen, if you're trying 483 00:32:01,682 --> 00:32:03,390 to come up with clever non-linear control 484 00:32:03,390 --> 00:32:05,700 solutions for systems, is you tend 485 00:32:05,700 --> 00:32:08,670 to have to examine carefully the equations of motion 486 00:32:08,670 --> 00:32:10,565 of your system. 487 00:32:10,565 --> 00:32:12,690 And sometimes you end up with these sort of bizarre 488 00:32:12,690 --> 00:32:16,727 looking feedback laws that work. 489 00:32:16,727 --> 00:32:18,810 Because they tend to cancel out the terms that you 490 00:32:18,810 --> 00:32:19,750 want to cancel out. 491 00:32:19,750 --> 00:32:21,630 So you can prove that something is always 492 00:32:21,630 --> 00:32:23,638 monotonically decreasing. 493 00:32:23,638 --> 00:32:25,680 Something like the energy is always monotonically 494 00:32:25,680 --> 00:32:27,780 decreasing or something like that. 495 00:32:27,780 --> 00:32:30,030 That's actually a pretty typical. 496 00:32:30,030 --> 00:32:32,790 That's a pretty representative case of a nonlinear control 497 00:32:32,790 --> 00:32:34,380 design. 498 00:32:34,380 --> 00:32:40,530 And there's lots of cool stuff working in that realm. 499 00:32:40,530 --> 00:32:44,680 So typically to prove it more carefully we'd look-- 500 00:32:44,680 --> 00:32:47,067 we'd design a Lyapunov function. 501 00:32:47,067 --> 00:32:49,150 We're not going to use it right now in this class. 502 00:32:54,020 --> 00:32:55,770 But if you haven't seen Lyapunov functions 503 00:32:55,770 --> 00:32:58,110 it's a good thing to know about. 504 00:32:58,110 --> 00:33:01,920 Jean-Jacques Slotine teaches his nonlinear control course 505 00:33:01,920 --> 00:33:03,220 in mechanical engineering. 506 00:33:03,220 --> 00:33:05,440 He uses Lyapunov functions. 507 00:33:05,440 --> 00:33:08,850 But he also uses other metrics to prove stability. 508 00:33:08,850 --> 00:33:11,880 His favorite, I think, right now is contraction analysis. 509 00:33:19,550 --> 00:33:20,050 OK. 510 00:33:22,122 --> 00:33:24,330 It's worth listing those two because there's actually 511 00:33:24,330 --> 00:33:25,170 not a lot-- 512 00:33:25,170 --> 00:33:27,120 that's not really a very long list-- 513 00:33:27,120 --> 00:33:30,180 there's not actually a lot more different solution techniques 514 00:33:30,180 --> 00:33:31,735 that I can put up here. 515 00:33:31,735 --> 00:33:33,360 There's actually only sort of a handful 516 00:33:33,360 --> 00:33:36,700 of ways people have to prove stability 517 00:33:36,700 --> 00:33:38,970 in non-linear systems, continuous systems. 518 00:33:38,970 --> 00:33:39,470 OK. 519 00:33:44,210 --> 00:33:48,492 So that's sort of approach one. 520 00:33:48,492 --> 00:33:50,700 Approach two, which we're going to do in this course, 521 00:33:50,700 --> 00:33:55,340 is let's not design specific controllers 522 00:33:55,340 --> 00:33:56,770 for specific systems. 523 00:33:56,770 --> 00:33:58,520 Let's turn it into an optimization problem 524 00:33:58,520 --> 00:34:00,110 and use our optimal control. 525 00:34:00,110 --> 00:34:02,780 OK. 526 00:34:02,780 --> 00:34:03,800 Good. 527 00:34:03,800 --> 00:34:07,160 So we know how to do the swing-up control 528 00:34:07,160 --> 00:34:07,940 of the cart-pole. 529 00:34:07,940 --> 00:34:14,270 It's pretty simple based on an energy argument. 530 00:34:14,270 --> 00:34:16,280 What would happen if I didn't use the PFL? 531 00:34:16,280 --> 00:34:20,870 I used the PFL here to make things analytically cleaner. 532 00:34:20,870 --> 00:34:23,420 But essentially what it's doing is the same thing 533 00:34:23,420 --> 00:34:24,429 as the simple pendulum. 534 00:34:24,429 --> 00:34:27,949 As it said, if the pendulum is moving this way, 535 00:34:27,949 --> 00:34:29,480 I want to add energy. 536 00:34:29,480 --> 00:34:31,610 Then just push it in that way. 537 00:34:31,610 --> 00:34:34,100 If it's derivative's this way, then push it in that way. 538 00:34:34,100 --> 00:34:38,090 There's a cosine which modifies things. 539 00:34:38,090 --> 00:34:40,940 Just because of the coupling really I think. 540 00:34:40,940 --> 00:34:42,230 Maybe the cosine's real. 541 00:34:42,230 --> 00:34:44,005 When you change signs you actually-- when 542 00:34:44,005 --> 00:34:45,380 you cross the origin you actually 543 00:34:45,380 --> 00:34:46,547 have to go the opposite way. 544 00:34:46,547 --> 00:34:49,820 Maybe the cosine's real actually. 545 00:34:49,820 --> 00:34:52,670 But it's basically just doing the same thing 546 00:34:52,670 --> 00:34:54,920 we did-- had our intuition for in the pendulum, which 547 00:34:54,920 --> 00:34:56,870 is push the system the way it's already going. 548 00:35:01,070 --> 00:35:08,450 So it turns out you can do the same thing without PFL 549 00:35:08,450 --> 00:35:11,210 and it probably works. 550 00:35:11,210 --> 00:35:13,010 To be fair, I even spent a minute 551 00:35:13,010 --> 00:35:14,603 finding different parameters. 552 00:35:14,603 --> 00:35:16,520 I could've made a really compelling demo using 553 00:35:16,520 --> 00:35:18,950 the same parameters from PFL which worked horribly 554 00:35:18,950 --> 00:35:20,480 for the other system. 555 00:35:20,480 --> 00:35:23,840 But I actually found some good parameters 556 00:35:23,840 --> 00:35:31,490 and if I do that one, it still gets there. 557 00:35:31,490 --> 00:35:33,612 It's not going to be quite as pretty. 558 00:35:33,612 --> 00:35:35,570 That was actually probably the worst I've seen. 559 00:35:38,090 --> 00:35:40,250 Thank you. 560 00:35:40,250 --> 00:35:41,960 OK but it'll still work. 561 00:35:41,960 --> 00:35:45,770 The PFL, though, made the motion of that card pretty beautiful, 562 00:35:45,770 --> 00:35:47,240 if you care about that. 563 00:35:47,240 --> 00:35:49,580 And it made the math easy enough that we can really 564 00:35:49,580 --> 00:35:50,620 derive these things. 565 00:35:50,620 --> 00:35:51,440 OK. 566 00:35:51,440 --> 00:35:55,392 So PFL really turns out to be an important tool 567 00:35:55,392 --> 00:35:56,100 in these systems. 568 00:35:59,720 --> 00:36:05,168 Yeah, I just said basically, let's put in this controller. 569 00:36:05,168 --> 00:36:07,460 Forget about the-- actually I did the whole controller, 570 00:36:07,460 --> 00:36:07,960 I think. 571 00:36:07,960 --> 00:36:08,840 I can look. 572 00:36:08,840 --> 00:36:10,550 And instead of putting it into ubar, 573 00:36:10,550 --> 00:36:13,910 which was my synthetic command through my PFL, 574 00:36:13,910 --> 00:36:17,690 let's just make that the force on the cart. 575 00:36:17,690 --> 00:36:23,630 Let's use this basic feedback law as the force 576 00:36:23,630 --> 00:36:24,770 directly on the cart. 577 00:36:24,770 --> 00:36:27,788 And forget about linearizing the cart dynamics. 578 00:36:27,788 --> 00:36:29,330 Yeah, because the intuition is right. 579 00:36:29,330 --> 00:36:31,537 It's just pushed that way to add energy. 580 00:36:31,537 --> 00:36:32,370 And if I add energy. 581 00:36:32,370 --> 00:36:34,200 I should get up near the top. 582 00:36:34,200 --> 00:36:35,653 And if it does work. 583 00:36:35,653 --> 00:36:37,070 And the PFL just makes it cleaner. 584 00:36:40,460 --> 00:36:41,300 OK. 585 00:36:41,300 --> 00:36:42,590 What about the acrobat? 586 00:36:42,590 --> 00:36:44,960 I don't spend a lot of time because it's pretty similar. 587 00:36:44,960 --> 00:36:46,377 What would you do for the acrobat? 588 00:36:51,770 --> 00:36:55,850 If you want to get the acrobat to balance, just add energy. 589 00:36:55,850 --> 00:36:57,750 And get itself towards the top. 590 00:36:57,750 --> 00:36:58,250 It's funny. 591 00:36:58,250 --> 00:37:03,200 Zach, in our group, he took the class last year. 592 00:37:03,200 --> 00:37:04,940 He's building our cool acrobat now. 593 00:37:04,940 --> 00:37:08,750 He's the one you saw him hold up the poster. 594 00:37:08,750 --> 00:37:10,250 But for his first reaction, which 595 00:37:10,250 --> 00:37:13,160 I think he did on the real hardware, was just 596 00:37:13,160 --> 00:37:15,110 do a stabilizing controller at the bottom. 597 00:37:15,110 --> 00:37:17,220 And then flip the gains. 598 00:37:17,220 --> 00:37:18,470 So it just went kind of crazy. 599 00:37:18,470 --> 00:37:20,550 And I think that sort of worked, which is-- 600 00:37:20,550 --> 00:37:22,550 doesn't say a lot about how hard the problem is. 601 00:37:22,550 --> 00:37:25,990 But there's a more elegant way to do it. 602 00:37:25,990 --> 00:37:26,490 OK. 603 00:37:29,457 --> 00:37:30,290 How would you do it? 604 00:37:30,290 --> 00:37:32,810 Given this sort of line of thinking. 605 00:37:32,810 --> 00:37:34,910 We've got PFL at our disposal. 606 00:37:34,910 --> 00:37:36,020 We want to add energy. 607 00:37:36,020 --> 00:37:36,770 What would you do? 608 00:37:45,240 --> 00:37:45,740 Yeah? 609 00:37:54,570 --> 00:37:55,700 No, but you're close. 610 00:37:55,700 --> 00:37:57,326 Well so collocated would get-- 611 00:37:57,326 --> 00:38:00,860 it controls the elbow, because the motors at the elbow. 612 00:38:00,860 --> 00:38:01,360 Yeah. 613 00:38:04,760 --> 00:38:07,970 So if you use collocated and you could still solve-- 614 00:38:07,970 --> 00:38:10,190 add energy into the first link so that it swings up 615 00:38:10,190 --> 00:38:12,660 like a pendulum. 616 00:38:12,660 --> 00:38:14,660 That's the same way we sort of add an extra term 617 00:38:14,660 --> 00:38:15,500 to keep the cart. 618 00:38:15,500 --> 00:38:18,710 Near zero we add an extra term to keep the second joint close 619 00:38:18,710 --> 00:38:19,780 to zero. 620 00:38:19,780 --> 00:38:21,020 That's exactly what it is. 621 00:38:21,020 --> 00:38:22,190 OK. 622 00:38:22,190 --> 00:38:24,920 So I'll just write it quickly because it's that simple. 623 00:39:02,130 --> 00:39:12,350 We're going to use collocated PFL to control 624 00:39:12,350 --> 00:39:29,590 theta two and energy shaping to drive theta 1 to up right. 625 00:39:40,990 --> 00:39:42,400 So it turns out-- 626 00:39:42,400 --> 00:39:45,730 how do you add energy in the acrobat? 627 00:39:45,730 --> 00:39:50,410 if you want to add energy to the theta 1, whatever direction 628 00:39:50,410 --> 00:39:53,110 that one's moving, make the theta 2 move 629 00:39:53,110 --> 00:39:55,340 in that direction too. 630 00:39:55,340 --> 00:39:56,290 OK. 631 00:39:56,290 --> 00:40:02,140 So u bar, the command to your PFL controller 632 00:40:02,140 --> 00:40:13,422 should be q 1 dot e tilde, k greater than 0 633 00:40:13,422 --> 00:40:15,860 It works out to be that simple. 634 00:40:15,860 --> 00:40:18,280 And we're going to, in general, we'll 635 00:40:18,280 --> 00:40:20,510 add another something to make sure 636 00:40:20,510 --> 00:40:25,600 that theta 2 doesn't deviate too far from where it went, 637 00:40:25,600 --> 00:40:26,920 from straight out. 638 00:40:32,700 --> 00:40:36,360 Interestingly, the energy that people use-- 639 00:40:36,360 --> 00:40:38,940 that Spong uses in his paper is not 640 00:40:38,940 --> 00:40:43,710 the energy sort of the simple pendulum created by link one. 641 00:40:43,710 --> 00:40:45,870 It's actually the total energy of the system 642 00:40:45,870 --> 00:40:46,890 and that still works. 643 00:41:06,546 --> 00:41:09,750 STUDENT: You couldn't use the total energy of the cart-pole 644 00:41:09,750 --> 00:41:12,674 to try and invert that pendulum? 645 00:41:17,160 --> 00:41:19,420 RUSS TEDRAKE: My guess is it would still work, 646 00:41:19,420 --> 00:41:21,750 but the proof is based on-- on not that. 647 00:41:34,390 --> 00:41:39,540 So I should say there is no proof, for the acrobat, 648 00:41:39,540 --> 00:41:42,840 that it will get to the top, that I know of. 649 00:41:42,840 --> 00:41:46,110 Spong's paper in '96, beautiful paper, 650 00:41:46,110 --> 00:41:51,120 says, we conjecture that you can show that this thing is 651 00:41:51,120 --> 00:41:52,837 semiglobal stable. 652 00:41:52,837 --> 00:41:55,170 The other thing I didn't say is that this thing actually 653 00:41:55,170 --> 00:42:00,480 doesn't work if you started at 0 0. 654 00:42:00,480 --> 00:42:04,960 Because if theta dot zero, you're not 655 00:42:04,960 --> 00:42:06,570 going to actually do anything. 656 00:42:06,570 --> 00:42:07,920 So it's not globally stable. 657 00:42:07,920 --> 00:42:11,470 It's semiglobally, so we need to knock a little bit. 658 00:42:11,470 --> 00:42:13,510 Have Zach pull with the string across through. 659 00:42:17,620 --> 00:42:20,050 But they conjecture that it's semiglobal, 660 00:42:20,050 --> 00:42:21,970 despite the fact that the energy-- 661 00:42:21,970 --> 00:42:23,660 that there might be multiple solutions. 662 00:42:23,660 --> 00:42:25,660 The picture of the homoclinic orbit, I'll admit, 663 00:42:25,660 --> 00:42:27,250 is not as clean for the acrobat. 664 00:42:30,700 --> 00:42:35,350 But I think the intuition is that if you're doing some work 665 00:42:35,350 --> 00:42:43,510 to keep theta 2 near zero, then it's 666 00:42:43,510 --> 00:42:46,903 looking-- it's moving a lot like a pendulum, 667 00:42:46,903 --> 00:42:48,820 and you're thinking about the homoclinic orbit 668 00:42:48,820 --> 00:42:50,860 of that big pendulum. 669 00:42:50,860 --> 00:42:53,800 And it gets up there. 670 00:42:53,800 --> 00:42:57,280 I think these terms prevent it from sort 671 00:42:57,280 --> 00:43:00,340 of being in this lots of different configurations 672 00:43:00,340 --> 00:43:01,120 to get to the top. 673 00:43:04,300 --> 00:43:07,510 But presumably the proof of semiglobal, semiglobality, 674 00:43:07,510 --> 00:43:12,800 I guess, would be dependent on kl and k2 or k2 and k3. 675 00:43:12,800 --> 00:43:13,300 Good. 676 00:43:19,255 --> 00:43:21,880 People don't seem jumping out of your chair excited about that, 677 00:43:21,880 --> 00:43:26,790 but I hope you like it and get it and get it. 678 00:43:26,790 --> 00:43:29,025 It's an important class of derivations. 679 00:43:35,470 --> 00:43:37,260 All right so in that trend. 680 00:43:37,260 --> 00:43:42,040 So we used PFL, now, to do-- 681 00:43:42,040 --> 00:43:45,340 to basically make energy shaping arguments simple. 682 00:43:45,340 --> 00:43:47,650 And to actually even simplify the analytics 683 00:43:47,650 --> 00:43:49,210 of those arguments. 684 00:43:49,210 --> 00:43:52,750 But actually PFL can do a lot of things. 685 00:43:52,750 --> 00:43:54,490 Disclaimer, PFL is bad. 686 00:43:54,490 --> 00:43:58,090 Don't use it if you care about system dynamics, 687 00:43:58,090 --> 00:44:01,858 but it'll do a lot of things for you. 688 00:44:01,858 --> 00:44:03,400 So let's just see how much it can do. 689 00:44:03,400 --> 00:44:06,160 I want to show you the slightly more general form, which 690 00:44:06,160 --> 00:44:35,870 is not, surprisingly, is not as common in the literature 691 00:44:35,870 --> 00:44:39,500 And just one general form, I guess, 692 00:44:39,500 --> 00:44:42,580 but this is using the notion of a task space. 693 00:44:47,520 --> 00:44:48,020 OK. 694 00:44:48,020 --> 00:44:51,920 So last time, last time we talked 695 00:44:51,920 --> 00:44:54,530 about using partial feedback linearization 696 00:44:54,530 --> 00:44:56,960 to control all of your actuated joints perfectly, 697 00:44:56,960 --> 00:45:00,890 or to control all of your unsaturated joints perfectly. 698 00:45:00,890 --> 00:45:03,110 But naturally you'd like to see a form 699 00:45:03,110 --> 00:45:06,230 where you could control one unactuated joint, one 700 00:45:06,230 --> 00:45:06,913 actuated joint. 701 00:45:06,913 --> 00:45:08,330 Maybe you don't actually even care 702 00:45:08,330 --> 00:45:10,593 about controlling a particular actuators. 703 00:45:10,593 --> 00:45:12,260 Maybe what you care about is, let's say, 704 00:45:12,260 --> 00:45:15,710 controlling the end effector of your machine. 705 00:45:15,710 --> 00:45:18,680 So let's say I'm 120 degree of freedom robot 706 00:45:18,680 --> 00:45:20,000 with a few unactuate joints. 707 00:45:20,000 --> 00:45:21,920 I'm not actually bolted to the ground. 708 00:45:21,920 --> 00:45:24,240 Maybe my shoulder doesn't work today. 709 00:45:24,240 --> 00:45:29,810 And I want to control the endpoint of my arm right. 710 00:45:29,810 --> 00:45:32,240 We should be able to do that I think. 711 00:45:32,240 --> 00:45:38,150 And, intuitively, as long as my task space 712 00:45:38,150 --> 00:45:40,520 is coupled to my motors. 713 00:45:40,520 --> 00:45:43,100 I can have sort of 10 actuators on this robot 714 00:45:43,100 --> 00:45:45,200 and try to control the parts of joint over there. 715 00:45:45,200 --> 00:45:48,020 As long as they're coupled with this inertial coupling idea. 716 00:45:48,020 --> 00:45:50,780 And I have sort of enough motors, 717 00:45:50,780 --> 00:45:52,700 as many motors as I have degrees of freedom 718 00:45:52,700 --> 00:45:54,020 of the thing I'm trying to control, 719 00:45:54,020 --> 00:45:55,520 you'd like to think that would work. 720 00:45:57,740 --> 00:46:00,960 So for the cart-pole, let's say, I'd like to think I could 721 00:46:00,960 --> 00:46:01,460 regulate-- 722 00:46:01,460 --> 00:46:04,220 I can't regulate the endpoint of the pole 723 00:46:04,220 --> 00:46:06,470 perfectly, because that would be x and y. 724 00:46:06,470 --> 00:46:09,860 It would be the two variables and I've only got one motor, 725 00:46:09,860 --> 00:46:11,450 but maybe I should be able to regulate 726 00:46:11,450 --> 00:46:12,800 the y position of the endpoint. 727 00:46:16,320 --> 00:46:20,490 On the acrobat, I should be able to regulate the y 728 00:46:20,490 --> 00:46:22,620 position of the end effector. 729 00:46:22,620 --> 00:46:27,250 Or, in little dog, the robot I showed you, 730 00:46:27,250 --> 00:46:28,920 we do regulate the center of mass 731 00:46:28,920 --> 00:46:33,570 of the robot using all the internal joints on the machine. 732 00:46:33,570 --> 00:46:36,400 So let's see the slightly more general form. 733 00:46:36,400 --> 00:46:37,740 And then put it to use. 734 00:46:46,850 --> 00:46:49,257 OK. 735 00:46:49,257 --> 00:46:50,840 I'm still going to make the assumption 736 00:46:50,840 --> 00:46:56,600 that we have joined with zero torque and joints with torque. 737 00:46:56,600 --> 00:46:58,730 So I can use this form. 738 00:46:58,730 --> 00:47:00,380 I'm sure you can generalize it further. 739 00:47:00,380 --> 00:47:08,020 But excuse me. 740 00:47:30,240 --> 00:47:34,950 OK where I'm using q1 here to represent my passive joints. 741 00:47:39,180 --> 00:47:45,930 And let's say that there are m of them 742 00:47:45,930 --> 00:47:49,530 and q2 to represent my active joints, 743 00:47:49,530 --> 00:47:57,220 my actuator Let's say there are l of them. 744 00:47:57,220 --> 00:47:59,640 And let's say the q, m, n. 745 00:48:08,280 --> 00:48:12,810 So that's my equations of motion of the system I'm 746 00:48:12,810 --> 00:48:17,640 working on factored into block matrix form based 747 00:48:17,640 --> 00:48:20,490 on where the actuators are. 748 00:48:32,990 --> 00:48:37,790 So let's try to control some subset 749 00:48:37,790 --> 00:48:41,150 of the actuated and unactuated joints. 750 00:48:41,150 --> 00:48:44,555 And in general we'll do that by defining some output function. 751 00:48:54,200 --> 00:48:57,440 Some function of just the full vector 752 00:48:57,440 --> 00:48:59,660 q, but we're not of q dot for now. 753 00:49:05,140 --> 00:49:12,910 And let's say y lives in p dimensional space. 754 00:49:12,910 --> 00:49:15,020 Just running out of letters here. 755 00:49:15,020 --> 00:49:15,520 OK. 756 00:49:21,022 --> 00:49:22,980 Let me tell you the answer first and then we'll 757 00:49:22,980 --> 00:49:25,090 make sure it works. 758 00:49:25,090 --> 00:49:39,120 So let's define j1 to be partial f partial q1, j2 to be partial 759 00:49:39,120 --> 00:49:42,030 f partial q2. 760 00:49:42,030 --> 00:49:47,120 And j is the full thing. 761 00:49:56,750 --> 00:50:06,890 So j1 is going to be what, p by m. 762 00:50:06,890 --> 00:50:13,100 And j2 is going to be p by l. 763 00:50:13,100 --> 00:50:16,220 And j is going to be p by n. 764 00:50:27,430 --> 00:50:35,260 My claim is if you command the actuated joints to do this. 765 00:51:32,600 --> 00:51:33,620 OK. 766 00:51:33,620 --> 00:51:37,100 It's a little bit of a big pill to swallow, 767 00:51:37,100 --> 00:51:47,260 but I'm using this to represent the right Moore-Penrose 768 00:51:47,260 --> 00:51:58,910 pseudoinverse in general. 769 00:51:58,910 --> 00:51:59,900 OK. 770 00:51:59,900 --> 00:52:01,820 And there's nothing too egregious just yet. 771 00:52:01,820 --> 00:52:05,660 We've got h11 is invertible, we said. 772 00:52:08,480 --> 00:52:09,670 So that sort of looks OK. 773 00:52:12,620 --> 00:52:16,730 We're going to have to ask how invertible j bar is. 774 00:52:16,730 --> 00:52:18,670 It's got a j2 in there. 775 00:52:18,670 --> 00:52:20,220 j2 is not square. 776 00:52:20,220 --> 00:52:23,520 So we're going to have to think about that a little bit. 777 00:52:23,520 --> 00:52:26,060 That's why I have to use the pseudoinverse here. 778 00:52:29,060 --> 00:52:30,090 Good. 779 00:52:30,090 --> 00:52:33,920 So let's see if we believe that. 780 00:52:33,920 --> 00:52:39,470 Oh boy. 781 00:52:39,470 --> 00:52:50,748 This is subject to the rank of j bar equaling p. 782 00:52:50,748 --> 00:52:52,790 And I don't want to write that on the next board. 783 00:52:52,790 --> 00:52:53,748 That's got to go there. 784 00:53:06,410 --> 00:53:06,910 OK. 785 00:53:06,910 --> 00:53:09,100 So let's just think about the dimensionality here. 786 00:53:09,100 --> 00:53:12,760 So j2 is p by l. 787 00:53:12,760 --> 00:53:15,602 So a number of things I'm trying to control 788 00:53:15,602 --> 00:53:17,560 by the number of things I have to control them. 789 00:53:20,500 --> 00:53:24,880 j1, p by m, this one's going to be m by m. 790 00:53:24,880 --> 00:53:26,943 This is going to be m by l. 791 00:53:26,943 --> 00:53:28,360 So this thing is going to work out 792 00:53:28,360 --> 00:53:32,900 to be p by l, as we expected. 793 00:53:32,900 --> 00:53:39,100 So I'm saying that I'm going to write j pseudo inverse 794 00:53:39,100 --> 00:53:41,260 because it's not square. 795 00:53:41,260 --> 00:53:43,690 But I only really want to run this controller 796 00:53:43,690 --> 00:53:48,730 if the rank of jbar is equal to p. 797 00:53:48,730 --> 00:53:52,990 It's not going to be greater than p ever. 798 00:53:52,990 --> 00:53:56,283 Because the matrix has only got p rows. 799 00:53:56,283 --> 00:53:57,700 So the trivial condition is I need 800 00:53:57,700 --> 00:54:00,400 to have at least as many actuators 801 00:54:00,400 --> 00:54:03,040 as I have things I'm trying to control. 802 00:54:03,040 --> 00:54:06,460 If l is at least p, that's a necessary condition. 803 00:54:06,460 --> 00:54:09,211 I'm not going to get the if-- 804 00:54:09,211 --> 00:54:11,920 if I have less actuators than what I'm trying to control, 805 00:54:11,920 --> 00:54:15,310 this rank condition will always fail. 806 00:54:15,310 --> 00:54:19,263 If I have four actuators and two things I'm trying to control, 807 00:54:19,263 --> 00:54:21,430 but three of the actuators are on a different robot, 808 00:54:21,430 --> 00:54:22,760 then it's also going to fail. 809 00:54:22,760 --> 00:54:28,075 So it's not only the case that the counting game works. 810 00:54:31,900 --> 00:54:33,467 But if l is greater than p-- 811 00:54:33,467 --> 00:54:35,550 I'm sorry to be throwing around all these things-- 812 00:54:35,550 --> 00:54:37,330 if you have more actuators than things 813 00:54:37,330 --> 00:54:38,890 you're trying to control, then you 814 00:54:38,890 --> 00:54:40,640 should go ahead and use that pseudoinverse 815 00:54:40,640 --> 00:54:42,940 because you have choices. 816 00:54:42,940 --> 00:54:44,740 At any given time, if you want to produce 817 00:54:44,740 --> 00:54:47,213 a certain acceleration in your output space, 818 00:54:47,213 --> 00:54:48,880 whether it's the end effect or whatever. 819 00:54:48,880 --> 00:54:50,422 There are actually there's a manifold 820 00:54:50,422 --> 00:54:53,170 of solutions you can use to try to produce 821 00:54:53,170 --> 00:54:56,570 that same acceleration of the output. 822 00:54:56,570 --> 00:54:59,170 So for those of you that have used sort of Jacobians 823 00:54:59,170 --> 00:55:01,995 and null spaces a lot in the previous robotics course, 824 00:55:01,995 --> 00:55:03,370 this is perfectly compatible then 825 00:55:03,370 --> 00:55:06,670 with sort of a null space decomposition. 826 00:55:06,670 --> 00:55:09,310 If you wanted to say I have a first priority 827 00:55:09,310 --> 00:55:14,230 task in this joyed space, and then a second priority task 828 00:55:14,230 --> 00:55:16,780 that works on the null space of that controller, 829 00:55:16,780 --> 00:55:18,940 that stuff all works in this framework. 830 00:55:18,940 --> 00:55:21,420 But I won't go into the details there. 831 00:55:21,420 --> 00:55:27,550 OK so j pseudoinverse could have a null space 832 00:55:27,550 --> 00:55:29,170 if you have more actuators than things 833 00:55:29,170 --> 00:55:30,212 you're trying to control. 834 00:55:36,760 --> 00:55:52,072 So we quickly make sure we think that works 835 00:55:52,072 --> 00:55:52,780 So what do we do? 836 00:55:52,780 --> 00:55:57,790 We started with y is f of q. 837 00:55:57,790 --> 00:56:01,610 So we want to know how that thing's going to change. 838 00:56:01,610 --> 00:56:05,225 That's going to be j of q dot. 839 00:56:14,620 --> 00:56:23,590 And y double dot is going to be jdot qdot plus j, 840 00:56:23,590 --> 00:56:27,670 because remember j is partial f partial q right, plus jq 841 00:56:27,670 --> 00:56:36,940 double dot, which I'm going to break apart into j1 q1 double 842 00:56:36,940 --> 00:56:40,330 dot plus j2 q2 double dot. 843 00:56:46,060 --> 00:56:51,100 So I've got some contribution from the effects 844 00:56:51,100 --> 00:56:52,093 of my passive joint. 845 00:56:52,093 --> 00:56:53,260 Some from the active joints. 846 00:56:57,610 --> 00:57:01,930 We can use this first equation here 847 00:57:01,930 --> 00:57:05,020 to figure out what the accelerations 848 00:57:05,020 --> 00:57:06,615 of my passive joints are going to be 849 00:57:06,615 --> 00:57:07,990 with respect to the accelerations 850 00:57:07,990 --> 00:57:10,990 of my active joints. 851 00:57:10,990 --> 00:57:13,640 The same thing we did before. 852 00:57:13,640 --> 00:57:18,280 So I can easily write down here that q1 double dot had better 853 00:57:18,280 --> 00:57:33,140 be negative h11 inverse, h12 q2 double dot plus phi1. 854 00:57:58,680 --> 00:58:02,730 If you stick that in, then you end up with y double dot 855 00:58:02,730 --> 00:58:14,280 is jdot qdot minus j1 h11 inverse 856 00:58:14,280 --> 00:58:21,720 h12 q2 double dot plus phi1. 857 00:58:21,720 --> 00:58:29,230 I would write this down if it's in your notes here, 858 00:58:29,230 --> 00:58:36,630 which happens to be jdot qdot plus jbar q2 double dot 859 00:58:36,630 --> 00:58:43,230 minus j1 h11 inverse phi1. 860 00:58:43,230 --> 00:58:51,750 Therefore, If I can invert jbar then, where'd my control go. 861 00:58:51,750 --> 00:58:56,970 If you read it off, jbar inverse is 862 00:58:56,970 --> 00:58:59,000 going to cancel out that term. 863 00:58:59,000 --> 00:59:02,130 I'm going to subtract off the jdot qdot, 864 00:59:02,130 --> 00:59:07,110 and add back in the j1 h inverse phi1. 865 00:59:07,110 --> 00:59:14,640 And I'm going to be left with y double dot equals v. So 866 00:59:14,640 --> 00:59:15,210 that works. 867 00:59:15,210 --> 00:59:17,310 That's not too shocking. 868 00:59:17,310 --> 00:59:23,980 What's cool is that this task space PFL is sort of all, 869 00:59:23,980 --> 00:59:25,230 you need to know. 870 00:59:25,230 --> 00:59:27,460 if you're willing to remember this one, 871 00:59:27,460 --> 00:59:34,350 then the collocated and the non collocated come out for free. 872 00:59:34,350 --> 00:59:45,930 So if I were to choose and do the collocated, 873 00:59:45,930 --> 00:59:48,240 then that means my output function 874 00:59:48,240 --> 00:59:58,220 is this, which one, just q2 which means the partial 875 00:59:58,220 --> 01:00:01,550 with respect to q1 is 0. 876 01:00:01,550 --> 01:00:04,670 The partial with respect to q2 is just i. 877 01:00:07,190 --> 01:00:07,890 jdot is 0. 878 01:00:12,670 --> 01:00:19,370 jbar works out to be i if you look at It. 879 01:00:19,370 --> 01:00:21,470 Long story short, everything drops out. 880 01:00:21,470 --> 01:00:23,810 You get exactly the collocated feedback 881 01:00:23,810 --> 01:00:26,970 that you wanted before. 882 01:00:26,970 --> 01:00:29,610 What's even cooler is the non-collocated 883 01:00:29,610 --> 01:00:33,210 does the exact same thing. 884 01:00:33,210 --> 01:00:38,130 The non-collocated, if you make y equal q1 885 01:00:38,130 --> 01:00:41,078 and you put it through this task space PFL, 886 01:00:41,078 --> 01:00:42,870 not only do you get the same controller out 887 01:00:42,870 --> 01:00:49,050 that you would have gotten, but this rank condition on jbar 888 01:00:49,050 --> 01:00:51,300 for the collocated case, it's trivially true, 889 01:00:51,300 --> 01:00:52,583 which you'd expect. 890 01:00:52,583 --> 01:00:54,000 And for the non-collocated case it 891 01:00:54,000 --> 01:00:57,000 turns exactly into the strong inertial coupling condition 892 01:00:57,000 --> 01:00:58,753 of the other derivation. 893 01:01:02,110 --> 01:01:02,610 OK. 894 01:01:02,610 --> 01:01:04,540 So now we can do something interesting. 895 01:01:04,540 --> 01:01:07,470 I'm sorry to write so many symbols, 896 01:01:07,470 --> 01:01:10,615 but, because you're all falling asleep. 897 01:01:10,615 --> 01:01:12,240 Let's do something interesting with it. 898 01:01:12,240 --> 01:01:12,740 OK. 899 01:01:12,740 --> 01:01:18,030 So let's do the example I said. 900 01:01:18,030 --> 01:01:21,480 Let's take the cart-pole and make 901 01:01:21,480 --> 01:01:26,430 it go through some y trajectory, a sine wave or something like. 902 01:01:26,430 --> 01:01:30,660 What would it take to make the cart-pole go 903 01:01:30,660 --> 01:01:32,180 like this for a long time? 904 01:01:36,087 --> 01:01:38,420 Speeding up and slowing down, but always actually moving 905 01:01:38,420 --> 01:01:39,210 in one direction. 906 01:01:39,210 --> 01:01:41,210 So my information is not going to be too pretty. 907 01:01:41,210 --> 01:01:44,130 I tried to come up with a really clever task space, 908 01:01:44,130 --> 01:01:48,020 five minutes before class, that would stay on the screen 909 01:01:48,020 --> 01:01:50,580 and regulate the output. 910 01:01:50,580 --> 01:01:52,850 I'm going to show you that leaves the screen quickly, 911 01:01:52,850 --> 01:01:54,910 but at least plot that it found the output. 912 01:02:04,040 --> 01:02:04,540 OK. 913 01:02:04,540 --> 01:02:09,580 So if I make y equal, this y, poor choice, 914 01:02:09,580 --> 01:02:13,360 is just the vertical position of the end point 915 01:02:13,360 --> 01:02:16,120 through the kinematics of the cart-pole. 916 01:02:30,250 --> 01:02:33,470 Then, you could see it here. 917 01:02:33,470 --> 01:02:40,210 So why is just negative l cosine of the x2. 918 01:02:40,210 --> 01:02:45,680 I think this is my y desired is this y underscore. d 919 01:02:45,680 --> 01:02:47,590 Is my shorthand for desired. 920 01:02:47,590 --> 01:02:53,980 It's just some sine wave that's going to go between 1/4 921 01:02:53,980 --> 01:02:56,800 of the length and 1/2 the length, or sorry 3/4 922 01:02:56,800 --> 01:02:57,790 of the length. 923 01:02:57,790 --> 01:03:00,427 It would be unfortunate if I asked it to go somewhere. 924 01:03:00,427 --> 01:03:02,260 It couldn't go because things would blow up. 925 01:03:02,260 --> 01:03:04,135 My rank condition would stop being satisfied, 926 01:03:04,135 --> 01:03:07,060 but it's nice that it would at least alert me to that fact. 927 01:03:07,060 --> 01:03:09,460 OK. 928 01:03:09,460 --> 01:03:12,130 I put those exact equations I just showed you 929 01:03:12,130 --> 01:03:16,000 in a few lines of MATLAB. 930 01:03:16,000 --> 01:03:28,400 And I called it task space. 931 01:03:32,110 --> 01:03:38,690 There it goes, but after 10 seconds 932 01:03:38,690 --> 01:03:41,810 and it's quite far away from anything we're going to see. 933 01:03:41,810 --> 01:03:44,250 I can show you that a regulator that operate beautifully. 934 01:03:44,250 --> 01:03:50,390 OK 935 01:03:50,390 --> 01:03:57,020 If you want to see a little bit more of it, I can zoom out. 936 01:03:57,020 --> 01:04:00,990 So it's really gone. 937 01:04:00,990 --> 01:04:02,150 OK. 938 01:04:02,150 --> 01:04:08,030 But again the output regulated beautifully. 939 01:04:08,030 --> 01:04:10,593 OK. 940 01:04:10,593 --> 01:04:13,010 So in retrospect the cart-pole might not have been the way 941 01:04:13,010 --> 01:04:16,847 to show you the power of partial feedback linearization, 942 01:04:16,847 --> 01:04:17,930 except for the fact that-- 943 01:04:17,930 --> 01:04:19,180 I mean if you really did care. 944 01:04:19,180 --> 01:04:22,320 Maybe you're a cart-pole bartender or something. 945 01:04:22,320 --> 01:04:26,000 You have to really keep some things steady. 946 01:04:26,000 --> 01:04:27,740 But, maybe, that's I guess it's still 947 01:04:27,740 --> 01:04:31,713 bad to drive away to infinity. 948 01:04:31,713 --> 01:04:32,380 Where you going? 949 01:04:35,960 --> 01:04:37,520 OK. 950 01:04:37,520 --> 01:04:41,750 So little dog is a good example, where we could nicely regulate 951 01:04:41,750 --> 01:04:43,190 the center of mass of the dog. 952 01:04:43,190 --> 01:04:46,318 And have it tip up and act like a simple pendulum, 953 01:04:46,318 --> 01:04:48,110 even though it had lots and lots of joints, 954 01:04:48,110 --> 01:04:49,700 and a passive joint in the middle. 955 01:04:49,700 --> 01:04:53,540 OK so task space are actually a pretty fundamental concept 956 01:04:53,540 --> 01:04:54,260 in robotics. 957 01:04:54,260 --> 01:04:56,390 And they haven't seen them use that much 958 01:04:56,390 --> 01:04:58,100 in underactuated robotics, but they 959 01:04:58,100 --> 01:05:01,760 work just fine if you're going to use partial feedback 960 01:05:01,760 --> 01:05:03,180 linearization, which is bad. 961 01:05:03,180 --> 01:05:03,680 OK. 962 01:05:06,860 --> 01:05:07,460 Good. 963 01:05:07,460 --> 01:05:08,960 Well I was hoping to have an acrobat demo today, 964 01:05:08,960 --> 01:05:11,335 but Zach tells me were going to do it on Tuesday instead. 965 01:05:11,335 --> 01:05:14,292 And we're going to use it in the future throughout. 966 01:05:14,292 --> 01:05:16,250 So it's the same way I go back to the pendulum, 967 01:05:16,250 --> 01:05:18,980 we're going to go back and show how the better algorithms work 968 01:05:18,980 --> 01:05:20,790 on the acrobat and things like that. 969 01:05:20,790 --> 01:05:23,130 So you will see hardware again very soon. 970 01:05:23,130 --> 01:05:24,940 But not today.