Correction of heightmap is not really working
-
-
@fcwilt yes thanks for helping,
what should I do next
-
@icy_snake said in Correction of heightmap is not really working:
@fcwilt yes thanks for helping,
what should I do next
I organize by code somewhat differently than is perhaps the most common. Are you aware of the M98 command which allows running one .g file from another .g file?
For example I mentioned that when you make changes to the G31 command in the config.g file you have to reboot or reset the printer to get the config.g file processed to apply the changes.
I prefer to put the M950, M558 and G31 commands need for configuring the Z probe into a separate file, which I name config_probe.g, but the name can be anything you like. Then any code, like the code in bed.g or mesh.g, that is going to use the Z probe, includes the command M98 P"config_probe.g" which results in the Z probe configuration being updated to the current values in config_probe.g.
Does that make sense to you? Do you understand what I am doing and why? I understand you are new to all this and I don't want to confuse you but I do want to get you started on the right track and help you understand the "how and why" of things.
Frederick
-
@fcwilt yes i looked at m98.
makes sense to me.
So have different files which will be called.
Fine.
so lets start with config_probe.g
I have all 3 files config_probe.g, bed.g, mesh.g open now for input
Iยดm using version 3.3 on the software
-
Hi,
Here is an example of a config_probe.g" file adjusted to use the values from your files. The G31 Z parameter is the one that needs to be "tweaked" to reflect your actual hardware and get accurate probe readings.
M950 S0 C"duex.pwm5" M558 P9 C"zprobe.in" H5 F120 T6000 A5 R0.7 G31 P500 X-18 Y24 Z2.917
Here is an example of a bed.g file adjusted to use the values from your files. It uses a while loop to execute a leveling pass up to five times (or any other number you want) stopping when any pass reports the bed is level "enough" based on checking the object model value move.calibration.initial.deviation. This file assumes the printer is currently homed.
M98 P"config_probe.g" ; insure probe is using most recent configuration values G29 S2 ; cancel mesh bed compensation M290 R0 S0 ; cancel baby stepping G90 ; absolute moves G1 Z5 F99999 ; insure Z starting position is high enough to avoid probing errors ; M671: Define positions pf manual bed levelling screws or Z leadscrews ; Xnn:nn:nn... list of between 2 and 4 X coordinates of the leadscrews that drive the Z axis or the bed levelling screws ; Ynn:nn:nn... list of between 2 and 4 Y coordinates of the leadscrews that drive the Z axis or the bed levelling screws ; Snn maximum correction allowed for each leadscrew in mm (optional, default 1.0) ; Pnnn pitch of the bed levelling screws (not used when bed levelling using independently-driven leadscrews). Defaults to 0.5mm which is correct for M3 bed levelling screws ; Fnn fudge factor, default 1.0 M671 X-189:-189:645:645 Y645:-64:-64:645 S10 ; Anticlockwise ; --- level bed --- while true ; run leveling pass G30 P0 X2 Y20 Z-99999 ; Probe near a leadscrew G30 P1 X600 Y20 Z-99999 ; Probe near a leadscrew G30 P2 X600 Y600 Z-99999 ; Probe near a leadscrew G30 P3 X2 Y600 Z-99999 S4 ; Probe near a leadscrew if move.calibration.initial.deviation < 0.02 break ; check pass limit - abort if pass limit reached if iterations = 5 M291 P"Bed Leveling Aborted" R"Pass Limit Reached" abort "Bed Leveling Aborted - Pass Limit Reached" ; --- finish up --- ; --- set Z=0 datum which can be affected by leveling --- G1 Xaaa Ybbb ; move probe to center of bed - set values aaa and bbb as appropriate G30 ; do single probe which sets Z to trigger height of Z probe
-
@fcwilt
ok
so far.G1 x300 y300
-
@icy_snake said in Correction of heightmap is not really working:
@fcwilt
ok
so far.G1 x300 y300
Good.
I suppose at this point we should re-visit all of your homing files. So please post, using the </> tag once per file, all four of your homing files.
Frederick
-
@fcwilt
</ homeall.g>
M280 P0 S60 I1
G91 ; relative positioning
G1 H2 Z5 F200 ; lift Z relative to current position
G1 H1 X-605 Y605 F3000 ; move quickly to X and Y axis endstops and stop there (first pass)
G1 H2 X5 Y-5 F600 ; go back a few mm
G1 H1 X-605 Y605 F600 ; move slowly to X and Y axis endstops once more (second pass)
G90 ; absolute positioning
G30 ; home Z by probing the bed
</>< /homex.g>
; homex.g
; called to home the X axis - DUAL ENDSTOPS
G91 ; relative positioning
M913 X50
G1 H1 X-605 F3000 ; move quickly to X axis endstop and stop there (first pass)
G1 H2 X5 F600 ; go back a few mm
G1 H1 X-605 F600 ; move slowly to X axis endstop once more (second pass)
M913 X100
G1 H2 Z-5 F200 ; lower Z again
G90 ; absolute positioning
</>< homey.g
; homey.g
; called to home the Y axis
G91 ; relative positioning
G1 H2 Z5 F200 ; lift Z relative to current position
G1 H1 Y605 F3000 ; move quickly to Y axis endstop and stop there (first pass)
G1 H2 Y-5 F600 ; go back a few mm
G1 H1 Y605 F600 ; move slowly to Y axis endstop once more (second pass)
G1 H2 Z-5 F3000 ; lower Z again
G90 ; absolute positioning< homez.g
; homez.g
; called to home the Z axis
M280 P0 S60
G91 ; relative positioning
G1 H2 Z5 F200 ; lift Z relative to current position
G90 ; absolute positioning
G30 ; home Z by probing the bed< rehome.g
M280 P0 S60
G91 ; relative positioning
G1 H2 Z5 F200 ; lift Z relative to current position
G1 H1 X-605 Y605 F3000 ; move quickly to X axis endstop and stop there (first pass)
G1 H2 X5 Y-5 F600 ; go back a few mm
G1 H1 X-605 Y605 F600 ; move slowly to X and Y axis endstops once more (second pass)
G90thats ok so?
-
Here is an example of a mesh.g file adjusted for your values.
M98 P"config_probe.g" ; insure probe is using most recent configuration values G29 S2 ; cancel mesh bed compensation M290 R0 S0 ; cancel baby stepping G90 ; absolute moves ; --- set Z=0 datum which is needed for creating a heightmap G1 Z5 F99999 ; insure Z starting position is high enough to avoid probing errors G1 Xaaa Ybbb ; move probe to center of bed - set values aaa and bbb as appropriate G30 ; do single probe which sets Z to trigger height of Z probe M557 X20:600 Y20:620 S58 ; define mesh grid 420 points S58 G29 S0 ; probe bed and create height map
-
@fcwilt ok understand
-
When homing the Z axis with a G30 you need to precede it with a G1 command to move to the center of the bed.
I don't know what the M280 P0 S60 is for - I don't have it in my code.
You also have some M913 commands - I have not found it necessary to use those.
You have a file rehome.g - what is that for?
Frederick
-
@fcwilt
I have no idea for what they are using M280, because i have no servo to set any position.Not sure why they change the current for the stepping motors.
I believe they copied many codes together to get it running
-
@icy_snake
@fcwilt ok understandso we have the bed.g and the mesh.g
now we need to finish the config_probe.g to call the others?
I have the following questions.
How will i get the z-offset value in the g31 command?
do we also generate a z_offset.g?
thx
Dieter -
@icy_snake
Frederick are you there?? -
I made a mistake on the mesh.g file and have edited it to include the call to config_probe.g.
The bed.g file already had it.
Since the Z parameter for G31 is pretty much "set and forget" I don't use any sort of macro to set it.
I do have a macro to set the Z=0 Datum at the center of the bed - which consists of the G1 command to move to the center of the bed and the G30 command to probe and set the Z=0 datum.
At that point you can verify that the Z=0 Datum was set correctly by using the DWC "jog" buttons to move to Z=0.
If you end up touching the bed before reaching Z=0 then the Z parameter in the G31 is too large by the value displayed for Z.
If you reach Z=0 and are not just touching the bed then the Z parameter in the G31 is too small by the size of the gap between the nozzle tip and the bed.
Once I have determined the value needed, I edit the config_probe.g file and run the Z=0 Datum macro again to be sure all is good.
Frederick
-
I also forgot to mention that you should include an M98 P"probe_config.g" command in the config.g file just so the probe is configure after a reboot or reset.
Frederick
-
@fcwilt said in Correction of heightmap is not really working:
M98 P"probe_config.g"
ok i added it. not problem
-
@fcwilt the new z-value is 3.025
-
@icy_snake said in Correction of heightmap is not really working:
@fcwilt the new z-value is 3.025
That sounds very reasonable.
Frederick
-
@fcwilt good so far