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.
    • Rushmere3Dundefined
      Rushmere3D @OwenD
      last edited by

      @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

      OwenDundefined 2 Replies Last reply Reply Quote 0
      • OwenDundefined
        OwenD @Rushmere3D
        last edited by

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

        Rushmere3Dundefined 1 Reply Last reply Reply Quote 0
        • Rushmere3Dundefined
          Rushmere3D @OwenD
          last edited by

          @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

          OwenDundefined 1 Reply Last reply Reply Quote 0
          • OwenDundefined
            OwenD @Rushmere3D
            last edited by OwenD

            @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
            • OwenDundefined
              OwenD @Rushmere3D
              last edited by

              @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
              • OwenDundefined OwenD referenced this topic
              • OwenDundefined OwenD referenced this topic
              • Nightowlundefined
                Nightowl
                last edited by Nightowl

                @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

                OwenDundefined dc42undefined 2 Replies Last reply Reply Quote 0
                • OwenDundefined
                  OwenD @Nightowl
                  last edited by

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

                  1 Reply Last reply Reply Quote 1
                  • dc42undefined
                    dc42 administrators @Nightowl
                    last edited by

                    @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
                    • cosmowaveundefined cosmowave referenced this topic
                    • Hugsyundefined
                      Hugsy
                      last edited by

                      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.

                      dc42undefined 1 Reply Last reply Reply Quote 0
                      • dc42undefined
                        dc42 administrators @Hugsy
                        last edited by dc42

                        @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
                        • First post
                          Last post
                        Unless otherwise noted, all forum content is licensed under CC-BY-SA