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

    Your start.g

    Scheduled Pinned Locked Moved
    General Discussion
    7
    13
    873
    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.
    • Proschi3Dundefined
      Proschi3D
      last edited by

      I would be interested in idex start codes

      Love my Duet 3 Mini.
      https://www.instagram.com/proschi3d
      https://youtube.com/@proschi3d
      https://www.proschi3d.de

      1 Reply Last reply Reply Quote 0
      • jens55undefined
        jens55
        last edited by jens55

        Can't help you with strat.g but here is my very blah start.g for my jubilee tool changer:

        ; This file is called before any print job
        T-1
        if !move.axes[0].homed || !move.axes[1].homed|| !move.axes[2].homed ; If the printer hasn't been homed, home it

        My start.g file for a creality printer .... doesn't exist.

        Exerqtorundefined 1 Reply Last reply Reply Quote 1
        • Exerqtorundefined
          Exerqtor @jens55
          last edited by

          @jens55 said in Your strart.g:

          Can't help you with strat.g but here is my very blah start.g for my jubilee tool changer:

          Fixed! 😂

          ; This file is called before any print job
          T-1
          if !move.axes[0].homed || !move.axes[1].homed|| !move.axes[2].homed ; If the printer hasn't been homed, home it

          My start.g file for a creality printer .... doesn't exist.

          Yeah i guess the homing could live there.

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

            ; start.g - run before slicer gcode at start of print
            
            M140 S65		; set heated bed to 65 and release
            T0			; Select Tool 0
            M291 P"Print Started. Preheating and Homing." T10
            G4 S1
            M98 P"0:/macros/Musical Tunes/LuckyTune.g" ; Lucky tune to start print off on the right foot
            G4 S1
            M220 S100		; Set speed factor back to 100% in case it was changed
            M221 S100		; Set extrusion factor back to 100% in case it was changed
            M290 R0 S0		; clear babystepping
            M106 S0			; Turn part cooling blower off if it is on
            G10 P0 R0 S80		; Set extruder to 80 and release
            M190 S65		; set heated bed to 65 and wait
            G28			; home XYZ
            G29 S1			; load heightmap
            G10 P0 R80 S180	; Set extruder to 180 and release
            M98 P"0:/sys/ZSpeedsPrint.g"	; Load Z speeds for printing
            M98 P"0:/sys/CurrentsPrint.g"	; Load print motor currents
            M566 P1 ; jerk between all moves
            
            ; Slicer Start Gcode begins.
            

            Z-Bot CoreXY Build | Thingiverse Profile

            Exerqtorundefined 1 Reply Last reply Reply Quote 0
            • Exerqtorundefined Exerqtor marked this topic as a regular topic
            • mikeabuilderundefined
              mikeabuilder
              last edited by

              I wrote these when I was beginning to learn coding on the Duet, so there may be a better way to do this, but...

              I collect the time (state.time) in one global variable and the print file name (job.file.name) in another.

              Then in stop.g, I collect the time again so I have the elapsed print time. I append the start time, elapsed time, and job name into a file so I can create print statistics.

              When I did this, I thought the data I wanted would be deleted from the object model before stop.g would run.

              And since writing the macro over a year ago, I've never looked at the file once.

              But I'm going to add some of the things from Phaedrux's file, and the checking for homing.

              1 Reply Last reply Reply Quote 0
              • Exerqtorundefined
                Exerqtor @Phaedrux
                last edited by

                @Phaedrux
                Got som ideas there! Care to share that lucky tune btw? Just for shits and giggles? 😂

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

                  @Exerqtor Sure, here's a link to all the midi files and converted gcodes I have messed around with.

                  https://artisanalrobotics.ca:22597/d/s/rqPGN0DTNtMvhiQuNXmH3PeHZiEEaQyH/RKWWWVJzciWvzL6y177wNDdw4OZqZWCc-nbqgzzmaHQo

                  And here's the ones that actually ended up working well, including the ones I made myself.

                  https://artisanalrobotics.ca:22597/d/s/rqPKR4rm5OSxkYIFSIrHQ08H5HR5Cir7/CajwpV2Tbtc7FCBjge8daO01bFGstcGA-JbzA8WqaHQo

                  It's a bit hit or miss these days whether the PanelDue will play them smoothly as things have gotten more complex.

                  And here's the original thead with a link to the tool to convert midi to gcode tone.

                  https://forum.duet3d.com/topic/15722/turn-your-printer-into-a-juke-box

                  Z-Bot CoreXY Build | Thingiverse Profile

                  Exerqtorundefined 1 Reply Last reply Reply Quote 1
                  • Exerqtorundefined
                    Exerqtor @Phaedrux
                    last edited by

                    @Phaedrux said in Your start.g:

                    @Exerqtor Sure, here's a link to all the midi files and converted gcodes I have messed around with.

                    https://artisanalrobotics.ca:22597/d/s/rqPGN0DTNtMvhiQuNXmH3PeHZiEEaQyH/RKWWWVJzciWvzL6y177wNDdw4OZqZWCc-nbqgzzmaHQo

                    And here's the ones that actually ended up working well, including the ones I made myself.

                    https://artisanalrobotics.ca:22597/d/s/rqPKR4rm5OSxkYIFSIrHQ08H5HR5Cir7/CajwpV2Tbtc7FCBjge8daO01bFGstcGA-JbzA8WqaHQo

                    It's a bit hit or miss these days whether the PanelDue will play them smoothly as things have gotten more complex.

                    And here's the original thead with a link to the tool to convert midi to gcode tone.

                    https://forum.duet3d.com/topic/15722/turn-your-printer-into-a-juke-box

                    Thanks! Looks like it might be some weirdness happening in RRF 3.5.0b1+ though 🤔 I uploaded luckytune.g and ran it to listen to what it sound like, and each time i excecute the file it plays off in a different pitch/tune lol.

                    On another note (pun intended), I've slapped together something based on your start.g and my excisting print start routine:
                    start.g:

                    ; /sys/lib/print/print_start.g  v2.0
                    ; Called when starting a print (after start.g) at the end of your slicers start code
                    ; Used to configure print parameters
                    
                    M140 S{global.bed_temp}                                                        ; Set bed temperature
                    if exists(global.sb_leds)
                      set global.sb_leds = "heating"                                               ; StealthBurner LED status
                    M116 H0 S5                                                                     ; Wait for the bed to reach its temperature +/-5°C
                    M98 "/sys/lib/print/print_probe.g/"                                            ; Pre print mesh macro, if it will probe a mesh or not i controlled by global.Print_Probe(true=on, false=off) and select a mesh accordinlgy
                    M376 H5                                                                        ; Set bed compensation taper to 5mm
                    G10 P{global.initial_extruder} R{global.hotend_temp} S{global.hotend_temp}     ; Set active and standby temps for the initial tool
                    if exists(global.sb_leds)
                      set global.sb_leds = "heating"                                               ; StealthBurner LED status
                    M116 H1                                                                        ; Wait hotend to reach it's temperature
                    M42 P0 S0.3                                                                    ; Turn on chamber lights to 30%
                    G0 Z{(global.first_layer_height + 5)} F3000                                    ; Drop bed to first layer height + 5mm to reduce pucker factor
                    M98 P"/sys/lib/print/print_purge.g"                                            ; Purge the nozzle before starting print
                    M400                                                                           ; Wait for moves to finish
                    if exists(global.sb_leds)
                      set global.sb_leds = "printing"                                              ; StealthBurner LED status
                    if exists(global.RunDaemon)
                      set global.RunDaemon = false                                                 ; Disable daemon.g while printing because of bug in RRF 3.5.0b1+
                    
                    OwenDundefined 1 Reply Last reply Reply Quote 0
                    • OwenDundefined
                      OwenD @Exerqtor
                      last edited by

                      @Exerqtor
                      If you have daemon.g running it tends to interrupt these "music" macros.
                      I see you have a global runDaemon
                      I use that at the start and finish of the tunes to disable the daemon for the duration of the tune.
                      It depends where the daemon is in terms of its process cycle as to whether the tune ends up unhindered.
                      You may need a G4 at the start of the tune.

                      Exerqtorundefined 1 Reply Last reply Reply Quote 0
                      • Exerqtorundefined
                        Exerqtor @OwenD
                        last edited by

                        @OwenD said in Your start.g:

                        @Exerqtor
                        If you have daemon.g running it tends to interrupt these "music" macros.
                        I see you have a global runDaemon
                        I use that at the start and finish of the tunes to disable the daemon for the duration of the tune.
                        It depends where the daemon is in terms of its process cycle as to whether the tune ends up unhindered.
                        You may need a G4 at the start of the tune.

                        Noted, thx!

                        Proschi3Dundefined 1 Reply Last reply Reply Quote 0
                        • Proschi3Dundefined
                          Proschi3D @Exerqtor
                          last edited by

                          M291 P"Start.g wird ausgeführt" S0
                          M98 P"/Macros/SUB/CheckDoor"          ;Door open or closed
                          M561
                          M106 P3 S0
                          G4 S1
                          M106 P3 S25
                          G4 S1
                          M106 P3 S0
                          G4 S1
                          M106 P3 S25                          ;dimme LED for IR Probe
                          M98 P"/Macros/SUB/Preheat"           ;Preheat for Loaded Filament
                          if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed
                            G28
                          G28 Z0
                          M98 P"/Macros/Buildplate"            ;Load Hightmap for Buildplate and Filament
                          M98 P"config_probe.g"
                            
                          

                          Love my Duet 3 Mini.
                          https://www.instagram.com/proschi3d
                          https://youtube.com/@proschi3d
                          https://www.proschi3d.de

                          1 Reply Last reply Reply Quote 1
                          • apakundefined
                            apak
                            last edited by apak

                            here are some of my start.g

                            https://github.com/macasero/Hbot-3d-Campy/blob/main/MORAN/sys/start.g

                            https://github.com/macasero/Bear-mk3s-duet2/blob/main/sys/start.g

                            https://github.com/macasero/Predator-Duet3mini-smarteffector-REPRAP/blob/main/sys/start.g

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