@droftarts Hi
Thanks I understand what you ment now.
Latest posts made by Cubiceye
-
RE: Duet 2 IDLE State Power Off - Solution
-
RE: Duet 2 IDLE State Power Off .
@Cubiceye
Hi droftarts
I have just posted the code.My Duet Controlled machine' category.
everthing below:- "Below is the code I came up with".
Is all supposed to be one code block. -
Duet 2 IDLE State Power Off - Solution
I have rebuilt a 3D Systems CubePro Trio 3D Printer around a Duet 2 WiFi controller board, into a dual nozzle printer with an auto bed levelling sensor where the 3rd nozzle was originally. The CubePro Trio's mechanical build quality is superb, 2nd to none however, the software was atrocious. The whole package was far too proprietary down to the even the filament size of 1.60mm.
I wanted the machine to power off automatically if left Idle for too long.
Below is the code I have come up with and it seems to work OK. In fact it worked the first time I ran it. I decided to do a bit of a tweek, but managed break it and it took 2 hours to get it going again.Below is the code I came up with.
; PW 3D Printer AutoShutdown GCode meta Command Program V001.1 ; This program is placed in a file called daemon.g in the main /sys root directory ; it will automatically be run by the system every 10 secs. ; The program will automatically cool the heaters and shutdown the printer ; if it has been left powered but idle for a predetermined period of time. ; Global variables, Idletime and AutoShutdownCall to be declared ; and set to 0 in config.g file. ;is AutoShutdownCall=10 if it is, then proceed to shutting down the printer if global.AutoShutdownCall=10 echo global.AutoShutdownCall ;echo value to screen M291 P"Auto shutdown has started - To abort, select MACROS/Shutdown Printer/Cancel Shutdown" R"Auto Shutdown" S1 T8 ;autoshutdown message M98 P"sleep.g" ; Run the sleep Macro, which is the auto shutdown program it will also ;reset the printer and thus reset the global variables back to 0. else if ((state.status=="busy") | (state.status=="processing")) ; checking current the status of the printer set global.IdleTime = 0 ; reset IdleTime variable count ;echo "Resetting Idletime Count" ;M117 "Cooldown Cancelled" else set global.IdleTime=global.IdleTime+1 ; to increment the idletime counter if global.IdleTime=90 ;daemon.g runs 6 times a min, 90 allows 15 min of idle time then cooldown ;reduce time for testing purposes if required M291 P"Printer Has Been Idle For Too Long - All Heaters Have Been Set To OFF" R"Cool Down" S1 T8 ;cool down before auto shutdown message M117 "Cooling Down" ; print to screen ;Starting Cooldown ;sound three beeps to indicate cooldown starting, total duration = 6.5 secs M300 S100 P1500 ; Beep 1kHZ for 1 1/2 seconds G4 P1500 ; Wait 1 1/2 sec before next beep M300 S100 P1500 ; Beep 1kHZ for 1 1/2 seconds G4 P1500 ; Wait 1 1/2 sec before next beep M300 S100 P1500 ; Beep 1kHZ for 1 1/2 seconds M104 T0 S0 ; Set Tool 0 to 0C (off) ;turn off all heaters M104 T1 S0 ; Set Tool 1 to 0C (off) M140 S0 ; Set bed to 0C (off) else if global.IdleTime=120 ;daemon.g runs 6 times a min, 120 allows 20 min for cooldown, then power off printer set global.AutoShutdownCall=10 ;now on next daemon.g pass the printer will proceed to shutdown else ;end ;place below in config.g remove semicolons at start of lines ;if !exists(global.IdleTime) ;check to see if the global IdleTime variable has been set ;global IdleTime=0 ;declare Idletime variable for use in daemon.g and set it to 0 ;if !exists(global.AutoShutdownCall) ;check to see if the global AutoShutdownCall variable has bee set ;global AutoShutdownCall=0 ;declare AutoShutdownCall variable for use in daemon.g and set it to 0
-
RE: Duet 2 IDLE State Power Off .
@Cubiceye Hi All
I have managed to solve the Idle power off issue and I wanted share the script I am using to so.However, when I paste the code into the compose window (here), for some reason, it gets broken up into multiple parts in the preview window. As such, some of the code has the forum script highlighting and is in a scrolling text box and some doesn't. It makes it look like three bodies of separate code where in reality it is only one. Is there a trick to posting code?
I was going to post it in the 'My Duet Controlled machine' category.
-
RE: How to get started with daemon.g
Hi Guys
Thank you for your replies. I think I now have all the info I need to actually get going.
Cheers. -
How to get started with daemon.g
Hello
I recently posted a request for help “Duet 2 IDLE State Power Off”
https://forum.duet3d.com/topic/34479/duet-2-idle-state-power-off.
I had some very helpful suggestions from Phaedrux and OwenD, which pointed me in the right direction. With their help, I think I now understand what needs to done and I have already got the code I think I will need using daemon.g. I understand GCode meta commands and Object Model calls / interrogating.
However, there are some fundamental issues with daemon.g I still need help with. I have scour the Internet, the Duet forum and the Duet website, I am amazed that there seems to be no entries (I can find) which tell you how to actually get started with daemon.g. No daemon.g how too’s, no daemon.g basics, nothing to help a newbie get going.
The following information is what I need help with please:-- Where to compose your code. Notepad, Notpad++, Word?
- How do I test run my code for syntax and or code errors?
- How would you title you code if you wanted to control more than one aspect on your duet board? For example, if you wanted write code to flash your printers LED lights and at the same time play a Christmas tune via the sounder in your PanelDue display? You only seem to be able to have one daemon.g code list in your system directory.
- How do forum contributors get the fancy text colours on the code they publish?
- I got my head around how the GCode Meta Commands work, no problem, but flummoxed with how to get started. I expected to easily find this information on the Duet forum at least.
Cheers..
-
RE: Duet 2 IDLE State Power Off .
Hello
Thank you very much for your replies. I will give them a go after Christmas and promise to report back. -
Duet 2 IDLE State Power Off .
I have rebuilt a 3D Systems CubePro Trio 3D Printer around a Duet 2 WiFi controller board, into a dual nozzle printer with an auto bed levelling sensor where the 3rd nozzle was originally. The CubePro Trio's mechanical build quality is superb, 2nd to none however, the software was atrocious. The whole package was far too proprietary down to the even the filament size of 1.60mm.
The rebuilt printer has many users of varying ability and knowledge, it therefore needs to be as safe to use as possible.
I have managed to use the board’s ATX PSU facility along with a custom controller relay board, to switch off the printer after a print using a MACRO called in the End gcode script to initiate shutdown. As an extra safety measure, I would like for the printer to switch off after a period of being idle, either with the heaters / build plate at temp or not. However, I can’t seem to find a flag or pinout anywhere on the Duet board that I could exploit to trigger a ‘close down / power down command if the printer has been idle for a predetermined period.The Duet browser Dashboard status screen displays 'IDLE' (see pic), when the machine is in a quiescent state, so the board knows what state the printer is in at any time, I would like to somehow access this flag and make use of it.
I also have a large CreatBot DX II 3D Printer, if powered on but not used it will power off automatically after about 10 mins. It will do this even if the nozzle or build plate are at working temps but no activity, it can be a pain sometimes but at least it is protecting the printer and its surroundings.
I have waded through the Duet forums as well the internet in general, but so far not found anything. Maybe have looked too hard and missed the solution glaring back at me, or maybe not.
My Control Board is -
Duet2 WiFi
F/W Ver 3.4.6 2023-07-21
Duet WiFi Server Ver 1.25
Purchased from E3D 2021.Can anyone help please?