Parallel tasking



  • Hi,

    Is there any way to execute a command during a G0/G1 insruction?

    I'd like to do a specific action when the X axis has reached a defined position, while the X axis motor is traveling at full speed.

    I am using a Duet 2 Wifi board, firmware version 3.1.1.

    Is it possible ?


  • administrators

    It really depends on the type of command. What action do you have in mind?



  • I will use the G0 command to travel from X = 0 to X = 100 (millimeters) . When X has reached 50 millimeters, I'd like to turn on the Fan 2.


  • administrators

    is there any reason why you can't split the G0 command into two commands and put the M106 command between them?



  • I'm doing a 3-axis stapler with an electric trigger. The electric trigger needs a pulse in order to work. I want to staple the paper block every 100 millimeters during the G0 command (while the stapler is moving at full speed).



  • @Anthoval if your kinematics are solid, you can configure high jerk and acceleration and you'll barely notice any pause.


  • administrators

    Even without high jerk and acceleration, the motion should be continuous provided you don't have a M400, G4 or similar command between the two G1 moves.

    To generate a pulse without using G4 you could use something like this:

    G1 X100 F4000
    M42 P0 S1
    G1 X101
    M42 P0 S0
    G2 X200
    M42 P0 S1
    G1 X201
    M42 P0 S0

    and so on.

    Another way would be to set up the port using M670, then you can do this:

    G1 X100 F4000 P0
    G1 X101 P1
    G2 X200 P0
    G1 X201 P1



  • If the motion is continuous bewteen two G1 commands, it should be fine. I'm going to try what has been suggested.

    From what I understand, there's no way of doing any parallel tasking with the Duet boards, only a very quick series of commands.


  • administrators

    There is a small amount of parallel tasking that can be done using the daemon.g file, but I don't think it's appropriate for this purpose. There is another form that allows the Z axis to move independently (height following mode), but again that's not appropriate here.

    We have plans to implement multiple independent but synchronised GCode streams on Duet 3 in the future, but that won't be implemented for some time.

    Motion is as continuous as possible between adjacent G1 commands. If the G1 commands are in the same direction, then motion should be continuous provided that the print head is up to speed at the end of the first one, and the second one does not require more deceleration that is possible in the length of the move. If you put other commands between the two G1 commands, then motion may stop depending on the command. M42 commands will not cause a stop.

    I just thought of another way to operate your stapler: put the machine in laser mode using M452, configure the laser output to operate the stapler, then do this:

    G1 X100 F4000 S0
    G1 X101 S1
    G2 X200 S0
    G1 X201 S1

    and so on.



  • I'll try it and give a feedback afterwards. Thanks!


Log in to reply