Making chainsaw robot, carving logs

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

He's become my favorite YouTube channel. Brilliant dude and makes ridiculous shit.

πŸ‘οΈŽ︎ 59 πŸ‘€οΈŽ︎ u/RobbySkateboard πŸ“…οΈŽ︎ Apr 04 2021 πŸ—«︎ replies

The absolute madlad.

There's definitely a way to do this, but ultimately the more you optimize, the more it makes sense to just have a traditional 3-axis tool mount instead of a robot arm. Stupid math ruins all the fun.

πŸ‘οΈŽ︎ 24 πŸ‘€οΈŽ︎ u/Cheapskate-DM πŸ“…οΈŽ︎ Apr 04 2021 πŸ—«︎ replies

Don’t have time to watch this now but I just wanna say his channel is so fun to watch if you’re into engineering at all

πŸ‘οΈŽ︎ 10 πŸ‘€οΈŽ︎ u/BigGoopy πŸ“…οΈŽ︎ Apr 04 2021 πŸ—«︎ replies

He needs to have the chainsaw robot cut his hair.

πŸ‘οΈŽ︎ 9 πŸ‘€οΈŽ︎ u/UseDaSchwartz πŸ“…οΈŽ︎ Apr 04 2021 πŸ—«︎ replies

Love it! I’ve had some experience programming CNCs in the past and had a lot of errors I never expected, such as the tool chuck hitting the part...

Your explanation of the errors your encountered and the solutions to those problems is brilliant.

Looking forward to seeing more videos!

πŸ‘οΈŽ︎ 2 πŸ‘€οΈŽ︎ u/nobodyworthnoting πŸ“…οΈŽ︎ Apr 05 2021 πŸ—«︎ replies

I am a dumb guy that doesn't understand anything about math.

But couldn't you find the angle by picking each polygon of the 3D model and generate the slope value?

πŸ‘οΈŽ︎ 1 πŸ‘€οΈŽ︎ u/randmzer πŸ“…οΈŽ︎ Apr 04 2021 πŸ—«︎ replies

Ffs his channel is STUFF MADE HERE

πŸ‘οΈŽ︎ 1 πŸ‘€οΈŽ︎ u/johnny_appletits πŸ“…οΈŽ︎ Apr 04 2021 πŸ—«︎ replies
Captions
oh yes i told you this project was important my cnc chainsaw is going to save the day stay back i will kill you so it's obviously not a real bear trapped in the log it's the idea of a bear and my cnc chainsaw will remove everything that isn't the bear although normally the log is wood not foam [Music] we'll get to that if you're wondering why i'm trying to cut bears out of logs with chainsaws this is something that people do and i can even buy one but they are really expensive and i knew in my heart that i could make a much worse one for free i just need thousands of dollars in equipment this is one of those ideas that's so bad it wraps back around to good i think you know what i mean right so the basic idea here is i'm attaching a custom chainsaw to the end of a robotic arm so i should be able to move it anywhere that i want and cut whatever i want the arm is a tormach za6 they asked me if i'd be interested in beta testing it and there really is only one answer to that kind of question i live streamed the setup to my patreon although i tried to do without a manual which was kind of a mistake i'm sure my cnc chainsawing feature requests have been invaluable robot arms are super cool they can move and rotate anyway see how the joints are moving in crazy ways to make it go in a straight line the math behind this is called inverse kinematics and for once i don't have to solve it thank goodness so to understand cnc chainsaws you first have to understand a few things about normal cnc machines i'm sure you've seen a cnc machine run you put a block of metal in you hit a button it goes to town and you get a nice part when it's done have you ever wondered how it knows where to cut the answer is it doesn't it doesn't know anything the only thing that a cnc machine knows how to do is follow instructions for example i might tell it to go up maybe a bit higher and then down down again to the left to the right and so on if i tell it to stab itself in the face it'll do it to make the machine cut this part out i have to tell it the specific moves that i needed to do so that the resulting shape is the part that i want the motions that you tell a cnc machine to do they're called tool paths because they're the path that the tool takes when i want to make a part i load it into special software that generates the instructions for the machine for me i'll tell it things like drill a hole here or cut a pocket here and then the software will generate thousands and thousands of specific instructions for the machine to follow to make my part just like the cnc machine the robot arm doesn't know anything so i'm gonna have to write software to tell it specifically how to move so that the chainsaw cuts out the part that i want this is one of those things where it's pretty easy for a human to figure out like duh just cut it here but it's very hard for a computer to figure out it's kind of like a captcha dog it says these kinds of problems are hard because computer doesn't see like a human sees it doesn't have a concept of shape or space it can do things like tell me how much material would be inside of a specific cut this leads to a kind of guessing game where you test all the different possibilities and choose the best one this is similar to trying to guess a password the number of combinations of all the different letters is really high for example a five letter password has about 12 million combinations it is completely infeasible to go through all these possibilities to find the best or even a really good cut i'm going to start by focusing on just removing most of the material and not worrying too much about the shape of the part i'm going to do it in a very inefficient way but it'll allow me to avoid most of the problems i just described i'm going to use what i call the apple peeler algorithm have you ever seen one of these old-timey apple peeler slicers if you haven't they are a miracle of science the interesting thing about this apple peeler is how it removes the apple from the core it essentially does one long continuous spiral slice i can do something very similar with the chainsaw if this was my log i could cut down the depth of the part that i want and then rotate around changing my depth to whatever i need to just hit the part that i want and then just repeat that all the way down the part this would remove most of the material to actually do the apple peeler algorithm i start with my part and this is a side view i take a bunch of cross sections of this part that are spaced out by the thickness of the chainsaw blade let's say one of the cross sections looks like this my goal is to go all the way around this layer and cut away everything that isn't the model if i do that for every single slice then it'll remove almost all the material the downside is we convert almost the entire log to sawdust but it's easy and that's what matters there are a couple problems the first is that the robot arm can't actually reach all the way around a big part i'm going to put the part on an automatic turntable so i can turn it to face the chainsaw there is another problem if i cut along this surface the chainsaw is too big to fit into this zone i also can't fit the chainsaw into this area here there's an amazing math trick that i've been wanting to show for a long time so let me show you i take the shape of the bar the chainsaw and i mirror it i place a copy of it at every single point along this curve the shape formed by the outer edge of all of these copies is all of the valid spots that i can move this and it won't go into the places that it can't go in there's a rigorous definition of this it's called a minkowski difference but it basically is magic if we put all this together we can calculate the chainsaw motions to cut apart out i want to try my tool paths but i need a chainsaw that sticks out the absolute minimum distance the further the saw sticks out the more it will multiply any error in the positioning of the robot and then on top of that it will multiply the forces going back into the robot which can overload it think about it like a wrench the longer the handle is the more torque you can put for the same amount of force and that's why i have this bar which they call a cheater when you have a bolt that's really stuck you get way out here and snap your wrench in half ideally just the blade would be sticking out but i can't just bolt a chainsaw to the side of the robot like this these arms move in mysterious ways and many of these movements will make the saw collide with the robot alright here's my design it's built around a pole saw which is basically a chainsaw on a stick which you use to cut branches out of trees and stuff like that the number one concern for this design is keeping it as compact as possible so that it sticks out the minimum amount the way my pole saw works there's a shaft going into the back of it and if you turn the shaft that drives the blade i'm driving the pole saw through this belt which allows me to fold the motor up next to the pole saw and make it a lot more compact this motor is an electric skateboard motor so it's almost an electric skateboard this design should be able to avoid hitting the robot arm at least most of the time all right let's get this thing built remember this is my software only project don't pay any attention to what i'm doing here [Music] so [Music] [Music] it occurred to me how dangerous this thing is it has a kill radius of like a meter and a half and it can really zip around all right it's pretty safe now i really just want to go for it but some tests on a small log seem smart [Music] finally i really wish i would have built and tested the chainsaw before spending an entire week writing the apple peeler algorithm i thought it would be all right based on my big chainsaw but it is just way too slow i estimate from the speed that it was cutting that it would take about 10 hours to remove most of the log and there's zero chance that that little chainsaw would survive continuous cutting for 10 hours now that we've established that converting the entire log to sawdust isn't a great strategy i need to find a way to calculate a series of cuts that removes as much material as possible although this is where it gets tricky if i'm only allowed to take slices off the model then there'll be no way for me to get into these concave areas the best i'll be able to do is something like this in computational geometry this is referred to as a convex hull that's no good i want my bear to have curves what i really want is for the chainsaw to take scoops out of the part chainsaws can't do this they can't turn they can only keep cutting in the direction that they're cutting in so the best thing that i can do come in and cut and then come back out and then come in from another angle and meet the other cut and then this will remove a sort of a wedge shape unfortunately throwing wedges into the mix makes choosing a good cut about a million times harder now i have to think about where the cut is but how wide it is and how long it is i'm not going to go through all the math but my conservative estimate for the number of possibilities is approximately a bazillion it would probably take my computer a thousand years just to count them so what i need is a way to search through this massive number of possibilities and find my needle in a haystack i'm going to try a computational trick called gradient ascent imagine i have a little ball and i'm trying to get it to the top of this peak i could move the ball to every single point on this map and then figure out which one is the highest but that's really inefficient because i have to check so many points the idea behind gradient ascent is that i start with a guess and then i say if i move the ball side to side does that make me go up or down and if i move the ball another direction what does that make me do and from this i can figure out what direction will make the ball go up the steepest path so you move up some and then you repeat it and you do it again and again and in very few steps the ball will walk up the hill and get to the peak i can do the same thing for my cutting problem i can start with a guess and see how much material that cut would remove and then i can figure out how much the removed material would change if i tweak the cut and doing this for all the possible changes i can figure out the direction that will most improve the cut this method sounds really good but the devil's really in the details i've spent more than a week on this and i cannot get it to work the problem with gradient ascent is that it can get stuck at points that aren't actually the highest point you can imagine that if my guess was here i would walk up to this point and the ball would happily say i'm at the highest point but it's really a false summit getting stuck at a false summit happened to my program almost every time i'm sure there's someone really smart out there who could make this work but i can't so this means i'm gonna basically have to write it again using a different technique hopefully third time is the charm because i don't know how much more of this i can take i'm a little weary of writing code so i'm gonna go work on some other problems there's a very subtle problem that i have to deal with if i don't fix it my parts are gonna look completely wrong this stand was made by a total poser amateur welder this means squareness is unlikely which is a bigger issue than you probably think imagine that i'm trying to cut this part out with the chainsaw and the chainsaw can move around the part to cut it from any direction the robot thinks that up is up now imagine that this part is tilted and this part hasn't been cut yet so it's just a block so the chainsaw is going to try to cut this dotted area it doesn't know that the part is tilted it'll just miss the part where things get really bad is when you start rotating this part that you're cutting so what will happen is the chainsaw might cut too shallow over here then if you rotate that part that you just cut 180 degrees then you bring the chainsaw over here it's going to cut way too deep and it's just going to completely destroy your part getting your rotation axis lined up with the chainsaw is extremely important everything is adjustable and i made a calibration system so that i can measure this and then dial everything in i could fix this in software but i'm pretty sure i would do it wrong the first time so this is just easier for machines like this that can kill you and not even realize that they killed you the e-stop is really important it's what you slam if anything is going wrong and everything stops although the way i originally designed this there was two e-stops there's an e-stop that i made that would cut the power to the chainsaw and there was an e-stop built into the robot that would stop it i found this a bit concerning the robot is coming at me i have to decide which e-stop i'm gonna hit i found a way to wire my button up so that it stops the chainsaw and the robot i press this whenever i'm gonna go into the kill box and disables everything i have the warning sticker and i have the e-stops but i still feel like it would be really easy for this thing to kill me and so i wired in this party slash warning light and whenever the system is in kill mode it will enable this and it's a nice visual indicator that you will die if you come in here i think it's time to get back to the software so before everyone tells me i know that a rapidly exploring random tree is probably the way to go here if you don't know what that is it's just a way of searching an enormous number of possibilities to find a pretty good solution from my perspective this would be a terrible solution because i would have to write a lot more code and besides i have a half-baked solution that has a chance of working imagine that this is my part and this is the remaining material that i need to cut away i start by taking every point along the boundary of the material i need to cut and i calculate how far it is to the closest point on the model and what direction i need to go to get there i use this to find the furthest point from the model and then i search along this direction to figure out the biggest cut that i can take i'll explain how that works in a second this method works pretty well but it does have a big problem if i search at this location right here i could very easily end up searching in this direction or in this direction and when i look at this i think i would want to do a cut kind of like this so that i really get into that notch so what you can do is you can search in this area what are the possible directions i could go in this area then you can search for that range of angles and pick up these special cases so when i say i search along a direction let me tell you what that means imagine that i'm trying to find the best possible cut along this path to the part my simple algorithm starts here and it figures out what's the widest angle cut that it can do it tests all the way up to the part and chooses the best one doing exactly what i just described is probably still too slow but it's not too bad to write so let's try it anyway all right this is probably going to take a while i have a very unexpected problem which is that i cannot find a good 3d model of a bear to cut i thought there's gonna be tons of these things there's just tons of bears in the t-pose which would be hilarious to carve out of a log but they just don't really fit the aesthetic that i'm going for so i found this dog model don't let the low poly count fool you it doesn't matter i'm cutting this with a chainsaw all right it's been a while let's see if the algorithm is done this is way too slow this will take a week or two to process thankfully we have an ace of our sleeve called software optimization this means using tricks to make your code go faster make it really hard to read and usually break it so my plan is to take advantage of what's physically happening like what these computations actually represent in reality and i'm going to use that to cut out a lot of computation that i don't have to do we can know from the geometry that some things may or may not happen without testing them for example if i run a test at this point and i find that this is the widest wedge that i can cut i know that any angle less than this will also work because it's inside of the bigger angle i also know that any point on this trajectory before this one is also good at that angle because they're also contained within it by doing this single test i eliminate an enormous amount of variables that i don't test anymore i can do similar tricks when i figure out how long the wedge cut should be as well as what orientation it should be at i was just really excited because my optimized code ran in less than a millisecond and then i realized that i optimized it so hard that it didn't actually compute anything i fixed my dumb problem and it is a lot faster it's maybe about 10 minutes to generate the cuts for a model whereas before it was days and weeks and months so solid improvement everything that i've described so far is to compute a single cut to compute all the cuts i just do that routine over and over and when it's done i have a set of moves that the chainsaw needs to do to cut out my model all right i need some big logs fortunately i know a guy with a tree this log looked a lot smaller outside all right here we go [Music] the other purpose of the stop is to stop the robot before it does something stupid that i told it to do all right here we go [Music] for some reason the chainsaw is getting hot like really hot if i try to cut into the logs that the tip is going in the log it just won't cut i think what's happening is that the blades on the tip just aren't cutting they're rubbing this is why i was smoking so bad and setting off my smoke alarm i think the problem might be related to this little anti-kickback tooth there's no way that i'm gonna be able to cut this log at least not today with some really big changes my tool paths to maybe rock the saw or something like that i might be able to get through it but that completely breaks everything that i did we'll save that for a future project or something for now i'm just gonna do the reasonable thing in compromise this is basically a log right if you think i'm just going to hit go and it's going to work you are sorely mistaken in fact let me show you my five easy steps to wasting an entire week start by going up the machine full of youthful optimism then hit the start button within five seconds smash the e-stop go upstairs and fix whatever bone-headed programming error he made and then go back to step one and for a bit of variety hit the robot with the chainsaw several times ideally this would be violent enough that you have to rebuild the whole saw at least four times but look on the bright side there is a finite number of ways to screw it up so you will eventually finish [Music] this doesn't exactly look like a dog but it doesn't totally not look like a dog either i think i need to go figure out what the heck is going on but it's something a lot of testing later i caught the perpetrator red-handed and it was me previously on stuff made here getting your rotation axis lined up with the chainsaw is extremely important [Music] long story short i screwed up the alignment nothing lined up so i was pretty much just skewing the portal randomly it should be fixed now although that's what i said before i'm almost out of things i can screw up so i'm feeling pretty good about this one stay back i will kill you finally this was a long time coming but it is so cool overall i'm really happy with how this turned out my heart says make a wooden dog but my brain says but think of all the other things you can do with this arm i'm torn this is way better than i was expecting especially based on the last result there were some areas that it just couldn't reach and so it's not cut there and then there's some cuts where it couldn't make the connecting cut so there's a few slices just into the model i'm super curious to see what my wife thinks of this i think she's really going to like it she likes dogs but before i get to that i want to talk about this video's sponsor if you can take just a minute to check it out it really helps me out and i would really appreciate it this video is sponsored by kiwico what kiwico does is they send you a crate every month with everything that you need to build an entire project and i've talked a lot about growing up and making things and why honestly kiwiko is phenomenal my wife also grew up making things so i thought it'd be interesting to hear from her instead of me for once it's in the box electroluminescent sculptures in this crate you bend el wire to make really cool sculptures when i saw this i knew my wife would love it that's one of the cool things about these crates is that there's so many different types like i think this one you're gonna like so you probably noticed that i like engineering my wife is totally different which is one of the reasons i love her so much she really is into the arts it was fun to watch her do this crepe because it was something that she really enjoys oh it's so cute whatever your kids age or interest might be there probably is a kiwiko crate that they're going to love so go to kiwico.com stuff made here you'll get 50 off your first crate and i've put a link down in the description i really do recommend it i think just within our immediate family there's probably been like 10 crates given and received i had fun with this yeah she's going to make another one she's gonna go make another one it's so cute you like my dog i love it where should we put it on a column like those lions you should make one in wood and yeah i try i think it looks a lot better than the first dog well yeah that looks like a weird mountain that someone would call monkey rock or something because it sort of looks like a monkey a little bit you should put the crown on the dog this project was really fun and if you enjoyed it please consider subscribing it helps me out a lot and it'll keep in the loop when i post new projects so win-win when oh wait the the final question so we both made dogs whose dog is better that really is a hard one actually [Music] if it's so hard why is this dog have a crown on
Info
Channel: Stuff Made Here
Views: 3,156,739
Rating: 4.9535441 out of 5
Keywords:
Id: ix68oRfI5Gw
Channel Id: undefined
Length: 22min 28sec (1348 seconds)
Published: Sun Apr 04 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.