Page 1 of 2
Automatic Bed Leveling
Posted: Sun Jun 02, 2013 2:23 pm
by jesse
Re: Automatic Bed Leveling
Posted: Mon Jun 03, 2013 4:31 am
by euroflo
Now thats the ducks nuts..!!
Re: Automatic Bed Leveling
Posted: Mon Jun 03, 2013 9:49 am
by geneb
Johann has placed the code for that online - I think in the Marlin repo, but I'm not sure. I don't expect it'll be too much longer before it lands in Repetier and specifically, the SeeMeCNC branch.
g.
Re: Automatic Bed Leveling
Posted: Mon Jun 03, 2013 10:36 am
by Jimustanguitar
Looks like a mechanical end-stop, right? I'm imagining that I hear it click

Re: Automatic Bed Leveling
Posted: Mon Jun 03, 2013 10:44 am
by JohnStack
Ok, you can't just put out a video like this an not say anything! LOL
Some kind of additional limit switch that captures and echos position?
Re: Automatic Bed Leveling
Posted: Mon Jun 03, 2013 11:04 am
by Durandal
He post's more in the video, it is indeed a mini switch, the probe itself is a allen wrench and by the looks of it some weak springs.
What would be really cool is a CMM touch probe attachment to allow measurement in 2.5 axes. (measuring upward without a tilting head is rather difficult.)
Combine a quick tool change system to allow multiple extruders with one offset and you've got yourself a fairly powerful little machine.
Re: Automatic Bed Leveling
Posted: Mon Jun 03, 2013 12:47 pm
by foshon
geneb wrote:Johann has placed the code for that online - I think in the Marlin repo, but I'm not sure. I don't expect it'll be too much longer before it lands in Repetier and specifically, the SeeMeCNC branch.
g.
May already be there?
Code: Select all
#ifdef SOFTWARE_LEVELING
void calculate_plane(long factors[], long p1[], long p2[], long p3[]) {
factors[0] = p1[1] * (p2[2] - p3[2]) + p2[1] * (p3[2] - p1[2]) + p3[1] * (p1[2] - p2[2]);
factors[1] = p1[2] * (p2[0] - p3[0]) + p2[2] * (p3[0] - p1[0]) + p3[2] * (p1[0] - p2[0]);
factors[2] = p1[0] * (p2[1] - p3[1]) + p2[0] * (p3[1] - p1[1]) + p3[0] * (p1[1] - p2[1]);
factors[3] = p1[0] * ((p2[1] * p3[2]) - (p3[1] * p2[2])) + p2[0] * ((p3[1] * p1[2]) - (p1[1] * p3[2])) + p3[0] * ((p1[1] * p2[2]) - (p2[1] * p1[2]));
}
float calc_zoffset(long factors[], long pointX, long pointY) {
return (factors[3] - factors[0] * pointX - factors[1] * pointY) / (float) factors[2];
}
#endif
Re: Automatic Bed Leveling
Posted: Mon Jun 03, 2013 12:48 pm
by CosplayEngineer
In 30 seconds that accomplished something that took me weeks to do.
Re: Automatic Bed Leveling
Posted: Mon Jun 03, 2013 12:53 pm
by Eaglezsoar
Has anyone tried that posted code to see if it works?
I am not a programmer and I have no idea what that code does.
Does it store the values it determines somewhere so it refers to the values every time it prints?
How do I run that code?
Re: Automatic Bed Leveling
Posted: Mon Jun 03, 2013 3:02 pm
by foshon
I don't know if it can be ran at this point Carl. It may be missing the call. On the Repetier sub-forum at reprap there was a recent discussion on z-probing. The author (owner?) of Repetier stated it is coming. I sent him a PM and asked if it could be used by a micro switch device. Here is a link to the discussion, should open up at the post he starts talking about it, if not it's near the bottom.
http://forums.reprap.org/read.php?267,2 ... msg-209004
Re: Automatic Bed Leveling
Posted: Mon Jun 03, 2013 3:13 pm
by Polygonhell
I think what Johann is trying to do and what the repetier code does are different.
The repetier code takes measurements at 3 points and generates the supporting plane and Z offset.
What Johann is I think trying to do is closer to bed/screw mapping on a CNC mill, he's measuring at regular points and will probably attempt some sort of piecewise correction.
The difference is that while you only need to measure 4 points to fix software calibration issues, with a more detailed model of the bed you can also correct for small geometric errors.
Re: Automatic Bed Leveling
Posted: Mon Jun 03, 2013 3:16 pm
by foshon
Cool! Either way it's good to see the software advancing again.
Re: Automatic Bed Leveling
Posted: Mon Jun 03, 2013 4:43 pm
by JohnStack
Staying true to my "I absolutely never get anything done on a Monday" rif:
1. code looks right, needs inputs somehow. I guess the script in conjuction with more limits would do it.
2. And then there's this:
http://www.measurecentral.com/products/ljg/2d_laser.php
Re: Automatic Bed Leveling
Posted: Sat Jun 08, 2013 10:32 pm
by daftscience
I'm wondering if it would be possible to somehow incorperate
this. or
this into the hotend mount. It could do two things. Act as a crash prevention and be used to autolevel the bed.
Re: Automatic Bed Leveling
Posted: Tue Jun 11, 2013 10:09 am
by JohnStack
daftscience wrote:I'm wondering if it would be possible to somehow incorperate
this. or
this into the hotend mount. It could do two things. Act as a crash prevention and be used to autolevel the bed.
I used those force resistors in an arduino project last year and dropped them in favor of a capacitative touch pad. (Just an on/off switch). They weren't very precise. I thought I would try them on a small actuator-driving project.
It might be interesting to rig up an adapter with separate readouts; however, I don't think they're very precise. You would almost have to calibrate them first (and over and over again) before using them.
An IR or optical measurement solution would be more precise. Did you check this out?
http://www.adafruit.com/products/164
The data sheet - if under 10 cm appears to be very precise!
http://sharp-world.com/products/device/ ... 21yk_e.pdf
Re: Automatic Bed Leveling
Posted: Tue Jun 11, 2013 1:20 pm
by kbob
A Hall effect sensor is very precise. It detects a magnetic field. I wonder whether a PWM current in the heated bed would create enough of a magnetic field for a Hall effect sensor.
Re: Automatic Bed Leveling
Posted: Tue Jun 11, 2013 3:22 pm
by JohnStack
kbob wrote:A Hall effect sensor is very precise. It detects a magnetic field. I wonder whether a PWM current in the heated bed would create enough of a magnetic field for a Hall effect sensor.
Kinda interesting! I wonder how three of them would work together.
Mind the soundtrack but... another idea.
http://www.youtube.com/watch?v=FA2aj33OwMo
Re: Automatic Bed Leveling
Posted: Tue Jun 11, 2013 5:12 pm
by JohnStack
Ok, putting this out for feedback.
How about a laser-triggered measuring device. The general idea is to stick the T on an axis, turn it on and when the head crosses the beam, an indicator light goes on.
I will probably fab one of these up with a laser pointer and light sensor to see if it might work. I've got a spare arduino, a laser pointer and some light sensors.
Attached is the image of the drawing.
Anything you might change?
Re: Automatic Bed Leveling
Posted: Wed Jun 12, 2013 7:38 am
by daftscience
kbob wrote:A Hall effect sensor is very precise. It detects a magnetic field. I wonder whether a PWM current in the heated bed would create enough of a magnetic field for a Hall effect sensor.
That's a really interesting idea. If will work, I have no clue. One concern, if the hall effect sensor can pick up the bed, would it trigger the same everywhere on the surface of the bed? Also, those with glass, or aluminum might not be able to use this.
JohnStack wrote:Ok, putting this out for feedback.
How about a laser-triggered measuring device. The general idea is to stick the T on an axis, turn it on and when the head crosses the beam, an indicator light goes on.
I will probably fab one of these up with a laser pointer and light sensor to see if it might work. I've got a spare arduino, a laser pointer and some light sensors.
Attached is the image of the drawing.
Anything you might change?
I'm not sure I follow how the laser rig would work for detecting the different points on the bed. Maybe i'm missing something. I do think the idea of the IR might be interesting. With my suggestion I was trying to figure out how to permanently mount something onto the effector that will measure the calibration points. This way it doesn't need to be removed when printing.
Again though. That IR idea seems like it would work beautifully.
Re: Automatic Bed Leveling
Posted: Wed Jun 12, 2013 3:44 pm
by Gimbal
For glas bed a laser pointing in an angel (45deg ex) and reflecting on the glas back to a photo sensor should do the trick, put the sensor at the end of a small tube right, guess 5$ will do it

Re: Automatic Bed Leveling
Posted: Wed Jun 12, 2013 4:00 pm
by JohnStack
Great idea but I'm thinking the challenge is proximity to the area being measured; therefore I've got some square aluminum tube stock (1"), I orderedthe laser bracket and laser bracket from Adafruit. The idea right now is just to mark a small spot on the heated bed with red paint to get the laser line close, then place the "device" on the glass.
The price so far (adafruit is a little high but they're friends) - $16 without power.
I'm just going to wire it to a 12-volt off the PS.
Re: Automatic Bed Leveling
Posted: Wed Jun 12, 2013 4:08 pm
by Gimbal
I will putt the laser/sensor permanent on the effector on etch side of the hotend, this will able me to do leveling before every print and it's easy to tweak the firmware to adjust it automatically
Re: Automatic Bed Leveling
Posted: Wed Jun 12, 2013 5:12 pm
by JohnStack
I'd love to see that!!!
Re: Automatic Bed Leveling
Posted: Wed Jun 12, 2013 5:32 pm
by Gimbal
Well haven't give it much torts but then i went thru my old treasure boxes recalling i have an Omron E3X amplifier (new) with fiber maybe it can be useful, put the fiber in a orifice 0.3mm aliening them to reflect on the glass, hmm, will give it a go. The Arduino part, i will look in to it when i got the time, will go abroad next week and babysit a Crue of Pakistani technician for a month and i have fiddling with Arduino a few year.
Re: Automatic Bed Leveling
Posted: Wed Jun 12, 2013 8:17 pm
by JohnStack
You won't need arduino unless you're doing a display of some time. I found laser circuits all over the place. I just remembered that there was a trip circuit plan based on Arduino...
It's two resistors, the sensor, power, an LED and an Laser I think.