Run async commands (G1 -> M106)
-
Hello,
Using Duet wifi application, I tried uploading the gcode file and starting printing.
I would like some commands to be run in asynchronous mode.
Execute travel (G1) and then start/stop fan (M106) directly, and don't wait until the travel command finish (G1).I successes in doing this from your UI manually, but not when I'm using my gcode file.
Also, your Multiple motion systems command M596 is irrelevant because the fan is no motion system - am I right?Thanks a lot, and have a great day!
Adi -
@adistr it should be possible to use the multiple motion system support to do what you want, because the secondary motion support extends to most non-motion commands including M106. However, we're not planning to support multiple motion systems on Duet 2 because of lack of enough flash memory and RAM.
It's possible to use the daemon.g process or the trigger mechanism to execute some commands asynchronously, although in the case of daemon.g the time resolution would need to be quite poor (e.g. at least 1 second) to avoid using too much CPU time in the loop.
-
Hi @dc42 and thank you for the quick response.
Could you please give me an example of how I can solve my situation using daemon.g or trigger mechanism?
What files should I edit?
What commands should I write in the code file?Thank you very much,
Adi -
@dc42 I've one more question -
What Duet version is support multiple motion systems and all duet 2 wifi capabilities?Thank you,
Adi -
@adistr Duet 3 MB6HC, Duet 3 MB6XD, Duet 3 Mini Ethernet and Duet 3 Mini WiFi will support multiple motion systems. These boards support most Duet 2 WiFi features except:
- No support for DueX expansion boards, or expansion breakout board
- No support for SX1507B I/O expanders
- Fan voltage is selectable between VIN as 12V (was VIN and 5V on Duet WiFi)
- No endstop input LEDs
- No WiFi except on Duet 3 Mini WiFi (the other have Ethernet)
- The drivers on the Duet 3 Mini are less powerful (in terms of maximum current) than on the Duet 2. The drivers on the MV6HC are more powerful.
HTH David
-
@adistr said in Run async commands (G1 -> M106):
Hi @dc42 and thank you for the quick response.
Could you please give me an example of how I can solve my situation using daemon.g or trigger mechanism?
What files should I edit?
What commands should I write in the code file?I think using a trigger would be best. In RRF 3.3 or 3.4 you would need to:
- Identifier a free pin on the Duet that can be used as a dummy input. In the following I will assume that you do not have a DueX connected and you are using pin e2stop (which is on the expansion connector).
- Use a M950 command with J parameter to create an input on that pin
- Use a M581 command to configure a trigger on that port, with the polarity set to trigger in its default state. For example, I think this a should work:
M950 J10 C"^e2stop" ; create GpIn port 10 ion input e2stop with pullup resistor enabled
M581 T5 P10 S1 R0 ; trigger 5 is activated by a low-to-high transition on input 10To activate the trigger, use:
M582 T5
Suppose you want to execute a G1 command and then turn a fan on 2 seconds later. Your GCode file could do this:
M400 ; wait for movement to stop so that we know when the G1 command will start
M582 T5 ; activate trigger 5
G1 X1000 F100 ; do the G1 moveYour /sys/trigger5.g file could do this:
G4 P2000
M106 S1Notes:
- I have not tested this!
- Only one trigger can be executing at a time, apart from trigger 0 (emergency stop) and trigger 1 (pause) which can interrupt other triggers.
- In RRF 3.5 I will make it possible to set up a trigger with no associated I/O pin.
-
@dc42 Thank you!