# Specific 3D Printers, Scanners, & Hardware > RepRap Format Printer Forum > MakerFarm Forum >  Auto leveling

## DrLuigi

Hey guys,

Just wanted to make a small blog of this topic,

I am going to order a servo and new micro switch, And i should try in the near future depending on the shop delivering it on time to get my printer up with auto bed leveling,

I first didnt know if i should do this as i have a fan duct that uses all that space wich i would need to remove to get this auto bed leveling in place,
But i guess it will be worth it, hopefuly,


Might also buy a new hotend after this wich probably would be a E3D hotend as its been proven to do reasonable prints, 
Tryed other hotends but they just didnt fit the printer, and the E3D will.

Anyhow,
Best regards,
DrLuigi

----------


## old man emu

I've got the servo and the stl files. I just need to get my printer operating and I'll be on my way, too. I might have to buy another microswitch, but my junk box holds a small momentary action switch. I wonder if that would do the job?

According to the video, the fan duct was only removed for clarity. You should be able to refit it after you have fitted the leveling hardware.

How good are you at changing Arduino files. Remember that you have to modify the config.h file and load of the whole of the new version of the Arduino software.

Old Man Emu

----------


## KDog

Ramps is actually really easy to flash once you have the driver and software on your pc.  Watch the videos on youtube.  They are really helpful.

Cheers,

KDog

http://www.youtube.com/watch?v=awsI9bMndJA

----------


## DrLuigi

Meh Arduino files with marlin are just so obvious,
No problem at all, Its not like you need to code something, you just give it a few cordinates/angles.

Well i have a big fan duct. http://www.thingiverse.com/thing:119061
The lvling system wont work if thats also there :P

----------


## DrLuigi

Meh Sweden post is so slow D:

I can't even track where it is, And its been on the mail for a week now, Thats what dealextreme tells me anyhow...

I'm also thinking to get a more Box type of printer like the ultimaker/zotrax so its more stabile, less noise, and perhaps faster.
I would use my makerfarm parts for it as hardware goes, Would only buy the aluminium bars and such.

Can't find a great opensource printer yet tho..

----------


## DrLuigi

Just got the package,

The connection cable is way to short to get to ramps,

I guess the only option is to cut it, and solder a piece of wire between it to gain length?

----------


## old man emu

> Just got the package, The connection cable is way to short to get to ramps, I guess the only option is to cut it, and solder a piece of wire between it to gain length?


Go to a Radio Control Model site. It is possible to buy these leads in quite long lengths. Then again, if I was in the same predicament, I'd be cutting and soldering, too. You are going to cut one lead off anyway because you don't need it. Use that bit of wire.  :Smile: 

Old Man Emu

----------


## KDog

I just cut and soldered extensions on mine.  I have so much wire around from shortening servo leads, etc., that it wasn't a problem.

----------


## DrLuigi

Well i might not even install it :P I just don't have the feeling to do it xD
I would have to remove my fans etc then, I just dont feel like it atm :P


Might do it over a week. but at the end its not that much better ;P

----------


## DrLuigi

Just installed it all,

Configuring it at the moment, but what i do see is when i try to heat everything up, My screen is now alot less visible,
When not heating up, its pretty normal, but if its heating up its like, Half the contrast it used to have.

I did have to update my firmware of course to get this autolveling

Edit:

A sec ago when i wanted to heat it up, The servo went in retraction, and warmped up/became noisy quiet a bit,
Now it doesnt seem to work anymore :/
It gives a little rattle when i say it has to move thats all..


I guess its already broken...

----------


## old man emu

Your servo on/off switch is not working. The servo is getting power all the time. Did you put the jumper in on the pins on the opposite side of the RAMPS board to where the extruder stepper driver plugs in?

The rattle could be the sound of burnt out innards.  :Frown: 

OME

----------


## DrLuigi

Well i am guessing it wanted another degree, due that it might slammed against a piece of wood at the back and didnt go further.
Well i did it open and one of the gears was broken, already ordered a new one.

Well i soldered it lol :P
I used some solder and made a small bridge between the two pins that are inside the board, not the one outside.


It did work a few times tho, i typed M401 and M402 and it went great,
Perhaps i didnt see it that when he went back, that he was hitting the wood and that he wanted to try getting further.
I HOPE that :P else its something on my ramps board D:


This realy sucked haha :P Realy hoped yesterday i could see it work :P

----------


## old man emu

Jumpers:

Go to your electronics shop and see if you can buy jumper shunts like these:

jumper shunts.jpg

A packet of them came with the last Arduino board I bought.  They are easier to work with than soldering bits of wire to your RAMPS.

I know that M401 and M402 are machine instructions in Gcode, but what do they make the machine do?

OME

----------


## DrLuigi

They simple make the arm go up and down at the degree you selected.

The soldering works afterall anyhow.
So i guess i dont need it,
I just used some solder, Without cable i just made a small bridge between the two pins.

----------


## DrLuigi

Just bought a new one, If that one breaks again i will just give it up i guess, 

Its now instead of China from the UK, So i hopefuly still get it this week, So i can print again in my vacation.
China took easily a month so i didnt want to wait that long again :P

If it works i might buy a reserve from China as those are cheaper/and no shipping fee.


Edit:
Should get it this week,


I already tested the function, My endstop works and it does the pattern, Now the new servo and it should work nicely ^^
The only thing is that my Endstop is quiet small, 6mm height and 16 width, Its realy not that much bigger then the Hotend,
Wich is also a good thing, thanks to that my servo doesnt have to retract a whole lot and i can still use my old Fan duct ^^
Hopefuly it doesnt break this time, if it does i simple give it up instead of buying even more of em,
If it works i will simple buy a few reserve servos from China as they are pretty cheap over there (1-2 dollars), But from the UK its easily 10 dollars including shipping

----------


## DrLuigi

Installed and works fine, Gotta get it now fine tuned and then its ready ^^

Down side of a small endstop like i have bought (didnt know it was that small lol, it didnt have measurements on the site :P) That i did have a few times that it almost crashed that it didnt click the button,
As the servo isnt a percision tool it does get a small offset from what you have given, after a few start ups of course.

The Z axis doesnt move alot, i guess that great as it means that my bed is very close to perfect level.
Most ive seen so far was a halve turn.

----------


## DrLuigi

One of my first prints with the auto bed leveling, Seems nicely done ^^

https://www.dropbox.com/s/c0w1kap044...2022.04.09.jpg

----------


## old man emu

Please post a copy of your new Configuration.h file so we will know what to alter when we do ours.

Old Man Emu

----------


## DrLuigi

> Please post a copy of your new Configuration.h file so we will know what to alter when we do ours.
> 
> Old Man Emu



Well all my numbers will be ofc diffrent then yours, keep that in mind ^^

There are also a few guides online how to do this,

https://www.dropbox.com/s/lm2owzcn1v...onfiguration.h

My E axis is also probably diffrent from yours, Colin changed it once from 928 to 942 or something, since his new hotends had less friction, But for my Jhead its still 926.8 or something near that number.
Also you lose aprox 1.5mm (From each side, so its 3-4mm in total) as the Servo does take a bit of space in the X.

If you have a question feel free to ask here ^^

I also use at the moment 9 probing spots, as i guess that would be a bit more accurate, as if you do only 4, it wont measure the middle wich may be a bit diffrent for example if you did hairspray on it, it will be a few hundreds of a mm diffrent than the rest.

----------


## old man emu

Thank you. Got it and can study it.

OME

----------


## DrLuigi

I do have the feeling you would need to change the Arduino file quiet often,
As the servo isnt precise every time, 
It will almost always be Print able, But i do notice that when i switch from ABS to PLA that PLA has air between lines, 
Its still print able, the next layer will be close to perfect, but its just something i wanted to say, that this isnt something that will be once set, always good to go.

Example today, I had it perfect for ABS, once i switched to PLA it was like i said earlier, a bit to high.

----------


## RobH2

I'm getting the same kinds of anomalies. I'm always having to tweak my gap in 'configuration.h'. But still, it's nice to have. 

One odd thing I have is the servo is "twitchy." When it's up and a print it running, it makes little noises and twitches ever so slightly. I just unplug it when it bothers me but then I always forget to plug it back in. I thought that it might be a bad servo so I took the time to switch it out. Same thing. It appears that some stray current pulses through that header and causes the servo to twitch. I doesn't cause any print issues but I worry about it damaging the servo or wearing it out. Any thoughts?

----------


## Roxy

> I'm getting the same kinds of anomalies. I'm always having to tweak my gap in 'configuration.h'. But still, it's nice to have. 
> 
> One odd thing I have is the servo is "twitchy." When it's up and a print it running, it makes little noises and twitches ever so slightly. I just unplug it when it bothers me but then I always forget to plug it back in. I thought that it might be a bad servo so I took the time to switch it out. Same thing. It appears that some stray current pulses through that header and causes the servo to twitch. I doesn't cause any print issues but I worry about it damaging the servo or wearing it out. Any thoughts?


Two comments.   First, you might want to check out your 

#define PROBE_SERVO_DEACTIVATION_DELAY 500

If you don't have a value specified, it will stay on all the time.   Probably, you don't want that.

The other point is you might want to make some type of stop at the right position so the servo can only travel so far.  Then you can tell the servo to go slightly past that stop and it will be pressing hard and not twitching.   I also made my probe such that when it is pressing on the bed, the probe gets pressed a little bit against the stop.   That way the repeatability of the measurements is better.

----------


## RobH2

Thanks Roxy. Perfect suggestions. I'll do that now.

----------


## clough42

Has anyone else had issues with the probe striking the bed when extending and retracting?  I had to modify my firmware to raise the Z axis 2mm before retracting.  It's an ugly hack (raise 2mm, retract servo, lower 2mm) and I'm not super keen on releasing it in its current form.

Anyone else dealt with this?

----------


## RobH2

> Has anyone else had issues with the probe striking the bed when extending and retracting?  I had to modify my firmware to raise the Z axis 2mm before retracting.  It's an ugly hack (raise 2mm, retract servo, lower 2mm) and I'm not super keen on releasing it in its current form.
> 
> Anyone else dealt with this?


Yes. There is a long thread discussing aspects of this that Roxy is doing a lot of work on. Try this thread:  http://3dprintboard.com/showthread.p...1267#post21267

----------


## clough42

> Two comments.   First, you might want to check out your 
> 
> #define PROBE_SERVO_DEACTIVATION_DELAY 500
> 
> If you don't have a value specified, it will stay on all the time.   Probably, you don't want that.
> 
> The other point is you might want to make some type of stop at the right position so the servo can only travel so far.  Then you can tell the servo to go slightly past that stop and it will be pressing hard and not twitching.   I also made my probe such that when it is pressing on the bed, the probe gets pressed a little bit against the stop.   That way the repeatability of the measurements is better.


Second that.

The other thing you can do is use a Z probe design that has the button (or tip of the lever) is directly in line below the servo shaft.  This way, the error is the cosine of the absolute servo arm position error, which is pretty much nil in this situation.  If it isn't in line below the pivot, the error can be significant.

I think the reason the servo twitches is because the Arduino isn't able to schedule the interrupts for the servo pulses reliably.  As load on the MCU changes, it has a hard time maintaining the pulse width, exactly.  This is particularly the case when the mechanics are moving.  Marlin (correctly) prioritizes the stepper motors at the expense of servo precision.

----------


## Tachout

Just wondering once I install this will it eliminate the stupid Z endstop microswitch?  I hate that thing.  Mine has a creep in it or something.  I turned on the printer today after not using it for more than a week.  Printed the first file perfect.  Nothing changed from first file to second file in my slicer configs, and even tried printing the exact same gcode file and somehow the z stop moved from where it was to about a 1/4" to high.  I have to figure out that one.

----------


## Roxy

> Just wondering once I install this will it eliminate the stupid Z endstop microswitch?  I hate that thing.  Mine has a creep in it or something.  I turned on the printer today after not using it for more than a week.  Printed the first file perfect.  Nothing changed from first file to second file in my slicer configs, and even tried printing the exact same gcode file and somehow the z stop moved from where it was to about a 1/4" to high.  I have to figure out that one.


It can be implemented a number of ways.  But the typical method that most people are doing is to use the Z-Probe as the end stop.  With that said, most people add a switch to the Z-Probe and leave the existing end stop in place and unused.   Some people get more fancy and have both active using the existing Z-End_stop as a backup in case something goes horribly wrong to stop the nozzle from driving into the bed.

One thing I know for my printer is without the auto bed leveling, it makes a big difference whether the bed is hot or not.  If I had the Z End-Stop set so it worked good with a cold bed, it did not work well with a hot bed.  And vice versa.  The Auto Bed Leveling made that a non-issue.

----------


## DrLuigi

damn i guess my servo is broken... again..

Auto leveling is nice, but if i have to keep switching these servos i aint sure if i will use em for alot longer realy..

The motor seems to still work tho, 
Its pretty weak and my 3D printer seems to get to little eletricity due the servo being broken i guess..

----------


## RobH2

I don't mean this to be sarcastic, but if you are using the absolute cheapest servo on EBay/Amazon, you can expect performance issues no and then. Granted, I have no idea what kind of servo you bought. But, in my own tinkering, I rarely buy the cheapest item if I have a choice. I buy the next level up and seem to get better reliability and performance. In some things it's true, "you get what you pay for." 

Maybe try a more expensive servo and see if it services you better.

----------


## Roxy

I bet he was spraying hair spray on it!   

Seriously...  I've been using the same $2.57 servo from eBay from the start.  I ordered an extra just in case but have not had any need for it.  With limited data, my experience is the cheap servo's work just fine.

----------


## clough42

Something else must be wrong.  I'm using a sub-$3 HXT-900.  I buy them by the dozens and use them for everything.  I've never had one fail.  

Is the servo staying on, struggling against a mechanical stop or something like that?  That could certainly damage it.  You might also check the voltage to the servo.  If it's over 5V, that could shorten the servo life.

----------


## Roxy

> Something else must be wrong.  I'm using a sub-$3 HXT-900.  I buy them by the dozens and use them for everything.  I've never had one fail.  
> 
> Is the servo staying on, struggling against a mechanical stop or something like that?  That could certainly damage it.  You might also check the voltage to the servo.  If it's over 5V, that could shorten the servo life.


Specifically:   Check and make sure

#define PROBE_SERVO_DEACTIVATION_DELAY 500

is defined and has a reasonable value in it  (500 to 1500 should be OK)

----------


## clough42

> Specifically:   Check and make sure
> 
> #define PROBE_SERVO_DEACTIVATION_DELAY 500
> 
> is defined and has a reasonable value in it  (500 to 1500 should be OK)


And it's worth checking that the servo actually shuts down.  (I.e. you can easily move the arm by hand.)  A few servos do weird things when the pulse train goes outside of its expected window.

----------


## DrLuigi

Well i can see when trying to push the servo wish makes the motor of the servo turn, the 3D printers screen starts to flash,
The motor is quiet weak,
When i turn the printer off, and i put the arm somewhere else from its home position, the 3d printer sometimes doesnt have enough eletricity and will reboot, This is a psu of 550 watts i believe.

It still works when i give it a gentle push,
My best guess is that one of the plastic gears is broken.

----------


## clough42

Hmm...if a gear is stripped, you'll hear and feel a crackling or popping noise when moving the servo by hand.  If it's smooth, the gears are probably fine.

It sounds like the servo may be pulling more current than the 5v regulator can deliver.  That could cause the resets.  Which servo is it, and which electronics are you using?  If RAMPS, which Arduino variant do you have?

----------


## Roxy

I know my PrintrBoard could not supply the power to the servo.   I had to grab a 5v line off of my ATX Power Supply and feed that to the servo.   I was so confused until I figured that out.   I could move the servo around but only in small steps.  Big steps would reset the PrintrBoard.  To verify I even made changes where it would only modify the position of the servo by 5 degrees at a time and then pause to keep the initial surge current low.  That would work and I could position the servo accurately.   I just could not do it in one big quick step.    

Then....  Everything made sense!

----------


## DrLuigi

Using ramps 1.4 with Marlin here,

Well i heard yesterday a click, and today due playing with it and probably forcing it, it got even worse,

RIP servo 05/05/14 - 12/08/14

----------

