@phaedrux BOSSA says "File operation exceeds flash size". I have tried Fallback procedure #1 and #2, same results, DIAG Led stays dimmed. Whats next?
Posts made by K01571N3N
-
RE: Duet 3 DIAG led is dimmed
-
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?
-
RE: expression inside expression
@chrishamm thats nice! i forgot to mention that i got a raspberry with duet...
-
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
-
RE: expression inside expression
@dc42 echo works but that other one doesn't. I don't understand what it could be due to
-
RE: expression inside expression
@dc42 how can i do that? Its not working in console or any macros if i make them in dwc.
-
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
-
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?
-
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.gi 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!
-
RE: Infinite loop?
@jay_s_uk i understand but that's why i told you why ModeLast exists. and checking printer state is one option too
-
RE: Infinite loop?
@k01571n3n it is so easy to customise almost everything with variables
-
RE: Infinite loop?
@jay_s_uk but why wouldnât you want to use variables? i dont get your point for that
-
RE: Infinite loop?
@jay_s_uk yes i can but.. if im not printing, it will change it to wrong mode, thats why there is that last state in memory
-
RE: Infinite loop?
@jay_s_uk the reason for global.LEDModeLast is:
Printer is printing -> LEDMode = "Printing"
Toolchange comesToolchange macro set global.LEDMode = "ToolChange" tool change stuff set global.LEDMode = {global.LEDModeLast}
When LEDMode is changed to something from "Printing", it sets LEDModeLast = "Printing"
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" <------ here
So when the toolchange is completed, LEDMode is back at "Printing" or whatever was the last state of LED, you got the point?
-
RE: Infinite loop?
@jay_s_uk in config.g is M98 P"VariableReset.g" and all variables are resetted to something i want in that VariableReset.g. LEDMode is "OFF" and for example, in tool change macro have set global.LEDMod = "ToolChange", when printing LEDMode = "Printing" etc
-
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
-
RE: Infinite loop?
@dc42 what you mean by led code? do you mean that led control loop? and what is daemon.g?
-
Infinite loop?
Hi! I posted earlier about led controlling with loops. Now i got new firmware and variables are working but...
I cant do a infinite loop because printers status is then busy all the time and i cant do anything because of "busy"...
Does anyone have any idea how to do that?
Heres some code
; Configuration file for Duet3 ; Executed when Duet 3 is started M80 ; Power supplies ON ; General parameters G90 ; Absolute coordinate M83 ; Relative extrusion M550 P"Koistisen TC1" ; Printer's name M669 K1 ; Printer's kinematics = CoreXY ; Motor drivers M569 P1.0 S1 ; Motor 1.0 CW (X) M569 P1.1 S1 ; Motor 1.1 CW (Y) M569 P0.3 S1 ; Motor 1.2 CW (Z) M569 P0.0 S1 ; Motor 0.0 CW (C) M569 P0.1 S0 ; Motor 0.1 CCW (E0) M569 P0.2 S0 ; Motor 0.2 CCW (E1) M569 P0.5 S0 ; Motor 0.3 CCW (E2) M584 X1.0 Y1.1 Z0.3 C0.0 E0.1:0.2:0.5 ; Motor axis parameters M350 X16 Y16 Z16 I1 ; XYZ-Microstepping with integration M350 E16:16:16 I1 ; E-Microstepping with integration M350 C8 I0 ; C-Microstepping with integration ; Motor parameters M92 X200.00 Y200.00 Z3200.00 C100 E829.00:829.00:829.00 ; Step/mm M566 X500.00 Y500.00 Z100.00 C300.00 E500.00:500.00:500.00 ; Max allowable instantaneous speed change = Jerk (mm/min) M203 X17000.00 Y17000.00 Z800.00 C5000.00 E9000.00:9000.00:9000.00 ; Max speed (mm/min) M201 X1500.00 Y1500.00 Z300.00 C500.00 E2000.00:2000.00:2000.00 ; Acceleration (mm/s^2) M906 X1100 Y1100 Z1600 C400 E1300:1300:1300 I30 ; Motor current (mA) and motor idle factor in per cent M84 S30 ; Set idle timeout ; Axis limits M208 X0:365 Y0:362 Z0:509 C-120:120 ; Min/Max ; Endstops M574 X1 S1 P"1.io0.in" ; X-Endstop = 1.io0.in M574 Y1 S1 P"1.io1.in" ; Y-Endstop = 1.io1.in M574 Z1 S2 ; Z-Endstop = Z-Probe ; Z-Probe M558 P8 C"0.io8.in" H1 F120 T15000 ; Z-Probe = Microswitch. Measuring depth ja speed. Input = C"1.io2.in" G31 P1000 X0 Y0 Z0 ; Z-Probe triggervalue and offset M557 X0:367 Y50:310 S30 ; Bed calibration ; Heaters ; Bed M308 S0 P"1.temp0" Y"thermistor" T100000 B4138 A"Peti" ; Heat sensor 0 = 1.temp0 M950 H0 C"0.out0" T0 ; Heater 0 = 0.out0 = Heat sensor 0 M307 H0 B0 S1.00 ; PID-control, max PWM-value M140 H0 ; Bed = Heater 0 M143 H0 S120 ; LÀmpöraja lÀmmitin 0 = 0-120C ; Tool 0 M308 S1 P"0.temp0" Y"thermistor" T100000 B4138 A"T0" ; Heat sensor 1 = 0.temp0 M950 H1 C"0.out1" T1 ; Heater 1 = 0.out1 = Heat sensor 1 M307 H1 B0 S1.00 ; PID-control, max PWM-value M143 H1 S280 ; Thermal limit for heater 1 = 0-280C ; Tool 1 M308 S2 P"0.temp1" Y"thermistor" T100000 B4138 A"T1" ; Heat sensor 2 = 0.temp1 M950 H2 C"0.out2" T2 ; Heater 2 = 0.out2 = Heat sensor 2 M307 H2 B0 S1.00 ; PID-control, max PWM-value M143 H2 S280 ; Thermal limit for heater 2 = 0-280C ; Tool 2 M308 S3 P"0.temp2" Y"thermistor" T100000 B4138 A"T2" ; Heat sensor 3 = 0.temp2 M950 H3 C"0.out3" T3 ; Heater 3 = 0.out3 = Heat sensor 3 M307 H3 B0 S1.00 ; PID-control, max PWM-value M143 H3 S280 ; Thermal limit for heater 3 = 0-280C ; Fans ; Tool 0 M950 F0 C"0.out7" Q500 ; Fan 0 = 0.out7 = 500hz M106 P0 C"T0/Kappale" S0.0 H-1 ; Fan 0 name = "Kappale". Without temperature control M950 F1 C"0.out4" Q500 ; Fan 1 = 0.out4 = 500hz M106 P1 C"T0/HotEnd" S1.0 H1 T50 L1.0 ; Fan 1 name = "HotEnd". Temperature control = Heat sensor 1 = 50C ; Tool 1 M950 F2 C"0.out8" Q500 ; Fan 2 = 0.out8 = 500hz M106 P2 C"T1/Kappale" S0.0 H-1 ; Fan 2 name = "Kappale". Without temperature control M950 F3 C"0.out5" Q500 ; Fan 3 = 0.out5 = 500hz M106 P3 C"T1/HotEnd" S1.0 H2 T50 L1.0 ; Fan 3 name = "HotEnd". Temperature control = Heat sensor 2 = 50C ; Tool 2 M950 F4 C"0.out9" Q500 ; Fan 4 = 0.out8 = 500hz M106 P4 C"T2/Kappale" S0.0 H-1 ; Fan 4 name = "Kappale". Without temperature control M950 F5 C"0.out6" Q500 ; Fan 5 = 0.out5 = 500hz M106 P5 C"T2/HotEnd" S1.0 H3 T50 L1.0 ; Fan 5 name = "HotEnd". Temperature control = Heat sensor 2 = 50C ; Tools ; Tool 0 "BMG1" M563 P0 S"BMG1" D0 H1 F0 ; Tool 0 parameters G10 P0 X0 Y0 Z0 ; Tool 0 offset G10 P0 R0 S0 ; Tool 0 valmius- ja kÀyttölÀmpötilat 0C/0C ;M591 D0 P7 S1 L7 C"0.io0.in" ; Tool 0 Filament sensor ; Tool 1 "BMG2" M563 P1 S"BMG2" D1 H2 F2 ; Tool 1 parameters G10 P1 X0 Y0 Z0 ; Tool 1 offset G10 P1 R0 S0 ; Tool 1 valmius- ja kÀyttölÀmpötilat 0C/0C ;M591 D1 P7 S1 L7 C"0.io1.in" ; Tool 1 Filament sensor ; Tool 2 "BMG3" M563 P2 S"BMG3" D2 H3 F4 ; Tool 2 parameters G10 P2 X0 Y0 Z0 ; Tool 2 offset G10 P2 R0 S0 ; Tool 2 valmius- ja kÀyttölÀmpötilat 0C/0C ;M591 D2 P7 S1 L7 C"0.io2.in" ; Tool 2 Filament sensor ; Tool 3 "JYRSIN" M563 P3 S"JYRSIN" F-1 ; Tool 3 parameters G10 P3 X0 Y0 Z0 ; Tool 3 offset ; Macros M98 P"0:/sys/VariableReset.g" ; Variable reset ;M98 P"0:/sys/LEDControl.g" ; LED Control Loop start <--printer wont start because of the loop M98 P"0:/sys/BedOrigin.g" ; Bed zeropoint G55 M98 P"0:/sys/ToolActive.g" ; Active tool reading ; Other M911 S23 R23.8 P"M500 M913 X0 Y0 C0 M150 S60 G91 M83 G1 Z2 E-1 F1000" ; Voltage threshold M501 ; Load saved parameters from config-override.g ; Tool Offsets G10 P0 X4.5 Y39 Z-46. ; Tool 0 offset G10 P1 X4.5 Y39 Z-45.95 ; Tool 1 offset G10 P2 X4.5 Y39 Z-45.85 ; Tool 2 offset G10 P3 X0 Y0 Z0 ; Tool 3 offset
; VariableReset.g ; Resets all variables ; 14.06.2021 16:16 ; LED Variable reset ; Mode----------------- global LEDMode = "OFF" global LEDModeLast = "OFF" var LEDModeMemory = "OFF" ; Color---------------------- global LEDAllColor = "White" global LEDBedColor = "White" global LEDFrameColor = "White" global LEDToolHeadColor = "White" ; Dimming-------------- global LEDAllDim = 0 global LEDBedDim = 0 global LEDFrameDim = 0 global LEDToolHeadDim = 0 ; All--------------- global AllRed = 0 global AllGreen = 0 global AllBlue = 0 global AllCustomRed = 0 global AllCustomGreen = 0 global AllCustomBlue = 0 ; Bed--------------- global BedRed = 0 global BedGreen = 0 global BedBlue = 0 global BedCustomRed = 0 global BedCustomGreen = 0 global BedCustomBlue = 0 ; Frame--------------- global FrameRed = 0 global FrameGreen = 0 global FrameBlue = 0 global FrameCustomRed = 0 global FrameCustomGreen = 0 global FrameCustomBlue = 0 ; ToolHead--------------- global ToolHeadRed = 0 global ToolHeadGreen = 0 global ToolHeadBlue = 0 global ToolHeadCustomRed = 0 global ToolHeadCustomGreen = 0 global ToolHeadCustomBlue = 0 ; Tool Variable reset var CurrentToolMemory = -1 ; Filament Variable reset global FilamentName = 0 global FilamentTemperature = 0 global FilamentRetract = 0
; LED-Control ; LED Control loop ; 10.06.2021 ; Signal colors ; Blue = Waiting ; Red = Error/emergency ; Yellow = Warning/operator ; Green = Running ; Global variables for mode: ; global.LEDMode = <Mode> ; global.LEDModeLast = <ModeLast>; This is used automatically ; <Mode> (Explanation) ; WorkLight (Bed static white, Frame static white, ToolHead static white) ; Homing (Bed flashing yellow, Frame static white, ToolHead flashing yellow) ; Printing (Bed static green, Frame static white, ToolHead static white) ; ToolChange (Bed flashing green, Frame static white, ToolHead flashing yellow) ; FilamentWait (Bed flashing blue, Frame static white, ToolHead static yellow) ; Wait (Bed flashing blue, Frame static white, ToolHead static white) ; PrintFinished (Bed flashing green slow low dim, Frame OFF, ToolHead OFF) ; OFF (Bed OFF, Frame OFF, ToolHead OFF) ; Warning (Bed flashing yellow, Frame static white, ToolHead static white) ; Error (Bed flashing red, Frame static red, ToolHead static White) ; Custom (Give your own parameters for color and dimming, will reset every time when Mode changed) ; Global variables for color: ; global.LEDAllColor = <Color> ; global.LEDBedColor = <Color> ; global.LEDFrameColor = <Color> ; global.LEDToolHeadColor = <Color> ; <Color>: Red, Green, Blue, White, Yellow, Custom ; Global variables for dimming ; global.LEDAllDim = <Dim> ; global.LEDBedDim = <Dim> ; global.LEDFrameDim = <Dim> ; global.LEDToolHeadDim = <Dim> ; <Dim>: 0-255 ; Global variables for custom color: ; global.AllCustomRed = <ColorRGB> ; global.AllCustomGreen = <ColorRGB> ; global.AllCustomBlue = <ColorRGB> ; global.BedCustomRed = <ColorRGB> ; global.BedCustomGreen = <ColorRGB> ; global.BedCustomBlue = <ColorRGB> ; global.FrameCustomRed = <ColorRGB> ; global.FrameCustomGreen = <ColorRGB> ; global.FrameCustomBlue = <ColorRGB> ; global.ToolHeadCustomRed = <ColorRGB> ; global.ToolHeadCustomGreen = <ColorRGB> ; global.ToolHeadCustomBlue = <ColorRGB> ; <ColorRGB>: Value 0-255 for each color ; M150 U255 R255 S18 P255 F1 ; LED Bed = Yellow ; M150 R255 U255 B255 S29 P255 F1 ; LED Frame = White ; M150 R255 U255 B255 S3 P255 ; LED ToolHead = White M150 X0 Q3000000 while 1=1 ; Main control Loop set global.LEDMode = {global.LEDModeLast} ; Modes ; 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 ; Exit loop ; ToolChange (Bed flashing green, Frame static white, ToolHead flashing yellow) while global.LEDMode = "ToolChange" ; Enter loop M150 U255 S18 P255 F1 ; LED Bed = Green M150 R255 U255 B255 S29 P255 F1 ; LED Frame = White M150 R255 U255 S3 P255 ; LED ToolHead = Yellow G4 P1000 ; 1000ms time delay M150 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 != "ToolChange" set global.LEDModeLast = "ToolChange" break ; Exit loop ; Wait (Bed flashing blue, Frame static white, ToolHead static white) while global.LEDMode = "Wait" ; Enter loop 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 G4 P1000 ; 1000ms time delay M150 B255 S18 P0 ; LED Bed = OFF G4 P1000 ; 1000ms time delay if global.LEDMode != "Wait" set global.LEDModeLast = "Wait" break ; Exit loop ; PrintFinished (Bed flashing green slow low dim, Frame OFF, ToolHead OFF) while global.LEDMode = "PrintFinished"; Enter loop M150 U255 S18 P130 F1 ; LED Bed = Green M150 R255 U255 B255 S29 P0 F1 ; LED Frame = OFF M150 R255 U255 B255 S3 P0 ; LED ToolHead = OFF G4 P2000 ; 2000ms time delay M150 U255 S18 P0 ; LED Bed = OFF G4 P2000 ; 2000ms time delay if global.LEDMode != "PrintFinished" set global.LEDModeLast = "PrintFinished" break ; Exit loop ; OFF (Bed OFF, Frame OFF, ToolHead OFF) while global.LEDMode = "OFF" ; Enter loop M150 R255 U255 B255 S18 P0 F1 ; LED Bed = OFF M150 R255 U255 B255 S29 P0 F1 ; LED Frame = OFF M150 R255 U255 B255 S3 P0 ; LED ToolHead = OFF if global.LEDMode != "OFF" set global.LEDModeLast = "OFF" break ; Exit loop ; Warning (Bed flashing yellow, Frame static white, ToolHead static white) while global.LEDMode = "Warning" ; Enter loop M150 R255 U255 S18 P255 F1 ; LED Bed = Yellow M150 R255 U255 B255 S29 P255 F1 ; LED Frame = White M150 R255 U255 B255 S3 P255 ; LED ToolHead = White G4 P1000 ; 1000ms time delay M150 R255 U255 S18 P0 ; LED Bed = OFF G4 P1000 ; 1000ms time delay if global.LEDMode != "Warning" set global.LEDModeLast = "Warning" break ; Exit loop ; Error (Bed flashing red, Frame static red, ToolHead static White) while global.LEDMode = "Error" ; Enter loop M150 R255 S18 P255 F1 ; LED Bed = Red M150 R255 S29 P255 F1 ; LED Frame = Red M150 R255 U255 B255 S3 P255 ; LED ToolHead = White G4 P1000 ; 1000ms time delay M150 R255 S18 P0 ; LED Bed = OFF G4 P1000 ; 1000ms time delay if global.LEDMode != "Error" set global.LEDModeLast = "Error" break ; Exit loop ; Custom LEDs while global.LEDMode = "Custom" ; All colors-------------------- if global.LEDAllColor = "Custom" set global.AllRed = {global.AllCustomRed} set global.AllGreen = {global.AllCustomGreen} set global.AllBlue = {global.AllCustomBlue} if global.LEDAllColor = "Red" set global.AllRed = 255 set global.AllGreen = 0 set global.AllBlue = 0 if global.LEDAllColor = "Green" set global.AllRed = 0 set global.AllGreen = 255 set global.AllBlue = 0 if global.LEDAllColor = "Blue" set global.AllRed = 0 set global.AllGreen = 0 set global.AllBlue = 255 if global.LEDAllColor = "Yellow" set global.AllRed = 255 set global.AllGreen = 255 set global.AllBlue = 0 if global.LEDAllColor = "White" set global.AllRed = 255 set global.AllGreen = 255 set global.AllBlue = 255 ; Bed colors-------------------- if global.LEDBedColor = "Custom" set global.BedRed = {global.BedCustomRed} set global.BedGreen = {global.BedCustomGreen} set global.BedBlue = {global.BedCustomBlue} if global.LEDBedColor = "Red" set global.BedRed = 255 set global.BedGreen = 0 set global.BedBlue = 0 if global.LEDBedColor = "Green" set global.BedRed = 0 set global.BedGreen = 255 set global.BedBlue = 0 if global.LEDBedColor = "Blue" set global.BedRed = 0 set global.BedGreen = 0 set global.BedBlue = 255 if global.LEDBedColor = "Yellow" set global.BedRed = 255 set global.BedGreen = 255 set global.BedBlue = 0 if global.LEDBedColor = "White" set global.BedRed = 255 set global.BedGreen = 255 set global.BedBlue = 255 ; Frame colors-------------------- if global.LEDFrameColor = "Custom" set global.FrameRed = {global.FrameCustomRed} set global.FrameGreen = {global.FrameCustomGreen} set global.FrameBlue = {global.FrameCustomBlue} if global.LEDFrameColor = "Red" set global.FrameRed = 255 set global.FrameGreen = 0 set global.FrameBlue = 0 if global.LEDFrameColor = "Green" set global.FrameRed = 0 set global.FrameGreen = 255 set global.FrameBlue = 0 if global.LEDFrameColor = "Blue" set global.FrameRed = 0 set global.FrameGreen = 0 set global.FrameBlue = 255 if global.LEDFrameColor = "Yellow" set global.FrameRed = 255 set global.FrameGreen = 255 set global.FrameBlue = 0 if global.LEDFrameColor = "White" set global.FrameRed = 255 set global.FrameGreen = 255 set global.FrameBlue = 255 ; ToolHead colors-------------------- if global.LEDToolHeadColor = "Custom" set global.ToolHeadRed = {global.ToolHeadCustomRed} set global.ToolHeadGreen = {global.ToolHeadCustomGreen} set global.ToolHeadBlue = {global.ToolHeadCustomBlue} if global.LEDToolHeadColor = "Red" set global.ToolHeadRed = 255 set global.ToolHeadGreen = 0 set global.ToolHeadBlue = 0 if global.LEDToolHeadColor = "Green" set global.ToolHeadRed = 0 set global.ToolHeadGreen = 255 set global.ToolHeadBlue = 0 if global.LEDToolHeadColor = "Blue" set global.ToolHeadRed = 0 set global.ToolHeadGreen = 0 set global.ToolHeadBlue = 255 if global.LEDToolHeadColor = "Yellow" set global.ToolHeadRed = 255 set global.ToolHeadGreen = 255 set global.ToolHeadBlue = 0 if global.LEDToolHeadColor = "White" set global.ToolHeadRed = 255 set global.ToolHeadGreen = 255 set global.ToolHeadBlue = 255 M150 R{global.BedRed} U{global.BedGreen} B{global.BedBlue} P{global.LEDBedDim} S18 F1 ; LED Bed M150 R{global.FrameRed} U{global.FrameGreen} B{global.FrameBlue} P{global.LEDFrameDim} S29 F1 ; LED Frame M150 R{global.ToolHeadRed} U{global.ToolHeadGreen} B{global.ToolHeadBlue} P{global.LEDToolHeadDim} S3 ; LED ToolHead if global.LEDMode != "Custom" set global.LEDModeLast = "Custom" break
-
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!