Mesh Bed Compensation Screwy

Avatar

By pcsentinel 7 March 2017 18:27

Member · 42 comments

Update on G30 four point probing. Now I have actually read DC42's comment (sorry must have overlapped) I have set the four poits clockwise from minor XY as per

G30 P0 X49 Y49 H0 Z-99999
G30 P1 X49 Y149 H0 Z-99999
G30 P2 X149 Y149 H0 Z-99999
G30 P3 X149 Y49 H0 Z-99999 S

it looks like the four pointer is working, the results are
G32
Bed equation fits points [49.0, 49.0, -0.118] [49.0, 149.0, -0.156] [149.0, 149.0, 0.162] [149.0, 49.0, -0.093]

So my final bed.g looks like

; bed.g
; called to perform automatic bed compensation via G32
;
; generated by RepRapFirmware Configuration Tool on Sun Feb 26 2017 13:25:00 GMT+0000 (GMT Standard Time)
G90
; Clear any bed transform
M561

; Probe the bed at 4 points CLOCKWISE!
G28
G30 P0 X49 Y49 H0 Z-99999
G30 P1 X49 Y149 H0 Z-99999
G30 P2 X149 Y149 H0 Z-99999
G30 P3 X149 Y49 H0 Z-99999 S
G1 X0 Y0

Also my Home Z and Home All now have

G1 X1 Y21 F6000
G30

becuase my X offset of the probe from the extruder is 48 and Y offset is 28 and G30 instructions account for the offset in the instructed points.

Hope this helps anyone else who is suffering.

Last edited by pcsentinel (7 March 2017 19:08)

Avatar

By pcsentinel 7 March 2017 19:37

Member · 42 comments

Hi All, can I now confirm that I amprinting the four squares test succesfully. thanks for your help.

DC42 as a suggestion, might it be worthwhile adding the above fledged out with a little explanation to the Wiki, at least for those of us that are using Glass Beds on a Cartesian?

Avatar

By deckingman 7 March 2017 20:00

Member · 702 comments

@pcsentinel. Glad you got it sorted. A couple of points. You seem to only be doing the bed compensation for 100mm x 100mm of the bed area. It's usually best to probe close to the 4 extreme corners of the axes movements so that you cover the entire printable area. Also, your Z homing example seems to indicate that you are homing Z at one corner of the bed and it's usually better to do the Z homing at the centre of the bed, because that is where the majority of your printing will take place and therefore where you need the most accuracy. HTH
Ian


Avatar

By pcsentinel 7 March 2017 22:33

Member · 42 comments

Ok, thanks I tried that, but because of my offset when I go to postion 2 on the grid with
G30 P1 X49 Y189 H0 Z-99999
the nozzle is hitting the bed and compressing the carriage before te sensor is activated therefor throwing off the reading

Avatar

By dc42 8 March 2017 08:05

Administrator · 2,256 comments
pcsentinel wrote

Ok, thanks I tried that, but because of my offset when I go to postion 2 on the grid with
G30 P1 X49 Y189 H0 Z-99999
the nozzle is hitting the bed and compressing the carriage before te sensor is activated therefor throwing off the reading

I think you must have a severely tilted bed. You can increase the Z probe dive height - it's the H parameter in the M558 command. But it's better to get the bed more level than to rely on a lot of compensation.


Duet WiFi hardware designer and firmware engineer
http://www.escher3d.com
https://miscsolutions.wordpress.com

Avatar

By GrodanB 10 March 2017 13:53

Member · 19 comments

Is it possible for me to test before a firmware is released?

Avatar

By pcsentinel 11 March 2017 16:52

Member · 42 comments

Further unknown with 4 point plane. Sorry I know this is under Mesh, but its where all the previous comments are.

I extended my four points to be wider but obviously still keep the probe over the bed.

I then thought I would check each four points without any compensation, i.e. drop nozzle to just hold paper, set z to 0, raise head by 5mm and do G30 S-1.  and then check repeatability. the result are below that seem to indicate that the points all have different trigger heights but repeatability at each point is good.

      Nozzle X    Nozzle Y     Probe X    Probe Y           G30 S-1           G30 S-1         G30 S-1             Average        Offset from P1
Point 1    1        1            49        29        0.385        0.382        0.38                0.382333333    0
Point 2    1        161            49        189        0.298        0.298        0.303        0.299666667    -0.082666667
Point 3    131        161            179        189        0.157        0.153        0.155        0.155        -0.227333333
Point 4    131        161            179        189        0.185        0.185        0.188        0.186        -0.196333333


My settings in coonfig.g are
M558 P1 X0 Y0 Z1 H5 F120 T6000 ; Set Z probe type to unmodulated, the axes for which it is used and the probe + travel speeds
G31 P500 X48 Y28 Z0.382333333 ; Set Z probe trigger value, offset and trigger height

I therefor mofidied my bed.g to

; bed.g
; called to perform automatic bed compensation via G32
;
; generated by RepRapFirmware Configuration Tool on Sun Feb 26 2017 13:25:00 GMT+0000 (GMT Standard Time)
G90
; Clear any bed transform
M561

; Probe the bed at 4 points CLOCKWISE!
G28
G30 P0 X49 Y29 H0 Z-99999
G30 P1 X49 Y189 H-0.082666667 Z-99999
G30 P2 X179 Y189 H-0.227333333 Z-99999
G30 P3 X179 Y29 H-0.196333333 Z-99999 S
G1 Z5
G1 X0 Y0

But after I ran the bed compensation I then went back to each probe point and dropped the Z to 0 over the piece of paper, at all points the paper was trapped until I lifted the nozzle 0.3mm. So I added:
G1 Z0.25
G92 Z0
into the bed.g before the G1 Z5 and now everything seems to be working, but I am really mystified why I have to push the the height up by 0.25 does anyone know?

Avatar

By pcsentinel 12 March 2017 17:25

Member · 42 comments

Hi, re previous post, can anyone enlighten me as really confused?

Avatar

By GrodanB 13 March 2017 08:31

Member · 19 comments

Hi

Would like to help but I think I asked the same or related question above... I suspect there is some thing weird in how the compensation is used...

Could be the interpolation issue now look at and hopefully corrected.

That is why I offered to test... As soon a beta is available that has the fix for interpolation I will try it... Since interpolation is probably used in the application of the correction also... My guess after 17 years in embedded software development...

Avatar

By dc42 13 March 2017 12:09

Administrator · 2,256 comments

I've just released firmware 1.18beta2 which includes fixes for mesh bed compensation when the head is outside the points actually probed. My thanks to ChristophPech for the fixes.


Duet WiFi hardware designer and firmware engineer
http://www.escher3d.com
https://miscsolutions.wordpress.com

Avatar

By pcsentinel 13 March 2017 12:28

Member · 42 comments

so are we saying that the same compensation routine may also be used in 4 point plane correction?

Avatar

By dc42 13 March 2017 13:01

Administrator · 2,256 comments
pcsentinel wrote

...
But after I ran the bed compensation I then went back to each probe point and dropped the Z to 0 over the piece of paper, at all points the paper was trapped until I lifted the nozzle 0.3mm. So I added:
G1 Z0.25
G92 Z0
into the bed.g before the G1 Z5 and now everything seems to be working, but I am really mystified why I have to push the the height up by 0.25 does anyone know?

What XY coordinates to you use when you home the Z axis, in homez.g and homeall.g?


Duet WiFi hardware designer and firmware engineer
http://www.escher3d.com
https://miscsolutions.wordpress.com

Avatar

By GrodanB 13 March 2017 13:49

Member · 19 comments
dc42 wrote

I've just released firmware 1.18beta2 which includes fixes for mesh bed compensation when the head is outside the points actually probed. My thanks to ChristophPech for the fixes.

And thank you for the update. Will try a new first layer ASAP. Just need to get home from work first.

Avatar

By hairy_kiwi 13 March 2017 14:14

Member · 34 comments

I'm just about to flash 1.18beta2, but wanted to check where, if anywhere in particular, should homez.g and homeall.g be run?

I'm seeing very similar results with 1.18beta1 on a couple of points other people have raised:

Using 1.18beta1 and homing z in homez.g and homeall.g at the bed center, while printing a 50x50x1.8mm solid cube at the bed center:
- during first layer, I needed to Baby step z to +0.3mm (i.e. one print layer height) to prevent the first layer being badly squashed, despite z-homing to be accurate to ±0.025mm (gauged with a piece of note paper, itself checked with a digital 0.001mm/0.00005" micrometer).

- Initially I used z-taper of 3.0 mm (M376 H3.0) but didn't see any visible z motion during the entire print, so reduced it to M376 H0.6. That resulted in quite a coarse z-compensation motion in one corner, but only AFTER 0.6mm z-height:

wiener90_mesh_results_top_01_600px.png?dl=1
wiener90_mesh_results_bottom_01_600px.png?dl=1

The results above were achieved using the following 9-point height map:

RepRapFirmware height map file v1 generated at 2017-02-12 13:15, mean error -0.00, deviation 0.05
xmin,xmax,ymin,ymax,radius,spacing,xnum,ynum
25.00,165.00,15.00,155.00,-1.00,70.00,3,3
  0.011,  0.013, -0.023
  0.070,  0.064, -0.013
 -0.051,  0.018, -0.095

Just before 1.18beta2 was announced, I generated the following 25-point height map, checked a couple of times; deviation repeatability is within ±0.01mm. (I'll recheck this with  1.18beta2):

RepRapFirmware height map file v1, mean error 0.01, deviation 0.04
xmin,xmax,ymin,ymax,radius,spacing,xnum,ynum
25.00,165.00,15.00,155.00,-1.00,35.00,5,5
  0.011,  0.015, -0.007,  0.010, -0.026
  0.024,  0.053,  0.062,  0.041, -0.013
  0.073,  0.061,  0.059,  0.040, -0.011
  0.032,  0.051,  0.066,  0.040, -0.031
 -0.038, -0.036,  0.019, -0.049, -0.099

EDIT: pics added

Last edited by hairy_kiwi (15 March 2017 13:36)

Avatar

By dc42 13 March 2017 14:48

Administrator · 2,256 comments

If you are using mesh bed compensation and also using the Z probe to do Z homing, then you should Z home with the probe over a point that is on the grid. Otherwise the interpolated bed height at that point may not be exactly the same as the probed bed height, leading to a difference in the Z=0 position.

I guess it might help if there was a version of the G30 command that lets you specify an XY position to probe for Z homing, just like G29 does. Otherwise you will need to take account of the probe X and Y offset yourself.


Duet WiFi hardware designer and firmware engineer
http://www.escher3d.com
https://miscsolutions.wordpress.com

Avatar

By GrodanB 13 March 2017 19:53

Member · 19 comments

Lets try this:
RepRapFirmware height map file v1 generated at 2017-02-13 20:49, mean error 0.15, deviation 0.08
xmin,xmax,ymin,ymax,radius,spacing,xnum,ynum
26.00,299.00,12.00,188.00,-1.00,16.00,18,12
  0.017,  0.127, -0.015,  0.007,  0.127,  0.000,  0.055,  0.127, -0.010,  0.105,  0.127, -0.005,  0.092,  0.080, -0.062,  0.075,  0.010, -0.043
  0.060,  0.012,  0.130,  0.037,  0.072,  0.185,  0.142,  0.127,  0.240,  0.137,  0.107,  0.235,  0.122,  0.127,  0.145,  0.057,  0.060,  0.112
  0.062,  0.197,  0.100,  0.030,  0.180,  0.115,  0.137,  0.225,  0.125,  0.182,  0.240,  0.102,  0.122,  0.158,  0.117,  0.135,  0.148,  0.075
  0.122,  0.182,  0.070,  0.175,  0.165,  0.110,  0.220,  0.117,  0.120,  0.275,  0.185,  0.117,  0.217,  0.150,  0.105,  0.190,  0.092,  0.060
  0.182,  0.150,  0.077,  0.240,  0.178,  0.192,  0.237,  0.275,  0.180,  0.280,  0.277,  0.180,  0.342,  0.148,  0.142,  0.245,  0.137,  0.172
  0.137,  0.297,  0.122,  0.172,  0.222,  0.168,  0.247,  0.270,  0.215,  0.270,  0.242,  0.212,  0.230,  0.220,  0.140,  0.232,  0.190,  0.125
  0.120,  0.202,  0.205,  0.158,  0.250,  0.245,  0.165,  0.255,  0.295,  0.247,  0.287,  0.200,  0.155,  0.300,  0.320,  0.180,  0.307,  0.192
  0.205,  0.115,  0.185,  0.222,  0.210,  0.267,  0.202,  0.232,  0.303,  0.332,  0.225,  0.275,  0.262,  0.160,  0.197,  0.158,  0.158,  0.180
  0.135,  0.172,  0.178,  0.145,  0.265,  0.252,  0.172,  0.287,  0.188,  0.195,  0.280,  0.182,  0.230,  0.252,  0.135,  0.175,  0.257,  0.150
  0.092,  0.140,  0.057,  0.145,  0.155,  0.125,  0.207,  0.142,  0.120,  0.280,  0.162,  0.140,  0.197,  0.152,  0.142,  0.200,  0.140,  0.155
  0.070,  0.055,  0.037,  0.120,  0.107,  0.035,  0.142,  0.105,  0.142,  0.145,  0.097,  0.142,  0.142,  0.040,  0.148,  0.180,  0.075,  0.137
  0.017, -0.003, -0.028,  0.037,  0.002, -0.053,  0.095,  0.057, -0.023,  0.110, -0.010,  0.010,  0.033,  0.012,  0.055,  0.053,  0.015,  0.050

CktpWkv.png

o204mlB.png

Nope, this did not work... printed in the air... do not understand

Next try:

YmHpVWO.png

mwMMDMa.jpg

I do get the impression that there is some "overcompensation" done here...
I do not get the feeling when testing the bed that it is half a mm off but that is what the probe measures...

But this is much better.

Last edited by GrodanB (13 March 2017 21:50)

Avatar

By pcsentinel 14 March 2017 07:14

Member · 42 comments

Hi DC42in answer to your question, re four point plane above, I use the first probe point for HomeZ and HomeAll

Avatar

By GrodanB 14 March 2017 07:32

Member · 19 comments

In the override-config.g there is three G31 lines.

T1 had a z compensation number but not the X an Y. Why? I have this in my config.g file... But I do not have the T1 set in that file...

This is from my setup:
M558 P1 X0 Y0 Z1 H3 F200 T4000              ; Smart IR Z probe, used for homing Z axis, dive height 3mm, probe speed 200mm/min, travel speed 5000mm/min
G31 X-25.19 Y7 Z2.3 P500

I trigger the override-config.g later in the config.g file thus overriding my previous setup...

This could be the root cause to my "overcompensation" problem.

Now the main problem is the fact that this override-config.g is automatically generated.

Will test to do what is not recommended and that is to update the file.

I have the Z probe that came with my E3D Bigbox. Is that a type T1 probe then?

Why can't I set the probe placement relative to each tool separately?

Why do I have a T3 and T4 G31 in my automatically generated file?

I got hopeful that is was Tool 1 probe offsets in each G31...

The more I read the less I seem to understand how this work...

Last edited by GrodanB (14 March 2017 07:37)

Avatar

By CHP 14 March 2017 10:58

Member · 14 comments

@GrodanB
> Why can't I set the probe placement relative to each tool separately?
Because it has nothing to do with the tool offsets. Think of the IR-sensor as if it it's own tool.

Also your measured bed-matrix looks very inconsistent. I had the same problem on my BigBox in the past, the reason was that the angle of the IR-sensor was not parallel to the bed. I couldn't even change the angle because the screws of the sensor mount have made some groves.

The "correct" bed-matrix on the BigBox should look mostly flat with a slight bulge upwards in the center (this is due to the sag of the smooth rods)

Avatar

By dc42 14 March 2017 13:16

Administrator · 2,256 comments
GrodanB wrote

In the override-config.g there is three G31 lines.

T1 had a z compensation number but not the X an Y. Why? I have this in my config.g file... But I do not have the T1 set in that file...

This is from my setup:
M558 P1 X0 Y0 Z1 H3 F200 T4000              ; Smart IR Z probe, used for homing Z axis, dive height 3mm, probe speed 200mm/min, travel speed 5000mm/min
G31 X-25.19 Y7 Z2.3 P500

I trigger the override-config.g later in the config.g file thus overriding my previous setup...

This could be the root cause to my "overcompensation" problem.

Now the main problem is the fact that this override-config.g is automatically generated.

Will test to do what is not recommended and that is to update the file.

I have the Z probe that came with my E3D Bigbox. Is that a type T1 probe then?

Why can't I set the probe placement relative to each tool separately?

Why do I have a T3 and T4 G31 in my automatically generated file?

I got hopeful that is was Tool 1 probe offsets in each G31...

The more I read the less I seem to understand how this work...

Yes the IR sensor that came with the BigBox is a type 1.

Probe X and Y offset in the G31 command is relative to the head reference point, just like the G10 tool offsets. So you don't need a different probe offset for each tool. You can choose the head reference point wherever you like. If you have just one nozzle, then you would normally use the nozzle position as the head reference point. On my dual nozzle printer, I chose the head reference point to be mod way between the two nozzles.

RRF records separate G31 parameters for probe types 0 or 1 or 5, 3 and, 4 so that you can use more than one Z probe. Running M500 saves all of them. That's why you get G31 commands for probe types that you have not actually configured.

I just tried changing the probe offset by sending a G31 command with X and Y parameters, then I ran M500. The new offsets were correctly shown in the G31 command in config-override.g. Perhaps you last ran M500 when before you included X and Y offsets in your G31 command?


Duet WiFi hardware designer and firmware engineer
http://www.escher3d.com
https://miscsolutions.wordpress.com

Avatar

By GrodanB 14 March 2017 14:34

Member · 19 comments
CHP wrote

@GrodanB
> Why can't I set the probe placement relative to each tool separately?
Because it has nothing to do with the tool offsets. Think of the IR-sensor as if it it's own tool.

Also your measured bed-matrix looks very inconsistent. I had the same problem on my BigBox in the past, the reason was that the angle of the IR-sensor was not parallel to the bed. I couldn't even change the angle because the screws of the sensor mount have made some groves.

The "correct" bed-matrix on the BigBox should look mostly flat with a slight bulge upwards in the center (this is due to the sag of the smooth rods)

How did you fix it?


That is the way it looks when making a five point bed level... And one other thing that is weird: the five point bed level shows the corners approximately at the same height... But not the mesh level.

I have not the borosilicate glass but the PEI aluminum bed from Clever3D. So it MIGHT be less flat... But then again does not look that way when checking with a straightedge.

So test for tonight : somehow get the sensor more level... Is the one that is sold on duet3D better (although not more square) ?
I will try to set the bed height relative the nozzle with the bed level screws then somehow get the sensor more square to that...

Then I'll change my offset to the middle point of the print heads... (and verify that the new offset is recorded in the file after m500.)

Last edited by GrodanB (14 March 2017 14:36)

Avatar

By CHP 14 March 2017 15:14

Member · 14 comments

@GrodanB
(I have the Clever3D bed too, but not the black one, the metallic one)
I made this horrible IR-sensor mount: https://drive.google.com/file/d/0B-DBgm … sp=sharing
It's good for testing the influence of the angle but only a temporary measure before I switch to IDEX. You can easily misalign it by touching it the wrong way, also it only fits the pro-hybrid carriage with volcano.

Additionally my bed.g script turns off the lights before measuring and turns them back on after, but I'm almost sure that doesn't matter.

Avatar

By hairy_kiwi 15 March 2017 14:48

Member · 34 comments
dc42 wrote

If you are using mesh bed compensation and also using the Z probe to do Z homing, then you should Z home with the probe over a point that is on the grid. Otherwise the interpolated bed height at that point may not be exactly the same as the probed bed height, leading to a difference in the Z=0 position.

I guess it might help if there was a version of the G30 command that lets you specify an XY position to probe for Z homing, just like G29 does. Otherwise you will need to take account of the probe X and Y offset yourself.

Thanks for that.

I like your idea if I understand correctly: it would extending the G30 command to include XY motion AND take into account any already specified z-probe XY offset?


I've just had a play with 1.18beta2 and - unrelated to it - by chance discovered I have an issue with the reflectance of the window glass sitting on my heated bed PCB: The 'bunker' in the middle of the mesh in the image below is most probably the result of (unintentionally) z-probing over the center of the Prusa MKII-style PCB - exactly where the thermistor hole is located. This may explain my previously reported issue where I needed 0.3mm of baby stepping to correctly set z0.

Next, after performing G30 in a random location using the following macro (use with caution and best deleted when done to prevent inadvertently crashing tool or z-probe):

; Z-PROBE macro to check random locations:
G91                ; relative mode
G1 Z4 F200         ; raise head 4mm to ensure it is above the Z probe trigger height
G90                ; back to absolute mode
G30                ; lower head, stop when probe triggered and set Z to trigger height

I then tried moving the head away from that location and in some areas, within less than a millimeter of X or Y travel, observed the z-probe LED (trigger height indication) would extinguish. It seems the probe is being affected by the white screenprint on the PCB, and the darker area provided by the thermistor hole. Is this feasible? I thought I'd read that plain glass was capable of providing sufficient reflection for the IR z-probe? I'll try placing a piece of black paper under the glass when I get some, but it does make me wonder if the distinctly-patterned bed meshes other people are generating is the result of subtle changes in reflectance due to minute influences of the weave of a PCB material or machining marks on tooling plate, for example. Any thoughts?

I have probed the bed in the past with a digital 0.01mm indicator and the shape otherwise generally agrees with the generated bed mesh, except for the center divet or bunker:
wiener90_mesh_bed_81pt_20170315_image01.png?dl=1

Avatar

By GrodanB 15 March 2017 18:11

Member · 19 comments

Just started on my test work... Disassembled the z-probe... and low and behold:
JDbTCNd.jpg

That cannot be good if it is sensitive to not being square...

Will now re-assemble it and try again... after standing the part up.

And I also tested that the M500 stores the value.

I also moved the "center" to midpoint of print heads.
G31 T1 P500 X-44.2 Y7.0 Z2.53

Is this correct?

The probe is -44.2mm to the left of the center of the tools... when printing I still do not understand HOW the compensation is done... T0 (left tool) is at -38 when right tool (T1) is at zero. X that is... So when T1 is printing the probe is -63.2 to the left of the printing area... But the compensation says -44.2...

But the config.g has the code above... but the G31 T1 seem not to be updated by that... so just running the G31 above seemed not to get the T1 entry updated in the override file.
But when adding the G31 manually to T1 and then a M500 it was stored...

SOOOO close... but no cigar...
SbXhEy5.jpg

Hard to see when the depth of field is not so good but the duet is pressing hard against the bed in the front left and less to the right

This is the mesh level result:
rqZ0CEV.png
Still bumpy but I assume better...
Why is this five point leveling UNDER the grid?
99Oizi3.png
I have not printed between these mesh leveling...

I give up for now... do not understand this...

Last edited by GrodanB (16 March 2017 07:35)

Avatar

By Dougal1957 15 March 2017 18:20

Member · 265 comments

Yep had this happen a few times after failed prints where a rats nest has caught them straighten them up and re-measure the Z Offset value and carry on printing.