welcome to my personal quest to eliminate micro switches from within the interior of my 3D printer you may be asking yourselves why I find myself fairly often replacing these micro switches over time I find they just stop working accurately they break down I need to replace them multiple times now when a switch is broken it has essentially destroyed one of my print beds at least the Pei sheets these are really quite expensive to replace especially in the 350 millimeter size my going theory is we are probably running these switches pretty close to their upper limits in terms of temperatures that they were designed to operate at and at least for me I find they fail in addition although this is not the best example of wiring I also do have issues with wiring as I find they tend to break as well too and so in a quest for more reliability my goal has been to just get rid of them all this started with installing tap and by including tap I was able to get rid of the Z end stop by going umbilical I was able to get rid of the XY pod although I still had switches I'm now going sensorless homing and as you can see here my X limit switch is gone from my printhead and as you saw in the previous part of the video I also eliminated my why and so at this point in time I've got no micro swatches left in the interior of my print first a word of caution please don't copy my stall guard settings you may have a different driver you may have different loads on your Motors different lubrication different rails I can almost guarantee you my settings will not be the same as yours I've published my config files in the past I've gotten messages from people angry that they copied my settings exactly and it caused damage to their printer I can't think of anything that could cause more damage to your printer than doing this incorrectly worst case copying my numbers and it doesn't work for you so please follow the steps don't copy my values and find out what numbers work for you before you get started I strongly recommend you take a look at some of the reference materials that exist out there I would start with the Clipper documentation on sensorless homing I would just give this a read from frankly beginning to end it very well quite clearly outlines the process you're going to go through it also identifies changes are going to have to happen to the CFG files it calls out special cases it also calls out some of the differences between the drivers and uh errors issues and concerns that you may run into it's definitely worth reading from there I jump into the official documentation from voron on setting up and calibrating sensorless XY homing and this in some areas at least gets into a little more detail some of the text here is hard to see from the CFG configuration files but you can highlight it copy it paste it into another document to make it clear to see and again that'll help clarify the changes you're going to be making to the CFG files how you're going to be coming up with the values that you need and also what you can do to test this to make sure this works and again I strongly recommend you read through all of this it's not long it certainly doesn't take long um but uh I think you'll get significant benefit in terms of understanding what it is we're trying to do here step one configure your MCU I'm using a spider and so here I've gone to the spider documentation online and here I'm selecting I have a 1. 0 version of The Spider and if you take a look in that little section there it actually shows you the diagnostic pins and you will need to set the diagnostic pin for X and Y meaning put a jumper here and you will also need to remove the actual end stop switches as in actually unplug them physically from the board before you do any of the work here and if you're using the big tree Tech octopus if you go in and take a look in GitHub at the octopus documentation I believe it is on page 14. you'll scroll down it'll show you the jumpers as well to get the motor controllers into diagnostic mode or rather the mode that's required to get sensorless homing working and here they are the stall guard jumper settings where it shows you um where these are in addition I would highly recommend if you have the octopus or just in general it's worth reading Eric Zimmerman um in his voron tools GitHub also has documentation he's created on sensorless and there's a lot uh the steps are really good really clear um it's very similar what you find in the voron documentation except some additional Clarity and it's specific to the octopus controller as well too the MCU and here you can see where Eric is showing you the jumpers that need to be set as well and with the octopus in fact any MCU you need to do the same thing get the drivers in the diagnostic mode and you need to unplug the end stop switches from the MCU before you do anything and I've got links to all of this documentation in the description for this video so next we create the sensorless.
cfg file that we'll use in our printer. cfg file I'm going to assume you know how to create what amounts to an empty file I'm posting my file on GitHub and there'll be a link to this file as well in the description of this video and this is what it looks like I've added a bunch of comments here we can see the macro underscore home underscore X and underscore home underscore Y and then of course our homing override which is where these are going to be called from and so anytime G-Code or whatever it is needs to home or are you home from the command line in Clipper or press any of the buttons this is actually the Homing code that's going to be called and you can see here where it calls X it calls y if it needs to and it also calls Z if needed as well as you can see here one more thing I'm using tap and so I'm also using a 350 millimeter size bed and so you're going to have to most likely change these values if you're not using tap it's going to these coordinates are going to have to be the end stop switch and if your bed is a different size you'll obviously have to change these as well too if you're using tap so up above the important stuff here so first of all this code here this first set of code is all we're doing is we're getting the current set value that most likely resided in the printer. cfg file and storing it and what this code is going to do is take the current value that's being used for the motors that was used for the motors while you calibrated the stall guard sensitivity right now this is most likely going to be by default what motor current to set for your X and Y Motors in your printer.
cfg file but by having this code here is you can in the future now change your current values in your printer. cfg file and not worrying not worry about having to recalculate your stall guard sensitivity values so this is really code that's protection arguably you don't even really have to have it here but it's a nice to have I recommend you have it it gives you freedom and flexibility to change your printer CFG file without messing up um stall guard or sensorless homing and so here you can see we've set the home current you need to set this to whatever value you have in your printer. cfg file and then what we do here is this code will now set the value to home current and then what will happen here is um it'll home X and then once it's done it'll revert back to what value was in effect in your printer.
cfg file and again this is giving you the freedom to change now if you're getting under current errors from the TMC driver which is what I was getting thanks to Julian I'm going to post a link to his YouTube channel as well he helped me out here it turned out I had to lower the acceleration value of the motors as well most likely you won't have to do this I haven't heard of many people having to do this but all this code does is take the current value let's store it temporarily and let's temporarily set the value while we're homing for acceleration to 1000 and then once we're done we're going to revert it back so g28x0 means let's home the X and once we've honed the X uh just so the print head it is isn't sitting there mashed up against the end of the Gantry let's move it out by 10. and then here once we home X we're pausing for two seconds to give the stall guard registers time to clear the voron documentation talks about one second I tried one second one and a half one and three quarters two seconds was the absolute minimum I needed to get this to work properly or homingx was not reliable or especially when it moved over to trying to home y you may find you may need to add a little bit more than two seconds but two seconds generally seems to work and once that's done the registers have cleared here we can see the code setting the motor current back to whatever was initially set in the printer. cfg file and then you'll also see the next line which if you uncommented the acceleration change up above um we've also reverted back that back to whatever is set in your printer.
cfg file and in the home y macro we're doing exactly the same thing but for the y-axis and again making sure we've got some flexibility as it relates to the current if you need it the adjustment to the acceleration and then we're homing Y and then of course we're moving it just a little bit off and then of course the pause for two seconds and then of course let's reset both the current values and the acceleration back to normal and then here in the Homing override again you can see we're home X and home wire being called and just for repetition again here we are moving the print head in this case because I use tap to the center of the build plate I have a 350 which is why this is 175 by 175. if your plate is smaller you'll have to use the appropriate location and if you're not using tap this should be the Z end stop and then here I'm actually homing Z and then moving it up by 10 off the plate and again make sure you make the changes here that values that match how your printer is set up and configured so our next step is to modify the printer. cfg file to take advantage of all these changes so at the very top you can see here in my printer.
cfg file I've added the include for the sensorless. cfg file so the Homing macros we just created are now here will be loaded by Clipper and will be in effect also if you don't have it make sure you've got a force move section with the enable Force move set to true to make sure this all works correctly and let's scroll down a little further to the stepper X section and here under stepper X here well I've already commented out but you can see you need to comment out the end stop pin if you're using an octopus you need to either remember or whatever the case may be what that pin is because you're going to need to reuse that just a little bit later if you're using a spider it doesn't matter comment it out either case and then here we're setting a new end stop pin which is the TMC 2209 stepper X virtual end stop in addition to that if you move a little further down here you can see the Homing speed the documentation recommends 20. I couldn't get it to work I had to set it to 40 and the Homing retract distance had to be set to zero as well too and then if you take a look here at the TMC 2209 stepper X section there's the diagnostic pin which we had to add in and again if you're using an octopus you're going to use your old n-stop pin value but if you're using a spider especially in the 1X Series this has a different value a pin value this is the PB 14 which you will need for x and this comes straight out of the pin documentation for the spider and then you'll have to set the driver sensitivity here if you're using a 2209 255 is the most sensitive you need to check this if you don't have a 2209 driver because some of the TMC drivers use different ranges and in some cases as I understand it for example some of them use a maximum value of 64.
but zero is actually the most sensitive value at least that's what I think I don't have those drivers make sure you do that and then for step the stepper y section I'm essentially doing the exact same thing you can see here I commented out the end stop pin added the virtual end stop pin and then here I've set my homing speed again the voron doc say 20 I had to use 40 and the retract distance set to zero and then and then if you scroll further down in the CFG file you probably have a safe Z home section this needs to be completely commented out or overriding it anyway with what's in the sensorless. cfg file and so simply comment this out and once you've done that you simply save and restart Clipper for these settings to take effect so next we want to find the highest sensitivity for stall guard that can get the print head over to the end of the Gantry and simply go to the council here I copied this from both you can get it from either the Clipper documentation or you can get it from the voron documentation and I simply set the value to 250 by default it's currently set to 255 and I hit send and then the very next thing I do is I enter in a g28x 0 and ask it to home and at that point you should see some values up here on the screen and if all goes well you would see something move but the reality is with values this low you're going to see nothing happened so you're going to have to continue to reiterate through the values dropping from 250 245 and so on before you restart the test you do need to wait about two or three seconds and let the register in the motor driver clear if you don't give it that time you'll start to get incorrect results I'm not going to show you what values work for me because I worry about people damaging their printer but eventually you'll get to a point where you'll see something kind of like this happen this means you found the highest sensitivity value and you need to write this down for a calculation so now we need to find the lowest sensitivity for X using stall guard and so again you really just keep going keep dropping the numbers maybe for the first one or two you can go by five or so but other than that start to go by one digit at a time and again after each try free the motors move it by hand back to the center because for now it's going to continue to hit the right side and what you're waiting for here is an audible change as in you actually hear it hit a little bit harder or maybe see it bounce twice but something about it the tone of the clock whatever the case may be ought to change and once you have hit that point you now have the lowest X sensitivity and you need to write that down because we're ready to do a calculation so the driver underscore Sgt HRS under the X section in your printer. cfg file is this simple calculation take the max value wrote down subtract the minimum value from that divide it by 3 and then take that value and add it to the minimum and update your printer.
cfg file which is right here and once you're done of course save and restart once that's complete you have to follow the same process again but now for your y-axis and so again at the command line This is actually the pretty much the exact same text we entered in before but instead of stepper underscore X at stepper underscore underscore y here I'm changing the 255 to 250 to kick off this round of testing and then of course you want to do a g28 y 0 and again aiming for those same values the high the low and the same calculation and then update your printer.