Welcome! Log In Create A New Profile

Advanced

Bed Auto Leveling.. check this out

Posted by AlexBorro 
Re: Bed Auto Leveling.. check this out
March 14, 2014 10:52PM
Hi everyone,

I am trying to get the auto-leveling feature working, but I am having problems. When I send an M280 command in Repetier Host, it extends and works perfectly. So I know it works, and it is powered correctly. However, when I issue a G28 or G29 command, the axis move like they are supposed to, however the servo does not move. It just vibrates, but never actually moves. Any ideas?
Re: Bed Auto Leveling.. check this out
March 15, 2014 09:18AM
Does it move when sending a M401 and M402?

Did you set the retract and extend values in SERVO_ENDSTOP_ANGLES that you found with the M280 command?

Do you have the firmware set to use the eeprom? Then don't forget to use the appropiate commands to update the settings saved in the eeprom.
Re: Bed Auto Leveling.. check this out
March 15, 2014 10:19AM
It does not move when I send an M401 or M402 command.

I changed the SERVO_ENDSTOP_ANGLES to {0,0 0,0, 20,100} in Marlin.

I am new to all of this, so when you say eeprom, what do I need to do with that?
Re: Bed Auto Leveling.. check this out
March 15, 2014 10:55AM
The 20 is extended setting, and the 100 is the retracted setting, correct?

Is the following set like this?
#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1

If you have the following defines uncommented, you're using the eeprom. It saves a bunch of the settings that you define in configuration.h. So when you change something in configuation.h, it never really changes until you send a M502, followed by a M500.
I have it disabled, since I have never needed to change them via the lcd controller or a gcode command and I always forgot about it when I changed some setting. angry smiley

// EEPROM
// the microcontroller can store settings in the EEPROM, e.g. max velocity...
// M500 - stores paramters in EEPROM
// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
// M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
//define this to enable eeprom support
//#define EEPROM_SETTINGS
//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
// please keep turned on if you can.
//#define EEPROM_CHITCHAT
Re: Bed Auto Leveling.. check this out
March 15, 2014 11:50AM
Yes that is correct, the 20 is the extended angle, and the 100 is the retracted angle. Here is my servo settings from Marlin: (I have the number of servos as 4 because I was just trying all four pin selections on RAMPS to see if that would make a difference, it doesn't work even if it is just set to 1).

// Number of servos
//
// If you select a configuration below, this will receive a default value and does not need to be set manually
// set it manually if you have more servos than extruders and wish to manually control some
// leaving it undefined or defining as 0 will disable the servo subsystem
// If unsure, leave commented / disabled
//
#define NUM_SERVOS 4 // Servo index starts with 0 for M280 command

// Servo Endstops
//
// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.
//
#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
//smartrap : version pololu servo (dark blue)
#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 0,120} // X,Y,Z Axis Extend and Retract angles
//smartrap : version chinese 3.7g (light blue)
//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 75,10} // X,Y,Z Axis Extend and Retract angles

#include "Configuration_adv.h"
#include "thermistortables.h"

#endif //__CONFIGURATION_H



Here is my settings regarding the EEPROM:

// EEPROM
// The microcontroller can store settings in the EEPROM, e.g. max velocity...
// M500 - stores parameters in EEPROM
// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
// M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
//define this to enable EEPROM support
#define EEPROM_SETTINGS
//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
// please keep turned on if you can.
#define EEPROM_CHITCHAT


Let me know what you think. Thanks for your help!

Edited 1 time(s). Last edit at 03/15/2014 11:52AM by camcknight14.
Re: Bed Auto Leveling.. check this out
March 15, 2014 02:15PM
Since you have the eeprom enabled, you do need to send a M502, followed by a M500 to use the current configuration.h settings.
If it still doesn't work, try changing the NUM_SERVOS to 1. That's the number I use.

How are you powering the servo? I'm using a 7805 attached to the 5a 12v input to power it with a wire from the output to the 5v servo input. I had random problems when powering it off the Mega2560.

I've run out of ideas on what could be wrong.
Re: Bed Auto Leveling.. check this out
March 15, 2014 02:31PM
I just placed a jumper between the 5V and the VCC next to the reset switch on the RAMPS, and used that for power.

Would it be easier if I just comment out the EEPROM?
Re: Bed Auto Leveling.. check this out
March 15, 2014 05:08PM
Commenting out both eeprom defines is how I did it.
Re: Bed Auto Leveling.. check this out
March 15, 2014 08:49PM
Gave it a try, but sadly still no luck.
Re: Bed Auto Leveling.. check this out
March 18, 2014 12:56AM
Thanks edn. I'd given up. The Rambo pin is PWM pin 5 Pins i & 2 are vcc & Gnd I'm now unsure how to wire up the microswitch that I've mounted on the servo. I've currently got the hall effect magnetic switch. Should I try putting it in series with the existing switch, or replace the hall effect switch with another mechanical switch?
Re: Bed Auto Leveling.. check this out
March 18, 2014 02:25PM
I just printed the auto touch z-axis end stops for my Prusa i3. Autoleveling works great using the nozzle of the hotend on the bed.
Re: Bed Auto Leveling.. check this out
March 21, 2014 10:25AM
I have a MakerFarm 8" Prusa i3. I upgraded the firmware to the latest version (as of 3/19/14) and setup auto bed leveling.

My G28 works, my G29 seems to calibrate correctly. When the probing stops, and the servo retracts the head is 6mm above the print bed.

#define Z_PROBE_OFFSET_FROM_EXTRUDER 6

That is my offset. However, when the print starts, the head is still 6mm above the bed. The Z motors are spinning to level it, but the gap is a little big. What did I miss?
Re: Bed Auto Leveling.. check this out
March 21, 2014 08:20PM
Quote
cmcd2820
I have a MakerFarm 8" Prusa i3. I upgraded the firmware to the latest version (as of 3/19/14) and setup auto bed leveling.

My G28 works, my G29 seems to calibrate correctly. When the probing stops, and the servo retracts the head is 6mm above the print bed.

#define Z_PROBE_OFFSET_FROM_EXTRUDER 6

That is my offset. However, when the print starts, the head is still 6mm above the bed. The Z motors are spinning to level it, but the gap is a little big. What did I miss?

Shouldn't you be using minus 6?
You may also have to adjust this a few times to get it perfect, increasing the negative value (-6.2 example) will bring the nozzle even closer to the bed. If the nozzle is too close, go the other way and enter -5.8 and adjust these values until you get it perfect.

Edited 1 time(s). Last edit at 03/21/2014 08:23PM by regpye.


[regpye.com.au]
"Experience is the mother of all knowledge." --Leonardo da Vinci
Re: Bed Auto Leveling.. check this out
March 21, 2014 11:29PM
I missed the minus sign in my post. -6 is correct. I had been poking around in the new firmware and think I might have changed another file, so I started from scratch and plugged in my numbers and it worked like it was supposed to. Now if I can just get my ABS from jamming in my extruder, I can get back to printing.

Edited 1 time(s). Last edit at 03/21/2014 11:30PM by cmcd2820.
edn
Re: Bed Auto Leveling.. check this out
March 23, 2014 06:08PM
Quote
gwandad
Thanks edn. I'd given up. The Rambo pin is PWM pin 5 Pins i & 2 are vcc & Gnd I'm now unsure how to wire up the microswitch that I've mounted on the servo. I've currently got the hall effect magnetic switch. Should I try putting it in series with the existing switch, or replace the hall effect switch with another mechanical switch?

I would use a mechanical switch until everything is working as expected. Then, if you want, switch to a hall effect switch. That way you aren't fighting multiple problems at the same time. I'm not sure the extra complexity (and problems) of a hall effect switch make sense. Just using cheap micro switches from China off of eBay (for $1.00 including shipping) work just fine. I bought a 10x pack of these:

[www.ebay.com]

These are not high quality switches but they work just fine. With that said, I'm writing a command for Marlin to test the repeatability of the switch at a given location. It will do user selectable number of iterations at a given location (with reasonable defaults) and print the standard deviation of the samples. I'm getting good results with the cheap switch, but I'm curious how accurate and repeatable it is. Soon (like a month???) I'll have some code you can add to your Marlin build along with numbers so you know if you are doing good or bad.

Once I get that all working, I'll probably go get a legitimate 'Micro-Switch' branded switch. They are very good quality and very repeatable. (If you don't want to mess with a cheap switch... Spend a couple of dollars and get the real McCoy and be done with the problem.)
Re: Bed Auto Leveling.. check this out
March 29, 2014 04:21PM
Hi everybody,
I'm having the following issue: on pronterface the G29 command does nothing. I can't either use M401. M280 works though.
Homing with G28 works fine, the probe is extended and retracted.
If I send a dummy print with a G29 command after a G28 it prints "on the air" (not touching the bed) and the probing is ignored.
I'm using a MakerFarm Prusa i3 8" with a Marlin that is not the latest. If I try to install the latest version from GitHub I get a MINTEMP error or something like that.
Attached is my configuration.h
Please beware that I'm not too familiar with editing codes and such, but I try to do my best.
Thank you very much.
Regards,
LUCAS
Attachments:
open | download - Configuration.h (26.1 KB)
Re: Bed Auto Leveling.. check this out
March 29, 2014 08:22PM
This should help you get your Marlin up to the latest version. [zennmaster.com]


MakerFarm 8" Prusa i3v
RAMPS 1.4
0.4mm E3D v6 for 1.75mm
edn
Re: Bed Auto Leveling.. check this out
March 30, 2014 11:14AM
At line 334 of your Config.h file you will see:


//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)

You need to delete the two leading // bars and recompile in order to enable auto-bed-leveling. Right now, it is not turned on, and the G29 command does not exist in your firmware.

You also need to set the OFFSET's for X, Y, and Z to appropriate amounts and there are other things you should consider setting too...

Edited 1 time(s). Last edit at 03/30/2014 11:14AM by edn.
Re: Bed Auto Leveling.. check this out
March 30, 2014 08:07PM
Oh my, I can't believe I missed that... I should be very ashamed, and I really am!
Thanks edn! It's working now!
Thanks AbuMaia, that guide is really helpful.
Re: Bed Auto Leveling.. check this out
March 30, 2014 09:20PM
ok, now I have the following issue: when I send a G29 the Z axis starts lowering with the probe retracted.
I have to trigger the probe endstop manually before the nozzle hits the glass, and then I get this on pronterface:

SENDING:G29
Bed x: 30 y: 140 z: 23.03
Bed x: 30 y: 30 z: 23.05
Bed x: 140 y: 30 z: 24.23
echo:endstops hit: Z:24.23

And on my LCD I get a endstops hit: Z message

Edited 1 time(s). Last edit at 03/30/2014 09:32PM by lucaslucas80.
Re: Bed Auto Leveling.. check this out
March 30, 2014 10:44PM
That's normal, to get the endstops hit message after probing. After all, the probe is your new Z endstop.


MakerFarm 8" Prusa i3v
RAMPS 1.4
0.4mm E3D v6 for 1.75mm
Re: Bed Auto Leveling.. check this out
March 30, 2014 10:51PM
Ok, that I get, but why does the Z axis lower with the probe retracted? Shouldn't the probe extension be the first thing to happen?
It starts lowering and I have to trigger the endstop manually before the nozzle hits the glass.
Attached follows my configuration.h as of now.
Thanks AbuMaia

Edited 2 time(s). Last edit at 03/30/2014 10:52PM by lucaslucas80.
Attachments:
open | download - Configuration.h (26 KB)
Re: Bed Auto Leveling.. check this out
March 30, 2014 11:28PM
You have the same printer as I, yet there are some differences in our firmware.

This block:

#ifdef ENDSTOPPULLUPS
#define ENDSTOPPULLUP_XMAX
#define ENDSTOPPULLUP_YMAX
#define ENDSTOPPULLUP_ZMAX

I have the three "#define"s commented out (//)

Then just after that block, where it says "// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins." I have all the following "const bool" set to false.

Ooohhh, do you have your i3 set up to print facing forwards, with the X and Y endstops set as MAX endstops rather than MIN? That might account for it.


MakerFarm 8" Prusa i3v
RAMPS 1.4
0.4mm E3D v6 for 1.75mm
Re: Bed Auto Leveling.. check this out
March 31, 2014 07:26AM
Ok, good to know we have the same model.
Yes, I'm printing facing forwards, the X and Y endstops are indeed set as MAX. Such modification was suggested to me by Alex Borro, who at the time had this same printer. But I don't guess that accounts for this issue with the Z lowering before extending the probe, since the Z endstop is still set as MIN.
About the ENDSTOPPULLUPS block, it has always been this way, when I get back home I'll comment it out and see what happens.
Thanks again.
LUCAS

Quote
AbuMaia
You have the same printer as I, yet there are some differences in our firmware.

This block:

#ifdef ENDSTOPPULLUPS
#define ENDSTOPPULLUP_XMAX
#define ENDSTOPPULLUP_YMAX
#define ENDSTOPPULLUP_ZMAX

I have the three "#define"s commented out (//)

Then just after that block, where it says "// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins." I have all the following "const bool" set to false.

Ooohhh, do you have your i3 set up to print facing forwards, with the X and Y endstops set as MAX endstops rather than MIN? That might account for it.
Re: Bed Auto Leveling.. check this out
March 31, 2014 12:14PM
Ok, problem solved: my Z_RAISE_BEFORE_PROBING value was lower than my Z_PROBE_OFFSET_FROM_EXTRUDER. The former was set as 20 and the latter to -24.5 (I'm considering only absolute values, the offset must be negative, of course)
This way after homing the printer didn't realize the Z was lower than 24.5, so it began lowering past 20 to try and probe, but then it was too late and a collision imminent.
Now the Z raises to 30 and then normally proceeds to probing.
Thank you all who have helped me get to this conclusion.
LUCAS
edn
Re: Bed Auto Leveling.. check this out
March 31, 2014 01:00PM
There is a characteristic of the G29 bed leveling probe that I don't like. It raises and lowers the probe for each point. From a repeatability perspective, it is better to just lower it once at the start and raise it at the end. If anybody agrees with this view point and wants to deviate from the norm, I can post the (trivial) changes to do that.
Re: Bed Auto Leveling.. check this out
March 31, 2014 06:28PM
Quote
edn
There is a characteristic of the G29 bed leveling probe that I don't like. It raises and lowers the probe for each point. From a repeatability perspective, it is better to just lower it once at the start and raise it at the end. If anybody agrees with this view point and wants to deviate from the norm, I can post the (trivial) changes to do that.

That is how the early version worked and I am still using that version because I have no problems with it. I decided to stay with the early version because I was doubtful that multiple lifts of the probe would be as accurate. I found that spending a little extra time in setting up pays off and gets good results.
There may be some other improvements that are in the current version that I am missing, so yes, I would like to see the change made and then I may move over to the later version.

Edited 1 time(s). Last edit at 03/31/2014 06:29PM by regpye.


[regpye.com.au]
"Experience is the mother of all knowledge." --Leonardo da Vinci
Re: Bed Auto Leveling.. check this out
March 31, 2014 07:33PM
You can change the amount the probe lifts between points.

Just change this define:
#define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points
Re: Bed Auto Leveling.. check this out
March 31, 2014 10:02PM
That raises the entire extruder, not just the probe. The probe will retract, then Z will lift that number, move to the next probe point, then extend the probe.


MakerFarm 8" Prusa i3v
RAMPS 1.4
0.4mm E3D v6 for 1.75mm
edn
Re: Bed Auto Leveling.. check this out
April 01, 2014 11:32AM
Quote
regpye
Quote
edn
There is a characteristic of the G29 bed leveling probe that I don't like. It raises and lowers the probe for each point. From a repeatability perspective, it is better to just lower it once at the start and raise it at the end. If anybody agrees with this view point and wants to deviate from the norm, I can post the (trivial) changes to do that.

That is how the early version worked and I am still using that version because I have no problems with it. I decided to stay with the early version because I was doubtful that multiple lifts of the probe would be as accurate. I found that spending a little extra time in setting up pays off and gets good results.
There may be some other improvements that are in the current version that I am missing, so yes, I would like to see the change made and then I may move over to the later version.

Regpye: Find this code block in the G29 command. If you replace it with the slightly modified version, the probe will only kick down at the start and then retract at the very end. That is better from a repeatability perspective because you only get the probe positioning error once, not once per probed point.



for (double yProbe=FRONT_PROBE_BED_POSITION; yProbe <= BACK_PROBE_BED_POSITION+.001 /* incase of round off errors */ ; yProbe += yGridSpacing)
{
double xProbe, xInc;
if (zig)
{
xProbe = LEFT_PROBE_BED_POSITION;
//xEnd = RIGHT_PROBE_BED_POSITION;
xInc = xGridSpacing;
zig = false;
} else // zag
{
xProbe = RIGHT_PROBE_BED_POSITION;
//xEnd = LEFT_PROBE_BED_POSITION;
xInc = -xGridSpacing;
zig = true;
}

for (int xCount=0; xCount < ACCURATE_BED_LEVELING_POINTS; xCount++)
{
if (probePointCounter == 0)
{
// raise before probing
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_BEFORE_PROBING);
engage_z_probe(); // EDN wants the probe to only kick down once, so we do it
// before we start the probe loop.
} else
{
// raise extruder
do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS);
}

do_blocking_move_to(xProbe - X_PROBE_OFFSET_FROM_EXTRUDER, yProbe - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);

// engage_z_probe(); // Engage Z Servo endstop if available
run_z_probe();
eqnBVector[probePointCounter] = current_position[Z_AXIS];
// retract_z_probe();

eqnAMatrix[probePointCounter + 0*ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS] = xProbe;
eqnAMatrix[probePointCounter + 1*ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS] = yProbe;
eqnAMatrix[probePointCounter + 2*ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS] = 1;
probePointCounter++;
xProbe += xInc;
}
}
retract_z_probe(); // EDN moved this to end so we only kick down the probe once
// and only bring it back up once. This helps the repeatability
// of the Z-Probe in many implementations.

clean_up_after_endstop_move();

Edited 1 time(s). Last edit at 04/01/2014 12:26PM by edn.
Sorry, only registered users may post in this forum.

Click here to login