Welcome! Log In Create A New Profile

Advanced

Bed Auto Leveling.. check this out

Posted by AlexBorro 
Re: Bed Auto Leveling.. check this out
November 21, 2013 10:08PM
Apparently the servo world started out at 4.5 to 4.8V as a standard battery supply and they have been moving up in voltage ever since. The newer battery packs are all up around 6 to 6.5 volts. They still should have enough range to work on 5V....
Re: Bed Auto Leveling.. check this out
November 21, 2013 10:54PM
Quote
uncle_bob
Apparently the servo world started out at 4.5 to 4.8V as a standard battery supply and they have been moving up in voltage ever since. The newer battery packs are all up around 6 to 6.5 volts. They still should have enough range to work on 5V....

I am having no problems with my machines. All three of them are using the same setup, TGY-1800A servo and the 7805 voltage regulator. I noticed a big improvement after using your code wdl1908.


[regpye.com.au]
"Experience is the mother of all knowledge." --Leonardo da Vinci
Re: Bed Auto Leveling.. check this out
November 22, 2013 07:44AM
Servo's are generally pretty basic (dare I say cheap?) items. You can find lots of posts talking about one in ten or three of six having this or that issue. That's with them in things like R/C planes, but I'd bet the data still applies to what we are doing. Fortunately they are affordable enough that getting a flaky one isn't all that big a deal.
Re: Bed Auto Leveling.. check this out
November 23, 2013 04:51AM
Quote
AlexBorro
@Skew, your Z axis get reversed ONLY after performing G29?? Have you tried moving the Z axis after a G28 ??
It doesnt make sense since G29 don't affect anything related to axis movements..

It is a bug, I have just realized.. I will try to fix it asap.

Alex.

About this problem Alex. With the latest firmware I'm having exact same problem. G28 and G30 works perfectly, but after running G29 after 3rd measurment point the Z-axis and Y-axis go invert.
Can't figure out whats wrong on the config or is it the bug described earlier.

Update:
Found the cause coordinates of the measurement points were wrong which swapped the axis directions.

Edited 1 time(s). Last edit at 11/23/2013 12:05PM by Snowfly.
Attachments:
open | download - Configuration.h (26.4 KB)
open | download - Configuration_adv.h (19.1 KB)
open | download - Marlin_main.cpp (108.6 KB)
Re: Bed Auto Leveling.. check this out
November 23, 2013 11:21AM
i seem to have issues top right corner, always higher then other corners.

should the probing not be completed as a triangle as when i run g29 i see it probs bottom and top left but then only bottom right so the top corner were im having trouble is not checed at all?
Re: Bed Auto Leveling.. check this out
November 23, 2013 11:44AM
Been looking the same thing how to add the 4th point measurement to the code... still work on progress...
Re: Bed Auto Leveling.. check this out
November 23, 2013 02:59PM
Since three points define a plane, the mapping is (relatively) easy with 3 points. Once you add more points you are either:

1) Not defining a plane
2) Over defining a plane

In the second case it might reduce measurement error. In the first case you very much need to know what shape surface you are defining. For complex surfaces, 4 points likely is nowhere near enough data. I'm amazed that the Mega can handle the plane case. There's only so much it'll be able to handle math wise on anything more complex. Something like an 8 x 8 array of points with each point logged and square regions might be the "next best thing" rather than a mathematically perfect surface.
Re: Bed Auto Leveling.. check this out
November 23, 2013 03:31PM
i was thinking it would end up like the kossel auto level were it probs the whole bed using a grid?

from the tests iv run the past 2 weeks every time i run g29 top right corner is too high when printing.

any ideas what i can do to try and resolve the top right corner issue if other people are not being effected by it?
Re: Bed Auto Leveling.. check this out
November 23, 2013 03:46PM
An 8 x 8 array would give you a grid of points.

Simple answer to one corner being out is to make the bed flat. For what ever odd reason, many beds drift up and down, but they stay flat.

1) Is your glass flat when not clamped to anything? if not, replace it, it's cheap to do.
2) Is your glass flat when it's clamped only in two places? (not 3 or 4)
3) Is your heater bowing up in the middle? A bit of (careful) persuasion when it's hot may correct that. Don't go to far and break it...
4) Can you re-level the bed so it's flat rather than level? Auto level will take care of a flat plane.
Re: Bed Auto Leveling.. check this out
November 23, 2013 04:51PM
Quote
uncle_bob
An 8 x 8 array would give you a grid of points.

Simple answer to one corner being out is to make the bed flat. For what ever odd reason, many beds drift up and down, but they stay flat.

1) Is your glass flat when not clamped to anything? if not, replace it, it's cheap to do.
2) Is your glass flat when it's clamped only in two places? (not 3 or 4)
3) Is your heater bowing up in the middle? A bit of (careful) persuasion when it's hot may correct that. Don't go to far and break it...
4) Can you re-level the bed so it's flat rather than level? Auto level will take care of a flat plane.

I am having no problems with mine.
I use just two clamps, one at the front and one at the back, both about the middle.
No need for a lot of clamps. I even forgot to add one clamp one night when I was a bit tired and it still printed OK, but I guess I was very lucky it didn't move.

Glass will take a bowed shape if clamped at all corners. The bowing will come from the heated bed that will rise in the centre area. If only two clamps are used the glass will keep it's shape better. I use 3mm glass because when I used 2mm glass I found it can bend much easier and go out of shape.


[regpye.com.au]
"Experience is the mother of all knowledge." --Leonardo da Vinci
Re: Bed Auto Leveling.. check this out
November 23, 2013 04:54PM
been having another look at the corner issue again tonight

already tried what you suggested as i was thinking along the same lines

Have tried 3 peices of glass now all new cut to size all flat when on table
glass it tight to bed i use 4 clips to hold to bed
have taken out heated bed as its not used and i suspected it may bowing now using solid flat piece of alu composite with glass cliped on.
Have just re-leveled bed using G30 in each corner so Z Stop reads 6 on each corner tested twice back and forth to double check

Still getting right corner issue. Seems to get worse the further out the print goes. Run a quick printer and stopped after 1st layer to show issue

Pic had to drop quality to upload it but right corner you can see the skirt getting wider gaps and can see blue tape between lines.

Edited 2 time(s). Last edit at 11/23/2013 04:56PM by Enlightx.
Re: Bed Auto Leveling.. check this out
November 23, 2013 08:38PM
I would drop back to two clips and see how things go.

Can you level the bed manually? The bed leveling software is not doing anything that you could not do yourself with some shims.

If you have multiple pieces of glass, what happens when you stack two (or 3) pieces on top of each other on the printer? That should give you a pretty stiff platform.

If you put the glass on the bed when it's hot, does it lay flat? I'm betting it does not. Try clamping it at the two "high" corners and just let the low one(s) flop in the wind.
Re: Bed Auto Leveling.. check this out
November 24, 2013 08:44PM
So far I have spent roughly 10 hours trying to get this to work properly. I could of manually leveled my print bed 60+ times in that amount of time. Not sure this is worth it.
Re: Bed Auto Leveling.. check this out
November 24, 2013 08:54PM
Quote
agirgen
So far I have spent roughly 10 hours trying to get this to work properly. I could of manually leveled my print bed 60+ times in that amount of time. Not sure this is worth it.

What kind of issues are you having?
I also had a few problems, but once sorted out the leveling is so easy now.
I have put it on all my current machines and not had to level any of them manually at all.
It will become a standard part of all my builds from now on.

Thanks to Alex for the feature, it is great.


[regpye.com.au]
"Experience is the mother of all knowledge." --Leonardo da Vinci
Re: Bed Auto Leveling.. check this out
November 24, 2013 09:31PM
Uggh, I don't know... Inconsistent results? I followed the instructions and it worked once. After that it didn't. I have attached a video as well as my Configuration.h file. In the video, you can clearly see that the gap between the extruder and the glass isn't constant... And this is with the bed very level. Just doesn't seem to be doing what it's supposed to... Maybe I'm missing something.

Video of my auto bed level... not quite working.
Attachments:
open | download - Configuration.h (26.4 KB)
Re: Bed Auto Leveling.. check this out
November 24, 2013 09:38PM
Quote
agirgen
Uggh, I don't know... Inconsistent results? I followed the instructions and it worked once. After that it didn't. I have attached a video as well as my Configuration.h file. In the video, you can clearly see that the gap between the extruder and the glass isn't constant... And this is with the bed very level. Just doesn't seem to be doing what it's supposed to... Maybe I'm missing something.

Could be the micro switch. I tried a couple before I found one that worked consistently.
I also bent the lever so that I got a better action when being used. Mine works every time and very consistent.


[regpye.com.au]
"Experience is the mother of all knowledge." --Leonardo da Vinci
Re: Bed Auto Leveling.. check this out
November 24, 2013 09:44PM
That's what I was thinking, but it's a pretty high quality switch. I have a couple of others... I'll try them in the morning. Thanks for the quick replies... And sorry if I came across a bit brash. It's frustrating and I've been drinking. spinning smiley sticking its tongue out
Re: Bed Auto Leveling.. check this out
November 24, 2013 10:14PM
smileys with beersmileys with beersmileys with beersmileys with beer

For what ever reason, people seem to have switch troubles. A real Micro Switch (yes it's a trademark) should get you below 0.01 mm. You can set up with a micrometer and check them pretty easily. The only time you usually have trouble with them is when you are hitting the arm or actuator in a way that's not repeatable. One example is using the straight arm style at the tip of the arm. They are designed to be hit on the flat of the arm.

Of course the switch is only as good as the positioning repeatability of the servo and the end play in the servo shaft (plus a few other even more minor things).

Edited 1 time(s). Last edit at 11/24/2013 10:15PM by uncle_bob.
Re: Bed Auto Leveling.. check this out
November 24, 2013 10:36PM
Quote
uncle_bob
smileys with beersmileys with beersmileys with beersmileys with beer

For what ever reason, people seem to have switch troubles. A real Micro Switch (yes it's a trademark) should get you below 0.01 mm. You can set up with a micrometer and check them pretty easily. The only time you usually have trouble with them is when you are hitting the arm or actuator in a way that's not repeatable. One example is using the straight arm style at the tip of the arm. They are designed to be hit on the flat of the arm.

Of course the switch is only as good as the positioning repeatability of the servo and the end play in the servo shaft (plus a few other even more minor things).

Can't agree with you more Uncle-bob.
The micro switch I am using is a subminiature one. Brand name is Tiaihua. It is a snap action type.
I bent the lever so that I got a positive action each time the roller touched the bed.

Here is a photo of the switch out of the packet.

Here is a photo of the switch modified for bed auto leveling.


[regpye.com.au]
"Experience is the mother of all knowledge." --Leonardo da Vinci
Re: Bed Auto Leveling.. check this out
November 25, 2013 02:35AM
I'm having trouble moving the servo. I have ATX power supply and I'm trying to get the 5V power from the HD molex connection (red wire) which I've connected to Ramps 1.4 5V connection (next to reset switch) and I can measure and see that servos are getting 5V. But if I try to move the servo nothing happens.

If I disconnect the servo and manually move the servo to some position and then connect it again I'm able to move it to one direction with M280 P0 SXXX (XXX being some value between 100-180) but it doesn't move to another direction. When servo is connected I can feel that it has power because I can't turn it.

Could it be bad servo, bad Ramps, not enough amps or something else?
Re: Bed Auto Leveling.. check this out
November 25, 2013 04:42AM
Quote

If I disconnect the servo and manually move the servo to some position and then connect it again I'm able to move it to one direction with M280 P0 SXXX (XXX being some value between 100-180) but it doesn't move to another direction. When servo is connected I can feel that it has power because I can't turn it.

Same problem here...
I use RAMPS 1.3, but that shouldn't make any difference.
I found out that if I define NUM_SERVOS 2, than I can control the second servo via G-code. I'm kinda helpless here and can't understand whats going on. Just wanted to share my experience, maybe it helps.
Re: Bed Auto Leveling.. check this out
November 25, 2013 08:58AM
Servos come in many flavors. Some don't like a digital control signal at all. Some only like PWM signals that repeat at a specific rate or range of rates. The first thing I'd check is if your servo is one that others have gotten working with the Arduion servo setup.

------------------

Yes indeed you can bend the little arms on micro switches and it can help things. I've seen some *very* creative bend jobs over the years....
Re: Bed Auto Leveling.. check this out
November 25, 2013 09:32AM
Quote
uncle_bob
smileys with beersmileys with beersmileys with beersmileys with beer

For what ever reason, people seem to have switch troubles. A real Micro Switch (yes it's a trademark) should get you below 0.01 mm. You can set up with a micrometer and check them pretty easily.


Yeah, I checked my switch with a meter this morning. I got inconsistent results with every switch actuation. Unlike a normal switch, the one i was using would read a very high resistance just prior to it showing infinite resistance. With the switches I have had to deal with in aviation, this is a sign of them going bad. The switch should show two states, no resistance and infinite resistance. Nothing in-between (at least that we can see with standard test equipment). So I guess I'll be replacing that. Ill report back once I get a new one wired up.

Thanks!
Re: Bed Auto Leveling.. check this out
November 25, 2013 10:03AM
Quote
varjis
I'm having trouble moving the servo. I have ATX power supply and I'm trying to get the 5V power from the HD molex connection (red wire) which I've connected to Ramps 1.4 5V connection (next to reset switch) and I can measure and see that servos are getting 5V. But if I try to move the servo nothing happens.

Hello varjis,

Are you saying that you connected a 5 Volt source to the 5V VCC connection on the Ramps? You shouldn't have to do this... Just jumper the 5V VCC pins and you will get 5V at the servo connection.

Also, a lot depends on the type of servo you are using. In my experience with Arduino, plane ol analog servos work the best. In addition, some sub 9 gram servos run off of 3 volts, not 5... Is your servo getting hot when you connect it to 5V? You could also test the servo independently by hooking it up to an Arduino and loading up one of the sample sketches from the servo library (such as sweep).

http://playground.arduino.cc/Learning/SingleServoExample

Hope this helps smiling smiley
Re: Bed Auto Leveling.. check this out
November 25, 2013 11:22AM
Quote
agirgen
Quote
varjis
I'm having trouble moving the servo. I have ATX power supply and I'm trying to get the 5V power from the HD molex connection (red wire) which I've connected to Ramps 1.4 5V connection (next to reset switch) and I can measure and see that servos are getting 5V. But if I try to move the servo nothing happens.

Hello varjis,

Are you saying that you connected a 5 Volt source to the 5V VCC connection on the Ramps? You shouldn't have to do this... Just jumper the 5V VCC pins and you will get 5V at the servo connection.

Also, a lot depends on the type of servo you are using. In my experience with Arduino, plane ol analog servos work the best. In addition, some sub 9 gram servos run off of 3 volts, not 5... Is your servo getting hot when you connect it to 5V? You could also test the servo independently by hooking it up to an Arduino and loading up one of the sample sketches from the servo library (such as sweep).

http://playground.arduino.cc/Learning/SingleServoExample

Hope this helps smiling smiley

I will have to test that Servo example..

I have now put the jumper between 5V and VCC the servo is doing the same thing. I can manually turn in to "zero" when it's powered off and then power it and turn the servo to one direction.

The servo I'm using is something like this: [www.hobbyfactory.fi] (Sorry the link is to Finnish site but I think that you can get the basic info from there)

Does anybody have any working servo list? I was thinking that maybe the Arduino doesn't provide enough power (I'm using Laptop so don't know how much my usb gives the Arduino power) on Vcc but I guess if arduino runs out of power it just stops working.

EDIT: After testing the servo example I figured out that I had faulty servo. So seems that everything is working now with new servo.. smiling smiley

Edited 1 time(s). Last edit at 11/25/2013 01:46PM by varjis.
Re: Bed Auto Leveling.. check this out
November 25, 2013 12:45PM
... I've been agitating for people to post their servo information. There are a couple of people who have done so earlier in this thread. The TowerPro SG-90 seems to be one that other Arduino servo people are using a lot. It's a cheap servo that gets mixed reviews from the r/c people. I'd get several if you are ordering them. That way you have a spare if the first one is bad.
Re: Bed Auto Leveling.. check this out
November 25, 2013 01:49PM
Ok, I got my problems sorted out and now things are working really well. It was a rather silly mistake on my part; I didn't take G28 out of my G-Code. So I would run the auto calibrate function, then hit print. It would home and dump all the calibration data. So now I'm down to tweaking my offsets to get the hot end to bed spacing correct and I should be in business.

As for the servos, I have been doing RC for many years and for cheep, non-critical applications I find that Hextronic HXT-900 seem to work pretty well (it's what I'm using for this). When I order them, I usually get extras as it's probable that a few will be defective... Most of the blue transparent 9g servos you see on the market are pretty much the same, a knock off of the HiTec HS-55. The reason RC guys (mostly) stay away from the cheap knockoffs is because of the poor quality pots used in them. This translates to poor centering and inconsistent travel amounts. Also, the gears are cheap and they strip out easily.

For our applications tho, this stuff shouldn't matter as long as you can get the retract/extend locations to duplicate reliably. As there is no serious load on the servo, the quality of gears shouldn't matter much either. As for the power requirements, they are minuscule, especially when the servo isn't having to exert much force. I have successfully ran 5 9g servos off an Arduino Mega on USB power without a problem (they weren't attached to anything, just sweeping back and forth without a load). With an external power source, I have done the same thing with ~15 or 20 9g servos.

With the problems people are having here, if it can't be pinned on an issue with the firmware, (IMO) the best thing to do is to remove the servo and test it independently with either RC gear or an Arduino. As for the best servo for Arduino, any bare bones analog servo should work. KISS applies to this for sure.

Edited 1 time(s). Last edit at 11/25/2013 05:11PM by agirgen.
Re: Bed Auto Leveling.. check this out
November 25, 2013 05:55PM
iv found if using ramps 1.3 (not tried ramps 1.4) you have to edit pins.h to read this

ifdef NUM_SERVOS
#define SERVO0_PIN 6

#if NUM_SERVOS > 1
#define SERVO1_PIN 6
#endif
Re: Bed Auto Leveling.. check this out
November 27, 2013 06:39AM
Hi, i have a Makerfarm Prusa i3 8" and im trying to add auto bed leveling to it.
I got G28/G30 work correctly, but when I run G29, the z probe be lowered immediately then z-axis lowered and then z probe retracted.
XY axis are not moving at all but the system thinks it's moved.
Can anyone help me ?

Log from pronterface:
>>>G28
SENDING:G28
echoconfused smileyD init fail
>>>G29
SENDING:G29
Bed x: 75 y: 125 z: 7.00
Bed x: 75 y: 75 z: 7.00
Bed x: 125 y: 75 z: 7.00
echo:endstops hit:  X:44.00 Y:119.80 Z:7.00
>>>M114
SENDING:M114
X:94.00Y:69.80Z:7.20E:0.00 Count X: 94.00Y:69.80Z:7.20

auto bed leveling configuration part:
#define ENABLE_AUTO_BED_LEVELING

#ifdef ENABLE_AUTO_BED_LEVELING

  #define LEFT_PROBE_BED_POSITION 75
  #define RIGHT_PROBE_BED_POSITION 125
  #define BACK_PROBE_BED_POSITION 125
  #define FRONT_PROBE_BED_POSITION 75

  #define X_PROBE_OFFSET_FROM_EXTRUDER 31.00
  #define Y_PROBE_OFFSET_FROM_EXTRUDER 5.20
  #define Z_PROBE_OFFSET_FROM_EXTRUDER -7.20

  #define Z_RAISE_BEFORE_HOMING 20 
    
  #define XY_TRAVEL_SPEED 3000 
  
  #define Z_RAISE_BEFORE_PROBING 20  
  #define Z_RAISE_BETWEEN_PROBINGS 20 

//  #define PROBE_SERVO_DEACTIVATION_DELAY 300  
#endif
Re: Bed Auto Leveling.. check this out
November 28, 2013 03:20AM
So I seem to have the bed levelling set up and working roughly some things I note or have issues with.

The corner that is not probed (back right) sometimes is still 0.1 to 0.3mm out after G29, but not always, other corners and centre are usually OK but I find that after a G29 they are not all exactly the same level (some very slight variations) and then on other occasions they seem very very close.

The code seems to not safe guard against bad configuration in anyway, for example setting Z_RAISE_BEFORE_HOMING to a distance less than the Z_PROBE_OFFSET_FROM_EXTRUDER causes Z to lower before homing, in my mind anything that says it is a raising parameter should never lower regardless if the config is bad, is should just do nothing or echo an error.

On occasion If I run a G28 and then a G29 then start a print the head crashes into the bed hard on the first print move (goodbye side one of carbon fibre build plate), but if I then reset and run a G28 and then G29 then start the same print it is fine, this is worrying because it can't be trusted yet. This may occur after one print job has completed and I setup for a second without a shutdown or reset (I will have to test this further). I am going to wire a z end stop in series with the probe switch about 0.1mm lower than the bed as an emergency stop.

Any suggestions on this would be helpful.

Thanks,
Mark
Sorry, only registered users may post in this forum.

Click here to login