1 00:00:00,000 --> 00:00:05,880 So, hi, everyone. My name is Katie Levinson. And this presentation is called Don't Fix It 2 00:00:05,880 --> 00:00:11,120 in SoftLayer. And you may be asking what's happening here. And the long and short of it is 3 00:00:11,120 --> 00:00:19,400 I just said I got drunk and mouthed off at DEF CON 17. And, you know, someone showed up ‑‑ 4 00:00:19,400 --> 00:00:24,120 the longer story is that somebody showed up when a speaker didn't show up and said, you 5 00:00:24,120 --> 00:00:30,980 know, entertain the crowd, and, you know, and he was whining about how his robot didn't work in 6 00:00:30,980 --> 00:00:34,720 software. And ‑‑ or didn't work and he was going to use software to fix it. And the 7 00:00:34,720 --> 00:00:38,740 problem was basically that his ‑‑ that he said it didn't drive straight. And I'm finally 8 00:00:38,740 --> 00:00:43,140 like, what's the ratio of your drive base? And he's like, you know, are you driving the 9 00:00:43,140 --> 00:00:47,360 rectangle with the fat side forward or the skinny side forward? And he says the fat side. If 10 00:00:47,820 --> 00:00:51,560 you look at the nice fat rectangle ‑‑ I have a laser pointer. This means I'm in charge. 11 00:00:52,900 --> 00:00:54,100 If you look at the fat rectangle ‑‑ and the skinny side forward, and the skinny side 12 00:00:54,100 --> 00:00:59,500 rectangle if you imagine wheels on the end of this as you go like as you as you go forward at all 13 00:00:59,500 --> 00:01:04,300 you're basically levering against yourself to walk down and it's it's not really magical that 14 00:01:04,300 --> 00:01:09,200 you're getting out of alignment and if you if you want to only go straight you know use drive it 15 00:01:09,200 --> 00:01:15,680 with the skinny side of your rectangle forward and then enjoy figuring out how to turn um but uh 16 00:01:15,680 --> 00:01:21,760 you know so this is this is the situation as i you know and this goes on more questions and i 17 00:01:21,760 --> 00:01:27,000 wind up doing this this very academic intelligent rant which i'm i'm really sure probably look more 18 00:01:27,000 --> 00:01:33,860 like that um but the uh the long the short of it is afterwards security comes and takes me aside 19 00:01:33,860 --> 00:01:37,060 and this this makes me nervous because i don't have the best history with authority figures 20 00:01:37,600 --> 00:01:42,560 um but you know he says why don't you do that this is a talk and i was pretty excited because 21 00:01:42,560 --> 00:01:46,560 you know the bottle of vodka been offered and unfortunately some scoundrel absconded with my 22 00:01:46,560 --> 00:01:51,360 vodka i'm really proud i got to use those words it's like my vocab words of the day um 23 00:01:52,320 --> 00:01:58,800 and and but now thankfully someone else will give me vodka props to you dude uh but the long and the 24 00:01:58,800 --> 00:02:04,200 short of it is now we're coming up and we're going to do this big list of all the ways in which i all 25 00:02:04,200 --> 00:02:08,140 the things i wish someone had told me before i started building robots competitively or 26 00:02:08,140 --> 00:02:14,600 professionally um at the very least i can show you some pretty pictures um i do photography and so 27 00:02:14,600 --> 00:02:17,860 most of these slides are pretty pictures so i'm really that boring it's just there's some pretty 28 00:02:17,860 --> 00:02:21,740 pictures for you to look at all right uh my best qualification is the experience of being able to 29 00:02:21,760 --> 00:02:26,780 do stuff wrong as i'm sure you know all defcon speakers are only admitted if they are 30 00:02:26,780 --> 00:02:35,400 exceptionally qualified um so that that's how that's how things are uh these are qualifications 31 00:02:35,400 --> 00:02:41,720 i'm probably more likely to put on my resume um just want to like say right now uh thanks to 32 00:02:41,720 --> 00:02:45,260 originate i just started with them like a little bit ago and they're totally like yeah you can do 33 00:02:45,260 --> 00:02:49,560 this talk that's basically self-humiliation you could do it in our name they all they printed me 34 00:02:49,560 --> 00:02:51,740 an awesome hoodie which i unfortunately left out but i'm going to show you what it looks like and 35 00:02:51,760 --> 00:02:56,360 what i left on the floor because i plan head um but they are awesome and if you are sick of your 36 00:02:56,360 --> 00:03:03,660 boss's consider replying um yeah so uh basically if you have a question just like ask 37 00:03:03,660 --> 00:03:08,360 uh and if we run out of time i'll have to ignore you and you can email me but i'd like just to be 38 00:03:08,360 --> 00:03:19,620 you know casual and interactive as much as possible. Was what? No no no this was defcon 17 39 00:03:19,620 --> 00:03:21,740 No no no this was this was defcon 17 where i went up to the guys and said hey you know what this is 40 00:03:21,740 --> 00:03:28,140 up and like... Oh, that sounds terrible. We should do something about that, guys. Q and A 41 00:03:28,140 --> 00:03:34,280 afterwards. All right. All right. So the outline, we're going to go through some good ideas, 42 00:03:34,320 --> 00:03:37,000 we're going to go through some bad ideas, and we're going to go through some things that 43 00:03:37,000 --> 00:03:41,300 people generally just don't think through the whole way. So starting right off with the good 44 00:03:41,300 --> 00:03:49,360 ideas. Let's go through physics. Torque is angular force. If you were to take a wrench and 45 00:03:49,360 --> 00:03:55,640 apply some force to a bolt in a nice, you know, arc, that is torque. Speed is how fast you do 46 00:03:55,640 --> 00:03:59,740 it. Physicists will get snobby and tell me that I'm not saying this correctly and I don't care. 47 00:03:59,860 --> 00:04:06,060 This is just a working definition for us idiots, okay? First item is pulse width modulation 48 00:04:06,060 --> 00:04:12,080 abbreviated to PWM. Sometimes you want your robot to be going at a speed somewhere between zero 49 00:04:12,080 --> 00:04:19,100 and int max. People frequently decide that the way to do that is to just feed less energy 50 00:04:19,100 --> 00:04:24,480 into the motors, and that's a bad idea. You really should not be doing that. Motors do not 51 00:04:24,480 --> 00:04:34,220 output power linearly. You can see this straight line is actually that is the force output. You 52 00:04:34,220 --> 00:04:38,200 can see when it hits the side with the torque, that's called the stall torque. That's where it's 53 00:04:38,200 --> 00:04:43,320 not moving at all. Where it hits the X axis, that is called the free running speed where there's 54 00:04:43,320 --> 00:04:48,960 nothing on it at all. And, you know, the variations come in between there. You can see the 55 00:04:49,100 --> 00:04:54,960 power that is output in total on the curve line. And you'll notice 56 00:04:54,960 --> 00:04:59,580 that, like, it is not the same at all points. So you actually want to put it where it's getting ‑‑ I'm 57 00:04:59,580 --> 00:05:04,520 sorry, guys over there. I'm going to laser this one and try to describe as best as possible but I 58 00:05:04,520 --> 00:05:09,220 apologize in advance. You want to put it somewhere near the top so you get out as much power as 59 00:05:09,220 --> 00:05:17,800 possible and less inefficiencies. All right. So basically you want to pick a good point on that curve and stick 60 00:05:17,800 --> 00:05:19,080 with it as much as possible. Now, I'm going to say that I just want to talk about our current method of modeling, the 61 00:05:19,080 --> 00:05:23,980 gear your gear everything you know how fast you want the robot to go so take the motor at the 62 00:05:23,980 --> 00:05:28,640 torque and power output you want and just gear it so that the wheels actually turn at approximately 63 00:05:28,640 --> 00:05:35,380 the speed you're looking for um and the question is you know uh oh sorry nope we're looking picture 64 00:05:35,380 --> 00:05:41,360 now um this is an oscilloscope looking at a pwm output um and so you can see that basically the 65 00:05:41,360 --> 00:05:45,780 the line goes up and down it's about one third down two thirds up so if you do this insanely 66 00:05:45,780 --> 00:05:51,540 fast to humans it looks like the motor's just running at a slower speed um and so if they're 67 00:05:51,540 --> 00:05:56,220 if the line is up two thirds of the time it's going two thirds of its max speed and this is 68 00:05:56,220 --> 00:06:01,900 a real way you control speed on robots without totally messing up your power output um and the 69 00:06:01,900 --> 00:06:07,700 question is you know how do you pick the point that you run this square wave at um and the 70 00:06:07,700 --> 00:06:11,160 important thing to remember is that climbing takes force unless you're going to be constantly 71 00:06:11,160 --> 00:06:15,660 operating on a perfectly smooth surface you're going to need a little bit extra 72 00:06:15,660 --> 00:06:21,240 boost to get over whatever you happen to run into um and what happens very often is that people 73 00:06:21,240 --> 00:06:26,380 they put themselves right at this total peak and then they have to go up a hill so now they're 74 00:06:26,380 --> 00:06:31,460 moving slower so now they get pushed down this side of the curve they're outputting less speed 75 00:06:31,460 --> 00:06:35,000 it's coming out as torque now the motor is less efficient so they can shove further down the 76 00:06:35,000 --> 00:06:39,120 curve and further down the curve further down the curve and they're just wailing in place and 77 00:06:39,120 --> 00:06:45,140 really not getting anywhere so uh you want to optimally pick a place a little bit over towards 78 00:06:45,140 --> 00:06:45,640 the speed of the motor and then you're going to get pushed down this side of the curve and then 79 00:06:45,640 --> 00:06:50,800 the speed side is so if you hit a bump you don't wind in this horrible downward spiral of 80 00:06:50,800 --> 00:06:56,960 getting nothing done at all um and the expected terrain will change approximately where on the 81 00:06:56,960 --> 00:07:02,840 speed side of the curve you want to set your running point generally speaking um yeah i hope 82 00:07:02,840 --> 00:07:08,960 i'm going at okay speed this is uh you can see at the bottom these things here i'm gonna like i 83 00:07:08,960 --> 00:07:15,460 feel like being a total dick here um these things at the bottom uh these are pwms you usually do 84 00:07:15,460 --> 00:07:15,620 this at the bottom these are pwms you usually do this at the bottom these are pwms you usually do 85 00:07:15,620 --> 00:07:19,220 this as a hardware object you buy them the internet sells them they're like a hundred bucks 86 00:07:19,670 --> 00:07:27,460 they're cheaper if you like fire um but like you know a good trustworthy like i would feel 87 00:07:27,460 --> 00:07:31,200 comfortable putting this on my robot and it will probably not be the thing that catches fire 88 00:07:31,200 --> 00:07:36,440 about 100 bucks this guy um removed all the cooling systems because he likes fire that's his 89 00:07:36,440 --> 00:07:41,140 prerogative um you do get to at least see the insides of them which is interesting to some 90 00:07:41,140 --> 00:07:44,440 people all right next item 91 00:07:50,420 --> 00:07:55,460 i i really shouldn't have to have a whole series of slides on this but software people think threads 92 00:07:55,460 --> 00:08:01,020 are just kind of magic it's like i've i've applied a a bolt to this problem and now all my physics 93 00:08:01,020 --> 00:08:08,360 are solved and it's like no people major in this shit and it's kind of complicated um so but once 94 00:08:08,360 --> 00:08:14,780 over lightly this is a bolt this is not a bolt 95 00:08:16,720 --> 00:08:19,580 every time you call this a bolt i die a little inside 96 00:08:22,740 --> 00:08:29,060 and i need to drink um this is a screw the end is pointy you don't have to drill a hole first when 97 00:08:29,060 --> 00:08:34,420 you put it in you don't put a nut on the end so i don't know what this chick's problem is but um 98 00:08:35,380 --> 00:08:40,900 you don't need to put a nut on the end of this also uh bolts need to have something on the other 99 00:08:40,900 --> 00:08:44,720 end to hold them on you either thread the piece of metal or wood or whatever that you're putting 100 00:08:44,720 --> 00:08:45,600 them into or you can just put a nut on the end of this and you can just put a nut on the end of this 101 00:08:45,620 --> 00:08:52,300 or you put a nut on the end um this is wrong you're just gonna rip the head off the bolt here you 102 00:08:52,300 --> 00:08:56,440 see the arrows imply the force you're gonna rip off the head of the bolt or you're gonna rip the 103 00:08:56,440 --> 00:09:07,740 uh the the um twirly okay the thread yeah we're we we are extremely technical around here you're 104 00:09:07,740 --> 00:09:15,560 gonna rip the threads off the screw if you do this don't do this okay this is also wrong this is 105 00:09:15,620 --> 00:09:20,760 a machine that does nothing but bend your screws and by screws i mean bolts 106 00:09:29,300 --> 00:09:30,500 all right 107 00:09:42,240 --> 00:09:45,060 this is going to get a lot interesting really fast 108 00:09:45,940 --> 00:09:54,300 all right this is wrong this is also wrong um in this one you are not bending your bolt but 109 00:09:54,300 --> 00:09:59,280 you're going to shear it because you're using the bolt as the major pieces that keeps it together 110 00:09:59,280 --> 00:10:04,400 and they weren't actually in the same way that you know you rip off the head you'll just shear 111 00:10:04,400 --> 00:10:08,640 these things in half they're like zinc plated shit like they're they're really not made for 112 00:10:08,640 --> 00:10:13,880 this okay don't do this this is also wrong this is uh 113 00:10:16,300 --> 00:10:17,800 it's miller light dude 114 00:10:25,460 --> 00:10:31,820 this is right okay this is how you do it the bolt is actually not the object that is holding 115 00:10:31,820 --> 00:10:36,320 the pieces of metal together the bolt is the object that holds the pieces together enough for 116 00:10:36,320 --> 00:10:43,640 static friction to take over and actually do your major holding force um like it's it's it's like 117 00:10:43,640 --> 00:10:45,540 you don't like the the the force should 118 00:10:45,620 --> 00:10:49,260 not be physically in the bolts the force is in the fact that that static i'm just going to repeat 119 00:10:49,260 --> 00:10:54,600 myself you got it okay all right next this is a puppy because we're changing ideas 120 00:10:55,920 --> 00:11:01,760 and uh people say i talk too fast so i just put puppies and kittens and those things in whenever 121 00:11:01,760 --> 00:11:05,880 we have to transition ideas i hope you guys are cool with that puppies are awesome though so 122 00:11:06,500 --> 00:11:13,540 i really hope you are next item drivetrain ratio okay we're going to consider the uh the places 123 00:11:13,540 --> 00:11:15,400 where the wheels we're going to send the four-wheeled 124 00:11:15,620 --> 00:11:20,360 robot here because we're simple okay so uh assume that the the points where the wheels touch the 125 00:11:20,360 --> 00:11:26,480 ground are points you make them into a shape um if it's a square then you're you know you can go 126 00:11:26,480 --> 00:11:31,700 forward and turn you know if you if you want it to be super agile you know you have the big like 127 00:11:31,700 --> 00:11:35,880 crazy angle thing or you drive the rectangle with the short side forward if you just want it to go 128 00:11:35,880 --> 00:11:40,780 straight almost all the time uh this is not terribly complicated but a lot of people are just 129 00:11:40,780 --> 00:11:45,080 like i'm making a robot i'm gonna put some wheels on some plywood you know uh so think about this 130 00:11:45,620 --> 00:11:51,160 you're setting up your stuff uh okay the other thing that people default to is a car uh though 131 00:11:51,160 --> 00:11:56,680 and you know all of you who drive know that cars aren't actually like particularly nimble objects 132 00:11:56,680 --> 00:12:01,040 they need to they need that's just like trying to turn a bicycle they need to go forward in order 133 00:12:01,040 --> 00:12:07,840 to turn um also making the wheels swivel properly is a pain in the ass so unless you have a good 134 00:12:07,840 --> 00:12:12,220 reason for this this is probably not the default that you want to go to even though it's what you 135 00:12:12,220 --> 00:12:14,500 see most often in your daily life 136 00:12:16,100 --> 00:12:21,940 tank is actually a pretty good default just put the wheels down the side put them all forward to go 137 00:12:21,940 --> 00:12:27,180 forward put these guys forward and these guys backwards to turn turns on a dime pretty clean 138 00:12:27,180 --> 00:12:32,200 it'll scuff up everything uh if you care about that because basically the whole art of it turning 139 00:12:32,200 --> 00:12:38,720 is it doing little micro hops um so and it particularly if you have large tank treads and then 140 00:12:38,720 --> 00:12:45,600 you previously had rug in your house uh some people will do uh you know you can do a little 141 00:12:45,620 --> 00:12:51,120 like two wheels tank driven and then uh casters or omni wheels on the front as a slightly less 142 00:12:51,120 --> 00:12:58,120 brutal alternative um that that will that will save your carpet significantly but no guarantees man 143 00:12:58,960 --> 00:13:05,460 um omni wheels uh unless you have a good reason you should just buy these so many people want to 144 00:13:05,460 --> 00:13:13,720 make them I warned you um so they're helpful with the resistance um they permit like some people 145 00:13:13,720 --> 00:13:15,600 will do uh like they will have uh you know they will have uh you know they will have uh you know 146 00:13:15,620 --> 00:13:19,840 a set of wheels going this way on the robot and then a set of wheels going this way on the robot and 147 00:13:19,840 --> 00:13:23,600 what you can do is by driving different sets of wheels independently you get a robot that goes 148 00:13:23,600 --> 00:13:29,780 this way and goes this way without turning cute trick um terrible lateral traction for pretty obvious 149 00:13:29,780 --> 00:13:35,040 reasons this thing in the middle here is an omni wheel I'm gonna I I'm sorry the speaker's in the 150 00:13:35,040 --> 00:13:40,620 way I really can't even see that one I'm so sorry guys um but yeah this thing towards the middle is 151 00:13:40,620 --> 00:13:45,600 an omni wheel uh and as you can see it's a yo dawg I heard you like wheels so I put some wheels on your wheel 152 00:13:45,600 --> 00:13:53,860 wheels. These little black things are free floating. So this is why you can have the 153 00:13:53,860 --> 00:13:57,960 wheels go opposite ways of each other and not have anything actually fight. This is 154 00:13:57,960 --> 00:14:01,720 also the transition side towards vector drives, which are these things with like the 155 00:14:01,720 --> 00:14:07,400 miniature hair curler rolling pin things. You'll notice these are at an angle, which 156 00:14:07,400 --> 00:14:10,740 means that this wheel, when you turn it, most wheels when you turn it, they just want to 157 00:14:10,740 --> 00:14:16,460 go forward. This wheel wants to go forward and also in the direction of the little hair 158 00:14:16,460 --> 00:14:21,680 curlers. And so when you look at this, if you put four of them on, their like default state 159 00:14:22,340 --> 00:14:27,940 is that they all have a direction, they all have two directions that they're pushing. And 160 00:14:27,940 --> 00:14:31,060 if you balance them right, you actually now have a like fully