Microswitch for Z-probing
-
Ok, been a while since I was able to do some work on this but I thing things are nearly sorted. This is a board swap on a Up Plus 2 printer that comes with a nozzle height detection switch on the platform and a microswitch that is used for bed level correction.
Homing runs on the end of axis limit switches.
The bed.g is as follows:
M561
; Use a normally open (I1) switch connected to E1 limit (P6).
; Probe speed of 500mm/min and travel between points of 6000mm/min
M558 P6 X0 Y0 Z1 H5 I1 F500 T6000
; Set up the offsets for the switch.
G31 X0 Y10 Z18.1
; Four clockwise probe points and centre.
G30 P0 X10 Y10 Z-99999
G30 P1 X41.25 Y10 Z-99999
G30 P2 X72.5 Y10 Z-99999
G30 P3 X103.75 Y10 Z-99999
G30 P4 X72.5 Y63.75 Z-99999 S0
; Move to the head.
G1 Z20 F6000I've a macro that I run after that sets the zero level by touching the head on the platform switch as follows:
G1 X0 Y63.75 Z10 F6000
; Use a normally open (I1) switch connected to E0 limit (P4).
; Probe speed of 500mm/min and travel between points of 2000mm/min
M558 P4 I1 X0 Y0 Z1 F500 T2000 H30
G31 X0 Y0 Z0
G30
G92 Z0
G1 X72.5 Y63.75 Z80 F6000So my start up procedure for the user is:
G28 to home all axis
Fit the bed level microswitch
G32 to run bed level compensation
Remove the bed level microswitch
M98 P/macros/NozzleHeightHow do you add more points to the bed level correction for averaging?
Edit: thought the -99999 was a dive height on the G30. It's not. Goes screwy with z-20!
Edit2 Needed a G92 Z0 in the nozzle height macro. -
I don't understand why you needed a G92 Z0 command in your macro. A successful G30 command with no other parameters will set the Z height to the configured trigger height, which you have set in the preceding command to zero.
You are using the old 5-point bed compensation scheme. This has been superseded by mesh bed compensation (G29).
-
After the G30 command the web control was reporting a Z position of 0.52mm. I'll have another look this evening but that is why I added the reset to 0.
I'll read up on the G29. I thought this was for correcting for an uneven beds? If so how does it deal with a wonky bed. Does it remap the head path to move relative to the bed surface then gradually move back to moves parrallel to the x-y plane? In other words if I printed a solid block would the final surface match the debiations detected by the G29 process?
If the G32 or G29 does detect a tilt on the bed plane does it realign the z-axis to be equal to normal of the tilted bed, or keep the centre of each layer in the same position relative to the machine's x/y axis?
Feel free to answer with a webpage for further reading!
-
I've repeated the tests and not seen the same issue that led me to believe I needed the z=0 current position reset, Not sure what was going on but I can't repeat that. Other questions about the build platform normal and whether the layers gradually corret from a wonky bed still stand.
-
-
Thanks, I'll make sure that is in my configuration file.
Is that being applied to both correction for unevenness and z-axis to build surface normal correction? Is the axis to normal correction corrected for by rotating the whole dataset or a skew where only the z-component gets altered?Does the build simulation warn if
build surface normal, buid surface unevenness, orthe octagonal correction shift data out of the buildable volume? Bit of a delay to the build process but it would appear advisable to run the simulation after G32 if these warnings are presented.Edit: Strikes added because found bed mesh correction is applied to z only.
-
The wiki would appear to suggest the mesh bed compensation is a correction to the nozzle z-position only.
This bit concerns me though: "On a Cartesian printer, you can use either mesh levelling (G29) or G30/G32 probing, not both."Does this mean that I can't run a single G30 to set the z=0 plane after G29? If the G30 resets the height map can I run g29, then g30, then g29 S1 to reload the height map? I appreciate hardware changes would simplify this but that is not an option at this juncture.For other readers here is the wiki page: https://duet3d.com/wiki/Using_mesh_bed_compensation
Edit: Lack of sleep, but questions self answered! Strikes added.
-
This is a good read through for others learning bed mesh compensation:
https://www.duet3d.com/forum/thread.php?id=499&p=1
I understand now why G30 and G29 don't play well together. I need my nozzle height macro to define an offset rather than reset the global position. I need to read up on the macros and gcode a bit more.
-
Here is a video of the two switches in action: https://m.youtube.com/watch?v=kpatyPvD5oU
I was hoping to avoid the need for the user to read and write gcode strings but I think the following is the best procedure:
(user)
Load bed level switch.
(macro1)
Home machine
Move to over nozzle height switch and run g30 to reset on bed level switch trigger.
Run g29
(user)
Unload bed level switch
Connect nozzle height switch.
(macro2)
Move to over nozzle height switch and run g30 s-1 to move until nozzle height swith is triggered
(user)
Use value from m114 to set tool z offset.Edit: added user/macro sections for clarity.
-
Macro - init1
M80
M561
G28
M558 P6 X0 Y0 Z1 H5 I1 F500 T6000
G31 X0 Y0 Z0
G1 X0 Y53.75 Z25 F6000
G30
G1 Z15
M558 P6 X0 Y0 Z1 H5 I1 F500 T6000
G31 X0 Y10 Z0
G29
G1 X0 Y53.75 Z25 F6000Macro - init2
G1 X0 Y63.75 Z-10 F6000
M558 P4 I1 X0 Y0 Z1 F50 T2000 H30
G31 X0 Y0 Z0
G30 S-1User tool offset (applying -1 * value reported to console eg: "Stopped at height -17.587 mm")
G10 P0 X0 Y0 Z-17.587
Ok, redoing the full G29 each time seems a little extreme but the build surface is removed for each build and isn't extremely rigid. Besides the build surface heater is underpowered and it takes over 15 min to reach temperature, so the time cost of the g29 doesn't seem too bad!