error in bed.g kossel



  • ; Auto calibration routine for large delta printer
    M561                    ; clear any bed transform
    
    ; If the printer hasn't been homed, home it
    if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed
      G28
    
    ; Probe the bed and do auto calibration
    G1 X0 Y89.9 Z10 F10000        ; go to just above the first probe point
    while true
      if iterations = 5
        abort "Too many auto calibration attempts"
      G30 P0 X0 Y89.9 H0 Z-99999
      if result != 0
        continue
      G30 P1 X77.86 Y44.95 H0 Z-99999
      if result != 0
        continue
      G30 P2 X77.86 Y-44.95 H0 Z-99999
      if result != 0
        continue
      G30 P3 X0 Y-89.9 H0 Z-99999
      if result != 0
        continue
      G30 P4 X-77.86 Y-44.95 H0 Z-99999
      if result != 0
        continue
      G30 P5 X-77.86 Y44.95 H0 Z-99999
      if result != 0
        continue
      G30 P6 X0 Y44.9 H0 Z-99999
      if result != 0
        continue
      G30 P7 X38.88 Y-22.45 H0 Z-99999
      if result != 0
        continue
      G30 P8 X-38.88 Y-22.45 H0 Z-99999
      if result != 0
        continue
      G30 P9 X0 Y0 Z-99999 S6
      if result != 0
        continue
      if move.calibration.final <= 0.03
        break
      echo "Repeating calibration because deviation is too high (" ^ move.calibration.final ^ "mm)"
    ; end loop
    echo "Auto calibration successful, deviation", move.calibration.final ^ "mm"
    G1 X0 Y0 Z150 F10000                ; get the head out of the way
    

    gives me error:
    Calibrated 6 factors using 10 points, (mean, deviation) before (0.003, 0.050) after (0.000, 0.040)
    Error: in file macro line 43 column 36: G30: expected numeric operand

    it´s the line
    if move.calibration.final <= 0.03

    what should I do...it was working fine

    RRF 3.01RC4



  • @apak said in error in bed.g kossel:

    what should I do...it was working fine

    Was working on RC3?

    Anyway... even though it was working, sounds like the parser changed a little bit. I'd try things that achieve the same result, using different symbols, just for debugging.

    Example 1:

    if move.calibration.final < 0.031
    

    Example 2:

    if move.calibration.final < 0.03
      break
    if move.calibration.final = 0.03
      break
    

    Example 3: (I am less sure about the exact syntax on this one)

    if ! {move.calibration.final > 0.03}
      break
    

    You get the idea.



  • @Danal said in error in bed.g kossel:
    Example 1 console:

    	G32
    Calibrated 6 factors using 10 points, (mean, deviation) before (-0.370, 0.048) after (-0.000, 0.018)
    0
    Error: in file macro line 44 column 36: G30: expected numeric operand
    

    Example 3 console:

    0
    Repeating calibration because deviation is too high ({object}mm)
    Calibrated 6 factors using 10 points, (mean, deviation) before (-0.004, 0.020) after (-0.000, 0.020)
    0
    Repeating calibration because deviation is too high ({object}mm)
    G32
    Calibrated 6 factors using 10 points, (mean, deviation) before (-0.004, 0.027) after (-0.000, 0.023)
    0
    Warning: both space and tab characters used to indent blocks by line 44Repeating calibration because deviation is too high ({object}mm)
    

    This enters in a loop and keeps on going. I have to stop it.

    The 0 value is because I inserted an "Echo result after S6"

    So, example 1 (and previous code) do break the while, because it´s under 0.03, but can´t print the value and shows {object} instead.

    example 3, does a loop.



  • That makes it pretty clear the error is not with "<=" which was one of my suspects if this is a parser change.

    Given the results you are getting, I would continue to try "equivalent" statements of various kinds... but I would also take all the text in this file, copy it out to an editor that shows tabs, spaces, and trailing spaces separately clean up any such stuff, and put it back in the file.

    Meaning, I am now suspecting something we "can not see" when looking at the code. Space, Tab, Line End, etc, etc.

    And/or download the file, and attach it as I file here. (All file handling, not text copy/paste) and I will run it on my big delta.



  • got it:

    ; Auto calibration routine for large delta printer
    M561                    ; clear any bed transform
    
    ; If the printer hasn't been homed, home it
    if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed
      G28
    
    ; Probe the bed and do auto calibration
    G1 X0 Y89.9 Z10 F10000        ; go to just above the first probe point
    while true
      if iterations = 5
        abort "Too many auto calibration attempts"
      G30 P0 X0 Y89.9 H0 Z-99999
      if result != 0
        continue
      G30 P1 X77.86 Y44.95 H0 Z-99999
      if result != 0
        continue
      G30 P2 X77.86 Y-44.95 H0 Z-99999
      if result != 0
        continue
      G30 P3 X0 Y-89.9 H0 Z-99999
      if result != 0
        continue
      G30 P4 X-77.86 Y-44.95 H0 Z-99999
      if result != 0
        continue
      G30 P5 X-77.86 Y44.95 H0 Z-99999
      if result != 0
        continue
      G30 P6 X0 Y44.9 H0 Z-99999
      if result != 0
        continue
      G30 P7 X38.88 Y-22.45 H0 Z-99999
      if result != 0
        continue
      G30 P8 X-38.88 Y-22.45 H0 Z-99999
      if result != 0
        continue
      G30 P9 X0 Y0 Z-99999 S6
      if result != 0
        continue
      if ! {move.calibration.final.deviation > 0.03}
        break
      echo "Repeating calibration because deviation is too high (" ^ move.calibration.final.deviation ^ " mm)"
    ;end loop
    echo "Auto calibration successful, deviation "^ .deviation ^ "mm"
    G1 X0 Y0 Z150 F10000                ; get the head out of the way
    

    It´s the object...move.calibration.final.deviation instead of move.calibration.final

    my original file also worked one added de ".deviation" to the object "move.calibration.final"

    ; Auto calibration routine for large delta printer
    M561                    ; clear any bed transform
    
    ; If the printer hasn't been homed, home it
    if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed
      G28
    
    ; Probe the bed and do auto calibration
    G1 X0 Y89.9 Z10 F10000        ; go to just above the first probe point
    while true
      if iterations = 5
        abort "Too many auto calibration attempts"
      G30 P0 X0 Y89.9 H0 Z-99999
      if result != 0
        continue
      G30 P1 X77.86 Y44.95 H0 Z-99999
      if result != 0
        continue
      G30 P2 X77.86 Y-44.95 H0 Z-99999
      if result != 0
        continue
      G30 P3 X0 Y-89.9 H0 Z-99999
      if result != 0
        continue
      G30 P4 X-77.86 Y-44.95 H0 Z-99999
      if result != 0
        continue
      G30 P5 X-77.86 Y44.95 H0 Z-99999
      if result != 0
        continue
      G30 P6 X0 Y44.9 H0 Z-99999
      if result != 0
        continue
      G30 P7 X38.88 Y-22.45 H0 Z-99999
      if result != 0
        continue
      G30 P8 X-38.88 Y-22.45 H0 Z-99999
      if result != 0
        continue
      G30 P9 X0 Y0 Z-99999 S6
      if result != 0
        continue
      if move.calibration.final.deviation <= 0.03
        break
      echo "Repeating calibration because deviation is too high (" ^ move.calibration.final.deviation ^ " mm)"
    ;end loop
    echo "Auto calibration successful, deviation "^ move.calibration.final.deviation ^ "mm"
    G1 X0 Y0 Z150 F10000                ; get the head out of the way
    


  • console after the change:

    G32
    Calibrated 6 factors using 10 points, (mean, deviation) before (0.001, 0.023) after (0.000, 0.022)
    Auto calibration successful, deviation 0.022mm
    


  • Wooo Hooo!!! Good find.

    The object model DID change. 🙂


Log in to reply