instruction
stringclasses
1 value
input
stringclasses
1 value
output
stringlengths
0
113k
write a youtube script
no im not locked out i just want to see if you could break into my house the deadbolt doesnt really have a brand its a stuffed brand deadbolt which im pretty sure youve never seen one of these before i guess i should explain whats going on here i designed and built what i think is an unpickable lock although for some reason my wife doesnt share my unfounded confidence you really want to convince people you should have an expert try it you dont think im an expert no i do i just made a real expert shes totally calling me out and as an easily manipulated man i just cant let that stand so i found a locksmith and challenged them to break into my house i spent so much time on this lock and i just need it to work this was one of those unexpectedly difficult projects i had to design some parts more than times until i could get them reliable enough to have a locksmith go at it were gonna have to do some real work here to unpack this lock because you need to understand how locks are picked and to understand how locks are picked you need to understand how locks work so lets get into it imagine that i have a bar that i can slide in and out of a slot this could be a deadbolt for a house or whatever if i put a pin through both pieces this bar is now locked i cant move it this is about the simplest possible lock and this is a very insecure lock because all that i have to do is push this up and then this green part its unlocked if i split the pin into two pieces i have to push on it the exact right amount so that this lines up with this if i push it too far then the lower piece jams locked if i dont push it enough the upper piece jams locked and then a key for this lock is just something with a little wedge that will push these up the correct amount so that it can slide past lets take that drawing into the third dimension sort of heres how you unlock it with the key i also made a lock pick so i also made a lock pick all i have to do is slowly lift the pin upwards as i pull on the locked part and it will just pop open when the pin is in the right spot you can now pick single pin twodimensional locks lock designers realize that one pin isnt quite enough so what they said is well if you like one pin so much how about five im using my glowforge laser cutter to make these locks its awesome for quick prototyping lifting five pins simultaneously to the correct height is easy for a key but if you think about it picking a lock with five pins should be almost totally impossible imagine that i have a five letter password that i need to guess the number of combinations of letters is really high in fact if you do the math its about million combinations you have the same problem trying to guess the position of the pins in a lock what it really comes down to is that just like us locks live in the real world and that means despite what they show in magazines they have imperfections if we zoom in on the pins inside of a lock nothing fits perfectly and theres roughness and all kinds of issues this creates a lot of ways for a pin to get stuck in the unlocked position i could pull sideways on the lower part of this lock then push up on the pins and get the red pin stuck on this little edge if i can find a way to do this for every pin in the lock then thats it its unlocked this is equivalent to guessing a password one letter at a time for each letter you have a maximum of options at most itll take guesses instead of million that is the essence of lock picking break the problem down into a series of tractable small problems the main difference between common locks and the one that ive made here is that they typically rotate a cylinder rather than sliding lock designers have come up with all kinds of tricks to make locks harder to pick some locks are so good theyre almost impossible but in the end someone usually finds a way to set pins individually and pick the lock the key idea behind my lock is that it eliminates the ability to pick one pin at a time you have to try all the combinations which makes picking it intractable heres my conceptual idea for how to do that you start with a normal lock with a normal key that sets all the pins to the correct height except this lock is somehow designed such that you cannot test if the pins are at the correct height until you do a few things first you somehow lock the pins in place so they cant drop if the key loses contact with them then you separate the key from the pins which stay in place because theyve been locked and then this is very hand wavy but you insert some kind of barrier between the key and the pins then you test the pins to see if theyre set correctly this strategy leaves no possible way to test only one pin at once or to change your guess once the pins are being tested you will be subject to all the possible combinations good luck have fun conceptually this lock is really quite simple but designing a mechanism that i can actually make its a whole other story how do i lock the pins in place how do i fit it in a normal sized deadbolt how do i make it resettable catch on all the pins so after protracted wailing and gnashing of teeth heres the design that i finally came up with as a point of reference this is taking me about three times as long as moving basketball hoop theres a whole lot going on in here so lets take one piece at a time at the center of the lock is this core that accepts the key and already we have a part thats essentially impossible to manufacture just look at the way that it cuts left and right folks hes certainly in a tight spot lets see how he handles this one mr stuff breaking it up into manual pieces you cannot make this stuff up i would love to know where he pulled that tool from looks like the perfect tool for the job and it sounds like the crowd agrees this whole new addition to the mill is a tormach microarc contrary to the name implies it doesnt hold two of every little animal it allows me to spin apart while im machining it and i could not have made the parts for this lock without this thing its awesome it uses a harmonic gearbox which is like basically science fiction technology im gonna resist digging into it for now but maybe someday cause its really cool and heres where i reveal how my magic trick really works it mostly comes down to this very complicated and hard to make part that holds the core and some very special pins putting the key in pushes these little pins up if i take another pin and put it on top of the pin being pushed up i can find a way to freeze this pin at whatever height the lower pin pushed it to and then i can swing it sideways once it loses contact with the pin that pushed it up theres no way for the key or a person trying to pick the lock to change its height then you can try to pass it through a gate that it only goes through if its at the right height so when you put it all together all of the pins have to be set correctly and theres no way to individually pick each pin it kind of looks like a little pig doesnt it ive hand waved away this mechanism that locks the pins in place but i think youre old enough for the truth now this mechanism is the worst so theres this bar right here that we push with the key if we look at this from the top you might think i could do something like this where i just push a little lock bar over which will hit each key right here and lock them in place but this doesnt work if things arent the exact perfect size itll hit one pin before it hits another and itll never touch it so this will not get locked what ive been attempting to make is a system where each little finger that can lock a pin is floating on a spring that way each one can individually compress different amounts i can guarantee that they all make contact this has been hard for a lot of reasons related to actuating it with a key keeping things from binding up dealing with grease and other things that change friction i have made so many of these in different designs both with flexural springs with real springs with all different kinds of ramp geometries and it has been a huge pain at this point i still dont have it working reliably but im going to finish the rest of the lock so i can test the whole system how would you like a cot th of the top please do anything fun this weekend i hung out with my son hes a real chip off the old block oh wow cool getting it shrouded and mounted on door was actually surprisingly tricky because i have moving parts everywhere that that want to interfere with a mount so now it looks nice but it still doesnt work so its am and no i didnt get up early remember how i talked about remaking parts over and over again i did that for three more days i finally ran out of ways to do it wrong and i cracked it its the first time ive ever tried it in the deadbolt its the smallest thing but you would not believe how great it feels to see that deadbolt go in it unlocked theres just a little mechanism inside this that does exactly what its designed to do i just love it i did try to pick it to make sure i wasnt missing something totally obvious and as i expected i couldnt do anything ive put off calling a locksmith as absolutely long as i can but its time for me to look fate in the face and see how they judge me i found a locksmith that specializes in picking locks and the first thing that they tried to do was to set the pins individually using a variety of different tools it turns out they werent able to set more than one pin at once thanks to the pin locking mechanism so unexpected bonus security feature so with this first approach that they were using they werent close to picking the lock at all they also tried a technique called bumping and this is what i was most afraid of it launches the pins upwards and very hard and fast by hammering a special key into the lock and i was afraid theyd be able to launch the pins and quickly rotate the cylinder and get them to land in the right spots and go through the gates but they couldnt i dont think it would work they gave it a solid effort and tried for quite a while eventually theres just nothing else to try yeah we tried yeah thank you for trying and im not sure why i was so stressed about something that doesnt matter but i really was so its definitely resistant to the standard attacks yeah standard proof that bump key its just like watching them hit my child with a with a hammer really thats your baby i spent all this time raising my kid i dont want to see them fail when it matters the most you know what i mean i dont even know what to say to that i wouldnt say its unpickable i dont think theres enough evidence to say that i think that is a strong lock i think that it is formidable you know who you should send it to the lockpicking lawyer i would love to send it to the lockpicking lawyer let us know if youd like to hopefully we can make it happen if you want us to send it to the location lawyer dont bark i would definitely make some upgrades for sending tim more pins more power you know all that stuff one other thing that i wanted to point out is that this thing is not going to be important its not going to be commercially viable the main value is just the educational aspects the mechanical complexity just far outweighs any benefit if you want a truly unpickable lock just get a lock that doesnt have a key theres tons so did you like my wife tracking trebuchet i appreciate the learning experience what did you learn i learned nothing but hopefully our daughter learned something i built a robot to track and fire upon my wife as if she was a medieval target thanks to this videos sponsor kiwiko i love kiwico they provide a service that i think is really important ive mentioned before that so much that i know how to do i learned outside of school my parents gave me all kinds of building and project kits this is one of the first complete models i did with no help doing these projects taught me so many skills and it formed a solid foundation that i built so many of my other skills on top of kiwico is awesome because every month they send you a crate with everything that you need to do a complete project start to finish ive built and modified a number of these in their awesome projects theres the main project but then theres an entire magazine that goes into all the concepts behind the thing that you built and then theres other projects that you can build with the pieces that came with the kit i added a few offtheshelf components to this and turned it into a wife tracking trebuchet hey wife come check this out were learning what learning this stormy castle just remember its never too early to teach your children about medieval siege strategies its not all trebuchets they have eight different lines for different age groups and interests i was really excited when i saw they have a line of crates thats just a little bit more suitable for my daughters age so whether its for a child a relative yourself honestly this is really fun to build give the gift of knowledge and skill its a longterm investment that youre not going to regret can you imagine the skill that you would build from doing these crates every month for a year or two i am so thankful to have been exposed to these kinds of kits growing up if you go to kiwico.com stuff made here youll get off your first crate and youll also be supporting this channel although im not planning on selling any stuffed brand locks you can still support this channel by subscribing if you think i earned it checking out my patreon where you can support these projects directly and get a behindthescenes view as well as taking a minute to check out any sponsors it helps me a lot and is much appreciated Music you
write a youtube script
how long do you think it would take you to solve a piece allwhite puzzle I think it would take the average person a really long time like years but I think that a computer and a robot can do it really fast like less than a day if I can get my robot working in my last video I made a robot that can assemble puzzles but its real dumb it couldnt do more than maybe pieces so ever since Ive been working on an algorithm which will hopefully allow the robot to take big puzzles with like pieces figure them out and then assemble them quickly all white puzzles are really hard because theres no picture that you can look at to figure out if pieces will fit together if I want to figure out what piece connects to this piece I have to pretty much pick up every single piece and test it to see if it fits if you do the math this works out to somewhere around million comparisons that you would need to do and thats why I say it should take a human years I wanted to do this project because I love seeing robots do something thats hard for humans and I also really wanted to talk about computer science so I get to do both heres my plan for solving the puzzle Im going to give the robot each piece one at a time so that it can get a picture of every piece and then it will extract the shape of every piece from the photos and then think really really hard about all the ways that it could assemble it until it finds the right one and then itll use that plan to actually assemble the puzzle when you list it out like that it doesnt sound that bad but Ive spent the last several months trying to solve this problem it is without a doubt the hardest project that Ive done but it is an awesome opportunity to talk about algorithms and software its the reason that I did it so lets get into it I made a few Hardware upgrades since the last video Its better faster stronger less breakable but Im not going to get into the details of those because I want to focus on the software though the key takeaways are number one the magazine is gone because it is a reliability Nightmare and I made some upgrades to the business end that limit the range of motion of the robot and it cant physically assemble my piece puzzle anymore so I was thinking about it a bit more in five thousand piece puzzles are totally overrated what will be really hard is a four thousand piece puzzle no one makes a four thousand piece allwhite puzzle so I got a normal puzzle and I painted it white with all that done all thats between us and a soft puzzle is our imagination and a lot of software except I forgot my lease is up on my shop so I have to move all of my stuff this took me so much longer than I was expecting like six weeks to move everything clean up all the damage at the last shop and get set up at the new place moving a very delicate puzzle solving robot is nervewracking but I only slightly broke it welcome to my new workshop there is a lot of stuff it is packed tighter than a neutron star what it doesnt have is a lot of room to do stuff but thats okay because I have shipping containers that are packed very very packed all right lets get back to the robot the first step to solving the puzzle is getting a picture of every piece Im going to give the robot each piece one at a time itll take a picture of each piece with this very accurate camera with a telecentric lens this takes about eight hours thank goodness I only have to do it once all right so Ive got pictures of all the pieces but that doesnt really do me any good I need to extract the shape of each piece from the photos heres how I do that each picture is made up of a bunch of pixels that have a color and the pixel showing the background are a very different color than the piece we can say any pixel thats similar to the color of the background isnt the puzzle piece and every other pixel is the puzzle piece so weve got a blob thats the shape of the puzzle piece but what we really care about is the shape of the edge because thats what does all the connecting so the next step is to extract it so all we need to do is look at every pixel thats in the piece if that pixel is next to a background pixel we say that pixel is part of the edge and if you do this for every pixel in the image you get the entire edge of the piece so at this point we can throw away the image and treat the pixels as points in space that form the edge of a complicated polygon we want to do this so that were not constrained to pixels when you think about solving a puzzle youre usually not thinking about the entire shape of the piece youre thinking about the shape of one of the sides so we need to take this perimeter and divide it into the four sides for the puzzle piece and once we have those then we can start seeing which ones might fit together conceptually this is pretty easy you find the corners of the piece and you divide the Contour up at every corner but in reality its pretty tricky if we zoom in on the corner it isnt perfectly sharp any point along this curve could be considered the corner if Im not rigorous about how I Define the corner some edges will appear longer or shorter and they will not match correctly I start by finding the approximate Corner locations and then I grab a little part of the polygon on each side of this corner and I fit a curve to it I consider the intersection of these two curves the corner of the piece and it usually doesnt fall on the polygon so we find the point on the polygon thats closest to this corner floating out in space and we split it in half at that location if you repeat this for every corner you get four curves that are the shape of each side Im going to calculate this for every piece and its probably going to take a while but I only have to do it once I can save the result to my hard drive and then load it way faster than it would take to calculate it this is sometimes called preprocessing this is going to take a lot longer than I was expecting like probably days times like this make me really glad to have a super powerful computer because instead of trying to make it faster I can just throw a more computer at it and itll hopefully be fine so what Im going to do is split this job into smaller jobs that Ill run at the same time so hopefully instead of a few days itll get done in a few hours I dont think Ive ever talked about my computer before which is kind of surprising because its my most important tool Ive had this thing for about a year its made by a company called Puget systems and it is a beast they asked me what specs I thought I needed and I said I need all the ram all the CPU and all the GPU and for stuff like poorly written programs big cat assemblies and editing videos it is astonishing how much time it saves me if youre looking for a beefy reliable machine you should check out Puget Im a big fan I know a lot of people are going to tell me that I wouldnt have these problems if I didnt write my code in Python but if I wrote my code in something like C plus plus I would still be writing code so I like this trade now that we know the shape of all the edges we need to go through all of them and figure out which ones potentially match the slow easy way to do this would be to compare every Edge to every other Edge but that would be too slow this is where we get into software optimization you may have heard people talk about this before the general idea is that you find some kind of shortcut or alternate way of computing something so that it goes faster and what were going to try to do is find a way so that we can directly compute which edges match a given Edge without having to do any comparisons so if I have an edge I can just directly say heres all the edges that are similar to that one without having to compare it to every possible Edge its going to get kind of weird but also kind of awesome so hold on to your butts we can start by grabbing one of our edges and making an imaginary line from one side to the other and then divide this line into some number of equally spaced points and then at each point we calculate how far the curve is away from the line at that location station this will give us a list of numbers that approximates the shape of this curve to make what were about to do easier to understand lets pretend that we only took two evenly spaced points if I treat the first number as an xcoordinate and the second number as a y coordinate we can plot this point on a d graph if we do this for a bunch of edges ones that are similar will be near each other on the graph and ones that arent similar will be far apart unfortunately figuring out what points are near a given point requires that we compare them which is what we dont want to do so we need to go deeper if I take a line and add it to this graph we can calculate which side of the line any given point falls on then if I get a new Edge and I calculate where it goes on the graph I can see which side of this line that it falls on and I can ignore any of the points that are on the other side of the line I know that its not going to be similar to them without having to compare it but this stops being effective if I have points all over the place but if we add more lines dividing this graph something really cool happens this point is on the left side of this line the right side of this line and the left side of this line this sequence of left right left describes a very small specific region of this graph and all the other regions have their own unique sequence so for every point on this graph we can calculate the sequence that describes where it is on the graph if we keep track of what region of the graph each point falls under if we get a new Edge we can just calculate where it falls on this graph and directly look up what other points are similar without doing any comparisons so I did this in D so that we could visualize it I used dimensional space for my hash the math is the same its just dimensional graph and instead of a line you have a hyperplane but the math is really the same you just cant visualize it and I did not invent this its called locality sensitive hashing it has nothing to do with crypto or medicinal oils and it is an amazing technique one other really cool thing that its used for is reverse image search were going to use the hash to find all the similar edges for all of the pieces hmm I have been looking at this forever for days and I initially thought that I did it wrong which is usually a really good guess but in this case its even worse it looks like I did it right but its still giving me the wrong answer it looks like weve got a bad case of what programmers call garbage in garbage out when this happens it doesnt matter how good your algorithm is if you give it garbage data its going to give you garbage results although in my case its very subtle garbage its like a tiny bit of dog poo in your brownies you would know it from just looking at it but its garbage they must have used a very dull knife when they cut out the pieces the edges are super fuzzy which makes the pieces look like a different shape than they actually are this thing is a vibratory Bowl tumbler and the way it works is theres abrasive grit inside of it which it vibrates really hard and if you have something that has a lot of rust on it or sharp edges you can throw it in here let it run for a few hours and when you come back you have a really beautiful part so this thing is usually used with metal but Im hoping with some very gentle abrasive I can put cardboard puzzle pieces in there and they wont get disintegrated into nothing all right this is approximately infinity times better all the pieces changed so we have to scan them in again this takes about eight hours thank goodness I only have to do it twice all right lets calculate all the Edge matches what all right I am gonna lose my mind so the pieces look good my code looks good the results dont look good upon closer inspection it looks like the vibratory tumbler did a great job of removing all of the little fuzzy things and sharp edges but it also did a good job of changing the shape of the puzzle pieces by grinding them down and when you take pictures of them they dont look like they fit together anymore which I guess that makes sense but it is really unfortunate this is a really annoying problem even if I go and buy a higher quality puzzle that doesnt have the rough edges if I paint it white Im going to get paint on the sides of the pieces then Im going to want to put it back in here and its going to mess it up again the only thing I can think to do is make my own puzzle I can get the top of it painted white and then I can cut a puzzle out of it itll have really nice clean edges and there wont be any paint on the sides I should have done this from the beginning I would have saved so much time its a new puzzle so I have to rescan it which takes about eight hours thank goodness I only have to do this three times I didnt realize it when I was making it but my laser cut puzzle has some self intersections on the Contours which turns one piece into one really messed up piece and an extra little chunk and it looks like theres only four of them I could spend a bunch of time updating my algorithm to support malformed pieces but that really seems like a dumb idea I could remake the puzzle but that would take me like a day Im really leaning towards option C which is just put the pieces into the four missing spots when the puzzle is done all right weve got new picks new hash third times the charm okay finally believe it or not we are just now getting to the Crux of this problem every side of every piece potentially connects to multiple other pieces and without any kind of picture on the puzzle the only way to know which of these Edge connections is the right one is to build more of the puzzle and see if it makes sense if we go back to that original piece it has some number of potential connections on each side if we pick one of the possibilities for each of these sides the only way that they work is if they share a mutual piece in between them like this otherwise theres no way to connect them so even if they fit well to the original piece they dont make sense when you consider the rest of the puzzle if you do this for every piece it reduces the number of possibilities dramatically incidentally doing this also generates all of the possible two by two squares of pieces that you could use and this is where we go deeper we can pretend that a two by two block of pieces is one big complicated puzzle piece if both of the pieces on this block connect to both of the pieces on another block then its a valid connection we can eliminate possible Json block unless they share a mutual block and then you can build two by two blocks of two by two blocks which would be a four by four block and then keep repeating this until you cant go any further this part is actually really mind bending and really annoying I spent several weeks at this stage I could not get it to fully complete and I did have to give it some hints to help it along I do think with some more time I could have it run fully autonomously but Im fine Im okay with that so at the end of this process most of the pieces only have one possible connection so then you can go through that and assemble the grid of all the pieces which the robot can use to actually solve the puzzle four thousand pieces is a lot of pieces and it is not very fun to feed them in one by one into this robot I did want to have an automatic vibratory ball feeder I even built one but it had a bunch of issues and I figured it would take me longer to fix those issues than it would take for me to feed all the pieces in and so Im just going to do that thank goodness I only have to do this four times one other big problem that I really wanted to solve but I just dont have time for is that sometimes when you put pieces down they wont fit together perfectly this sort of has a Cascade effect when you click two pieces together itll shift the pieces that its connecting to and then when you try to connect a piece to the shifted pieces itll get tilted and wont seat all the way down and I wanted to be able to scan the pieces that I put down which is why I have this other camera its why the table is orange so that I can very clearly see the pieces that Ive put down and its why I added this really nice light to the cam camera if it can put them in mostly the right spot and I just have to nudge them with my finger to make them click together that is a complete win by my book so one thing that I like to say is that if at first you dont succeed reduce your expectations until youre a success I think those are pretty good words to live by and thats definitely what Im doing here at least in theory the robot now has everything that it needs to solve the puzzle if I put it into solve mode the robot expects me to load the pieces one by one when it sees a new piece it extracts all of its details and then looks up where it needs to go using the solution then it rotates the part to whatever orientation it needs to be at and then moves over and puts it down where it needs to go all right here we go that is so satisfying all right well with this many pieces you cant expect them all to fit together right I already regret not making that feeder Bowl work Music I didnt see it happen but I think a piece stuck up just barely enough to hit I was able to get it mostly back to the right spot I think I was gonna wait until the end to push the pieces down but that crash has me paranoid the cumulative error is really adding up in some spots the pieces are in the right spots though so its an easy fix well except for this last row theres a bunch of pieces that do not belong that are being stacked on top of each other Im guessing this is a stupid logic error but Ill have to look it was a stupid bug I think its fixed so lets keep going all right its almost there just gotta seat these pieces I have no idea why but only on this edge of the puzzle some of the pieces are not put in the right spot theyre stacked randomly on other parts of the edge mostly this Edge this is the last row in the simulation Im guessing theres still a kind of stupid bug happening there although I looked at the code and theres nothing really obvious so I thought about spending a ton more time trying to get to the bottom of this but I could also just do this I dont think anyone would know or even care right theres a few other missing pieces this is where the messed up selfintersecting pieces would be so we can just put those in the right spots all right it is done I made this puzzle yet somehow I lost two pieces I could laser cut some replacement parts but I think theres something poetic about two pieces being missing it sort of matches really well with my reduced expectations and the journey was the destination in any case and I hope that you enjoyed it I hope you learned something about algorithms if you find this fascinating like I do you should consider becoming a programmer if you arent already it is an awesome job where you basically explain to a computer in excruciating detail how to do stuff like this Im really curious to see if my wife is as impressed with this as I am but before we get to that I want to talk about this video sponsor its a company that I think is amazing brilliant people reach out to me all the time asking me what it is they need to learn to be able to make stuff like I do and whenever they do it makes me really happy because I really want to inspire people and this is why I love brilliant its a really powerful tool for learning math and computer science and a bunch of other technical stuff the way it works is itll take a really complicated subject like computer science and theyll break it down into a bunch of bitesized lessons which will teach you Concepts and then reinforce it by having you work examples which is just the best way to learn Ive read textbooks for years and this is exactly what I do and Brilliant is better than a textbook could ever be because a lot of the examples are interactive its so much easier to see and build intuition for how something works when you can directly interact and manipulate it and the fact that theyre smaller lessons makes it really easy to do a little bit every day I try to spend a little bit of time every day doing some kind of learning and Im always amazed when I look back at the past year how much progress I make just from that little bit every day Ive been working through their lessons on differential equations I did learn this back in college but I never really got it and I also forgot everything I knew about them in all the time since and I feel like its starting to click which is awesome so if youre interested in building technical skill you need to check out brilliant it is an amazing tool and its free to get started all you have to do is go to brilliant.org stuff made here you can also click on the link in the description and the first people to do this will get off their annual premium membership and thats it thank you brilliant for sponsoring this video and thank you for taking the time to check it out all right lets see what the wife thinks hey wife wow I thought you said it was finished I spend months building these projects and I love doing it if you enjoyed these videos please consider supporting them subscribing to the channel helps me get sponsorships and you can also support them directly on patreon thanks Music
write a youtube script
isnt it great i mean its neat but were not even doing anything it gets better wait until you see it work its magic Music its the future why would i spend my time having fun when i can build a robot to have fun for me imagine a robot that can sort out all the pieces in a puzzle and figure out their shape and then think really hard to figure out how they fit together and then assemble it in one straight shot its a super interesting problem with all kinds of challenges but if that isnt spicy enough its designed to solve what may be the worlds hardest puzzle a puzzle thats all white they say it takes over a month to solve and thats because you have to search through every piece every single time to find a match do you know what would be even harder pieces all white they dont even make that this is just a normal piece puzzle that im going to paint all white if you do the math it should take about two years of hour days to solve this puzzle if youre doing it at a more leisurely pace its more like years to life and as terrible as that sounds if this was a real product i bet theres people that would buy it my original plan was to use my robot arm to do this but the puzzle is bigger than i thought and theres no way to make the robot reach the entire puzzle without putting on top of another robot to move it around so thats just not gonna work so what im gonna do is build a big table with a gantry built into it that will move a little cart around which will pick up and move the pieces this is going to be a lot easier to explain when i actually have it so lets get this thing made step one is to make a giant table because piece puzzles are huge this thing has like parts so im printing as many as i can possibly get away with everything else is cut from raw materials using a variety of sharp blades i can never get over having the cnc making parts for me while im doing other stuff all right now hes got to bolt everything together the pieces all move without hitting each other which is a great start there is a lot going on with this robot but fundamentally its only doing two things moving pieces around and taking pictures of them the robots using a little suction cup to pick up pieces because it would be really hard to make a little hand the suction cup is on a little platform that can move up and down and it can also spin to get parts in the right orientation which really complicates things the vacuum system rides on bearings and is rotated by the servo motor all of that is lifted up and down by this funny little rc car shock we want to be able to push firmly but not destroy everything if theres anything that gets jammed up so the shock provides some wiggle room if you want the pieces to ever come off the suction cup you need a way to turn it on and off so it has a hole in the middle of it which we can either attach to a vacuum to make pieces stick to it or not to make pieces fall off it im using a compressed air powered vacuum which sounds like its just shoot the piece off but it doesnt and the way it works is awesome this is another air powered vacuum that i have which is used for cleaning air goes in here and shoots out the back and somehow it creates a bunch of suction on the front the pressurized air goes to a special nozzle that makes a high speed cone of air the air inside of the cone is just chilling and mining its own business but you cant really have air moving fast past air thats not moving so the fastmoving air just pulls the still air along with it this creates a continuous flow of air which you can use as a vacuum this may seem like a roundabout way to generate a vacuum but its so much easier than the alternatives all you need is a solenoid valve to turn the air on and off which are cheap and really easy to control electrically and then the little vacuum generator which is a piece of metal the automatic piece picker can be moved anywhere on the table with this gantry and its going to be moving a lot of pieces so my main design goal was to make sure that it could move quickly and as with many of my projects if you wanted to go fast you need it to be light Music achieving speed is why this gantry has such a strange belt design to understand whats going on lets start with a simpler arrangement we could have a motor moving a belt like this to move the cart back and forth then we could have another motor moving another belt to move this beam back and forth but this double stinks because youre moving a heavy motor and if you only push on one side of the beam it really wants to bend and break what you really want is a belt on each side of the beam pulling it but this still stinks because removing that heavy motor and this is where things get cool imagine if i reroute this belt like this now the belt will move the cart left and right and then if i reroute the other belt in the same way i have this very strange looking arrangement if i pull on both of the belts like this they pull on the cart in opposite directions and it cancels out so it stays still but the gantry beam moves down but if i move one of the motors less than the other one they only partially cancel out and the beam and the cart move together if i move the belts in opposite directions they both push in the same direction on the cart and only it moves by coordinating the motion of both motors we can move the cart anywhere we want with two stationary motors isnt that awesome this belt arrangement is called core y youll see it used a lot in d printers all right lets see what this thing can do oh that does not sound good lets try again these motors are so powerful that theyre making the belt skip i made some tweaks to the design that have made the problem a lot better but im still not able to use all of the motor power its totally fine for now but if i do want more speed in the future ill have to make some more modifications so i can get all the power out all right we are now moving pieces were at least percent done somehow the robot needs to pick up every piece of the puzzle scan it and store it somewhere for future use for now im gonna just feed the robot one piece at a time and even doing it this way turns out to be pretty challenging even if i have something like this that the robot knows basically where the piece is i cant just pick it up in the middle because some pieces the suction cup cant get a seal on it somehow the robot needs to know the sweet spot for a given piece to pick it up this is a camera pointing down so that the robot can find the pieces when it sees a piece it calculates the point on it thats furthest from all the edges this is the best place to pick the piece up because it has the most room for the suction cup i want this robot to work with any puzzle with any pattern on the top which could lead to some situations where the pieces blend in with the table which would make them very difficult to pick out with the camera and so what im going to do instead is pick them up off of a light the bright backlight will make every piece look like a blackonwhite silhouette which is very easy to reliably process the robots taking pictures of the puzzle pieces to figure out if they fit together for this to have any chance of working accurate measurements are critical which is a lot easier said than done because most camera lenses give a distorted view of the world do you really think my face is this shape if the computer used this picture of my face to figure out its shape it would think it looks like this i have this grid paper that i know is square i can take a picture of it and see how the lens distorts it so this is obviously wrong and if we measure how a lens distorts the image we can actually correct for it by distorting it in the opposite direction but this only corrects one of a few problems so i have this part thats a bunch of little pillars and even when its pointing straight at the camera you can see the sides of the pillars and the same thing happens for a puzzle piece if the back and sides are similar colors it can be almost impossible to figure out the actual shape of the puzzle piece this happens because the camera sees everything with a field of view as this line goes from one extreme of the field of view to the other everything it touches the camera will see the wider the field of view is the worse this problem is if we move the camera far away and zoom in the field of view gets smaller and these problems get a lot smaller and if we take this idea to the extreme and move the camera infinitely far away the problems disappear getting the camera infinitely far away is challenging and id rather not attempt it but were in luck because theres a special kind of lens that sort of does this this is a telecentric lens and it sees things as if they are infinitely far away you can think of it as seeing a tube that comes straight out of the lens that doesnt get any wider its really weird now we can move this piece anywhere in the view of the camera and we dont see the sides its also always the same size regardless of how far it is from the camera the camera is mounted below the table looking up through a hole and the robot can bring a piece over the hole and itll take a picture of the bottom of the piece Music assembling puzzle pieces is a delicate operation if youre off by even a millimeter they dont go together for this to work the gantry has to be very accurate and unfortunately i can tell just by looking at the gantry that its not accurate and if you can tell by eye that its bad its really bad let me show you what i mean if the robots accurate this will be a millimeter square yeah thats definitely not a square instead of making it nice or tweaking it endlessly to make it better im just gonna fix it in software you may have seen me using my optitrack cameras and some previous projects if you havent its a set of tracking cameras that can very accurately track the location of reflective markers like this if you want to understand how they work check out my wall painting robot video where i go into more detail putting a marker on the gantry allows me to track its position very accurately and then if its going to the wrong spot my software can correct it so it goes to the right spot all right take two alright now that is a square this is pretty cool you can see it moving the gantry to the side to correct for the nonsquare motion alright heres a big problem the gantry accelerates very aggressively which can shake the whole table which can make these pieces wander around and if the pieces move from where the robot left them thats a huge problem the first thing i did is i made the leg super stiff with these tension steel cables this should keep the legs from flexing and acting like springs the strength difference of a couple steel cables is so huge i have to show you a demo this is a model of two of the tables legs without bracing and this is one with bracing you can see how much this flexes with me barely pulling on it when you add the bracing its its not going anywhere i could probably hang from this if i could find a way to rig it Music all right such a huge difference the tension cables help but im not convinced that the vibration problem is totally fixed and i need to be sure because if the pieces move around its game over so what i did is i made the table hollow and if i need to i can drill a bunch of holes in the surface of the table and then this super powerful vacuum will suck all the air from the inside of the table which will pull air through all the holes drilled in the top which will suck the pieces down to the plywood surface so they cant move around for it to work i need about thirty thousand holes i made this little drilling attachment that can attach to the robot where the suction cup would go and instead of picking up pieces it will drill holes into itself im not gonna do this just yet but if we need it weve got it weve got ourselves a little bit of a space dispute before the puzzle algorithm can solve the puzzle it needs pictures of all the pieces this means all the pieces need to be scanned into the machine and if i just set the pieces on the table theres not enough room to assemble the puzzle i thought about just making the table bigger but its already huge and then i thought the robot could make little stacks of pieces until its ready for them but any vibrations will knock those stacks over so im making a little magazine that the robot can store the pieces in off to the side it will basically be a little platform that i can raise up and down with a screw whenever the robot sets a piece on the platform itll lower down a little bit and then be ready for the next piece the only problem is that stacking puzzle pieces is feet tall so im gonna make a bunch of shorter magazines in a row im making the magazine out of polycarbonate this will let me see whats going on when it jams up Music i wonder if it would be possible to design something with more parts than this i really should have just made the table bigger Music the design for this is kind of weird because i didnt want to have motors driving on the lead screws it would be expensive and a huge pain to wire up and if you think about it you really only need to move one at a time theres only one robot and so what i did is i put a single motor on a rail that i can move back and forth to any of the lead screws and turn whichever one i want we do need a second motor to move the first motor around there are some tricky little details to ensure it doesnt jam but i think this design can be reliable having a single motor that can drive a bunch of outputs like this is called multiplexing all right thats all the hardware now we can put it through its paces the robot continuously scans the piece pickup area when it sees a part it calculates the best spot to grab it and then takes it over to get scanned the software will calculate the shape and size of the piece square it up and then store it in the magazine well thats what it would do at least in a perfect world in practice when you combine this many complicated things it never works on the first second third or fifth try i like to call this integration hell because theres lots of problems and it usually sucks but eventually you get through most the problems all right things seem to be stable so its time to try out my phase one testing puzzle here we go Music alright the robot has all the pieces and pictures of them the laptop sent everything over to my editing computer because its a beast and solving this puzzle even with only nine pieces is super computationally intense a nine piece puzzle is taking it a couple of minutes a five thousand piece puzzle is impossible without me making it faster but one step at a time so heres the solution for the nine piece puzzle you can see that all the pieces dont line up perfectly this is one of the things that makes it so hard to compute once it has a solution it sends it back to the laptop and if i hit enter it wont do the right thing yet theres still one more problem the assembly plan wants to construct the puzzle from one side to the other in one straight shot but these pieces are in a random order its just whatever order i gave them to the robot and so the first piece that it wants is probably somewhere in the middle or the bottom i wrote a little routine thatll take the pieces out and then put them back in the correct order all right its finally ready to try to solve the puzzle so here we go Music not the best start but it did put them in a grid its better than nothing lets try again i think it might be better all right this time the charm maybe i should pivot and make this robot an avantgarde puzzle solver all right lets try again its definitely got the right idea theres just some problems still all right this ones the one all right maybe not ugh what you havent seen is all the software ive been going through all right this last time yes come on baby one more just one more yes yes one more finally what a pain oh that was three weeks of work i know its only a three by three but its so cool and i think thats because so much has to go right to even do this that its amazing to see it all come together this is a very highly abridged version of the struggle that it took to get this thing solving even the three by three all the algorithms to take the pictures of the pieces and then solve the puzzle is doing an enormous amount of work i spent over three weeks on it and theres still a lot more work to be done before i can do a piece puzzle the algorithm is so slow that it would take about years to solve the puzzle so instead of just grinding through the software issues and then glossing over it like i normally do i want to take you deep inside the matrix i want to show you how this thing actually solves puzzles and how i made it fast or at least how i think im going to make it fast because its super interesting so all of thats going to be in part two so if that sounds interesting please consider subscribing so you dont miss it and before we go the wife is going to come over and were going to do a slightly bigger puzzle than a x for game night if seeing all these projects get you super amped up to go out there and learn and build stuff you should take a minute to check out this video sponsor brilliant i admire brilliant because theyre doing something very important they make a tool that makes it so much easier to learn complex important stuff theyll take a topic like learning to program python and theyll present it in an interactive handson way that has you writing actual code in the lesson handson learning by doing is an extremely effective way to learn and its so much more than python look at all these courses all the math physics computer science stuff that you thought you had to go to college to learn nope they take these big intimidating subjects like vector calculus and they divide it up into a bunch of bitesized pieces that build one on top of the other which is really good for learning a bit every day this is how ive learned a lot of what i know i try to spend at least minutes a day learning something new i know ive said it a bunch of times but its amazing how much you learn when you exercise your brain regularly like this ive been working through the course on quantum mechanics because i know nothing about it at least not yet and its been super interesting so if you want to learn a bunch of interesting new stuff thats going to level you up and make you more capable go check out brilliant all you have to do is go to brilliant.org stuff made here you can sign up for free and the first people that do this will get off their annual premium membership finding ways to always be learning new stuff is one of the best things you can do so i hope you check out brilliant and thats it thank you brilliant for sponsoring this video and thank you for listening this thing is so cool isnt it great i mean its neat but were not even doing anything it gets better this is probably going to take about an hour and a half really yeah why it has to think really hard Music see why i need that Music oh shoot its already done it its way more fun when you actually see it solving the puzzle and maybe if i had more pieces Music you
write a youtube script
no looking william towel my wife did archery growing up i did not but being good at stuff is so th century put this on and you dont have to aim so i guess i made an aimbot when you wield the aimbot you almost have a superpower it tracks targets really well almost as well as my dog can track treats it moves the bow to correct for your lousy aim and when everything is perfectly lined up going into this i wanted to shoot bullseyes lame multiple bullseyes still lame which led to bullseyes flying through the air so were gonna try all that and maybe hit the worlds smallest william tell sweet this project started when i realized theres a hole in my heart that money just couldnt fill its and i cant buy a selfaiming bow so i built it it works now but it took me thousands of misses to get here there was also some collateral damage although my nose probably took the biggest beating so let me show you why an aimbot is hard hey what are we gonna do archery all right a lot of stuff just happened most importantly the arrow flew in a curved path she was aiming above the target so when the arrow curved down it would hit the right spot the arrow curves more or less depending on how fast its going if her hands are off by even a couple of millimeters she will miss three two one Music this is really hard you cant aim for where the target is because it wont be there when the arrow reaches it you have to shoot where the target will be which is called leading but whats really hard is the timing this arrow was fired milliseconds too late thats one third of the time that a blink takes let me show you milliseconds did you even see that let me do it again she has to fire within that window of time if she wants to hit the target its crazy and i want to hit moving targets too so my aimbot is going to have to do this this is going to be hard nice job i mean two out of three all right thats enough my plan is to make a little robot that goes between my hand and the bow it will move the bow so that everything is lined up just right and there will be an even tinier robot in my other hand which can release the string to fire the bow the core idea behind this is pretty straightforward but actually designing and making this is going to be a challenge Music Music oh i spent over a week on the spontaneous combustion issue were not even going to talk about it other than to say its fixed you slide it on like this it can aim the bow up and down with this linear axis and left and right with this one heres the little robot that releases the string it does this with a little servo motor it is super important that the bow always points at my back hand if it doesnt then the arrows just dont fly right at all Music the aimbot hardware is done but at this point its pretty much just a crappy heavy bow i need some kind of sensor that tells me where the bow is relative to the target and a lot of other stuff theres eight cameras throughout my shop that see everything theyre made by a company called optitrack heres how it works if i hold up this little reflective ball its seen by all the cameras at the same time imagine this is the ball that im holding up and the cameras looking at it from this angle the camera will take a picture that looks like this if you project an imaginary tube out from the ball in the image we know that the ball must be in that tube we just dont know how far away it is from the image if we add another camera looking at the ball from this angle we get another tube that the ball could be in and the intersection of these tubes gives us the location of the ball and these cameras do this super fast and the time that it takes to blink theyll give me updates on the location of this ball its bananas you call these balls markers if you want to sound like you know what youre talking about i have tracking balls on the front of the bow the little grip robot and on the target this lets it know where the bow is pointing how far its drawn back and where the target is i wrote a really simple program to track everything and shoot at stationary targets its time to see what this thing can do Music im putting all that force into the string and then it releases without any warning and i punch myself im trying really hard not to punch myself but i punch myself oh yeah and its also totally missing i really should probably move these out of the way i wanted to communicate my struggle with this problem so i made a movie trailer i dont even know anymore some say hes still in there please tell me that was fluke do you ever plan to let me go Music why wont you just work that was my week i was stuck in integration hell where all the pieces work by themselves but you put them together and they try to kill each other just like children the biggest problem is that it just wont shoot the right spot it is shooting up in the left almost every time i could shift things over in software but if i do that im going to just hide a bug thats going to bite me later but i wont tell if you dont all right lets put this thing to the test hey white autobow versus wife three shots each best shot gets the point come on here we go Music i need my binoculars oh im closer it depends on how you measure it darn i thought i was closer i was hoping for like a tie or something but wait if i hit this i win everything did you go around looking for the biggest apple you could possibly find no Music theres obviously some room for improvement here maybe pretty cool for you to fire it yeah maybe is it going to make me miss no its not going to hurt your aiming grip error check hand ow quit hitting yourself quit hitting yourself quit hitting yours we got a bit sidetracked there lets get back to making this work the bow is just not shooting the right point im pretty sure it has something to do with the software but im not going to debug this and try to figure it out i still need to make the bow track moving targets and all of that so im going to just nuke all of this code and hopefully replace all of these old problems with new and exciting problems one week later and i have nothing to show you because software development is very boring but its ready to test and i have a super awesome voice activated target launcher all right pool in the next milliseconds a lot is going to happen the bow is drawn and ready to fire im pressing this button which tells the computer to fire at will the tracking system sends the computer an update on where everything is every three milliseconds when the computer sees a target it checks to see if its moving in a parabolic motion then it does a tedious little calculation to figure out where it should move the bow to intercept the target taking into account the time to move there release the arrow reach the target and the curved path of the arrow this takes about a thousandth of a second and then it starts moving the bow and then it repeats this over and over again as more tracking data comes in which allows it to adapt for things like the shaking of my hands when it thinks its amy at just the right point it waits until the timing is just right and then completely misses Music so the wife catapult was getting pretty tired of waiting an hour for me to fix a bug that i said would only take a minute so i built this automatic catapult thats going to let me test as long as i want and im the only one thats going to suffer as expected the new code base is chock full of exciting problems for example why is it firing too early why is it firing too late why wont it hit the target when its sitting still why did it one hit ko my microcontroller so many bugs but its only a matter of time were knocking those bugs out we fix the microcontroller we destroy targets sitting still now were getting really close at this point im pretty sure the software and the robot are doing the right thing but the arrows arent going where theyre supposed to go but i think i know why ive been using a recurve bow which comes out of the box with a fundamental issue you have to fire the arrow around the bow this makes xero do crazy things and even crazier things if youre using the cheapest bow that money can buy theoretically i could calculate whats gonna happen and correct for this but were just gonna buy our way out of this problem this is a compound bow its very powerful oh why did i do that and it shoots arrows really straight its pretty much a drop in replacement for the other bow except for one problem this thing is really heavy so were going to do something about that Music if this isnt a name bot i dont know what is this thing supports all the weight of the bow so that all i have to do is hold it in place this thing shoots so much better than the recurve this kind of feels like cheating but were way past that point i think its time for another round of beau versus wife hey wife whoa what are you wearing its engineering whats it look like body armor with a snake you ever seen an engineer before same thing as before whoevers closest gets the point i brought the speed down and have it running in sharpshooter mode Music thats three points for the aimbot i didnt actually do anything but it feels like i won all right it works lets do stuff were gonna try william tell again i have a little apple hopefully this is acceptable size to you thats not an apple its an apple and were gonna shoot the heck out of it all right dont move no looking william tell oh boom Music lets do that again Music again i need more Music okay thats pretty cool its time to show what this thing can really do moving targets Music so Applause Music Applause Music Music Applause Music Music Applause Music that is so awesome oh my goodness i just love seeing it compute where the targets gonna go and then intercepting it so cool there is one more thing i really wanna see he has no idea whats coming maybe he does theres nothing to worry about were just going to shoot this tiny apple off his head to hit william tell nano we have to be able to hit not only bulls eyes we have to hit the exact same spot on the bullseye every time this is the best that i can do with the bow so were not gonna be able to do it every time but we should be able to do it sometimes look how close were getting to splitting another arrow it wants to real bad all right hes got his safety goggles on terrible shot this is just embarrassing thats what im talking about looks like you got him right in the heart kill shot oh yeah you did everything important we removed the apple but it wasnt quite the surgical removal that i hoped for lets try it again Music it did remove his arms and legs again but i think this is about as surgical as were gonna get this bow is really cool but it could be a lot better in fact im already working on a v which ill talk about in just a second before i get to that i want to talk about this video sponsor its for an opportunity that could literally change your life and i know that sounds really hyperbolic but i did the thing im about to tell you about nine years ago and it completely altered the trajectory of my life so check it out and you just might change your life this is a very unusual sponsorship its actually for an opportunity and its with form labs which is why theres so much orange around me all those really nice parts that you see on my projects those are made on these machines theyre d printers theyre some of the best in the world ive used one on literally every project that ive done i actually worked here for eight years developing these and other machines im up here right now for the annual hackathon where employees build basically whatever they want including some really cool things but this isnt about the machines its about an opportunity the things that formlabs engineers are so good it has led to a lot of success when i started there was people now theres over this is where the opportunity comes in it takes all of the engineering disciplines to make these things and formlabs is hiring for everything if you like my projects the engineering that happens here will melt your brain so just go check out formlabs.com jobs the eight years i spent here were fantastic it was really one of the best decisions that ive made i learned so much i had a big impact on the world i worked with amazing people theres also some pretty nice perks the only reason i left is i thought the youtube thing was a one in a million opportunity that i would just regret forever if i didnt try it there is one job i wanted to highlight which is cto this will be running all of the engineering programs this is a super rare super huge opportunity if you or someone that you know would be a good fit for this you can always apply online but ill also put a link in the description so that you can reach out directly so thats basically it you should work at formlabs you can check out all the jobs at formlabs.com jobs and maybe ill see you around Music this bow is cool but i want more i want to be competitive with real archers i actually took this bow to a local range but thats a story for another day what you need to know is that william tell nano is the key to everything when you push the target really far away small errors become big errors phone hit bulls eyes at feet or feet i need to be able to hit this apple every single time at this distance plus its awesome i think i need to make a version too and i kind of have a design in my head what it would look like im probably going to do that get ready legos youre ready legos watch out if that or any other crazy things i build sound cool please consider subscribing it helps me out and youll get notified when i post new videos if youd like to support these projects directly check out my patreon thats pretty cool Music thanks for watching Music you
write a youtube script
this foot wall would look a lot better with a giant painting on it but painting the wall is a lot of work so instead of spending a couple days doing that lets spend a month building a robot to paint this wall and as many walls as we want for us i only need to paint foot walls to break even so what i want is a robot that will take any random photo and paint it on the wall for me this is one of those things thats easy to say not easy to do for one im gonna have to make a gigantic wall size robot on top of that making robot paint is challenging what is this its your face its your face my biggest challenge with this project is deciding what to paint on the wall but i have an idea i have a tradition of pranking my wife oh Music these pranks often get me a really excellent glare how stupid but also awesome would it be to have a foot glare painted on the wall and if im lucky she might even reward me with a glare for the glare so before we get into being artists i should address the elephant in the room which is that last time you saw me i most definitely didnt have giant walls to paint murals on we moved across the state so that we could be closer to family and if youre wondering it was extremely painful to pull all of those tools out of my basement although i did have some help hey destin so thats how i came to have these giant walls i just need a graffiti bot and i also need a better name were gonna call it janxy okay heres my plan for janxy im gonna start with a robot that can move anywhere on the wall kind of like a roomba it will have some kind of fancy paint applicator that can put any color at any point on the wall and then ill write some code that takes whatever picture i want and itll convert it into a series of instructions to robot move here paint here and so on itll run for a long time and with some luck well get a thing that looks like our picture the thing thats really stressing me out about this project is that i really only have one wall to paint if i screw it up im going to be in for a world of pain so this thing has to work the most obvious way to make this robot work would be to do what humans do when they paint which is to mix a range of colors to make new colors that you apply artistically with a paintbrush there is not a chance im going to make a robot that works this way trying to mix colors is possible but completely impractical so what im going to do is exploit a quirk in the way that your eyes see which will allow me to completely skip over all of this color mixing business but its going to take a bit of explaining your eyes work by focusing light onto a grid of nerve cells which can detect the amount of light thats hitting them so something over here might project onto these nerve cells which your brain would interpret as something with that shape at that location you can also see a spectrum of color but whats interesting about the eye is that it cant actually really see color let me explain so if light comes in your eye thats anywhere between reddish and bluish some of these nerve cells will say that they see light they dont know what color it is they just see something other nerve cells will say they see light thats orangish to tealish again they dont know what color it is they just see something and then other cells will say they see light if its between greenish and violet your brain deduces what color it thinks its seeing from the relative proportions of light that these cells report if i saw something red it would mostly be the red nerve cells your brain says thats red if i see something yellow its sort of between these nerve cells and your brain says thats yellow and this is where the literal life hack were going to use comes in if i make a grid of red and green squares and then i scale them down to the point that your eye cant distinguish the individual squares the nerve cells will just be seeing that theres some red light and some green light and your brains like its yellow final answer sorry you can trick your brain into seeing almost any color with only red green and blue light this is actually how computer monitors work theres little red green and blue lights that theyre turning on and off to make whatever color it wants the dots being red green and blue is not random its based on how your eye works so we should be able to do the same thing and trick your brain into seeing colors that dont exist by painting various combinations of a small set of colors well also eliminate paint brushes by only painting dots this makes the robot approximately one million times simpler there is one little problem though which is your eyes see light but were painting with paint when you mix red green and blue light your eye interprets that as the color white but if i mix red green and blue paint its definitely not white red paint looks red because it absorbs all the light that isnt red same for blue same for green you mix them all together they absorb all the light and its black paint basically works the opposite way of light so what well do is well start with white surface if we want white well paint nothing and then well mix the paints to get whatever color we want and instead of red green and blue were going to use the color cyan magenta and yellow this will let us make more colors than we could with red green and blue so when i mixed the red green and blue i should have gotten black but i actually got brown and this is pretty typical in reality its very sensitive to the shades of color so instead of trying to mix black were going to use black paint you may have heard of cmyk that stands for cyan magenta yellow and black i dont know why black is k maybe its the same guy that named potassium on the periodic table so thats the theory its been done a billion times it definitely works but i do need a way to lay down all these dots and the right way to do this would be some kind of high performance super fast head that can lay down millions of dots per second but this is the kind of problem that entire companies spend decades trying to solve so im going to kind of go the other way and just do a thing that can do one dot at a time one dot at a time does have one fatal flaw though which is its going to be really really slow a typical inkjet printer prints dots per linear inch which means one square inch of paper has a million dots in it if i try to print at that resolution on my wall that would be about billion dots were looking at like years to print the wall so thats a definite nogo so i worked the numbers a bit more and i think the best i can do is about one dot per inch this would correspond to maybe about a week of printing and one dot branch is definitely not as good as a million dots per inch but if you stand far enough away you should get the same effect so remember kids if at first you dont succeed reduce your expectations till you get to the point that youre a success so now the trick is deciding what way im going to actually apply the paint i looked at a bunch of different ways of doing this none of these things seemed like they could be reliable enough so what i went for is a paint spray gun when you spray these they make a cone of paint so i should be able to change the spot size that i paint by how far it is from the wall this should be able to make the dots but i still need a way to move it anywhere on the wall which is definitely easier said than done because the wall is freaking huge imagine that i make a giant gantry that can move this paint head anywhere on the wall because its so big its going to be flexible if i tried to quickly move this from one point to another its going to vibrate but i need this thing to move as fast as possible because i need to make a ton of dots i could reduce the vibration by making it really stiff but this would make it super heavy which would mean huge motors so im going to do something a bit unusual im going to make a big gantry that can move anywhere on the wall thats slow and accurate and cheap and then hanging from this gantry is going to be another gantry thats light and fast the big gantry will move the little gantry to a desired location on the wall and then the little gantry will go to town and paint all the area that overlaps because its small and light i can move it quickly without the risk of huge vibrations if you repeat this over and over again you can paint the whole wall i think thats a plan we just needed to design it and build it building this took pretty much every tool that i have theres a decent amount of machine parts on the cnc and the manual mill weve got some laser cutting and d printing all the parts on this are selective laser centered theres a lot of big parts on this and i made a bunch of those on the cnc router because wood is cheap i love how easy wood is to cut compared to steel weve also got a number of plasma cut and bent sheet metal parts this is also a fast cheap way to make big things and a few hacks this is the little gantry thats moved around by the big gantry the paint gun mounts here and it has its trigger pulled with this little servo motor so the gantry rides in these steel tracks where it goes left and right across the wall it does this with feet of wooden gear racks and a little pinion gear that i made these barn door tracks are extremely awkward to hang but thankfully the warehouse allows me to have more power theres four of them and they need to line up perfectly so the cart doesnt get hung up i knew that the probability of me mounting these feet up the wall and them lining up was zero which is why i made these necessarily complicated rail mounts i mount these on the wall in mostly the right spot and then i can use this screw to adjust the alignment of the rails and then lock them in place with these bolts the little gantry hangs from these two steel cables it raises and lowers it by turning these spools the way that you would normally do this is have a rail at the top and the bottom and then some kind of rigid structure in between them only having to make this little wooden cart and hang some steel cables from it is infinitely easier it does have a big problem though which is newtons third law when i accelerate the paint gun to the right it pushes the gantry to the left and since its hanging from cables i made a very nice swing set fortunately i have another trick up my sleeve if i were to mount a second printhead on this gantry and accelerate it in the opposite direction of the main printhead they would push in opposite directions which would cancel each other out and the gantry shouldnt swing i really dont want to actually move a second spray head in the opposite direction but all that matters is that you move something with the same mass in the opposite direction so thats what these steel bars are for the gantry is built so that i can attach these to it and itll move them in the opposite direction and now its steady for some reason i just love this trick so the gantry doesnt do a fancy dance when its moving around anymore but this still cant work and thats because theres a lot of play and friction in the big gantry that moves this little gantry around it can easily be an inch or two over from where i think it is and that will never work instead of trying to make all the mechanics really accurate which is really hard im going to just avoid that problem by measuring where the spray head actually is if its in the wrong spot then ill correct for it using software so im using eight of these motion tracking cameras theyre made by a company called optitrack they tell me exactly where these reflective balls attach to the gantry are all i have to do now is roughly position this gantry and i can correct for any error so if i push this over here the gantry just goes to the right spot it doesnt really matter where this is and then if the motors stalled and it cant actually reach the spot it needs to paint then it knows how to ask for help how how how how help so all this together we have a paint sprayer that we can move anywhere on the wall and fire at will although before we can desecrate this wall theres quite a bit of software that we need our goal is to take an image and convert it into a set of cyan magenta yellow and black paint locations that when added together look like our image so we start with a photo a photo on the computer is divided into little regions called pixels and each pixel contains how much red green and blue light would trick your eye into seeing whatever color is at that pixel we can separate the image into three black and white images that correspond to how much red green and blue there is in the image and then theres a standard way to convert this red green and blue data to cmyk this is already pretty close to what we need to send to the robot i cant paint the pixels directly because a dot from the robot is bigger than a single pixel im planning to paint a uniform grid of dots so conceptually what i want to do is divide the image into a grid according to my biggest dot and then for each grid cell ill figure out what size dot would best represent the pixels within that cell bright pixels would get a full size dot and dim pixels would get no dot how i actually do this is a bit complicated to explain so hold on to your butts well start by looking at one of the pixels and the image that we want to dotify i look at the area around the pixel that corresponds to the biggest dot that i would paint i get the average color in that area and then i save that average color in the corresponding location in a new image i do this for every pixel in the image the new picture is the key to everything its also very blurry in fact this is how most blurring algorithms work the technical term for this is called a convolution every pixel in the blurry image is telling me what the average color would be if i were to put a grid cell at that location in the original image in other words if you want to put a dot here this is the color that it should look like to best capture the appearance of all the pixels that the dot replaces to get all the dots we need to paint we sample a grid of points on our blurry image and for each point we make the dot size proportional to the amount of color in each pixel and this gives us what we want the last little complexity is that the grid of spots for each color is made at a different angle and this is because when you have overlapping repeating patterns very strange stuff happens and thats it if we paint these dots we should get our image i think it looks really cool at low resolution especially up close this is what the wall should look like when you by it so everything im describing here is called half toning i definitely didnt invent it its been used for a really long time and im barely scratching the surface of it here once i computed the dots it should have been a simple matter of converting it into moves for the gantries but this wall has an unremovable fire alarm right in the middle of it the amount of time ive spent to ensure that the robot doesnt try to paint the fire alarm or crash into it it is way too high all right so i decided to go full pro and i got real cmyk inks oh man these smell awful and this robots going to take a week to print theres no way i can be aerosolizing this for a week ill die im gonna go find some less awful paint that was a fail so after the ink fail i decided to go with acrylics these are water soluble instead of some nasty solvent and i can also clean them up with water if or when i make a really big mess but i still cant just put this paint in the gun and expect it to work there is a bunch of variables that affect what size and quality of spot the spray gun is going to make and i dont understand them so we have to work our way through all of that before we can go to town on the wall i developed a series of tests that allow me to see how each of these variables affect the final result so i can figure out how i should be controlling the spray gun getting the spray head dialed in is a little bit finicky but i think i have a calibration that works so lets make some art before we go ruin the wall im doing some small paintings to make sure everything works and to keep things simple this first one is just monochrome so with the help of the reference picture i can see the resemblance i guess but there is one little problem though thats an easy fix but it is one of many problems im stuck in that infinite loop where it kind of works but it doesnt and you fix something and it gets a little better but then you fix something else and it gets worse and it goes on and on and on eventually it should work but i think were going to be here for a little while Music this ones looking great you just need some rose colored glasses that was actually close the paint sprayer is just spraying way too much paint so well do another day of calibration and now as they say were painting with fire Music this is way better than the red faced just kill me wife its so cool how up close it looks like nothing then as you pull back the face emerges ive been working on the art and i think i figured it out it is some real high society stuff it starts with a twotone stamp of my wifes face it progresses to a gray scale and then finally color the bs art justification for this is that it shows the evolution of the machine from this coarse and unrefined stamp to full color and it just is the story of the machine learning to paint with color the real explanation for this is that the robot can probably do this i dont know if it can do this i felt like this needed a little bit more got some diagonal stripes for visual interest and then i was thinking well you know what is she glaring at me so i added some laser eyes to really drive home that powerful gaze if this is an art i dont know what is i had a hard time sleeping last night because i really dont want to ruin this wall but i just have to go for it so here goes nothing Music Music running it for multiple days straight i ran into some entirely new issues felt like repairing a car while driving it down the highway Music what is art anyway is this art this has to be art if this is an art then i have no recourse but ill be very upset this is like actually art you get up close and you can see all these dots but then you back up and back up and back up and you see color and a face remember all that stuff about not hitting the fire alarm yeah were not even gonna go there theres also some variation in the brightness of the color but now that im thinking about it i realized that i actually meant to have these imperfections all along they give it character this is just the best so i havent shown my wife what im painting ive kept her completely in the dark and its time to see what she thinks about all this hopefully she thinks its amazing but i can see why having your face feet tall on a wall might be a little weird maybe my wife just got here she hasnt seen anything that im doing and im super excited to see what she makes of this work of art i guess that the robot has made shes been waiting here for me are you ready to see some art im ready to rumble what do you think of my art my gosh it looks like im ready to be on a dollar bill oh yeah you do look like a dollar bill i look very patriotic miss america no fallen soldier tribute these are squish spiders these are obliterated spiders do you like my art i do oh this should have been right on my eye missed opportunity so on a scale of one to a billion dollars how much did you pay for my heart well that assumes i want it i dont know a thousand dollars i should have made that scale narrower thats like a . out of . its big though therefore its worth more thats how it works oh right i forgot that better luck next time in the process of making this art i made some other art and im really curious to see what you make of that as well i promise were gonna get back to my wife and what she thought about those portraits in just a second before we do that i want to do something which i dont really want to do because it makes me uncomfortable which is ask you for your help these videos take a lot to produce i put all the time all the resources anything i can do to make these videos as good as i possibly can and i do that because i love making them and i hope that theyre useful and although i love making these videos your support is what makes them possible so if you want to help me make more of these videos theres a few things that you can do the first thing you can do is support these projects directly on patreon you can also subscribe to the channel the more interest there is in the channel the easier it is to get sponsorships which then fund the videos and then the final thing you can do is take just a minute to check out the video sponsor in this case it is one of my most favorite sponsors of all time kiwico what kiwico does is they send you a crate every month that has everything that you need to do some kind of project this is actually a lock and ive been wanting this one for a while im pretty excited about it the reason i love these so much is that i was raised building kits just like these i know the impact that they have on a kid its huge this is one of the more complicated projects but they have things for all ages weve been giving our daughter kiwico crates since she was six months old and you might have noticed that my wife is a little bit pregnant and were gonna be doing exactly the same thing for baby number two if you didnt already know my wife is the best all the glaring and everything thats just us messing around so anyway ive made multiple locks from scratch and this crate is incredible you make a fully functioning lock from parts this is such a good project so if theres anyone that you know that you want to give a really good really useful gift to this year go to kiwico.com stuff made here youll get off your first crate from any of the lines and thats it thank you kiwiko for sponsoring this video and thank you for listening to the sponsorship all right weve got some bonus art here is the first one that it made this thing on i like it when you have a software bug that never turns the sprayer off is this single it looks like im so enraged it almost looks like youre asleep like or youre dead so what did you think you were looking at before i told you that it was you it looks like a flaming hot cheeto with eyes this one though looks like pacman its a conversation starter thats what art really is right what is this is that pacman no its my wife thats a good conversation starter this last one is actually my favorite i think i might like this more than the whole wall you gotta back way uh soon its more like nose you know its not this you should set up a little glass or something that you look through that makes it look real far away oh reverse binocular trick ill have to give you some reverse binoculars with some ink on him it is weird that its me it is weird that its you i want you to do it of our dog i had a lot of fun with this project and i hope that you enjoyed it and maybe even learned something if you have any ideas of things i could paint on my wall let me know and until next time thanks for watching