Octoprint, Custom Controls, and Bed Leveling

Have questions or comments about Simplify3D, Slic3r, Cura, Reptier, etc? Or wondering about which CAD software to use...discuss it here...
Post Reply
User avatar
zemlin
Posts: 467
Joined: Thu Feb 04, 2016 9:32 pm
Location: Indianapolis, Indiana

Octoprint, Custom Controls, and Bed Leveling

Post by zemlin » Mon Mar 27, 2017 1:02 am

Been putting the Custom Control plug for Octoprint to use lately. I have a Rev E machine in an enclosure in the garage, so using the Quick Start to level the bed was a bit of the pain as I had to haul the laptop out there, unplug the PI, etc ...

So today I decided to add a section of Custom Controls for bed leveling within Octoprint.

First off, I have set Z-Offsets I use for my different beds, and I set my Z height by running the Z-Axis up to -.13 (.005") and dropping the nozzle down onto the shim stock. FWIW, in the heated enclosure I have to set a significantly larger gap, as thermal expansion of all the components matters.

So here's my custom control section:
Capture.JPG
With "Center" I set my initial height, and also use that as the starting point for leveling. For leveling I'll use the same .005" shim that comes with the RevE machine. I use the Z-UP and DOWN controls until I JUST feel drag, basically like in the quick start application. I then use the 4 corner positions to adjust the bed. Before any movement the buttons drop the bed by 1mm and then raise it back up at the end to prevent dragging.

Did my first leveling with this and it worked great.

Here are the scripts I have behind the buttons. I have a dual, so single owners can tweak the X-values of the moves.

Center:
G91
G1 Z1
G90
G1 X80 Y125 F3600
G91
G1 Z-1

Left Front:
G91
G1 Z1
G90
G1 X15 Y35 F3600
G91
G1 Z-1

Left Rear:
G91
G1 Z1
G90
G1 X15 Y215 F3600
G91
G1 Z-1

Right Front:
G91
G1 Z1
G90
G1 X160 Y25 F3600
G91
G1 Z-1

Right Rear:
G91
G1 Z1
G90
G1 X160 Y225 F3600
G91
G1 Z-1

Z Up 0.10:
G91
G1 Z-0.10

Z Down 0.01:
G91
G1 Z0.01

3dPrintingMD
Posts: 277
Joined: Fri Oct 02, 2015 5:37 am

Re: Octoprint, Custom Controls, and Bed Leveling

Post by 3dPrintingMD » Mon Mar 27, 2017 2:43 pm

I would like to hear more about the offsets. I have a few different print surfaces/beds, and this would be awesome to have so I can set it easily upon swapping beds.
M2 - V4, MIC-6 Build Plate, Astrosyn Damper's(X/Y), Rev. E, Geeetech LCD

S3D - FFF Settings https://forum.simplify3d.com/viewtopic.php?f=8&t=2367
Print Quality Troubleshooting https://www.simplify3d.com/support/prin ... eshooting/

User avatar
zemlin
Posts: 467
Joined: Thu Feb 04, 2016 9:32 pm
Location: Indianapolis, Indiana

Re: Octoprint, Custom Controls, and Bed Leveling

Post by zemlin » Fri Mar 31, 2017 3:37 am

To enter a Z-Offset for a specific bed thickness, home Z first then, the command is
M206 ZX.XX ; set z offset
M500 ; store settings

I think I got my initial value after running through the quick-start program with glass and did an M503 to see the settings.

My glass offset is 8.91. For my 1/4" aluminum with PEI it's 3.95. I have a piece of 1/4" G10 that I don't use for anything, but it is 7.69.

Since a bed swap usually corresponds with a material change, I pull the old material and let the nozzle cool. Once it's close to room temp I will set the Z-Offset which I now do with custom controls in Octoprint (you can see the buttons above).

A typical script for a button is:
M206 Z3.95 ; set offset
M500 ; store settings
G91;
G28 Z0 ; home Z
G90 ;

Then I move the platform to .13mm from zero.
G90;
G1 Z0.13 F3600

With the platform in that position I loosen the nozzle clamp and slip the blue shim stock between the nozzle tip and the bed.
I have some additional offset buttons with small offset adjustments so I can dial in the first layer thickness if needed.

Make sense?

3dPrintingMD
Posts: 277
Joined: Fri Oct 02, 2015 5:37 am

Re: Octoprint, Custom Controls, and Bed Leveling

Post by 3dPrintingMD » Fri Mar 31, 2017 6:00 pm

Question, is this a Rev E machine you are using?
M2 - V4, MIC-6 Build Plate, Astrosyn Damper's(X/Y), Rev. E, Geeetech LCD

S3D - FFF Settings https://forum.simplify3d.com/viewtopic.php?f=8&t=2367
Print Quality Troubleshooting https://www.simplify3d.com/support/prin ... eshooting/

User avatar
zemlin
Posts: 467
Joined: Thu Feb 04, 2016 9:32 pm
Location: Indianapolis, Indiana

Re: Octoprint, Custom Controls, and Bed Leveling

Post by zemlin » Fri Mar 31, 2017 8:16 pm

3dPrintingMD wrote:Question, is this a Rev E machine you are using?
Yes, but I imagine the offsets would work just as well with the top-side stop.
{edit} as I think through this a bit more ... a switch-on-top machine homes before printing by running all the way up ... so firmware offsets are not going to work. If you set the stop bolt for the thickest plate, then on a thin plate the switch will be hit before the nozzle is close to the plate. With the inverse - the switch set to a thin plate and a thick plate on the machine, the nozzle will strike the plate when the machine attempts a Z-Axis HOME.
[/edit]

User avatar
ednisley
Posts: 1188
Joined: Fri Apr 11, 2014 5:34 pm
Location: Halfway up the Hudson
Contact:

Re: Octoprint, Custom Controls, and Bed Leveling

Post by ednisley » Fri Mar 31, 2017 11:49 pm

zemlin wrote:the nozzle will strike the plate
Move the nozzle off the platform to the max X side before homing Z; you must have already homed X, which may require moving the platform downward to ensure clearance. Kinda like this:

Code: Select all

G1 X130 Y0 F30000	; move off platform to right side, center Y
G28 Z0			     ; home Z with switch near center of platform
G92 Z-4.55		    ; set origin to measured z offset
That's with my screwball XY origin at the middle and the switch attached to the gantry, so it senses the actual top of the platform, no matter how thick the glass / PEI / aluminum / tortilla chip might be.

You could store the home offsets in EEPROM if you prefer. I keep them in plain sight, where they're easier to change, but I'm a fuddy-duddy.

86bg
Posts: 13
Joined: Fri Mar 17, 2017 1:46 am

Re: Octoprint, Custom Controls, and Bed Leveling

Post by 86bg » Mon Apr 03, 2017 6:01 am

Is there not a command that sets the current machine Z position as the Z offset? Coming from real CNC machines, this read, type, write to eeprom, then home process is cumbersome. I guess it can be resolved in Octoprint with a plugin if there is not one already available. I didn't see it.

User avatar
ednisley
Posts: 1188
Joined: Fri Apr 11, 2014 5:34 pm
Location: Halfway up the Hudson
Contact:

Re: Octoprint, Custom Controls, and Bed Leveling

Post by ednisley » Mon Apr 03, 2017 1:34 pm

86bg wrote:Is there not a command that sets the current machine Z position as the Z offset?
The RepRap dialect of RS-274 evolved pretty much independently of actual machine tools, with features heavily constrained by underpowered 1990-era microcontrollers: all the handy features I took for granted in LinuxCNC simply weren't there. Worse, some commands produce completely different results.

I pulled together a comparative command list that's now four years out of date:
http://softsolder.com/2013/03/14/g-code ... ster-list/

You're probably thinking of the G92 commands, which don't do the same things in RepRap as they do in, say, LinuxCNC.

LinuxCNC also makes system variables available to the G-Code through numeric #address references. Those let you access the current coordinates / offsets / conditions / whatever, perform arithmetic on them, and set them to different values. Marlin doesn't provide programmatic access to the interpreter's internal state, nor does it allow arithmetic manipulation of numeric values; it's that microcontroller thing.

Post Reply