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

Temperature controlled LED display

Scheduled Pinned Locked Moved
Gcode meta commands
6
26
1.7k
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
    Rushmere3D @OwenD
    last edited by 24 Jul 2022, 14:57

    @owend That's awesome, I've not had a chance to try the new code yet because 1) it's still quite hot in my small workshop and 2) I don't currently use PrusaSlicer for my toolchanger so haven't changed the code for S3D yet.

    But I will give it a go.

    Thanks.

    Follow my adventures in 3D Printing, laser cutting and electronics. https://linktr.ee/Rushmere3D

    1 Reply Last reply Reply Quote 0
    • undefined
      Rushmere3D @OwenD
      last edited by 26 Jul 2022, 13:15

      @owend

      Hey, had a go at using this today and It's not quite working. Below in my start gcode for single T3 printing, bare in mind on the toolchanger homing and ABL need to be done before a tool is picked up. What's happening is it basically get's to the point where the temp has been set and heating begins but even once at temp it just sits and does nothing but cycle through checking the tools/heaters.

      I have both macros in the macro folder for ref.

      M104
      T-1
      M140 S[first_layer_bed_temperature]
      ;M568 P0 A2 R[standby_temperature_delta] S[first_layer_temperature] ; set active and standby temps
      ;M568 P1 A2 R[standby_temperature_delta] S[first_layer_temperature] ; set active and standby temps
      ;M568 P2 A2 R[standby_temperature_delta] S[first_layer_temperature] ; set active and standby temps
      M568 P3 A2 R[standby_temperature_delta] S[first_layer_temperature] ; set active and standby temps
      M98 P"/macros/set_led_while_heating.g" S[first_layer_temperature] T[current_extruder] D3
      G28 ;
      G29 ; enable mesh
      M116

      Follow my adventures in 3D Printing, laser cutting and electronics. https://linktr.ee/Rushmere3D

      undefined 2 Replies Last reply 26 Jul 2022, 13:20 Reply Quote 0
      • undefined
        OwenD @Rushmere3D
        last edited by 26 Jul 2022, 13:20

        @rushmere3d
        I'll have a look, but probably not before the weekend

        undefined 1 Reply Last reply 26 Jul 2022, 13:29 Reply Quote 0
        • undefined
          Rushmere3D @OwenD
          last edited by 26 Jul 2022, 13:29

          @owend No problem, no rush.

          Shall I try the set_led_by_temp as a daemon.g? rather than being called from a macro.

          Thanks for your help.

          Follow my adventures in 3D Printing, laser cutting and electronics. https://linktr.ee/Rushmere3D

          undefined 1 Reply Last reply 26 Jul 2022, 20:12 Reply Quote 0
          • undefined
            OwenD @Rushmere3D
            last edited by OwenD 26 Jul 2022, 20:12

            @rushmere3d
            You could call it in daemon.g
            Perhaps set up a global variable so that you can only call it when you've set that variable to true.
            So in your slicer have

            set global.WarmUp = true
            // set all temps etc
            // do homing
            Set global.WarmUp = false

            Then in daemon.g

            If global.Warmup= true
            M98 P"path-to-macro.g"

            1 Reply Last reply Reply Quote 0
            • undefined
              OwenD @Rushmere3D
              last edited by 30 Jul 2022, 01:04

              @rushmere3d
              The problem was that you did not have any tools selected and I was using the selected tool to determine which heater to monitor in the while loop.

              This revised file will work with no tool selected.

              ; set_LED_while_heating.g
              ; Parameters can be passed for Tool number and target temp
              ; S = target temperature
              ; T = Tool number
              ; D = delay between checks
              ; example in Prusa slicer start code
              ; ####
              ; M568 P[current_extruder] R{"{heat.coldExtrudeTemperature+5}"} S[first_layer_temperature_0] A2
              ; M98 P"set_LED_while_heating.gcode" S[first_layer_temperature_0] T[current_extruder] D3
              ; M116
              ; ###
              var toolNumber = 0
              var thisTool = 0
              if exists(param.T)
              set var.toolNumber = param.T
              var targetTemp = 120
              if exists(param.S)
              set var.targetTemp = param.S
              var delay = 3
              if exists(param.D)
              set var.delay = param.D
              ;echo "Tool number is ", var.toolNumber
              if var.toolNumber != -1
              var heaterNumber = tools[var.toolNumber].heaters[0]
              while heat.heaters[var.heaterNumber].current < var.targetTemp
              M98 P"0:/macros/conditional_g_code_macros/set_led_by_temp.gcode"
              G4 S{var.delay}
              else
              while iterations < #tools
              set var.thisTool = iterations
              ;echo "Testing heat.heaters[tools[" , var.thisTool, "].heaters[0]]"
              if (heat.heaters[{tools[var.thisTool].heaters[0]}].state="standby")
              while (heat.heaters[{tools[var.thisTool].heaters[0]}].current) < (heat.heaters[{tools[var.thisTool].heaters[0]}].standby)
              M98 P"0:/macros/conditional_g_code_macros/set_led_by_temp.gcode"
              G4 S{var.delay}
              if (heat.heaters[tools[var.thisTool].heaters[0]].state="active")
              ;echo "active"
              while (heat.heaters[tools[var.thisTool].heaters[0]].current) < (heat.heaters[tools[var.thisTool].heaters[0]].active)
              M98 P"0:/macros/conditional_g_code_macros/set_led_by_temp.gcode"
              G4 S{var.delay}
              ; done heating, so set to white
              M150 R255 U255 B255 W255 P255 F0 ; set pixels
              1 Reply Last reply Reply Quote 0
              • undefined OwenD referenced this topic 2 Aug 2022, 06:51
              • undefined OwenD referenced this topic 2 Aug 2022, 06:56
              • undefined
                Nightowl
                last edited by Nightowl 8 Jul 2022, 08:07 7 Aug 2022, 08:06

                @nightowl said in Temperature controlled LED display:

                I'm going to learn from this to control a series of neopixel LEDs to change colour depending on the spindle speed for my CNC machine, and also have 3-colour LEDs to show my machine in Safe (Green: switched on but not in use/file not loaded), Pause (Orange) and Red (Running a project).

                Any thoughts on this, please?

                I was thinking of buying this 1m length (of 144LEDs/m) and cutting it to length, but isn't the current rating (20A) a bit high?

                Thanks

                Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
                I'm still on my learning curve, so take everything I say with caution!

                RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

                undefined undefined 2 Replies Last reply 7 Aug 2022, 10:39 Reply Quote 0
                • undefined
                  OwenD @Nightowl
                  last edited by 7 Aug 2022, 10:39

                  @nightowl
                  You will need an external 5v power supply for the LED's.
                  Wiring info here

                  1 Reply Last reply Reply Quote 1
                  • undefined
                    dc42 administrators @Nightowl
                    last edited by 7 Aug 2022, 16:21

                    @nightowl the current consumption is up to 60mA per LED, times 144 for a 1m length is 8.64A maximum. So you will need a separate 5V PSU for them, but a 10A one will do.

                    Duet WiFi hardware designer and firmware engineer
                    Please do not ask me for Duet support via PM or email, use the forum
                    http://www.escher3d.com, https://miscsolutions.wordpress.com

                    1 Reply Last reply Reply Quote 1
                    • undefined cosmowave referenced this topic 19 Jun 2023, 09:41
                    • undefined
                      Hugsy
                      last edited by 19 Jun 2023, 12:57

                      I strongly advise to not put any M98 inside daemon.g as it can disrupt the main DDARRing and cause stutter in the movement. What I usually do is copy the macro inside the daemon.g and even then some commands might disrupt the movement, at least not the whole macro will cause problems. Maybe we can queue the commands in a different G-Code queue with RRF3.5 to avoid all of this.

                      undefined 1 Reply Last reply 19 Jun 2023, 13:06 Reply Quote 0
                      • undefined
                        dc42 administrators @Hugsy
                        last edited by dc42 19 Jun 2023, 13:06

                        @Hugsy said in Temperature controlled LED display:

                        I strongly advise to not put any M98 inside daemon.g as it can disrupt the main DDARRing and cause stutter in the movement. What I usually do is copy the macro inside the daemon.g and even then some commands might disrupt the movement, at least not the whole macro will cause problems. Maybe we can queue the commands in a different G-Code queue with RRF3.5 to avoid all of this.

                        The main issue with doing too much in daemon.g is contention for the SD card. Using M98 causes it to open the macro file, which involve several SD card accesses.

                        Also there should be a delay command inside the while loop in daemon.g so that there are periods of time when daemon.g id not competing for resources. This delay should normally be at least 1 second, but more is better if you don't need daemon.g to react faster to changes.

                        Duet WiFi hardware designer and firmware engineer
                        Please do not ask me for Duet support via PM or email, use the forum
                        http://www.escher3d.com, https://miscsolutions.wordpress.com

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