Angles smaller than 8 degree break motion planning

Home Forums TinyG TinyG Support Angles smaller than 8 degree break motion planning

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6453
    moeter
    Member

    Okay, now I found something really odd:

    I am trying to draw a circle with line segments, calculated by the controlling PC. When using 44 segments for a circle, everything is fine. When I use 45 or more segments, e.g. direction changes of less than 8 degrees, all hell breaks loose:

    -No more decceleration/acceleration for the corners
    -Speed ALWAYS stays on maximum speed given by F
    -Infinite jerk/acceleration, thus stalling motors

    The radius of the circle has no influence on this behaviour, nor does speed or any parameter that I can think of…

    After digging around a little, I suspect the cornering algorithm getting into numerical inconsistencies: 8 degrees is the point, where 1-cos(theta) gets smaller than 0.01… but that’s actually a wild guess.

    Here are two GCODE examples, one that triggers this behaviour (45 segment “circle”, radius 100, center 0), and another one that doesnt (44 segment “circle”).

    Don’t use them on any real machine without inhibiting the axes.

    http://pastebin.com/BuZB0sJY
    (theres a G1 missing in example 1, but that’s just a copy&paste mistake)

    By the way, I’m on Edge 435.10, will try the same on the stable build.

    #6454
    moeter
    Member

    Found it in the sources:

    https://github.com/synthetos/TinyG/blob/edge/firmware/tinyg/plan_line.c#L494

    -0.99 needs to be closer to -1. Something like -0.9999 should be sufficient, this would include all angles larger than 1°.

    • This reply was modified 10 years, 3 months ago by moeter.
    #6473
    alden
    Member

    Thanks for the heads up. I’ll check into this.

    #6476
    moeter
    Member

    Tried it with -0.99999, it’s working.

    This keeps the line planning intact for angles down to 0.256°. I guess smaller angles can really be assumed to be straight lines for machines in our scale.

    Actually, we could calculate the value where we can consider a junction as straight line as a relationship of the maximum speed, maximum jerk, microsteps and the mm/rev parameters. We may never exceed the maximum jerk in the duration of one (micro)step to assume the junction to be a straight line. I’ll try to put this into a formula, but this might be complicated…

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.