Welcome! Log In Create A New Profile

Advanced

Mendel90 Auto Bed Leveling

Posted by D4RK1 
Mendel90 Auto Bed Leveling
March 22, 2015 09:58AM
Hi,

I have been searching through the Mendel90 section and haven´t been able to find a thread where this has been discussed already. So I am opening a new one.
After upgrading my Mendel90 to Neils Firmware, it should be now capable of doing the Auto Bed Leveling.

My understanding of electronics is quite limited, but watching Thomas Sanladerers video about the topic made it look manageable.

[www.youtube.com]

From what I understand I will be needing the sensor, and the two resistors, since I am already using an aluminum plate, the third requirement is already covered. Because the original Z-Endstop is connected to the gantry, I will need to get the signal to the Melzi another way because the new sensor will be installed on the carriage assembly.

I am guessing nophead has already prepared for that possibility by adding the P connectors on the Extruder connection PCB.

How is the pinout of those pins of the P-connector?

Edited 1 time(s). Last edit at 03/22/2015 10:05AM by D4RK1.
Re: Mendel90 Auto Bed Leveling
March 22, 2015 01:13PM
One of the P terminals is ground shared with the thermistor. Don't put much current through it or it will offset the temperature reading.

The other P terminal is the spare wire in the ribbon cable that arrives near the Melzi.


[www.hydraraptor.blogspot.com]
Re: Mendel90 Auto Bed Leveling
March 22, 2015 01:53PM
300mA is what it says on the data sheet, I ordered this sensor :

[www.ebay.de]

Would it be ok to connect the 12V of the sensor to one of the heater terminals?
I guess it should also be possible to add another wire (servo cable for example) and guide it along the ribbon cable if you expect problems when the GND connection is shared. Wouldn´t look so neat though tongue sticking out smiley
Re: Mendel90 Auto Bed Leveling
March 22, 2015 06:06PM
300mA will disturb the thermistor reading. The probe connections are intended for a switch, which is all that I use. I can't imagine why a sensor needs 3.6W. Does it get warm?

Yes you can take 12V from the heater terminals, but you need another wire for the ground.

If you have an NPN sensor I think you only need a single pull up resistor to 5V. You can probably use an internal pullup in the Atmel.


[www.hydraraptor.blogspot.com]
Re: Mendel90 Auto Bed Leveling
March 22, 2015 06:56PM
PS, the nearest suitable ground would be on the X limit switch, so if you add an extra wire it only needs to go from the carriage to the X motor bracket. Be sure you get the right pin as 300mA into the limit input might damage the Melzi.


[www.hydraraptor.blogspot.com]
Re: Mendel90 Auto Bed Leveling
March 23, 2015 03:45AM
Maybe I have gotten it wrong with the 300mA value, this picture is given in the article description:


Re: Mendel90 Auto Bed Leveling
March 23, 2015 09:28AM
The sensor is designed to be used as a switch. It can switch up to 300mA for either directly powering something small, or for engaging a relay for a much larger draw. The actual current that it draws is a very small fraction of that 300mA.
Re: Mendel90 Auto Bed Leveling
March 23, 2015 09:33AM
ok, thank you for your answer, so it should be ok to use the same GND as the thermistor. That´s great news, so I won´t have to use another cable....

Edited 1 time(s). Last edit at 03/23/2015 09:34AM by D4RK1.
Re: Mendel90 Auto Bed Leveling
March 23, 2015 10:22AM
I think it is saying the maximum current it can switch is 300mA, not that it takes 300mA itself. I can't find a proper datasheet for these or any indication what current it takes. I have ordered one to play with so I can measure it.

I have a capacitive one that takes 3 or 7mA depending if the LED is on. I measured the resistance between the probe ground and the Melzi as 0.26R. That would give a voltage drop of nearly 2 mV, which is below the resolution of the 10 bit ADC.

The problem I see with these, other than needing a metal bed, is they are too long to fit under the carriage so the offset from the nozzle is big, meaning it can only probe a small area of the bed as there is no over travel on the Mendel90.


[www.hydraraptor.blogspot.com]
Re: Mendel90 Auto Bed Leveling
March 23, 2015 11:18AM
Check out the X-carriage from ralfsteck, he has done a great design with less probe offset .
But it has only belt clamps for GT2 belts.
X-carriage

Edited 2 time(s). Last edit at 03/23/2015 11:25AM by Jesse_Blue.



Mendel90 kit from Nophead / marlinfirmware from NeilDarlow / auto leveling by IFM / e3d V6 hotend / Octoprint on RasberryPi
Re: Mendel90 Auto Bed Leveling
March 23, 2015 03:51PM
Looks good, no idea how to make it fit my "original" belts though... and he seems to have done something to the hotend? There is a spacer underneath so it sits higher? Is it a different hotend? And would the probe holder fit with the original fan duct.....?
And what about the X-Endstop... not sure if the original Endstop would work with the probe holder there?

@nophead
Quote

I have a capacitive one that takes 3 or 7mA depending if the LED is on. I measured the resistance between the probe ground and the Melzi as 0.26R. That would give a voltage drop of nearly 2 mV, which is below the resolution of the 10 bit ADC.

Is that good or bad ^^, My guess is, the inductive sensor will be quite similar, would it be possible to share ground with the thermistor, if it has similar values?

Edited 2 time(s). Last edit at 03/23/2015 04:25PM by D4RK1.
Re: Mendel90 Auto Bed Leveling
March 23, 2015 07:26PM
Yes 2mV is about 1/2 the least significant bit so you won't notice it if the inductive one takes a similar current. I will let you know when I get one. Or you could just try connecting it when the hot end is at working temperature and see if you notice a change.

It looks like Ralf's mods haven't been done in OpenScad. If they had it would be simple to change the belt pitch and see if it clashed with anything. It might just miss the X end and I think he is using a different fan duct.

Edited 2 time(s). Last edit at 03/24/2015 06:56AM by nophead.


[www.hydraraptor.blogspot.com]
Re: Mendel90 Auto Bed Leveling
March 24, 2015 01:39PM
how difficult would it be to add a similar probe holder to the original X-Carriage? and see if there is a) room for the fan duct and b) no clashing with the X-End? I read through his post again and he states that his hotend is longer than the JHead and I guess that is why he is using a different fan duct.



=)

Edited 1 time(s). Last edit at 03/24/2015 02:55PM by D4RK1.
Re: Mendel90 Auto Bed Leveling
March 24, 2015 06:15PM
I don't know until I get mine, model it in OpenScad and see where it will fit.

I still prefer a mechanical switch as it is a digital response to the surface of anything, not an analogue response to metal.


[www.hydraraptor.blogspot.com]
Re: Mendel90 Auto Bed Leveling
March 25, 2015 10:54AM
I have used this: capacitive sensor It is working great with glass.
I placed it below the steppermotor for the extruder. On the underside of the X-carriage. (I am not at home, will make pictures as soon as I am home again)
For that place it is much too long. So I removed the metal housing, the outer screw itself. It is only a thin threaded tube. Opened it carefully with a Dremel on both sides along the complete length of the tube and removed it completely.

If the metal housing is there or not makes no difference to the function of the sensor itself. It ist still working great. I did some tests before and after.
Inside the sensor there is some electronics on the sensing end, and a precision potentiometer on the other end. Between those are some wires.
There was some epoxy, but it could be removed carefully with a sharp wirecutter to free the wires to move it like a hinge.
I reformed the whole sensor in form of a knee or a L with 90°.

Attached is the OpenSCAD model for the sensor housing replacement in the new orientation and form and for attaching the sensor to the X-carriage.
In the first lines you find this:
oberteil = true;
unterteil = false;
There you can switch the two parts of the attachment on and off.
Take care where you place the screws in the x-carriage that you still can place the extruder without disorder.
For me it is working without any issue. But it seem that the two screws on the sensing end can be moved more to the outer end, closer to the sensing end to get a better grip.

It was my very first OpenSCAD model, I am aware that it could be done in a more efficient way.

Here are my offsets, I think they are not to bad. Only 40mm distance to the nozzle.
#define X_PROBE_OFFSET_FROM_EXTRUDER 40
#define Y_PROBE_OFFSET_FROM_EXTRUDER -3
#define Z_PROBE_OFFSET_FROM_EXTRUDER -0.63

I use the sensor in this configuration since 4 weeks and it is working great. Very stable repeatability. Around 0.01mm or even less.

The only thing was that the middle of the bed is at 0.0 but in the configuration.h you must enter coordinates for the probing area by a different orientation. (0,0 at front left edge)
And therefor I had to use some coordinates that seems to be false, but they work, even if they are not logically. It took me a long time to try that out.
This works for me on the Mendel90:
#define LEFT_PROBE_BED_POSITION -50
#define RIGHT_PROBE_BED_POSITION 80
#define BACK_PROBE_BED_POSITION 85
#define FRONT_PROBE_BED_POSITION -85

Take care with this coordinates as there was a update in Merlin regarding this topic. My working Merlin version is from mid of February.
I have already done the merge for a Merlin version from 20.03.15 but not tested until now.

Lars

Edited 1 time(s). Last edit at 03/25/2015 10:59AM by danielis.
Attachments:
open | download - kapaHalter.scad (2.3 KB)
Re: Mendel90 Auto Bed Leveling
March 25, 2015 12:26PM
thats interesting information, thank you Lars. I ordered a capacitive sensor as well but I am not too confident about removing the casing and leaving the sensor intact tongue sticking out smiley

If it were possible to attach the inductive one like ralfsteck has done, a swap to the capacitive sensor should be easy since it is smaller (even with the casing).

The inductive sensor has a diameter of 12mm and a length of 55mm whereas the capacitive sensor measures only 7,5mm in diameter and a length of 40mm, so it shouldn´t be too hard to fashion an adapter.
Re: Mendel90 Auto Bed Leveling
March 25, 2015 02:16PM
A capacitive sensor is fine for a metal bed but it doesn't respond the top surface of glass. It responds both to the metal of the PCB plus the thickness of the glass.

For example it might see the metal on its own at say 5mm and the glass on its own at 2mm but glass over metal at 7mm. It will only trigger at a fixed distance from the glass surface if your glass is a constant thickness and has flat metal under it, so a mirror might work well. Glass over the PCB is probably not very good because the PCB is nowhere near as flat as the glass. If the metal bowed down a little in the middle your probe would trigger lower even if the glass surface was flat.


[www.hydraraptor.blogspot.com]
Re: Mendel90 Auto Bed Leveling
March 25, 2015 02:56PM
hm.. there is a thread about bed leveling with a capacitive sensor in the german part of this forum. Unfortunately it is quite extensive so I haven´t been able to find an answer to the question if a capacitive sensor will reliably detect the surface of a glass sheet. So far I only found that it works quite well on a taped (Kapton?) glass sheet. I have posted a question and will tell about their answers here.
Re: Mendel90 Auto Bed Leveling
March 25, 2015 03:57PM
It won't detect the surface of an insulator, that is simple physics of a capacitor.

The surface of a conductor forms a capacitor plate, and moving the plates closer increases capacitance. An insulator forms a dielectric which will increase the capacitance if it has a higher relative permittivity compared to the air it replaces. But there is nothing special about the surface of an insulator.

Also the example I just gave was made by experimenting with a capacitive probe, a sheet of glass and a metal plate. So experiment matches theory as far as I am concerned.

Edited 1 time(s). Last edit at 03/25/2015 03:58PM by nophead.


[www.hydraraptor.blogspot.com]
Re: Mendel90 Auto Bed Leveling
March 25, 2015 04:25PM
ok.. so there is no hope ^^, at least on the capacitive front and using a glass sheet. By the way... the bed leveling process, from what I understand, the software will use the measurement to "tilt" the object relative to the measured surface.

About the measuring, will it in essence just measure 3 to 4 points on the bed and then use those measurements or will it measure more points? And if more points, what will it do, will it simply take an average of those measurements (plot a plane through them that fits best) or will it also map bumps and holes? So if there is a "hollow" will the extruder "dip" into it while traveling over it? (Doesn´t seem too useful, since it would do that for every layer of the print, so I guess this is not it )

If it uses say 4 corner points to map the bed, it could be possible to use points on the edge of the bed and maybe apply thin metal foil to the glass on these points?
Re: Mendel90 Auto Bed Leveling
March 25, 2015 06:23PM
Quote
D4RK1
ok.. so there is no hope ^^, at least on the capacitive front and using a glass sheet. By the way... the bed leveling process, from what I understand, the software will use the measurement to "tilt" the object relative to the measured surface.

Yes it rotates the model to match the slant of the bed. See [hydraraptor.blogspot.co.uk]

Quote
D4RK1
About the measuring, will it in essence just measure 3 to 4 points on the bed and then use those measurements or will it measure more points?

It can do three points or an N x N grid.

Quote
D4RK1
And if more points, what will it do, will it simply take an average of those measurements (plot a plane through them that fits best) or will it also map bumps and holes? So if there is a "hollow" will the extruder "dip" into it while traveling over it? (Doesn´t seem too useful, since it would do that for every layer of the print, so I guess this is not it )

If it probes a grid it does a least squares fit of the best plane. The bed still needs to be flat.

Quote
D4RK1
If it uses say 4 corner points to map the bed, it could be possible to use points on the edge of the bed and maybe apply thin metal foil to the glass on these points?

Yes you could select 2 x 2 points and specify where they are and put tape there but they can't be right in two of the corners because the probe is offset from the nozzle and the nozzle can't travel outside the bed.

Note I have never used Marlin leveling myself. I don't find I need it on my Dibond machines.

Edited 1 time(s). Last edit at 03/25/2015 06:23PM by nophead.


[www.hydraraptor.blogspot.com]
Re: Mendel90 Auto Bed Leveling
March 26, 2015 04:42PM
Any news from your inductive sensor? Still waiting on mine =/
Re: Mendel90 Auto Bed Leveling
March 26, 2015 08:26PM
No it hasn't arrived yet.


[www.hydraraptor.blogspot.com]
Re: Mendel90 Auto Bed Leveling
March 27, 2015 01:51PM
My inductive sensor arrived today. Datasheet is here.

I had hoped that the metal in mirrorglas would be enough to trigger the sensor but it isn't. Works well with a 5mm sheet of aluminium though.

So how do I connect the sensor to the board? I have noticed that there are 2 unused pins on that small extruder circuit board, but the sensor has 3 wires. It would be nice if I could only use the ribbon cable and not run extra cables.
Re: Mendel90 Auto Bed Leveling
March 27, 2015 02:21PM
The thread isn´t that long... I´d recommend reading it through, I´ve asked the same questions already and nophead was kind enough to answer smiling smiley
Re: Mendel90 Auto Bed Leveling
March 29, 2015 07:53AM
Hi, my sensor has arrived, what about yours nophead?
Re: Mendel90 Auto Bed Leveling
March 29, 2015 09:53AM
No not got it yet but you did order before me.


[www.hydraraptor.blogspot.com]
Re: Mendel90 Auto Bed Leveling
April 01, 2015 09:28AM
Mine just arrived. It takes 2mA with the LED off and 4mA when triggered.

Unfortunately the levelling code in Marlin doesn't make a lot of sense. Even with a grid probe where it does a least squares fit of the best plane it only uses the slope of the plane. It seems to get the level from the last point probed. It should get the level from the plane equation as that has contributions from all the points.

Also there is an error in deriving the normal to the plane from the plane equation in grid mode. It ignores the Z coefficient and sets it to 1, so even the slope is slightly wrong.


[www.hydraraptor.blogspot.com]
Re: Mendel90 Auto Bed Leveling
April 01, 2015 11:48AM
Pretending to have understood and nodding thoughtfully.....

So it is off the table or is it fixable? From what I understood the bed leveling is already working with Marlin? At least that is what I thought after watching the video I linked in the first post.

Edited 1 time(s). Last edit at 04/01/2015 11:48AM by D4RK1.
Re: Mendel90 Auto Bed Leveling
April 01, 2015 12:02PM
Hi,

The 3-point levelling works. In fact, with LCD and EEPROM settings enabled it is the only choice because grid-based levelling exceeds the available code space on a 1284P.


I try to write with consideration for all nationalities. Please let me know if something is unclear.
Printing with Mendel90 from fedora 25 using Cura, FreeCAD, MeshLab, OpenSCAD, Skeinforge and Slic3r tools.
Sorry, only registered users may post in this forum.

Click here to login