1. Hey guyz. Welcome to the All New Phlatforum!



    Sign Up and take a look around. There are so many awesome new features.

    The Phlatforum is a place we can all hang out and

    have fun sharing our RC adventures!

  2. Dismiss Notice

Path following. (Using exact stop in the Phlatscript)

Discussion in 'SketchUcam Help' started by kneedrag, Jan 5, 2011.

  1. kneedrag

    kneedrag Member

    Offline
    Messages:
    57
    Trophy Points:
    6
    Hi all,

    Thanks for all your hard work getting the Phlatscript working as wonderfully as it is.

    I don't know if this is a bug or a feature request. It could just be a conflict between EMC2 and the g-code that the Phlatscript generates.

    The issue I have detected is that in EMC2 the default path following is a predictive path. So if you jack up the speed it now suddenly rounds the corners so the machine will not have to slow down. This however starts causing issues when you want something to be a square and it now turns into a weird rounded square shape.

    I have manually modified my g-code and it seems to have fixed the issue.

    So here is my proposed fix.

    Normal g-code header looks as follows.

    [pre](Generated by PhlatscripT {0.924})
    (File: yak55-rev2-9mm.skp)
    (Bit diameter: 3.1400mm)
    (Feed rate: 5080.0000mm)
    (Material Thickness: 9.0000mm)
    (Material length: 450.0000mm X width: 830.0000mm)
    (Overhead Gantry: true)
    (www.PhlatBoyz.com)
    (620x490 Template)
    G90 G21 G49

    Adding a G61 tells it to follow the exact path

    (Generated by PhlatscripT {0.924})
    (File: yak55-rev2-9mm.skp)
    (Bit diameter: 3.1400mm)
    (Feed rate: 5080.0000mm)
    (Material Thickness: 9.0000mm)
    (Material length: 450.0000mm X width: 830.0000mm)
    (Overhead Gantry: true)
    (www.PhlatBoyz.com)
    (620x490 Template)
    G90 G21 G49 G61[/pre]

    By default if this is not there EMC2 assumes G64 which is warp corners to keep up the speed basically.

    Here is a list from the EMC2 user manual found here http://www.linuxcnc.org/docs/EMC2_User_Manual.pdf


    The trajectory control commands are as follows:
    G61 (Exact Path Mode) visits the programmed point exactly, even though that means it might
    temporarily come to a complete stop in order to change direction to the next programmed
    point.

    G61.1 (Exact Stop Mode) tells the planner to come to an exact stop at every segment’s end.

    G64 (Blend Without Tolerance Mode) G64 is the default setting when you start EMC. G64 is just
    blending and the naive cam detector is not enabled. G64 and G64P0 tell the planner to sacrifice
    path following accuracy in order to keep the feed rate up. This is necessary for some
    types of material or tooling where exact stops are harmful, and can work great as long as the
    programmer is careful to keep in mind that the tool’s path will be somewhat more curvy than
    the program specifies. When using G0 (rapid) moves with G64 use caution on clearance moves
    and allow enough distance to clear obstacles based on the acceleration capabilities of your
    machine.

    G64 P- Q- (Blend With Tolerance Mode) This enables the "naive cam detector" and enables blending
    with a tolerance. If you program G64 P0.05, you tell the planner that you want continuous
    feed, but at programmed corners you want it to slow down enough so that the tool path can
    stay within 0.05 user units of the programmed path. The exact amount of slowdown depends
    on the geometry of the programmed corner and the machine constraints, but the only thing
    the programmer needs to worry about is the tolerance. This gives the programmer complete
    control over the path following compromise. The blend tolerance can be changed throughout
    the program as necessary. Beware that a specification of G64 P0 has the same effect as G64
    alone (above), which is necessary for backward compatibility for old G Code programs. See the
    G Code Chapter for more information on G64 P- Q-.

    Blending without tolerance The controlled point will touch each specified movement at at least
    one point. The machine will never move at such a speed that it cannot come to an exact stop
    at the end of the current movement (or next movement, if you pause when blending has already
    started). The distance from the end point of the move is as large as it needs to be to keep up
    the best contouring feed.

    Naive Cam Detector Successive G1 moves that involve only the XYZ axes that deviate less than
    Q- from a straight line are merged into a single straight line. This merged movement replaces
    the individual G1 movements for the purposes of blending with tolerance. Between successive
    movements, the controlled point will pass no more than P- from the actual endpoints of the
    movements. The controlled point will touch at least one point on each movement. The machine
    will never move at such a speed that it cannot come to an exact stop at the end of the current
    movement (or next movement, if you pause when blending has already started) On G2/3 moves
    in the G17 (XY) plane when the maximum deviation of an arc from a straight line is less than
    the G64 Q- tolerance the arc is broken into two lines (from start of arc to midpoint, and from
    midpoint to end). those lines are then subject to the naive cam algorithm for lines. Thus,
    line-arc, arc-arc, and arc-line cases as well as line-line benefit from the "naive cam detector".
    This improves contouring performance by simplifying the path.

    I am by no means a programmer and for all intents and purposes could be talking out my rear but it seems to have fixed my curvy squares.

    Give me a shout if I am making no sense and I will make a screen dump of what it is doing this side.

    That and keep up the good work guys.

    I will add G61 to my code manually in the mean time. ;-)
     
  2. 3DMON

    3DMON Moderator Staff Member

    Offline
    Messages:
    2,380
    Trophy Points:
    38
    Location:
    Sebastian, Florida
    The ability to have the G61 command already exists. Go into the constants.rb file with a notepad editor, scroll to the bottom and change the value to true instead of false.

    This is what you will see.

    $use_exact_path = false

    Change it to true.

    Hope this helps.
     
  3. TigerPilot

    TigerPilot Well-Known Member

    Offline
    Messages:
    1,578
    Trophy Points:
    48
    Didn't know that, Shaun. Thanks for the heads-up!
     
  4. 3DMON

    3DMON Moderator Staff Member

    Offline
    Messages:
    2,380
    Trophy Points:
    38
    Location:
    Sebastian, Florida
    Sure thing.

    Kneedrag, I moved your topic to the help section and added to your title to help others that might have this problem in the future. Hope you don't mind.
     
  5. kneedrag

    kneedrag Member

    Offline
    Messages:
    57
    Trophy Points:
    6
    Ahhh could have saved myself so much pain. ;-)

    Thanks all. Should have known you guys have through of everything already. ;-)
     

Share This Page