Sending gcode for in-line monitoring and control
-
Dear Duet3D community,
I would appreciate if anyone could advise me about the possiblity of using Duet3D controller for in-line monitoring and control of a 3D print.
I am planning a new project in which I will be using a Duet3D to control a 3D printer that has a camera near the nozzle.
Printing parameters such as temepratrue and feedrate and camera feed of printed bead will be an input to an AI model that will suggest corrections to printing speed, temperature and extrusion rate.
The AI decision making will be done on a separeate PC, however, I need to know how the communication can be set up with the Duet3D.
Are there any Gcode commands from which the signals of temperature values can be read so I can feed it to the AI algorithm.
Also what is the best approach to send the corrected values of temperature, speed and feedrate during the printing process. I have read about commands such as M220, M290, M104, are there any better ways or they would be sufficient.
Also what would be the speed of communication for reading data from sensors such as temp and also for modifing printing parameters.
Thanks a lot! -
@Shaqour
That's an interesting project!
Is the AI detection just for catastrophic failure like model getting knocked over, filament run out, pooping etc.
If so, possibly all you need are basic controls which can be done with the API or telnet.If you are trying to adjust feed rate to reducing ringing or other subtle changes i'm not sure a camera is going to give you the best results and you'd be better of with other sensors like accelerators etc.
anyway, there are lots of ways to achieve external control of the Printer with a duet board. I have a duet2 wifi which is a bit old but even with that, one could use:
a plugin directly in DWC
(this one uses a camera)
https://github.com/Duet3D/DSF-Plugins/tree/master/MotionWebcamServerPluginRest API
https://github.com/Duet3D/DuetSoftwareFramework/wiki/REST-APIyou could also use telnet to send commands, which is probably the simplest but is a terrible idea.
https://forum.duet3d.com/topic/15294/communication-directly-via-tcp-without-using-http -
Hi @magnets99 and thanks for your reply to my post.
@magnets99 said in Sending gcode for in-line monitoring and control:
Is the AI detection just for catastrophic failure like model getting knocked over, filament run out, pooping etc.
If so, possibly all you need are basic controls which can be done with the API or telnet.
No, I need it for in-line monitoring of the printed bead. i.e. the camera would be adjusted to the printing nozzle and images of the 3D printing process will be continously captured.What I am trying to acheive is similar to what has been already done in this paper:
"Generalisable 3D printing error detection and correction via multi-head neural networks"However this was done on a normal controller connected to a rasepiry pi not a Duet3D. and since Duet3D provides a direct connection to the PC and webinterface. I beleive the communication can be done directly with it.
Another question that could be helpfull to know, does the Duet3D support line by line feeding to the printer to achieve the complete print? or we only can print by sending the whole gcode file?
thanks
-
@Shaqour said in Sending gcode for in-line monitoring and control:
Another question that could be helpfull to know, does the Duet3D support line by line feeding to the printer to achieve the complete print? or we only can print by sending the whole gcode file?
It's possible to print line-by-line but we don't recommended it, because if you do that then pausing the job and making some other changes have to wait until the move buffer is empties; whereas if the file is printed from SD card then pausing can be much faster, because RRF can abandon moves already in the queue and rewind the file pointer when restarting.
-
@dc42 many thanks for your feedback.
Can you please suggest me some resources to read in order to have more details about this technique!