Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Auto-Tramming a RailCore Using conditional GCode

    Scheduled Pinned Locked Moved
    Gcode meta commands
    7
    14
    1.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • elmoretundefined
      elmoret
      last edited by

      Upvoted for "tramming".

      1 Reply Last reply Reply Quote 0
      • kraegarundefined
        kraegar
        last edited by

        Here's another macro, "Pre-Print-Checks" to make sure the printer has been trammed and is homed before starting a print (this would be run in start.g, or out of your startup gcode). I check tramming first because homing is part of the tramming script above.

        ;If the printer hasn't been trammed, tram it
        echo move.calibrationDeviation.deviation ^ move.initialDeviation.deviation ^ move.calibrationDeviation.mean ^ move.initialDeviation.mean
        
        if move.initialDeviation.deviation > 0.01 
          echo "You need to tram, initial deviation is > 0.01 " ^ move.initialDeviation.deviation
          G32
          abort
        if move.calibrationDeviation.deviation > move.initialDeviation.deviation + 0.005
          echo "You need to tram, deviation is not within 0.005 of initial deviation " ^ move.calibrationDeviation.deviation ^ " " ^ move.initialDeviation.deviation
          G32
          abort
        if move.calibrationDeviation.deviation < move.initialDeviation.deviation - 0.005
          echo "You need to tram, deviation is not within 0.005 of initial deviation " ^ move.calibrationDeviation.deviation ^ " " ^ move.initialDeviation.deviation
          G32
          abort
        
        if move.initialDeviation.deviation == 0
          if move.initialDeviation.mean == 0
            if move.calibrationDeviation.deviation == 0
              if move.calibrationDeviation.mean == 0
                echo "You need to tram, or you hit the lotto and got all zeroes"
                G32
                abort
        
        ; If the printer hasn't been homed, home it
        if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed
          echo "Printer Not homed, homing"
          G28
          abort
        else
          echo "Printer is homed"
        

        Co-Creator of the RailcoreII CoreXY printer
        https://www.thingiverse.com/thing:2407174

        deckingmanundefined 1 Reply Last reply Reply Quote 0
        • deckingmanundefined
          deckingman @kraegar
          last edited by

          @kraegar Thanks for sharing.

          @ Moderators I can't help thinking that we could do with a separate section and or repository where users can post the clever things that are doing with conditional gcode.

          Ian
          https://somei3deas.wordpress.com/
          https://www.youtube.com/@deckingman

          kraegarundefined 1 Reply Last reply Reply Quote 0
          • kraegarundefined
            kraegar @deckingman
            last edited by

            @deckingman I agree 100% that conditional GCode is going to need its own section 🙂 Heck, just my posts on it may need their own section, I'm geeking out over here.

            Co-Creator of the RailcoreII CoreXY printer
            https://www.thingiverse.com/thing:2407174

            deckingmanundefined 1 Reply Last reply Reply Quote 0
            • deckingmanundefined
              deckingman @kraegar
              last edited by

              @kraegar said in Auto-Tramming a RailCore Using conditional GCode:

              @deckingman I agree 100% that conditional GCode is going to need its own section 🙂 Heck, just my posts on it may need their own section, I'm geeking out over here.

              I'm stuck 10,000 miles away from my printer but itching to play with conditional gcode 🙂

              Ian
              https://somei3deas.wordpress.com/
              https://www.youtube.com/@deckingman

              kraegarundefined 1 Reply Last reply Reply Quote 0
              • kraegarundefined
                kraegar @deckingman
                last edited by

                @deckingman I wouldn't worry too much just yet...

                Now when variables arrive, then we're talking!

                Co-Creator of the RailcoreII CoreXY printer
                https://www.thingiverse.com/thing:2407174

                1 Reply Last reply Reply Quote 0
                • nurooundefined
                  nuroo
                  last edited by

                  Hello,

                  @kraegar, just wondering if you ever revisted this since variables have been implemented.

                  I recently upgraded my railcore 2 300 zl to reprap firmware 3.3rc3 thanks to your config and help in discord. I'm hoping to not always have to call three g32's if not always necessary.

                  1 Reply Last reply Reply Quote 0
                  • nurooundefined
                    nuroo
                    last edited by

                    the following is a couple of manual g32's and then I ran you macro as well:

                    5/31/2021, 7:06:10 PM	4 points probed, min error -0.240, max error 0.121, mean -0.040, deviation 0.150
                    Height map saved to file 0:/sys/heightmap.csv
                    5/31/2021, 7:05:27 PM	Leadscrew adjustments made: -0.001 0.002 0.001, points used 4, (mean, deviation) before (0.001, 0.187) after (-0.000, 0.187)
                    5/31/2021, 7:04:58 PM	Leadscrew adjustments made: 0.008 0.003 -0.005, points used 4, (mean, deviation) before (0.001, 0.189) after (0.000, 0.189)
                    5/31/2021, 7:04:29 PM	M98 P"0:/macros/Prep-To-Print"
                    Leadscrew adjustments made: -0.065 -0.084 -0.104, points used 4, (mean, deviation) before (-0.089, 0.186) after (0.000, 0.185)
                    5/31/2021, 7:02:02 PM	Upload of Pre-Print_Checks successful after 0s
                    5/31/2021, 6:30:20 PM	g32
                    Leadscrew adjustments made: 0.010 0.001 -0.009, points used 4, (mean, deviation) before (-0.002, 0.187) after (-0.000, 0.187)
                    5/31/2021, 6:29:29 PM	g32
                    Leadscrew adjustments made: -0.067 -0.081 -0.079, points used 4, (mean, deviation) before (-0.077, 0.185) after (-0.000, 0.185)
                    

                    If already printed something
                    prepose adding to end.gcode is slicer
                    M84 S15 ;

                    So railcore will hold motor current for 15mins after a print.
                    Then no G32's should be necessary...
                    Heat steppers
                    Homeall
                    start new print


                    If cold printer, tram status unknown
                    Have macro determine if tram ie 1 g32
                    if yes - result below threshold > dont tram again > continue
                    yes - result above threshold > tram again > repeat if necessary
                    if no - continue

                    just ideas

                    MaxGyverundefined 1 Reply Last reply Reply Quote 1
                    • MaxGyverundefined
                      MaxGyver @nuroo
                      last edited by

                      @kraegar

                      Thank you very much for sharing this! I will give it a try. 👍
                      I also think a forum section for conditional Gcode would be nice.

                      -Max

                      Phaedruxundefined 1 Reply Last reply Reply Quote 0
                      • Phaedruxundefined
                        Phaedrux Moderator @MaxGyver
                        last edited by

                        @maxgyver said in Auto-Tramming a RailCore Using conditional GCode:

                        I also think a forum section for conditional Gcode would be nice.

                        You mean like this one?

                        https://forum.duet3d.com/category/34/gcode-meta-commands

                        Z-Bot CoreXY Build | Thingiverse Profile

                        MaxGyverundefined 1 Reply Last reply Reply Quote 0
                        • MaxGyverundefined
                          MaxGyver @Phaedrux
                          last edited by

                          @phaedrux Whoops, my bad! I have totally missed this.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post
                          Unless otherwise noted, all forum content is licensed under CC-BY-SA