Transcript for:
Innovative 3D Basketball Hoop Design

i can throw this ball anywhere and it's going in that hoop i don't have to throw it at the hoop that's right this hoop can move in 3d to correct your lousy shot when it's all done this thing is going to sink all the shots yes well except for the ones my wife shoots is that supposed to happen this hoop is the conclusion of an arms race between me and myself it all started with a specially shaped hoop that directed lots of shots in then i made it move but if you missed the backboard it was completely useless so i designed one that could move anywhere on a wall but what if you totally missed the wall it's time to move into the third dimension building a large fast robot that could move anywhere in a room turned out to have some challenges lots of challenges although let's not get ahead of ourselves the point of this robot is to impress my wife and to do that we need to make a system that can track a basketball as you throw it predict where it's going to go and then move a robot to intercept it before it hits the ground and the main challenge is time the ball is only in the air for a few hundred milliseconds and this is a big robot that has to move pretty far it also has to move in six dimensions wait what we want to be able to move and rotate it in every distinct direction these are called degrees of freedom although cool kids call them dofs they would be sixed off which makes it very cool but also very useful if a ball is coming in like this we need to move to intercept it but we also need to tilt to make it go in we could also potentially do some sweet bounce shots and other things a really common way that i might move and rotate a hoop around in a big room like this is with a giant gantry basically a bunch of big ol rails that can move all around like this with a really complicated cart riding on them that can rotate the hoop in any direction it's really hard to imagine doing this at room scale though it would be just like me before i make my new year's resolution heavy and floppy the acceleration forces would make it bend like a wet noodle or more realistically it would just break it would also clothesline me all the time it's unclear if that's a pro or con for all those reasons i decided that a cable actuated robot is the way to go imagine you have a 2d backboard with cables coming at it from all directions by changing the length of these cables you can move the backboard almost anywhere this works the same way in 3d it's just more complicated it turns out you need a cable for each degree of freedom so we're going to need six cables doing this to move a backboard may seem weird but it's perfect for this application it's very light which makes it a lot easier to move super fast it's also very stiff which means it won't flex as much under load this is because the cables form large triangles which are a very strong shape we need some kind of actuator that can push and pull on a cable to make it longer and shorter my plan is to have a motor with a pulley that can wind and unwind the cable i ended up redesigning this three times before i got one that i thought was good enough and it is more complicated than a motor with a pulley attached to it which is really unfortunate because i have to make six of these i'm gonna go make one because it will be a lot easier to explain how this thing works with a physical prototype all right here's your actuator and the first thing you're going to notice is that it's made of wood wood is cheap and really easy to make big stuff like this out of this is one of the motors and it is a little bit overpowered this thing can put out about eight horsepower and i have six of them which gives me about 50 horsepower to work with and just as a point of reference this is 50 horsepower it's enough power to make the backboard go about 250 miles per hour before it slams through the wall and explodes into a million pieces and the only reason i'm using these motors is that i had them already for another project and i thought why not and this is the pulley that the cables wound around they're made from the cheapest mini bike rims that money can buy i did have to modify them and make custom hubs but they were about 50 times cheaper than buying the material and machining them the wire comes off the wheel and goes up into this thingy which is very important as the hoop is moving around the wires constantly are changing direction and this special little pulley will always point towards the backboard there's a cable tensioning system built into the bottom of this pulley these tensioners are annoyingly important i need them because if there's any error in my calculation for how long each cable should be it's bad if i make the cables too long it goes slack and if i make them too short it tears everything apart so these give me some leeway a big problem is we don't know how much each tensioner is compressed which makes the position of the hoop indeterminate and for now i'm just going to kick that problem to future me hey there it's future me he's an idiot another challenge with these actuators is that if i hit the emergency stop or they lose power the pulley is free to spin and there's nothing stopping the backboard from unspooling all the cables and slamming into the ground this is why it has a disc brake from a bike on it if you pull up on this little arm it locks the brake i made this little mechanism with a really strong spring inside of it i can trigger it electrically and it will pull on that arm and lock everything in place check it out these brakes are actually powerful enough to overpower the motors so even if there's a software bug and it's saying go go go if i hit the e-stop it's going to stop [Applause] so i have three cables that need to come down from the ceiling and my original plan was to bolt the motors to these trusses but i realized that's a terrible idea and so what i did is i have them bolted to the ground and then i have a pulley system that lets them go up the wall and over and down where they connect the backboard which we still need to make we need this hoop to be as light as humanly possible if we can cut the weight in half it will accelerate twice as fast i'm going to make it out of pink foam which is really light but it's also not very strong we're going to use the foam as a form to hold everything in place and then we'll entume it in fiberglass which will make it very strong without adding very much weight here it is all put together the cables are going to yank on this backboard like crazy and how they attach the foam is critical because we don't want to just rip the anchors out and you can kind of see through my half-hearted paint job that there's a loop of cord that goes to three anchors when i yank on one of the anchors the force is distributed through the cord to the other anchors and then i have the same arrangement on the front for the other three anchors except it's mirrored one other important detail is that when these cables are tensioned they're trying to pull the cord into the foam not peel it off which is significantly stronger i welded up a super light aluminum rim it isn't strong enough to dunk on but it's like 20 times lighter than a typical strong steel rim [Music] we just need some electronics and software and it'll be moving and grooving so one downside of using really really really ridiculously overpowered motors is that i don't physically have enough power coming out of my wall for them well not yet at least this is a power distribution box and it's used to power a medium-sized construction site or in this case a medium-sized basketball hoop you feed it with a generator or another high-power source and it'll split that up into a bunch of independent outputs just look at the pluck on this thing it is a beast but it actually doesn't have enough power to run all the motors at 50 horsepower and i think that's fine because if i did i would just tear everything apart it's kind of like having a fast car you're never gonna go fast but you could if you wanted to and that makes you cool so before we can start moving motors and breaking stuff we need a little bit more electronics we need something that can send the commands to the motors so that they'll actually move and also orchestrate the motion of the various motors that they move in unison to do that we're going to use a little computer called a microcontroller it'll be wired to every motor and it'll tell them how much and what direction to rotate figuring out where each motor needs to go will be done by another computer running the big boss program big boss will do this by listening to a tracking system which will tell it where everything is located when it sees a ball it'll predict where it's going and how the hoop needs to move to intercept it then it'll tell the microcontroller also known as little boss how much to move the motors so that that actually happens i have the electrical schematic done all it does is it allows the microcontroller to connect to the motors and tell them how to rotate and also for it to command the brakes to brake it still has a ton of connections though each of these blue lines is actually a wire and if i tried to wire this all up by hand it would be a nightmare and i would get it wrong so what we're going to do instead is make a circuit board that will have all these wires inside of it and all i have to do is connect the various chips to it and it should work and because i want it now we're going to machine it turns out this is pretty dumb i don't know what i did wrong but this circuit board is just the worst i keep ripping traces off and it is driving me crazy so i was looking online and i can get one of these boards made tomorrow for fifty dollars or i can get five of them made tomorrow for fifty dollars so if you do the math that's actually ten dollars for a board how does that make any sense come on the more you spend the more you save he says that every time he gets a tool i can't afford not to all right hopefully i don't need the backups they cost ten dollars each we just need about a thousand feet of cable oh come on it's not that bad [Music] all right let's try to move some stuff i don't know which motor is which [Music] sweet all right so amazingly this worked on the first try when i tell a motor to move to a specific spot it does and the backboard flops around like a dead fish and that's all i can do right now we need the big boss program to figure out how to move the motors but before it can do that it needs to know where everything is in the past i've used a microsoft kinect and some pretty involved algorithms to figure out where the ball is it reminded me of trying to start a fire with one of these things you can do it but it's a pain in the butt come on and this is ridiculous it's 2022 we have technology in other words it's time to stop tracking objects like cavemen if you look closely i have eight of these cameras mounted all around the room it's an optitrack camera system which really accurately tracks the location of reflective objects it can track objects 10 times faster than the kinect with about 100 times the accuracy i put reflective stickers all over the ball which should be super visible to the tracking cameras they'll figure out exactly where these stickers are in space which they'll send a big boss which will then figure out where the center of the ball is and that's all there is to it excuse me sir do you have any comment that was easy the tracking cameras work by sending a snapshot where everything is at a moment in time they might say that the basketball is here and then four milliseconds later it's here if you collect a bunch of these points and connect them they give you the path that the ball has taken over time the big boss program is going to take all these points and perform a little simulation to predict where it thinks the ball is going to go in the future it's trickier than you might think though the computer just sees a bunch of places that the ball is it doesn't know if it's in my hand or in the air and the last thing i wanted to do is lock onto my hand and reverse down to the ball at 70 miles an hour so what we have to do is take all this information coming in on where the ball is going and classify it as in my hand or in the air so that we do the right thing if you didn't notice this is a giant mess we're going to use the fact that things flying through the air follow parabolic paths let's say these are the locations of the ball we can tell that it's flying here but the computer can't so here's what it does it draws a little line between each pair of adjacent points each of these lines is going to be at some angle if we measure the angle for every line and graph it it's going to give us some shape if our shape is a parabola it'll be a straight line if it isn't it'll be something else we can use this fact to pick out when the ball might be in the air and this is where it gets really cool this line is at some angle which depends on the shape of the parabola if the parabola that resulted in this line was generated by earth's gravitational pull the slope of this line will be equal to the gravitational constant for earth so if the computer sees a straight line and the slope spits out gravity we can be quite sure that the ball is flying through the air if you're curious and you want to learn more this is an application of calculus specifically the first and second derivative now the question is how the backboard should move to sync the shot it could switch the ball here it could do a backboard bounce it could do a fancy backboard bounce it could do this in fact there's infinite possibilities we're going to use a strategy that just looks at some of these and chooses one that's good enough we start by looking at where the ball will be a tiny bit in the future and we calculate the best swoosh and the best bounce this is done with a bit of linear algebra if you want to learn more check out my previous basketball videos once we have those we repeat this over and over again for every inch that the ball is going to travel this gives us a big set of possible ways we can make the ball go in although some of them are impossible either because the hoop can't move there fast enough or because it's an impossible position the rest are all fair game so i just pick one all of that takes about a thousandth of a second and we're doing this continuously hundreds of times per second until we figure out where we want to go but even once we're moving we're still getting more information on where everything is so we can use that to refine our prediction of where the basketball is going and also if the backboard is going to exactly the right spot because remember the tensioners can make it not go exactly where we want it to go so the big boss is constantly comparing where things are versus where it thinks they should be and if they're not quite right it'll tweak them so they line up we're almost there but we can't quite throw the ball yet the computer calculations are saying if we move the hoop to this spot in space it'll intercept the ball but to actually make it move that specific spot we have to make all these cables the right length and figuring out what they should be is called inverse kinematics and for a robot like this it's actually really simple if we know where we want the backboard to be and we know the coordinates of the anchor pulleys the length for each cable is just the distance between the anchor pulley and where it attaches on the backboard that's literally all there is to it the problem i'm having is actually a very practical problem which is that i don't know where the pulleys are located in space if i don't have accurate measurements for this my inverse kinematic calculations are going to be wrong a tape measure isn't accurate enough i also can't use the tracking cameras for this because the pulleys are too far apart to fit in the field of view of the cameras so unfortunately we're gonna have to make a special tool and write a little bit more code this is the tracking stick it has markers that the tracking system can track and it's designed to attach to one of the cables if we pull this cable really tight it's going to form a line straight towards the pulley and we can measure that line using the little tool that we just made the only question is where on this line is the pulley located so what we can do is we can move this all around and measure a bunch of lines that are all pointing towards the pulley and then theoretically the pulley is located at the intersection of all these lines unfortunately reality kind of sucks and none of the lines that we just measured are probably gonna intersect with each other and that's because there's a little bit of error in all the measurements that i take so we're gonna have to do a little bit more math in programming to figure out the best approximation of where the pulley is from all this data we start by taking all of the rays and choosing a random point as a terrible guess for the intersection of all the rays we calculate how far this point is from every ray and add that up we want the computer to figure out where to move this point to make this number as small as possible our strategy to do this is to move the dot a little bit in all three directions and calculate how this number changes and then we'll use this information to move the point in the direction that will most reduce the number if you do this a bunch of times the point will move until it can't get any smaller and this is a good approximation for the intersection of all the rays we just have to do that for every pulley and bam we got all their locations this technique is called gradient descent you may have seen me use it in some other projects it's very useful especially in machine learning [Music] all right here we go it's the moment of truth i've been waiting so long to try this [Music] apparently my brakes don't work i need to fix those and probably about a thousand other things but before i do the ball is not tracking well sometimes the trajectories just don't make sense and it doesn't matter how many problems i fix if i'm putting bad trajectory data in this just won't do the right thing i really didn't want to change the basketball so i've been trying to fix this in software i've done regressions and outlier ejection and tuning the camera system i got it better but not good enough so it's time for a hail mary or whatever the equivalent of that would be in basketball my thought is that i should just use the tracking markers that i use for everything else because i know that they work but you can't really just attach those to a ball and expect it to still be a basketball but if i put them inside the basketball so they're not sticking out it basically would work if you're wondering how i cut a pocket into a basketball i have a solid foam ball that you can cut stuff into and it won't just explode like an inflated ball i need these pockets to be pretty precise so i think cutting them out with the cnc machine is the way to go but this ball is super soft and i think the cnc machine will just push into the ball rather than cutting it but i think i know the answer and it's awesome plastics and rubbers get harder when they get colder who's there this should keep it from deforming this is not a machining operation that i ever foresaw myself doing i've still got 99 problems but this ball ain't won because this thing is awesome the tracking is excellent and most of the volume is still a basketball so i think it still counts unfortunately nothing else works here's a taste of two weeks of my life something that shouldn't happen happened i wonder why that is uh i basically told it to does it work now i'll take that as a no why isn't anything happening all right i think i got it why would it do that i guess technically my code said to do that what's the deal with that you know let's spend a week trying to make it not do that i think you get the drill [Music] oh gosh it just occurred to me how dangerous this is it's so fast that i don't know that you could dodge it if it went for your face so i'm just going to disable it from going below head height that way i don't have to worry about it one hit killing my wife in the long run i'll probably make some kind of tracker so it knows where everyone is and i just won't go within a certain distance of any of the people in the court i've probably said this 50 times at this point but i think i finally got it working let's see what this thing can do [Music] [Music] oh my goodness i think that's the coolest thing i've ever seen all right let's try that again look how good i am at soccer [Music] again oh oh we have a little setback i ripped one of the anchors off the wall and destroyed it but i don't care at all this thing totally works we're gonna get the wife in here and we're gonna see what she thinks this is the cheap ball this is the wife ball if you throw this one you're really good and if you throw this one you're not as good wow this is elaborate you want to try it yeah i do all right fire it well so fast so if you think that's cool try doing it over your shoulder [Music] okay [Music] whoa is that supposed to happen so it went in and then the hoop is so fast it zooms away and unswishes it [Music] that's pretty cool actually supposed to be a prank but i don't know if that counts it is really cool you demand you demand you demand all joking aside this thing is super fun though rebound backwards blindfolded wife oh you stink oh yeah top of the forklift [Music] hi [Music] time to go home there ball [Music] yes [Music] [Music] oh yes that is so cool [Music] [Music] it's literally more impressive if you miss okay natural talent so what do you think of my hoop i think it's a good thing you have it because you can't throw a basketball clearly so fast the crazy thing is it can go like 10 times faster really it is a kid in high school who never applied themselves operating at a few percent of its potential so it's you basically it's got some issues that are limiting it don't we all i think it can go so fast that i could score a basket then as the ball is falling down it could come and then score another basket before the ball hits the ground that would be really cool i might have to do that it'd be cool to see you on this first as a pro i thought about doing that but i need a bigger room my forklift is in the way my forklift's in the way i don't have a big enough room i got too much cool stuff in the way bigger space it's been two years since i made the first moving basketball hoop ever since i've known a 3d hoop is the right answer i've been putting it off for all this time because i knew it was going to cost a fortune so to all the people who supported me in all the different ways i wanted to say thank you i'm finally able to make this awesome hoop and it's just the beginning i want to make the biggest craziest things that you've ever seen so if that sounds interesting to you please consider supporting these videos you can join my patreon you can get a t-shirt or you can check out this video's sponsor kiwico and if you didn't notice i'm at the beach which means kiwico crates for everyone inside each crate is a project with everything you need to do it you tell kiwiko your age and interest and they send you a new crate every month for example i told them my nephew's 14 and he's interested in engineering kids love these because they're fun but i love these because hands-on projects like this build intuition and skill that's just going to snowball into future abilities i know this because i grew up with kids just like these and look at me now they really do have something for everyone so if this sounds interesting go to kiwico.com made here and you'll get 50 off your first month and that's it thanks kiwiko for sponsoring this video and thank you for taking a minute to listen to the sponsor you're 14 right no i'm sick that's fine this project has been a long time coming i have been talking about this thing since forever yeah forever and it's also been a long time since my last project part of that is that this project took forever but also i've been putting a lot of time into another project i'll probably share more details on that when i get further along and until i make this thing do some crazier stuff pretty much all i got i hope you enjoyed this project and thanks for watching all right see ya cut [Music] you