Running auto bed compensation at start of print.



  • As I'm using a cast ally bed with a Printbite surface, I'm using vastly different bed temps for different materials.

    For example with PLA I'm good to use 70/60 (first/second layer), but with ABS I need 135/115 for good adhesion.

    These are not actual surface temps by the way. While the PLA temps are close to the money, the ABS temps are a solid 10-12 degC less at the surface.

    Between these temps I'm seeing a real difference in nozzle homing height and bed level. Not a huge amount, but enough to make adhesion more difficult with ABS if I don't run the compensation or even reset nozzle zero.

    How would I go about running the auto bed compensation at the start of each print, therefore allowing for the temps set in the slicer?

    Obviously I could add a Gcode to the start script (G32?), but I'd also need to clear the results screen that appears in the DWC automatically before starting the print.

    What would be a good straight forward start script to use in the slicer?

    Cheers for any help.


  • administrators

    If it's just the height that you need to adjust and not the shape of the height map, then in the start script you can just command the head to 5mm above bed centre and execute G30.



  • Thanks David.

    I'm not sure what "the shape of the height map" is, but I'm talking about running the full bed compensation routine at the start of a print.

    Currently my start script is:

    G28 ; home all axes

    Which does put the head at the center and raise it 5mm when completed.

    Are you telling me to put G30 after that in the start script?


  • administrators

    Here are two options:

    1. After the G28 command, add G29 to run mesh bed probing.

    2. After the G28 command, run G29 S1 to load the height map previously generated by mesh probing. Then use a G1 command to place the nozzle 5mm above bed centre, followed by G30 to probe once and set the Z height.



  • OK, thank you David.

    I'll try that in a day or 2 (work calls) and get back to you with how it went.



  • Ok,

    So I decided I'd prefer to go with the first option, and run a full probe at the start of each print.

    In the starting script in S3D, I added G29:

    G28 ; home all axes
    G29 ; bed probing

    Nothing happened at all.

    It it homed, probed the center and started the print as usual.

    What would be nice would be a homeall script that incorporated the lot….homed x and y, then ran the mesh bed probing and ended up in the center, then started the print.


  • administrators

    Did you define the probing grid using the M557 command in config.g? Were there any error messages on the console?



  • @dc42:

    Did you define the probing grid using the M557 command in config.g?

    No, how do I do that (in laymans terms please)?

    I see no M557 in my config.g file.





  • OK,

    So my config.g file there is no M557 line at all.

    In my bed.g file there is this:

    ; Probe the bed at 5 points
    G30 P0 X15 Y15 H0 Z-99999
    G30 P1 X15 Y180 H0 Z-99999
    G30 P2 X180 Y180 H0 Z-99999
    G30 P3 X180 Y15 H0 Z-99999
    G30 P4 X97.5 Y97.5 H0 Z-99999 S

    So should I be adding to my config.g file the following?:

    M557 P0 X15 Y15
    M557 P1 X15 Y180
    M557 P2 X180 Y180
    M557 P3 X180 Y15
    M557 P4 X97.5 Y97.5

    OR, could I enter this and probe more points:

    M557 X15:180 Y15:180 S15

    And if so, where would I enter these lines? In general preferences below M208?

    Is 5 points enough for my 200x200 bed?

    What I don't get is why it's already there in bed.g and works when I click the auto bed compensation button in the DWC, but can't be activated in the start script all the same.

    Am I actually getting any bed compensation at the moment, or as it is is it just giving me a visual indication of the state of my bed?

    I am trying here, but I think it's been well and truly established previously that I'm not the gcode or IT specialist.


  • administrators

    See the link posted by DjDemonD 2 posts earlier.



  • @dc42:

    See the link posted by DjDemonD 2 posts earlier.

    Yes I did thank you, and the question just below was to ask which of the 2 forms offered in the wiki would be best for me, as well as a question that wasn't answered there.


  • administrators

    The first form of M557 (specifying individual points) is no longer supported from firmware 1.18 onwards, so use the second.



  • I've set the bed.g file as follows:

    ; bed.g
    ; called to perform automatic bed compensation via G32
    ;
    ; generated by RepRapFirmware Configuration Tool on Sat Oct 22 2016 18:28:19 GMT+1100 (AUS Eastern Daylight Time)

    ; Clear any bed transform
    M561

    ; Home all
    G28

    ; Probe the bed
    G29

    ; Absolute positioning
    G90

    ; Go to center bed probe point and home the Z axis
    G1 X97.5 Y97.5 F4800

    G30

    ; Uncomment the following line to lift the nozzle after probing
    G1 Z50 F500

    But the console shows I ran a G32 instead of a G29, and the values are different to the mesh map

    6:06:07 PMG32
    25 points probed, mean error -0.129, deviation 0.124
    Height map saved to file heightmap.csv

    What have I missed here?


  • administrators

    The console will show that you ran G32 because that is the command you sent from the console.

    What exactly do you mean by "the values are different to the mesh map"?



  • Thank you,

    The mesh map graphic screen that comes up at the end of the probe shows these results:

    Number of probe points: 25

    Probe area: 256.0 cm²

    Maximum deviations: -0.312 / 0.104 mm
    Mean error: 0.118 mm

    RMS error: 0.147 mm

    Yet the G code console shows this:

    G32
    25 points probed, mean error -0.076, deviation 0.125
    Height map saved to file heightmap.csv

    If you look at my bed.g file above, I removed G32 and the 5 point routine and replaced it with G29.

    How am I still sending G32?


  • administrators

    1. The auto bed compensation button in DWC sends G32. That command runs the bed.g file.

    2. You are correct, DWC displays different deviation data from the console:

    • in the console, the mean error is just the average height error, which may be positive of negative. In DWC is it the average absolute error, so it will always be positive.

    • in the console, the deviation is the RMS deviation from the mean, so it is the deviation after subtracting out any error in the average Z-0 position. It is a measure of how flat the printing plane is, and will be zero if the bed is perfectly flat, even if probing detects that the Z=0 positions is out. In DWC ii is the RMS height error, so it is not a measure of flatness of the printing plane because it also includes any general area in the Z=0 position.

    I'll discuss this with chrishamm, the author of DWC.



  • Did I inadvertently stumble upon something there?

    I've got the start script in S3D successfully running G29 now, and as the whole reason for wanting to do it was the varying bed temps I'm running, I'm happy to do it at the start of each print.

    Thanks very much for the points as I get my head around the whole Gcode thing.



  • Ok, so this has made a great improvement in my first layer.

    In the starting script (in S3D) I added this, which is exactly the same as my bed.g file:

    G29 S2
    G28
    G29
    G90
    G1 X97.5 Y97.5 F4800
    G30
    G1 Z5 F500

    I am now getting PERFECT and consistent first layer thickness right across the print, and have reduced my slicer Z offset from -0.25 to -0.1.

    Mechanically my bed is leveled perfectly, but despite using cast ally precision plate there is still some runout which I've been struggling with.

    While I didn't quite understand the explanation above regarding the difference between in the deviation data from the console, I can see quite plainly that (for my setup) this works and the other doesn't.

    I'm also very happy with this method, as when using a different bed temp/material/profile, you're getting a bed compensation directly related to the exact bed conditions caused by that profile.

    One weird thing though is that longer free movements between printing points are now jerky, short movements are unaffected.

    I've touched nothing else but the bed.g file and added the same file to the slicer start script.

    I strongly suspect that these jerky movements are the same 40mm long distance that I entered as the probing points.

    It's had no bad effect so far, but is a little annoying.

    Any reason this would happen?


  • administrators

    The reason for the jerky movements is the changes in Z speed due to mesh bed levelling. Increasing allowed Z jerk in the M566 command will get rid of it, if it doesn't cause the Z motor to skip steps.


 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.