Auto bed probing and compensation with G29 Development

Want to use the Open Source Hardware documentation to make your LulzBot 3D Printer do even more? Start here!
Post Reply
1013
Posts: 339
Joined: Thu May 23, 2013 9:56 am

Auto bed probing and compensation with G29 Development

Post by 1013 » Wed Jun 26, 2013 12:59 pm

The marlin firmware has G29 to G32 built in, and I want to try and use it. This will require adding a probe (preferable stowable), and some extra G-code.
G29-G32: Bed probing
G29 Detailed Z-Probe
probes the bed at 3 points.
G30 Single Z Probe
probes bed at current XY location.
G31 Report Current Probe status
reports whether Z probe is triggered.
G32 Probe Z and calibrate with FPU
probes the bed at 3 points and updates transformation matrix for bed leveling compensation.
G32 would be the code to use, and apparently the probe is just hooked up in parallel to the Z end stop.
Not sure where the probing positions are stored, but it can probably be set to whatever.

Now how do we get it mounted to the TAZ? it would have to be stowable after probing is done.

EDIT: should be G29, not G32

EDIT:
FIles are going up on thingiverse.
Anti-backlash Z-nut and motor to M6 couplers (needed to make the Z-probing compensation accurate):
http://www.thingiverse.com/thing:117950

Bed probing parts:
http://www.thingiverse.com/thing:117957

G-code for bed probing (use as the custom G-code in Slic3r at the beginning of each program). You may need to adjust the X positions for the deploy and retract positions since every machines X limit switch may be in a different position.
bed_level_W_probe.gcode
(534 Bytes) Downloaded 593 times

Code: Select all

M203 X192 Y208 Z4 ; set max rapid rates mm per sec
G91; set to incremental motion
G1 Z10.0 F11520; raise Z
G90; set to absolute motion
G28 X0 Y0; home X and Y axes
G1 X276 F11520; go to probe deployment position
G1 X288 F350; deploy probe
G1 X250 F11520; go to safe place
G28 Z0; Home Z axes
G29; probe bed
G1 Z12.0 F240; raise probe off bed
G1 X14 F11520; go to probe retract position
G1 X0.5 F350; retract probe
G1 X1 F350; move away from limit switch 
M206 X0.0 Y0.0 Z0.0; offset home position for fine tuning
and the Configuration.h file for the TAZ with the probing. You will have to adjust the "probe offset from extruder" position settings when you calibrate your own probe, but this should get you close.
Configuration.h
use this config file in place of the one from github
(16.83 KiB) Downloaded 825 times
and the other firmware files you need to get probing working are found here: https://github.com/larsbrubaker/Marlin/ ... _Bed_Level

Also Geneb found the following things that need to be changed in the firmware too:
1. You'll need to change the Z axis micro-steps to 4 in Configuration_adv.h.
Look for the #define of MICROSTEP_MODES and change it like so:
#define MICROSTEP_MODES {16,16,4,16,16}

2. In Configuration.h, you'll need to make sure that you've got the extruder steps set correctly. If you've got a "Factory" built TAZ, the steps per MM for the extruder will be shown on the calibration sheet that came with the printer. For mine, it was 860, so I modified DEFAULT_AXIS_STEPS_PER_UNIT to use that value, as shown:
#define DEFAULT_AXIS_STEPS_PER_UNIT {100.5,100.5,800,860,800}

I'm pretty sure these are the only two "gotchas" in the process.
And he even put together this nice videos of the install process.
http://youtu.be/dNqr_FqxrYs
Last edited by 1013 on Tue Nov 05, 2013 11:20 am, edited 11 times in total.

User avatar
Orias
Aleph Objects | LulzBot
Posts: 1509
Joined: Wed Mar 27, 2013 1:24 pm
Location: US

Re: Auto bed probing and compensation with G32 Development

Post by Orias » Wed Jun 26, 2013 3:06 pm

Similar to this?


1013
Posts: 339
Joined: Thu May 23, 2013 9:56 am

Re: Auto bed probing and compensation with G32 Development

Post by 1013 » Wed Jun 26, 2013 6:36 pm

yup, similar.

but I was thinking that the probe would pivot, or be cammed down when the x carriage goes to the max X travel, and retracts when it goes to X0. that way whenever the machine homes, the probe is out of the way. but programs would have to be slightly limited in x, so they do not accidentally deploy the probe.

then the code to get it to work would be simple. something like:

G0 Z10 (to make sure there is room for the probe to deploy)
G0 X289 (go to max X to deploy probe)
G32 (run probe routine)
G0 x0 (retract probe)

1013
Posts: 339
Joined: Thu May 23, 2013 9:56 am

Re: Auto bed probing and compensation with G32 Development

Post by 1013 » Wed Jun 26, 2013 6:48 pm

some good info here, but very few pictures:
http://www.thingiverse.com/thing:31633


and this is closer to what I am thinking, but still not quite.
http://www.thingiverse.com/thing:89146 (but it has a video)

Tshulthise
Posts: 17
Joined: Mon May 20, 2013 11:11 am

Re: Auto bed probing and compensation with G32 Development

Post by Tshulthise » Thu Jun 27, 2013 10:47 am

Brainstorming...

I passed that autoprobe video to Jeff last week. What a great feature.

For a method to deploy the probe without using any travel, what about a Nichrome wire that pulls the probe up when the extruder heat is on and lets a light spring drop it into a stop when the extruder heat is off?

Tony

Tshulthise
Posts: 17
Joined: Mon May 20, 2013 11:11 am

Re: Auto bed probing and compensation with G32 Development

Post by Tshulthise » Thu Jun 27, 2013 10:57 am

IF the bed is level
AND
IF you use a 3 point plate securement system
AND
IF the build plate is flat within acceptable tolerance
THEN
your z probe could just touch 3 metal plates of a known thickness that are between the plate clamps and the build surface but stick out enough to touch off on. That would allow the system to check for level and z axis offset at the same time.

During manual leveling you would just need to run to three pre programmed points and turn the bed screw until a light comes on (inline with the probe power). Once all three securement points pass a go-no-go test you know your bed is level and the z-offset can be derived easily.

I haven't measured the flatness of the plate used on the TAZ but the plate used on the CubeX is flat within 0.001" (25 microns) which means once you get three points set to the same z height, everything else is good to go after applying an offset to set the z-axis offset. Unfortunately, CubeX has a terrible setup for table leveling which makes a 5 minute job take 1 hour. I just got a TAZ so I'll see what I can do to make the leveling and z-offset easier for it too.

1013
Posts: 339
Joined: Thu May 23, 2013 9:56 am

Re: Auto bed probing and compensation with G32 Development

Post by 1013 » Thu Jun 27, 2013 12:14 pm

I do not want to level the bed physically. just probe it and compensate in the program for it (at the beginning of every program). that is what G32 does. it compensates for the un-levelness automatically. Just like rotating a work piece coordinate.

I have plenty of extra X and Y travel in the TAZ, so I would like to use that to deploy and retract the probe....simpler is better, and adding the extra electronics for a deployment system is not simple, so I want to avoid it. Printing some parts for a deployment mechanism is easy enough.


1013
Posts: 339
Joined: Thu May 23, 2013 9:56 am

Re: Auto bed probing and compensation with G32 Development

Post by 1013 » Sat Jun 29, 2013 11:06 am

got my basic design done.

probe drops during the last 22mm of x travel to the right, and retracts when homed. I was hoping to not use more than 12mm, so i still might tweak it some. took some work to get that cam system right though.

right now it is activated by the x rod holders, but I could have it activate by something attached to the frame, at a specific Z height only, or something attached to the bed, at a specific Z and Y position only. this would help prevent inadvertent deployment if you had a large print.
Attachments
probe down.jpg
probe down
probe up.jpg
probe up

1013
Posts: 339
Joined: Thu May 23, 2013 9:56 am

Re: Auto bed probing and compensation with G32 Development

Post by 1013 » Mon Jul 01, 2013 5:53 pm

BTW, looks like the firmware does need to be updated for this to work.

bed leveling firmware is here: https://github.com/larsbrubaker/Marlin/ ... _Bed_Level
and in the config file is where the probe coordinates and probe offsets are stored.

Post Reply