3.5.0-b2: Defining Motion Systems
-
Our setup is one 6HC with three 3HC, 14 axes total, combination of linear and rotary. This is not a printer application but a custom machine requiring that many motors.
Firmware of all boards is at 3.5.0-beta2Do you have an example of the asynchronous motion in action?
Specifically, how does one define a "motion system" with certain axes and can it be changed on the fly?
For example, M595 P0 has axes X, Z, M595 P1 has axes W, 'a, 'b, 'd, then after those motions are complete, M595 P0 has axes X, Z, and W, and M595 P1 contains a different set of axes.Our program works fine in synchronous mode but we would like to optimize cycle time by performing some actions asynchronously.
We keep getting "Error: G1: Axis ? is already used by a different motion system." where ? could be any axis letter we are using.
We are performing:
In config.g, all of our axes setup M584, M350, etc. plus:
M595 P0 60
M595 P1 60In master.g (our main macro to run one cycle of the machine)
M400
M596 P0
M98 P"macro1.g"M596 P1
M98 P"macro2.g"M598
M400M596 P0
M98 P"macro3.g"Macro 1 and 2 execute just fine asynchronously and use different axis.
Macro 3 executes and gives the above error when we try to move an axis that was used in macro2.gIf we remove the M400, M596, and M598 commands in the above master.g, everything runs just fine synchronously.
Is the expectation that all moves are in a single macro file and to not call multiple macros?
An example of how to use M596 P0/P1 on the fly would be great, just to give some clarity on how these commands are supposed to work.
-
@davidjryan axes are assigned to motion systems as follows:
- Initially, no axes or extruders are assigned
- When a T command is executed, the axes that X and Y are mapped to according to the M563 tool definition for that tool are assigned to the current motion system. The extruders used by that tool are also assigned.
- When an attempt is made to move an axis that is not allocated to the current motion system, if that axis is free then it is allocated to the current motion system
- When M598 is executed each motion system that reaches it releases, all axes and extruders that are not used by the current tool (if any) are released.
Therefore the sequence you described should work provided that neither motion system attempts to move an axis that X or Y is mapped to in the tool that the other motion system uses.
Do not put a T0 command in config.g when using multiple motion systems.
-
Hi dc42,
Thanks for the reply.
Since we are not using the Duet 6HC and 3HC boards in a printer application, we do not have any tools defined, so no T commands are ever issued. Likewise, we do not use M563 in config.g (or anywhere else for that matter). We are just issuing G&M commands (mostly G1 and M42 to turn things on and off) to the boards to control our motors in relative or absolute positioning mode.
When we execute this code (called async.g):
M598
M400M596 P0
G1 W80 F1000M596 P1
G1 'B360 F2000M598
M400M596 P0
G1 'B0 F2000M596 P1
G1 W0 F1000M598
M400W and 'B start moving at the same time but end at different times because 'B moves more than W; this is expected.
After 'B stops moving, 'B then returns to 0 but W does not move and we get this message in the console: "Error: G1: Axis W is already used by a different motion system"
This is unexpected based on the description of the M598 command. It's as if the M598 is not releasing the axis.No other macros/commands/etc. are being called while the async macro is running. We are just trying to get our heads wrapped around the multiple motion systems feature so we got rid of the multiple macro calls in our previous example.
Another clarification, we are in SBC mode with the Duet. I saw some posts from early-to-mid-2022 that multiple motion systems worked best in standalone mode, but that was pre beta1 release.
-
@davidjryan I will run your code to see if I can reproduce your results.
-
@davidjryan please post your config.g file. -
@davidjryan this is fixed in RRF 3.5.0-beta.3 which we hope to release later today.