4 Axis machine - Feedrate calculation and movement planning

  • Hello everyone,

    Let me put it in context,
    I'm building a XYZ+C (rotary around z axis) machine for a special application,

    In this application I need my feedrate to be constant regardless of the movements done by the C axis.

    I mean when I do those three different commands:

    -G1 X10 Y20 F1000
    -G1 X10 Y20 C12 F1000
    -G1 X10 Y20 C300 F1000

    What I would like to get is that those three commands be executed in the same amount of time.

    That means that the C axis needs to adapt it's speed in order to be completed in the amount of time required by the XY movement, regardless of the number of steps it has to complete.

    I've first thought of the G93 command "Feed Rate Mode (Inverse Time Mode)" which instead of a feedrate determine an amount of time for the movement to be completed, but this command is not implemented in the reprap ( or DC42 ) firmware.

    Do you have any advise on how to make the movement planner ignore the movement to be done on the C axis ?

    Thank you all,

  • administrators

    I am not sure however if the max speed of the "C" axis is set to much higher than X and Y then the limit should be the X and Y (and E if that is involved)

  • administrators

    Looks to me that we need a new gcode to define which of the axes the feed rate refers to. I'll take a look at this soon, I don't think it will be difficult.

    Btw additional axes in RRF are called U V W in that order.

  • Hi T3P3tony, Dc42,

    I've made some tests regarding tony's answer,
    When the X and Y max feedrate are limitating in the movement, the movement of the C axis will be completed in the time required by the XY move, which is what I want.

    However, this solution is not very satisfying because I have a different feedrate to respect for each move (because of my C axis and the fact that i need to take into account the distance to the center ).

    That means that I would need to set my X and Y max feedrate before every move and be sure to saturate the X and Y axis to this value.

    Dc42's answer would be cleaner I think,
    The movement planner would only take into account the movements made by the XYZ axis to determine the time in which the complete move would be done.
    However, I don't know how complexe the modifications in the Besenham algorythm would be, but that would be great to have it added to the RRF.

    One other solution would be to use the G93 command (inversed time mode), I know that this is implemented in Grbl for exemple.
    I imagine that you have a huge list of request and I don't know if would it be possible for you to implement it in RRF for duet ?

    An other solution would be for me to implement a complete 4 axis movement planing taking into account the lineic speed generated by the movement of the C axis depending on the XY position. I know that this type of vector transformation have been done in the 5 axis 3d printer Master Thesis base on the duet (ร˜yvind Kallevik Grutle, University of Oslo) and I will look into it. But the code was not published unfortunately.

    Thank you for your answers, viewing your active support on this forum was 50% of the reasons why I chose to buy a DUET for this project.


  • administrators

    First, are you happy to change the parameters that you are currently calling C to be U instead, to fit with how RRF names additional axes? I am aware that some CNC machines use A,B,C for additional axes instead, but even with that naming you would need to call it A.

    I've just read how LinuxCNC treats the F parameter (see http://linuxcnc.org/docs/html/gcode/machining-center.html#sub:feed-rate)) and it includes this:

    1. If any of XYZ are moving, F is in units per minute in the XYZ cartesian system, and all other axes (ABCUVW) move so as to start and stop in coordinated fashion.

    As I understand it, that would do what you want. So I think I should change RRF to work in this way, with the important proviso that if an axis (e.g. U) is moving because X is mapped to it, it is treated as if it is X in this respect so that IDEX machines will still work correctly.

    Which Duet do you have?

  • Yes I'm calling it C because it correspond to a rotation around the Z axis but in my Gcode and on the Duet it is mapped and called as U.
    I will use U in the next messages for the sake of clarity.

    1. If any of XYZ are moving, F is in units per minute in the XYZ cartesian system, and all other axes (ABCUVW) move so as to start and stop in coordinated fashion.

    This is precisly what I'm looking for ๐Ÿ™‚

    I have a Duet 0.8.5

  • Hello DC42,

    Do you think it is feasible to implement a linuxcnc like interpration of the Feedrate as you've said ?
    Would you consider adding it to the next DC42 RRF ?

    Thank you for your help !

  • administrators

    Yes I intend to implement it in the 1.19 firmware release.

  • Thank you so much !

  • Update :

    Working on Duet 0.8.5 with release 1.19alpha2

    The F parameter only takes into account XYZ movements, the U axis now adapts it's speed to be completed on time.

    (But if U max acceleration is too low, it will still slow down the overall movement, adjust it with M201 command)

    THANKS DC42 !

Log in to reply