• Tags
  • Documentation
  • Order
  • Register
  • Login
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.
  • undefined
    Exerqtor
    last edited by Exerqtor 1 Mar 2023, 16:22 3 Jan 2023, 13:48

    In the lack of anything nifty to put in start.g myself , what do you got in yours?

    1 Reply Last reply Reply Quote 0
    • undefined
      Proschi3D
      last edited by 3 Jan 2023, 14:06

      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
      • undefined
        jens55
        last edited by jens55 1 Mar 2023, 16:07 3 Jan 2023, 16:06

        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.

        undefined 1 Reply Last reply 3 Jan 2023, 16:24 Reply Quote 1
        • undefined
          Exerqtor @jens55
          last edited by 3 Jan 2023, 16:24

          @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
          • undefined
            Phaedrux Moderator
            last edited by 3 Jan 2023, 19:19

            ; 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

            undefined 1 Reply Last reply 5 Jan 2023, 11:37 Reply Quote 0
            • undefined Exerqtor marked this topic as a regular topic 3 Jan 2023, 20:57
            • undefined
              mikeabuilder
              last edited by 4 Jan 2023, 00:09

              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
              • undefined
                Exerqtor @Phaedrux
                last edited by 5 Jan 2023, 11:37

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

                undefined 1 Reply Last reply 5 Jan 2023, 19:24 Reply Quote 0
                • undefined
                  Phaedrux Moderator @Exerqtor
                  last edited by Phaedrux 1 May 2023, 19:26 5 Jan 2023, 19:24

                  @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

                  undefined 1 Reply Last reply 6 Jan 2023, 14:01 Reply Quote 1
                  • undefined
                    Exerqtor @Phaedrux
                    last edited by 6 Jan 2023, 14:01

                    @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+
                    
                    undefined 1 Reply Last reply 13 Jan 2023, 08:00 Reply Quote 0
                    • undefined
                      OwenD @Exerqtor
                      last edited by 13 Jan 2023, 08:00

                      @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.

                      undefined 1 Reply Last reply 13 Jan 2023, 12:29 Reply Quote 0
                      • undefined
                        Exerqtor @OwenD
                        last edited by 13 Jan 2023, 12:29

                        @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!

                        undefined 1 Reply Last reply 23 Apr 2023, 08:48 Reply Quote 0
                        • undefined
                          Proschi3D @Exerqtor
                          last edited by 23 Apr 2023, 08:48

                          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
                          • undefined
                            apak
                            last edited by apak 24 Apr 2023, 11:17

                            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