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

    M150 with Adafruit RGBW ring issue?

    Scheduled Pinned Locked Moved
    Tuning and tweaking
    4
    19
    605
    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.
    • Stephen6309undefined
      Stephen6309 @A Former User
      last edited by

      @thedragonlord Have you tried X3? I'm using the default of X1. I'm using a Duet3 6HC/PI4 and a Mini 5+.

      A Former User? 1 Reply Last reply Reply Quote 0
      • A Former User?
        A Former User @Stephen6309
        last edited by A Former User

        @stephen6309 said in M150 with Adafruit RGBW ring issue?:

        @thedragonlord Have you tried X3? I'm using the default of X1. I'm using a Duet3 6HC/PI4 and a Mini 5+.

        X3 doesn't work at all, but with I've relaized it works with no X parameter setted, but F1 still doesn't work...

        Stephen6309undefined 1 Reply Last reply Reply Quote 0
        • Stephen6309undefined
          Stephen6309 @A Former User
          last edited by

          @thedragonlord Don't know what to try next. I used a macro to test what I ended up using with my deamon.g file.

          A Former User? 1 Reply Last reply Reply Quote 0
          • A Former User?
            A Former User @Stephen6309
            last edited by

            @stephen6309 said in M150 with Adafruit RGBW ring issue?:

            @thedragonlord Don't know what to try next. I used a macro to test what I ended up using with my deamon.g file.

            maybe with the Duet2WiFi F1 simply doesn't work...I don't know....

            Stephen6309undefined 1 Reply Last reply Reply Quote 0
            • Stephen6309undefined
              Stephen6309 @A Former User
              last edited by Stephen6309

              @thedragonlord Don't know about the Duet 2, since the Duet 3 boards have a connector just for the NEOPixel LEDs.

              My are connected to a Mean Well 5vdc on one side of the strip, the other end for the input & GND to the connector.

              1 Reply Last reply Reply Quote 0
              • gloomyandyundefined
                gloomyandy @A Former User
                last edited by

                @thedragonlord You need to send at least one command without the F1 to actually set all of the accumulated leds so...
                M150 X4 R255 S4 F1
                M150 X4 U255 S4 F1
                M150 X4 B255 S4
                Should set the first 4 to red, the next 4 to green and the next 4 to blue. If you send another command it will start again at the first LED in the string.

                A Former User? 1 Reply Last reply Reply Quote 0
                • A Former User?
                  A Former User @gloomyandy
                  last edited by

                  @gloomyandy said in M150 with Adafruit RGBW ring issue?:

                  M150 X4 B255 S4

                  uh ok, it works like this, thanks

                  gloomyandyundefined 1 Reply Last reply Reply Quote 0
                  • gloomyandyundefined
                    gloomyandy @A Former User
                    last edited by

                    @thedragonlord The way that neopixels work is that you pretty much set them all at once. Basically each set of commands goes to the first pixel and if another set arrives within a short timeout then the previous set of commands are passed on to the next pixel and this continues for each pixel until there is a longer gap in the commands. So to make this work RRF needs to buffer up all of the commands until you have the complete sequence, yo do this by giving the commands with an F1 parameter, then on the final command (with the default F0) RRF sends all of the commands one after the other and all of the pixels in effect get set in one go. So using my previous set of commands the pixel command buffer will look like
                    RRRRGGGGBBBB where R = (255, 0, 0, 0), B = (0, 255, 0, 0) G=(0, 0, 255, 0) and the values in brackets are the red, green, blue, white values for each pixel. All of these will sent out one after the other when that final G150 with no F command is processed.

                    Hope that makes some sort of sense!

                    A Former User? 1 Reply Last reply Reply Quote 1
                    • A Former User?
                      A Former User @gloomyandy
                      last edited by

                      @gloomyandy said in M150 with Adafruit RGBW ring issue?:

                      @thedragonlord The way that neopixels work is that you pretty much set them all at once. Basically each set of commands goes to the first pixel and if another set arrives within a short timeout then the previous set of commands are passed on to the next pixel and this continues for each pixel until there is a longer gap in the commands. So to make this work RRF needs to buffer up all of the commands until you have the complete sequence, yo do this by giving the commands with an F1 parameter, then on the final command (with the default F0) RRF sends all of the commands one after the other and all of the pixels in effect get set in one go. So using my previous set of commands the pixel command buffer will look like
                      RRRRGGGGBBBB where R = (255, 0, 0, 0), B = (0, 255, 0, 0) G=(0, 0, 255, 0) and the values in brackets are the red, green, blue, white values for each pixel. All of these will sent out one after the other when that final G150 with no F command is processed.

                      Hope that makes some sort of sense!

                      I'm triyng to use the M150 in a while loop like this:

                      ; Check for T0 to start warming
                      if {global.isTool0Warming==false && tools[0].state=="active"}
                      	set global.isToolsStatusChanged=true
                      	set global.isTool0Warming=true
                      	set global.totalTemperature=global.totalTemperature+tools[0].active[0]
                      
                      ; Check for T0 to start cooling
                      if {global.isTool0Warming==true && tools[0].state!="active"}
                      	set global.isToolsStatusChanged=true
                      	set global.isTool0Warming=false
                      	set global.totalTemperature=global.totalTemperature-tools[0].active[0]
                      	
                      ; Recalculate temperature step for each LED
                      if {global.isToolsStatusChanged==true}
                      	set global.isToolsStatusChanged=false
                      	set global.temperatureStep=global.totalTemperature/24
                      
                      var index=1
                      var colore=0
                      if {global.temperatureStep>0}
                      	while {var.index<24}
                      		if {heat.heaters[1].current>=global.temperatureStep*var.index}
                      			set var.colore=255
                      		else
                      			set var.colore=0
                      		;echo "Step, colore =", var.index, var.colore
                      		M150 R0 B0 U{var.colore} S{var.index} F1
                      		set var.index=var.index+1
                      	if {heat.heaters[1].current>=global.temperatureStep*24}
                      		;echo "Step raggiunto =", var.index
                      		set var.colore=255
                      	else
                      		set var.colore=0
                      	M150 R0 B0 U{var.colore} S24 F0
                      

                      but it looks like the first M150 inside the loop "freezes" everithing and no LED is setted on....what am I doning wrong?

                      gloomyandyundefined 1 Reply Last reply Reply Quote 0
                      • gloomyandyundefined
                        gloomyandy @A Former User
                        last edited by

                        @thedragonlord What are you trying to do with that s{var.index} parameter on the M150, with that code you will be setting first 1 then 2 then 3... up to 24 leds to the selected colour and adding them into the buffer. So by the end of the loop you will have 1+2+3+4+5+6+7...+22+23+24 led commands in the buffer. Given that you only have 24 of them, that does not seem like a very good idea. The S parameter basically specifies the number of LEDS to set to the given colour, not an index into some sort of buffer. As I said above when you use the F1 parameter you are basically accumulating the commands in the command buffer,

                        A Former User? 1 Reply Last reply Reply Quote 0
                        • A Former User?
                          A Former User @gloomyandy
                          last edited by A Former User

                          @gloomyandy said in M150 with Adafruit RGBW ring issue?:

                          @thedragonlord What are you trying to do with that s{var.index} parameter on the M150, with that code you will be setting first 1 then 2 then 3... up to 24 leds to the selected colour and adding them into the buffer. So by the end of the loop you will have 1+2+3+4+5+6+7...+22+23+24 led commands in the buffer. Given that you only have 24 of them, that does not seem like a very good idea. The S parameter basically specifies the number of LEDS to set to the given colour, not an index into some sort of buffer. As I said above when you use the F1 parameter you are basically accumulating the commands in the command buffer,

                          Uh, I thought I understood but just for try I tried to set 5 LEDs in green and one LED in red, so I've sended:

                          M150 U255 R0 B0 S1 P10 F1
                          M150 U255 R0 B0 S1 P10 F1
                          M150 U255 R0 B0 S1 P10 F1
                          M150 U255 R0 B0 S1 P10 F1
                          M150 U255 R0 B0 S1 P10 F1
                          M150 U0 R255 B0 S1 P10
                          

                          and here's what I got:

                          20211003_190405.jpg

                          Only 5 LEDs turned on and the colors "randomly" assigned...

                          What am I doing wrong again?

                          EDIT
                          Maybe I understood, I always have to set the whole set of LEDS to make them work correctlu, right?

                          gloomyandyundefined 1 Reply Last reply Reply Quote 0
                          • gloomyandyundefined
                            gloomyandy @A Former User
                            last edited by

                            @thedragonlord Where are you setting the LED type? I thought you had RGBW leds, if so at some point you need to tell RRF that is what you have with the X parameter to M150.

                            A Former User? 1 Reply Last reply Reply Quote 0
                            • A Former User?
                              A Former User @gloomyandy
                              last edited by

                              @gloomyandy said in M150 with Adafruit RGBW ring issue?:

                              @thedragonlord Where are you setting the LED type? I thought you had RGBW leds, if so at some point you need to tell RRF that is what you have with the X parameter to M150.

                              I've discovered that if I set the LEDS whan the heater is heating, regardless the numbers, the colors etc. they don't ever be set on. When the heater reaches the temperature the LEDS works normally...

                              gloomyandyundefined 1 Reply Last reply Reply Quote 0
                              • gloomyandyundefined
                                gloomyandy @A Former User
                                last edited by

                                @thedragonlord How are you testing that? If you have a simple reproducible case then you should probably describe it so that dc42 can look into it.

                                A Former User? 1 Reply Last reply Reply Quote 0
                                • A Former User?
                                  A Former User @gloomyandy
                                  last edited by A Former User

                                  @gloomyandy said in M150 with Adafruit RGBW ring issue?:

                                  @thedragonlord How are you testing that? If you have a simple reproducible case then you should probably describe it so that dc42 can look into it.

                                  I discovered that if you heat the tools "manually" from the Tools buttons in DWC all gcodes stay queued until the tools reach the setted temperature... I haven't tried if heating from a print acts the same...

                                  jay_s_ukundefined 1 Reply Last reply Reply Quote 0
                                  • jay_s_ukundefined
                                    jay_s_uk @A Former User
                                    last edited by

                                    @thedragonlord you probably have M116 or similar in your tool change files

                                    Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

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