M48 Measure Z Probe repeatability and print to serial output.



  • That is useful for a lot of settings.... It is good to know your probe 😄

    Now what I do is use a macro to repeat a G30 S-1 several times and calculate the standard deviation and mean value by hand .


  • administrators

    Use a macro to execute repeated G30 Pn Xxx Yyy Z-9999 commands with values of n from 0 up to your chosen maximum. This is much more flexible, for example you can choose to move the head away and back between probing. You don't need to calculate the SD by hand because if you include S-1 on the last G30 command, the firmware will do it for you.



  • @dc42 I'll try it today. Thanks. 🙂



  • @dc42 said in M48 Measure Z Probe repeatability and print to serial output.:

    Z-9999

    Worked like a charm... so.... No need for the M48.

    Maybe have a special area at the gcodes wiki page mentioning about commands alternatives - like the M109 or M48 in this case.

    Thank you very much.

    The macro:

    M291 P"Probe will be tested 10 times and return mean and standard deviation. Ok or Cancel?" R"WARNING" S3 ; User must click OK or cancel.
    G28
    M401
    G30 P0 X151 Y161 Z-9999
    G30 P1 X151 Y161 Z-9999
    G30 P2 X151 Y161 Z-9999
    G30 P3 X151 Y161 Z-9999
    G30 P4 X151 Y161 Z-9999
    G30 P5 X151 Y161 Z-9999
    G30 P6 X151 Y161 Z-9999
    G30 P7 X151 Y161 Z-9999
    G30 P8 X151 Y161 Z-9999
    G30 P9 X151 Y161 Z-9999 S-1
    M402


  • administrators

    Using firmware 2.03RC3, you could put those lines of GCode in file M48.g in the /sys folder. Then you would have a working M48 command. Note, M48 already had a meaning in NIST standard GCode before Marlin hijacked it, so we won't be implementing M48 in RepRapFirmware.



  • Thanks @dc42. Just tried it and it works. Using BLTouch. Deviation from mean is 0.001.

    Will it be useful to also report the span? (max - min)


  • administrators

    Also note this: https://duet3d.dozuki.com/Wiki/G-Codes_not_implemented
    To answer the general question about where we document gcodes that have not been implemented for whatever reason



  • maybe add to that wiki the new feature where unkown g-codes will execute a macro if found, and which version that change is valid from?


  • administrators



  • The M48 without an X and Y location appears to simply move right to the end of travel.

    Could it be changed so that without X an Y, it probes at the current location?

    The intended use is:

    Probe_Corners.g
    ; Test repeatability at mesh bed compensation locations
    G1 X5 Y5
    M48
    G1 X300 Y5
    M48
    G1 X300 Y200
    M48
    G1 X5 Y200
    M48


  • administrators

    M48 in RepRapFirmware does nothing, unless you have a file called M48.g in the /sys folder (in which case, it executes that macro).



  • @dc42 I understand that. The macro early in this thread that takes 10 measurements at the point X151 Y161 works fine in the /sys folder. However, if it is edited to remove the X and Y co-ordinates like:

    M291 P"Probe will be tested 10 times and return mean and standard deviation. Ok or Cancel?" R"WARNING" S3 ; User must click OK or cancel.
    G28
    G30 P0 Z-9999
    G30 P1 Z-9999
    G30 P2 Z-9999
    G30 P3 Z-9999
    G30 P4 Z-9999
    G30 P5 Z-9999
    G30 P6 Z-9999
    G30 P7 Z-9999
    G30 P8 Z-9999
    G30 P9 Z-9999 S-1

    it does not stay at the current position but moves in X. I believe it should just take 10 points at the current location without moving.


Log in to reply