Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login
    1. Home
    2. K01571N3N
    • Profile
    • Following 1
    • Followers 0
    • Topics 7
    • Posts 28
    • Best 2
    • Controversial 0
    • Groups 0

    K01571N3N

    @K01571N3N

    Owner of 2 custom toolchangers

    2
    Reputation
    2
    Profile views
    28
    Posts
    0
    Followers
    1
    Following
    Joined Last Online
    Location Suomi Age 26

    K01571N3N Unfollow Follow

    Best posts made by K01571N3N

    • LED controlling with meta commands

      Hi!

      I have been working out for controlling all led lights in my tool changer 3d printer.

      I use 50 pieces of dotstar leds and first 18 are bottom of bed, next 29 are in frame and last 3 in toolchanging head. Bed leds are for notification light use to see the status of the printer.

      Heres some code for Led control loop. If there is m1 or something in print that requires waiting the operator, variable named global.LEDMode is set to Wait and leds are set to white and bed blue flashing loop will start. If global.LEDMode is set to Printing, leds are set to green and white static.

      ; LED control loop
      while 1=1
      
        ; Wait (White, Bed flashing blue) For M1 and filament change etc
        while global.LEDMode = Wait    ;1 <---this while could be if, i guess?
          M150 B255 S18 P255 F1		; LED Bed = Blue
          M150 R255 U255 B255 S29 P255 F1	; LED Frame = White
          M150 R255 U255 B255 S3 P255		; LED ToolHead = White
            while global.LEDMode = Wait	; Entering flashing loop
              G4 P1000			; 1000ms time delay
              M150 B255 S18 P0		; Blue off
              G4 P1000			; 1000ms time delay
              M150 B255 S18 P255		; Blue on
              if global.LEDMode != Wait
                break			        ; Exit flashing loop
        break   ;1 <---then this would be removed
      
        ; Printing (White, Bed static green)
        while global.LEDMode = Printing       ;<--- here while is necessary?
          M150 U255 S18 P255 F1		; LED Bed = Green
          M150 R255 U255 B255 S29 P255 F1	; LED Frame = White
          M150 R255 U255 B255 S3 P255		; LED ToolHead = White
          if global.LEDMode != Printing
            break			        ; Exit loop
      
      

      will this work like i expect?

      Meta command doesnt work yet because i have 3.2.2 firmware.

      Will that flashing loop work? does it(g4) stop printer if i want same loop for toolchange script?

      Thank you in advance!

      posted in Gcode meta commands
      K01571N3Nundefined
      K01571N3N
    • RE: Infinite loop?

      @dc42 Hi, yesterday I couldn't answer because this site said i was spamming... 😄

      tried that daemon file but it didnt work

      it was something like that

      set global.LEDMode = {global.LEDModeLast}
      
      ; WorkLight (Bed static white, Frame static white, ToolHead static white)
      while global.LEDMode = "WorkLight"		; Enter loop
        M150 R255 U255 B255 S18 P255 F1		; LED Bed = White
        M150 R255 U255 B255 S29 P255 F1		; LED Frame = White
        M150 R255 U255 B255 S3 P255			; LED ToolHead = White
        if global.LEDMode != "WorkLight"
          set global.LEDModeLast = "Worklight"
          break								; Exit loop
       
       
       
        ; Homing (Bed flashing yellow, Frame static white, ToolHead flashing yellow)
      while global.LEDMode = "Homing"			; Enter loop
        M150 R255 U255 S18 P255 F1			; LED Bed = Yellow
        M150 R255 U255 B255 S29 P255 F1		; LED Frame = White
        M150 R255 U255 S3 P255				; LED ToolHead = Yellow
        G4 P1000							; 1000ms time delay
        M150 R255 U255 S18 P0 F1			; LED Bed = OFF
        M150 R255 U255 B255 S29 P255 F1		; LED Frame = White
        M150 R255 U255 S3 P0				; LED ToolHead = OFF
        G4 P1000							; 1000ms time delay
        if global.LEDMode != "Homing"
          set global.LEDModeLast = "Homing"
          break								; Exit loop
       
       
       
      ; Printing (Bed static green, Frame static white, ToolHead static white)
      while global.LEDMode = "Printing"		; Enter loop
        M150 U255 S18 P255 F1				; LED Bed = Green
        M150 R255 U255 B255 S29 P255 F1		; LED Frame = White
        M150 R255 U255 B255 S3 P255			; LED ToolHead = White
        if global.LEDMode != "Printing"
          set global.LEDModeLast = "Printing"
          break		
      

      i also tried to change while to if

      set global.LEDMode = {global.LEDModeLast}
      
      ; WorkLight (Bed static white, Frame static white, ToolHead static white)
      if global.LEDMode = "WorkLight"		; Enter loop
        M150 R255 U255 B255 S18 P255 F1		; LED Bed = White
        M150 R255 U255 B255 S29 P255 F1		; LED Frame = White
        M150 R255 U255 B255 S3 P255			; LED ToolHead = White
        set global.LEDModeLast = "Worklight"
       
       
       
        ; Homing (Bed flashing yellow, Frame static white, ToolHead flashing yellow)
      if global.LEDMode = "Homing"			; Enter loop
        M150 R255 U255 S18 P255 F1			; LED Bed = Yellow
        M150 R255 U255 B255 S29 P255 F1		; LED Frame = White
        M150 R255 U255 S3 P255				; LED ToolHead = Yellow
        G4 P1000							; 1000ms time delay
        M150 R255 U255 S18 P0 F1			; LED Bed = OFF
        M150 R255 U255 B255 S29 P255 F1		; LED Frame = White
        M150 R255 U255 S3 P0				; LED ToolHead = OFF
        G4 P1000							; 1000ms time delay
        set global.LEDModeLast = "Homing"
       
       
       
      ; Printing (Bed static green, Frame static white, ToolHead static white)
      if global.LEDMode = "Printing"		; Enter loop
        M150 U255 S18 P255 F1				; LED Bed = Green
        M150 R255 U255 B255 S29 P255 F1		; LED Frame = White
        M150 R255 U255 B255 S3 P255			; LED ToolHead = White
        set global.LEDModeLast = "Printing"
      

      i also tested that the daemon.g is executed by adding m291 there and it works. but the led control dont work

      posted in Gcode meta commands
      K01571N3Nundefined
      K01571N3N

    Latest posts made by K01571N3N

    • RE: Duet 3 DIAG led is dimmed

      @phaedrux BOSSA says "File operation exceeds flash size". I have tried Fallback procedure #1 and #2, same results, DIAG Led stays dimmed. Whats next?

      posted in Firmware installation
      K01571N3Nundefined
      K01571N3N
    • Duet 3 DIAG led is dimmed

      Hi! I'm building new printer with Duet3 and Raspberry PI 4. I got this error message "Board is not available (no header)". DIAG Led on Duet is dimmed. On computer Duet shows as unknown device and com3 port. I installed Bossa and now it is Bossa Program Port. Then i tried updating firmware with Bossa but it says "File operation exceeds flash size". What can i do now?

      posted in Firmware installation
      K01571N3Nundefined
      K01571N3N
    • RE: expression inside expression

      @chrishamm thats nice! i forgot to mention that i got a raspberry with duet...

      posted in Gcode meta commands
      K01571N3Nundefined
      K01571N3N
    • RE: expression inside expression

      @dc42 interesting 🤔 🤔

      posted in Gcode meta commands
      K01571N3Nundefined
      K01571N3N
    • RE: expression inside expression

      @dc42 echo {"Kuumapään lämmittäminen " ^ global.Temperature ^ "-asteeseen"}

      this works also like it should. there is a some problem with that m291 comment

      posted in Gcode meta commands
      K01571N3Nundefined
      K01571N3N
    • RE: expression inside expression

      @dc42 echo works but that other one doesn't. I don't understand what it could be due to

      posted in Gcode meta commands
      K01571N3Nundefined
      K01571N3N
    • RE: expression inside expression

      @dc42 how can i do that? Its not working in console or any macros if i make them in dwc.

      posted in Gcode meta commands
      K01571N3Nundefined
      K01571N3N
    • RE: expression inside expression

      @dc42 and i noticed that this does not work because of "ä" letter.

      It says Error: M291: control character in string

      M291 R"Filamentin lataus" P{"Kuumapään lämmittäminen " ^global.Temperature^ "-asteeseen"} S1 T3
      

      Like this it works:

      M291 R"Filamentin lataus" P{"Kuumapaan lammittaminen " ^global.Temperature^ "-asteeseen"} S1 T3
      

      Also this doesnt work. If i change "ä" to "a" it will work like it should.

      M291 R"Filamentin lataus" P"Kuumapään lämmittäminen asteeseen"S1 T3
      

      b3132e8a-5942-4017-a146-c32a324d5b7e-image.png

      posted in Gcode meta commands
      K01571N3Nundefined
      K01571N3N
    • RE: expression inside expression

      @dc42 okay.

      i fixed it with this

      if global.CurrentToolMemory = 0
        T0
        G53 G1 X{global.T0ParkX} Y{global.T0ParkY} F20000	; ToolHead to the center
        M291 R"Kaikkien akseleiden kotiinajo" P"Kotiinajo valmis" S1 T1	; Message
      
      elif global.CurrentToolMemory = 1
        T0
        G53 G1 X{global.T1ParkX} Y{global.T1ParkY} F20000	; ToolHead to the center
        M291 R"Kaikkien akseleiden kotiinajo" P"Kotiinajo valmis" S1 T1	; Message
      
      elif global.CurrentToolMemory = 2
        T0
        G53 G1 X{global.T2ParkX} Y{global.T2ParkY} F20000	; ToolHead to the center
        M291 R"Kaikkien akseleiden kotiinajo" P"Kotiinajo valmis" S1 T1	; Message
      
      elif global.CurrentToolMemory = 3
        T0
        G53 G1 X{global.T3ParkX} Y{global.T3ParkY} F20000	; ToolHead to the center
        M291 R"Kaikkien akseleiden kotiinajo" P"Kotiinajo valmis" S1 T1	; Message
      
      else
        M291 R"Kaikkien akseleiden kotiinajo" P"Kotiinajo valmis" S1 T1	; Message
        G53 G1 X183 Y320 F20000	; ToolHead to the center
      
      

      when those array-valued variables will come?

      posted in Gcode meta commands
      K01571N3Nundefined
      K01571N3N
    • expression inside expression

      Hi. is this a bug or am i just not able to do it right?

      this is my homeall macro.

      ; homeall.g
      ; X, Y, Z, C-axis homing
      ; 15.06.2021 23:57
      
      
      set global.LEDModeMemory = {global.LEDMode}
      set global.CurrentToolMemory = {state.currentTool}
      set global.LEDMode = "Homing"	; LEDMode = Homing
      
      
      if state.currentTool = -1	; If there is not a tool in a ToolHead
        M291 R"Kaikkien akseleiden kotiinajo" P"C-akseli" S1 T10	; Message
        G91						; Relative coordinate
        M913 C60					; C-axis motors current 60%
        G1 H2 C-260 F2000			; Home C-axis against the hard end
        G90						; Absolute coordinate
        G92 C-121.6				; Set C-axis zeropoint
        M913 C100					; C-axis motors current 100%
        G53 G1 C0 F5000			; C-axis open = C0
        M291 R"Kaikkien akseleiden kotiinajo" P"X- ja Y-akselit" S1 T40	; Message
        G91						; Relative coordinate
        G1 H2 Z5 F1000			; Lower bed 5mm
        G1 H1 Y-1000 F10000		; Home Y-axis first time
        G1 H1 X-1000				; Home X-axis first time
        G1 X5 Y5 F20000			; Move X- and Y-axis 5mm away
        G1 H1 Y-20 F300			; Home Y-axis second time slower
        G1 Y10 F20000				; Move Y-axis 10mm away
        G1 H1 X-20 F300			; Home X-axis second time slower
        G1 X10 F20000				; Move X-axis 10mm away
        M291 R"Kaikkien akseleiden kotiinajo" P"Z-akseli" S1 T200	; Message
        G90						; Absolute coordinate
        G53 G1 X183 Y180 F20000	; Move X- and Y-axis to the center of the bed
        G91						; Relative coordinate
        G1 H1 Z-1000 F300			; Home Z-axis first time
        G4 P100					; 100ms time delay
        G1 H2 Z2					; Move Z-axis 2mm away
        G4 P100					; 100ms time delay
        G1 H1 Z-20 F50			; Home Z-axis second time slower
        G4 P100					; 100ms time delay
        G90						; Absolute coordinate
        G92 Z0					; Set Z-axis zeropoint
        G91						; Relative coordinate
        G1 Z10 F1000				; Lower bed 10mm
        G90						; Absolute coordinate
      
      else						; If there is a tool in a Toolhead
        M564 H0					; Allow movement without homing(for Z-axis)
        M291 R"Kaikkien akseleiden kotiinajo" P"X- ja Y-akselit, työkalu paikallaan  " S1 T40	; Message
        G91						; Relative coordinate
        G1 H2 Z5 F1000			; Lower bed 5mm
        G1 H1 Y-1000 F5000		; Home Y-axis first time
        G1 H1 X-1000				; Home X-axis first time
        G1 X5 Y5 F5000			; Move X- and Y-axis 5mm away
        G1 H1 Y-20 F300			; Home Y-axis second time slower
        G1 Y10 F20000				; Move Y-axis 10mm away
        G1 H1 X-20 F300			; Home X-axis second time slower
        G1 X10 F20000				; Move X-axis 10mm away
        G90						; Absolute coordinate
        T-1						; Tool remove
        G53 G1 X183 Y180 F20000	; Move X- and Y-axis to the center of the bed
        M291 R"Kaikkien akseleiden kotiinajo" P"C-akseli" S1 T10	; Message
        G91						; Relative coordinate
        M913 C60					; C-axis motors current 60%
        G1 H2 C-260 F2000			; Home C-axis against the hard end
        G90						; Absolute coordinate
        G92 C-121.6				; Set C-axis zeropoint
        M913 C100					; C-axis motors current 100%
        G53 G1 C0 F5000			; C-axis open = C0
        G291 R"Kaikkien akseleiden kotiinajo" P"Z-akseli" S1 T200	; Message
        G90						; Absolute coordinate
        G53 G1 X183 Y180 F20000	; Move X- and Y-axis to the center of the bed
        G91						; Relative coordinate
        G1 H1 Z-1000 F300			; Home Z-axis first time
        G4 P100					; 100ms time delay
        G1 H2 Z2					; Move Z-axis 2mm away
        G4 P100					; 100ms time delay
        G1 H1 Z-20 F50			; Home Z-axis second time slower
        G4 P100					; 100ms time delay
        G90						; Absolute coordinate
        G92 Z0					; Set Z-axis zeropoint
        G91						; Relative coordinate
        G1 Z10 F1000				; Lower bed 10mm
        G90						; Absolute coordinate
      
      
      
      ; Problem starts here!!
      
      
      
      if global.CurrentToolMemory != -1
        T{global.CurrentToolMemory}
        set global.TCurrentParkX = {global.T{state.currentTool}ParkX}
        set global.TCurrentParky = {global.T{state.currentTool}ParkY}
        G53 G1 X{global.TCurrentParkX} Y{global.TCurrentParky} F20000	; ToolHead to the center
        M291 R"Kaikkien akseleiden kotiinajo" P"Kotiinajo valmis" S1 T1	; Message
        
        
      else
        M291 R"Kaikkien akseleiden kotiinajo" P"Kotiinajo valmis" S1 T1	; Message
        G53 G1 X183 Y320 F20000	; ToolHead to the center
      
      
      set global.LEDModeLast = {global.LEDModeMemory}
      set global.LEDMode = {global.LEDModeLast}	; LEDMode = Last
      

      problem is this, it says=
      Error: {global.T{state.currentTool}ParkX}unknown variable 'T' of homeall.g

      i tried to write to the console

      echo {global.T{state.currentTool}ParkX}
      

      it will show just what i want to see. but in this homeall macro, it wont work.

      what is this about?

      Thanks in advance!

      posted in Gcode meta commands
      K01571N3Nundefined
      K01571N3N