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

    ; Home all

    ; Probe the bed

    ; Absolute positioning

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


    ; 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:

    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
    G1 X97.5 Y97.5 F4800
    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.

  • @dc42:

    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.

    Thanks David,

    That was it, the lowest jerk setting I got it to work at was 1250, up from 900.

    I took it up to 1400 with no skipping, but didn't like the feel of the machine at that setting. Less is more.

    I had also took the XY steppers up from 1000 to 1100mA thinking that was the problem before that, but have left them there and all feels good.

    This is working very well on all materials, and I would recommend others try this in their start script, as it's got to be more accurate than saving a mesh map at one bed temp then using it at a completely different temperature.

    I'll leave it all as I have it set up now regarding bed leveling, thanks all for the help.

  • I would recommend sending your head to 00 or better a negative position if possible then extruding 15mm of filament at the end of your start script this will make sure that when your print starts it is flowing and has a clean bed

  • @Whitewolf:

    I would recommend sending your head to 00 or better a negative position if possible then extruding 15mm of filament at the end of your start script this will make sure that when your print starts it is flowing and has a clean bed

    I'm not quite sure what that means, but I have my first layer at 150% height and 120% width, so my Z offset of -0.1mm is putting my first layer at 0.2mm with a bit more extrusion stuffed in there.

    I'm running 2-4 rounds of brim in the first layer, depending on the size of the printed piece, and am having no problem with the nozzle being primed or bed adhesion at all.

    First layers are pretty nice, bordering on beautiful, with a very minor elephants foot and stuck nicely to my printbite surface.

    Nozzle zero height is set exactly as per the wiki instructions, and bed is leveled very carefully with a feeler guage.

    If you're meaning something else, sorry please explain further, but I'm pretty happy with the result I'm getting here regarding my first layer.

    **Sorry, you're meaning to but the nozzle hard onto the bed then extrude some plastic to "pressure it up" before printing?

    Only concern I'd have there would be marking the print surface. Contrary to what they say, Printbite can be damaged by a hot nozzle pressing on it.

    But sure, please give me an example of the script you'd use to do that and I'll try it.**

  • I use a 3mm sheet of polycarbonate (black) so yeah that would harm the surface too. What I meant was sending the print head to a home position like X0 Y0… your start code seems to leave the head in the middle of the bed after homing. On my printer I am able to move the print head beyond the bed into X-14 Y-7 but this is not possible on all setups.

    I wouldn't want to build pressure by dragging the nozzle across the surface. What I have found at least is not every print is going to have a successful start if a certain amount of plastic has not been extruded first (this usually shows its ugly head around cold starts or jams).

    So in my start code in S3D I do this:

    [c]M572 D0 S0.1 ; Pressure advance
    M83 ; Set extruder to relative mode
    M109 S170 ; Set extruder temp to 170C cold enough to avoid ooze but get some temp on it
    M564 S0 ; Can go outside the print area limits
    M190 S[bed1_temperature] ; wait for bed temp
    G28 ; Home all axes
    G29 ; Mesh bed compensation
    G1 X-37 Y-7 F12000 ; go to X=-37 Y=-7 (parks head close to home)
    M109 S[extruder0_temperature] ; wait for extruder temp
    G1 E15 F300 ; Extrude to prime
    M564 S1 ; set again the safe area limits[/c]

  • P.S. the M564 commands are only needed if you are able to move your print head into a negative position (in other words not over the bed) this command allows you to move beyond the limits you previously setup, if you cant the sending to X0 Y0 would be my next move

Log in to reply