g2 icon indicating copy to clipboard operation
g2 copied to clipboard

feedhold does not work for G2/G3

Open rkoe opened this issue 7 years ago • 6 comments

Feedhold (!) and resume (~) work well for G0 and G1, but feedhold does not work for G2/G3 in the current stable version (100.26): I can send !, but the motors simply continue to run.

rkoe avatar Apr 12 '18 21:04 rkoe

That doesn't sound good at all. :wink:

justinclift avatar Apr 12 '18 21:04 justinclift

I tested it again with minicom, and this time it worked. I'll do more tests, try to reproduce the error and report back.

rkoe avatar Apr 18 '18 21:04 rkoe

It was tested on PR#305 (UVW) and it works as expected. That build also supports Z lift on feedhold. Try it out.

PR#305 is now in edge. Please let me know if you see any problems.

aldenhart avatar Apr 18 '18 22:04 aldenhart

Tested again, and it works. Turned out that the user-interfaces (cnc.js, Goko, chilipepper) are bad and break the feedhold. With direct serial communication, it works fine.

rkoe avatar Apr 25 '18 22:04 rkoe

Now I think I've tracked it down: On low ct and lower xjm, feedhold does not work correctly during G2:

  • $ct=0.01, $xjm=1000: works
  • $ct=0.01, $xjm=50: works
  • $ct=0.001, $xjm=1000: works
  • $ct=0.001, $xjm=50: fails. Sending a feedhold makes g2core to switch to machine state 6 (HOLD), but the machine stops much later (here: about 15 seconds).

(I've used $ct=0.001, since this creates nice smooth arcs; with $ct=0.01 I literally heared the line segments from the stepper motors ;))

Minimal, reproducible example (running after g2core-reset):

$xam=1
$xjm=50
$ct=0.001
N001 G0 X0 Y0
N002 F500
N003 G2 X100 Y0 I50 J0
N004 M2

Communication logs:

  • ct=0.01, xjm=50: OK

    {"r":{"fv":0.99,"fb":100.26,"fbs":"100.26-10-g1ff7","fbc":"settings_default.h","hp":3,"hv":0,"id":"0084-e739-18c6-08c","msg":"SYSTEM READY"},"f":[1,0,1]}
    $xam=1
    {"r":{"am":1},"f":[1,0,7]}
    $ct=0.001
    {"r":{"ct":0.001},"f":[1,0,10]}
    {"sr":{"stat":t,"n":t,"line":t,"posx":t,"posy":t,"posz":t,"mpox":t,"mpoy":t,"mpoz":t,"feed":t,"vel":t,"unit":t,"coor":t,"momo":t,"plan":t,"path":t,"dist":t,"admo":t,"frmo":t,"macs":t,"cycs":t,"mots":t,"hold"
    {"r":{"sr":{"stat":1,"line":0,"posx":0,"posy":0,"posz":0,"mpox":0,"mpoy":0,"mpoz":0,"feed":0,"vel":0,"unit":1,"coor":1,"momo":4,"plan":0,"path":2,"dist":0,"admo":1,"frmo":1,"macs":1,"cycs":0,"mots":0,"hold":
    {"sr":{"stat":1,"n":0,"line":0,"posx":0,"posy":0,"posz":0,"mpox":0,"mpoy":0,"mpoz":0,"feed":0,"vel":0,"unit":1,"coor":1,"momo":4,"path":2,"admo":1,"frmo":1,"macs":1}}
    N001 G0 X0 Y0
    N002 F500
    N003 G2 X100 Y0 I50 J0
    N004 M2
    {"r":{},"f":[1,0,14]}
    {"r":{},"f":[1,0,10]}
    {"r":{},"f":[1,0,23]}
    {"sr":{"stat":5,"n":3,"line":3,"posx":0.025,"posy":1.54,"mpox":0.025,"mpoy":1.54,"feed":500,"vel":500,"momo":2,"macs":5,"cycs":1,"mots":2}}
    {"sr":{"posx":0.132,"posy":3.623,"mpox":0.132,"mpoy":3.623}}
    {"sr":{"posx":0.326,"posy":5.7,"mpox":0.326,"mpoy":5.7}}
    {"sr":{"posx":0.608,"posy":7.768,"mpox":0.608,"mpoy":7.768}}
    {"sr":{"posx":0.975,"posy":9.821,"mpox":0.975,"mpoy":9.821}}
    {"sr":{"posx":1.43,"posy":11.87,"mpox":1.43,"mpoy":11.87}}
    {"sr":{"posx":1.968,"posy":13.886,"mpox":1.968,"mpoy":13.886}}
    {"sr":{"posx":2.589,"posy":15.877,"mpox":2.589,"mpoy":15.877}}
    {"sr":{"posx":3.297,"posy":17.853,"mpox":3.297,"mpoy":17.853}}
    {"sr":{"posx":4.082,"posy":19.786,"mpox":4.082,"mpoy":19.786}}
    {"sr":{"posx":4.948,"posy":21.684,"mpox":4.948,"mpoy":21.684}}
    {"sr":{"posx":5.891,"posy":23.556,"mpox":5.897,"mpoy":23.556}}
    {"sr":{"posx":6.918,"posy":25.375,"mpox":6.918,"mpoy":25.375}}
    {"sr":{"posx":8.014,"posy":27.15,"mpox":8.014,"mpoy":27.15}}
    !
    {"sr":{"stat":6,"posx":9.189,"posy":28.886,"mpox":9.189,"mpoy":28.886,"vel":491.98,"mots":3,"hold":3}}
    {"sr":{"posx":9.551,"posy":29.39,"mpox":9.551,"mpoy":29.39,"vel":0,"hold":7}}
    
  • ct=0.001, xjm=1000: OK

    {"r":{"fv":0.99,"fb":100.26,"fbs":"100.26-10-g1ff7","fbc":"settings_default.h","hp":3,"hv":0,"id":"0084-e739-18c6-08c","msg":"SYSTEM READY"},"f":[1,0,1]}
    $xam=1
    {"r":{"am":1},"f":[1,0,7]}
    $xjm=50
    {"r":{"jm":50},"f":[1,0,8]}
    {"sr":{"stat":t,"n":t,"line":t,"posx":t,"posy":t,"posz":t,"mpox":t,"mpoy":t,"mpoz":t,"feed":t,"vel":t,"unit":t,"coor":t,"momo":t,"plan":t,"path":t,"dist":t,"admo":t,"frmo":t,"macs":t,"cycs":t,"mots":t,"hold"
    {"r":{"sr":{"stat":1,"line":0,"posx":0,"posy":0,"posz":0,"mpox":0,"mpoy":0,"mpoz":0,"feed":0,"vel":0,"unit":1,"coor":1,"momo":4,"plan":0,"path":2,"dist":0,"admo":1,"frmo":1,"macs":1,"cycs":0,"mots":0,"hold":
    {"sr":{"stat":1,"n":0,"line":0,"posx":0,"posy":0,"posz":0,"mpox":0,"mpoy":0,"mpoz":0,"feed":0,"vel":0,"unit":1,"coor":1,"momo":4,"path":2,"admo":1,"frmo":1,"macs":1}}
    N001 G0 X0 Y0
    N002 F500
    N003 G2 X100 Y0 I50 J0
    N004 M2
    {"r":{},"f":[1,0,14]}
    {"r":{},"f":[1,0,10]}
    {"r":{},"f":[1,0,23]}
    {"sr":{"stat":5,"n":3,"line":3,"posx":0.031,"posy":1.542,"mpox":0.031,"mpoy":1.542,"feed":500,"vel":500,"momo":2,"macs":5,"cycs":1,"mots":2}}
    {"sr":{"posx":0.103,"posy":3.049,"mpox":0.103,"mpoy":3.049}}
    {"sr":{"posx":0.204,"posy":4.439,"mpox":0.204,"mpoy":4.439,"vel":467.59}}
    {"sr":{"posx":0.368,"posy":6.051,"mpox":0.368,"mpoy":6.051,"vel":123.27}}
    {"sr":{"posx":0.602,"posy":7.698,"mpox":0.602,"mpoy":7.698,"vel":393.76}}
    {"sr":{"posx":0.791,"posy":8.806,"mpox":0.791,"mpoy":8.806,"vel":499.34}}
    {"sr":{"posx":1.031,"posy":10.091,"mpox":1.031,"mpoy":10.091,"vel":152.07}}
    {"sr":{"posx":1.396,"posy":11.712,"mpox":1.396,"mpoy":11.712,"vel":298.11}}
    {"sr":{"posx":1.642,"posy":12.67,"mpox":1.642,"mpoy":12.67,"vel":471.66}}
    {"sr":{"posx":1.986,"posy":13.95,"mpox":1.986,"mpoy":13.95,"vel":128.16}}
    {"sr":{"posx":2.419,"posy":15.337,"mpox":2.419,"mpoy":15.337,"vel":401.41}}
    {"sr":{"posx":2.689,"posy":16.158,"mpox":2.689,"mpoy":16.158,"vel":303.5}}
    {"sr":{"posx":3.203,"posy":17.602,"mpox":3.203,"mpoy":17.602,"vel":172.96}}
    {"sr":{"posx":3.561,"posy":18.506,"mpox":3.561,"mpoy":18.506,"vel":426.21}}
    {"sr":{"posx":4.012,"posy":19.622,"mpox":4.012,"mpoy":19.622,"vel":131.82}}
    {"sr":{"posx":4.532,"posy":20.788,"mpox":4.536,"mpoy":20.788,"vel":401.36}}
    !
    {"sr":{"stat":6,"posx":5.041,"posy":21.863,"mpox":5.041,"mpoy":21.863,"vel":356.2,"mots":3,"hold":4}}
    {"sr":{"posx":5.241,"posy":22.262,"mpox":5.241,"mpoy":22.262,"vel":0,"hold":7}}
    
  • ct=0.001, xjm=50: FAIL

    {"r":{"fv":0.99,"fb":100.26,"fbs":"100.26-10-g1ff7","fbc":"settings_default.h","hp":3,"hv":0,"id":"0084-e739-18c6-08c","msg":"SYSTEM READY"},"f":[1,0,1]}
    $xam=1
    {"r":{"am":1},"f":[1,0,7]}
    $xjm=50
    {"r":{"jm":50},"f":[1,0,8]}
    $ct=0.001
    {"r":{"ct":0.001},"f":[1,0,10]}
    {"sr":{"stat":t,"n":t,"line":t,"posx":t,"posy":t,"posz":t,"mpox":t,"mpoy":t,"mpoz":t,"feed":t,"vel":t,"unit":t,"coor":t,"momo":t,"plan":t,"path":t,"dist":t,"admo":t,"frmo":t,"macs":t,"cycs":t,"mots":t,"hold"
    {"r":{"sr":{"stat":1,"line":0,"posx":0,"posy":0,"posz":0,"mpox":0,"mpoy":0,"mpoz":0,"feed":0,"vel":0,"unit":1,"coor":1,"momo":4,"plan":0,"path":2,"dist":0,"admo":1,"frmo":1,"macs":1,"cycs":0,"mots":0,"hold":
    {"sr":{"stat":1,"n":0,"line":0,"posx":0,"posy":0,"posz":0,"mpox":0,"mpoy":0,"mpoz":0,"feed":0,"vel":0,"unit":1,"coor":1,"momo":4,"path":2,"admo":1,"frmo":1,"macs":1}}
    N001 G0 X0 Y0
    N002 F500
    N003 G2 X100 Y0 I50 J0
    N004 M2
    {"r":{},"f":[1,0,14]}
    {"r":{},"f":[1,0,10]}
    {"r":{},"f":[1,0,23]}
    {"sr":{"stat":5,"n":3,"line":3,"posx":0.019,"posy":1.352,"mpox":0.019,"mpoy":1.352,"feed":500,"vel":397.92,"momo":2,"macs":5,"cycs":1,"mots":2}}
    {"sr":{"posx":0.1,"posy":3.165,"mpox":0.1,"mpoy":3.165,"vel":385.33}}
    {"sr":{"posx":0.243,"posy":4.913,"mpox":0.243,"mpoy":4.913,"vel":413.25}}
    {"sr":{"posx":0.44,"posy":6.611,"mpox":0.44,"mpoy":6.611,"vel":427.23}}
    {"sr":{"posx":0.693,"posy":8.292,"mpox":0.693,"mpoy":8.292,"vel":394.83}}
    {"sr":{"posx":1.002,"posy":9.959,"mpox":1.002,"mpoy":9.959,"vel":398.37}}
    {"sr":{"posx":1.369,"posy":11.614,"mpox":1.369,"mpoy":11.614,"vel":417.98}}
    {"sr":{"posx":1.793,"posy":13.268,"mpox":1.793,"mpoy":13.268,"vel":404.61}}
    {"sr":{"posx":2.276,"posy":14.912,"mpox":2.276,"mpoy":14.912,"vel":404.12}}
    {"sr":{"posx":2.819,"posy":16.548,"mpox":2.819,"mpoy":16.558,"vel":421.12}}
    {"sr":{"posx":3.426,"posy":18.186,"mpox":3.426,"mpoy":18.186,"vel":424.81}}
    {"sr":{"posx":4.097,"posy":19.821,"mpox":4.097,"mpoy":19.821,"vel":421.1}}
    {"sr":{"posx":4.843,"posy":21.468,"mpox":4.843,"mpoy":21.468,"vel":425.72}}
    {"sr":{"posx":5.648,"posy":23.085,"mpox":5.648,"mpoy":23.085,"vel":434.83}}
    {"sr":{"posx":6.534,"posy":24.711,"mpox":6.534,"mpoy":24.711,"vel":445.81}}
    {"sr":{"posx":7.497,"posy":26.333,"mpox":7.497,"mpoy":26.333,"vel":456.28}}
    {"sr":{"posx":8.546,"posy":27.956,"mpox":8.546,"mpoy":27.956,"vel":466.09}}
    !
    {"sr":{"stat":6,"posx":9.685,"posy":29.575,"mpox":9.685,"mpoy":29.575,"vel":476.85,"mots":3,"hold":3}}
    {"sr":{"posx":10.89,"posy":31.15,"mpox":10.89,"mpoy":31.15,"vel":484.36}}
    {"sr":{"posx":12.157,"posy":32.677,"mpox":12.157,"mpoy":32.677,"vel":481.8}}
    {"sr":{"posx":13.474,"posy":34.144,"mpox":13.474,"mpoy":34.144,"vel":478}}
    {"sr":{"posx":14.848,"posy":35.557,"mpox":14.848,"mpoy":35.557,"vel":473.29}}
    {"sr":{"posx":16.277,"posy":36.914,"mpox":16.277,"mpoy":36.914,"vel":468.42}}
    {"sr":{"posx":17.757,"posy":38.213,"mpox":17.757,"mpoy":38.213,"vel":464.23}}
    {"sr":{"posx":19.286,"posy":39.454,"mpox":19.286,"mpoy":39.454,"vel":461.32}}
    {"sr":{"posx":20.863,"posy":40.633,"mpox":20.863,"mpoy":40.633,"vel":459.9}}
    {"sr":{"posx":22.505,"posy":41.761,"mpox":22.505,"mpoy":41.761,"vel":478.45}}
    {"sr":{"posx":24.162,"posy":42.806,"mpox":24.162,"mpoy":42.806,"vel":477.77}}
    {"sr":{"posx":25.858,"posy":43.785,"mpox":25.858,"mpoy":43.785,"vel":476.47}}
    {"sr":{"posx":27.602,"posy":44.702,"mpox":27.602,"mpoy":44.702,"vel":473.98}}
    {"sr":{"posx":29.38,"posy":45.549,"mpox":29.38,"mpoy":45.549,"vel":470.64}}
    {"sr":{"posx":31.179,"posy":46.321,"mpox":31.179,"mpoy":46.321,"vel":467.59}}
    {"sr":{"posx":33.006,"posy":47.022,"mpox":33.006,"mpoy":47.022,"vel":464.71}}
    {"sr":{"posx":34.859,"posy":47.652,"mpox":34.859,"mpoy":47.652,"vel":462.33}}
    {"sr":{"posx":36.735,"posy":48.208,"mpox":36.735,"mpoy":48.208,"vel":460.69}}
    {"sr":{"posx":38.653,"posy":48.695,"mpox":38.653,"mpoy":48.695,"vel":459.69}}
    {"sr":{"posx":40.579,"posy":49.104,"mpox":40.579,"mpoy":49.104,"vel":475.77}}
    {"sr":{"posx":42.51,"posy":49.435,"mpox":42.51,"mpoy":49.435,"vel":475.45}}
    {"sr":{"posx":44.451,"posy":49.69,"mpox":44.451,"mpoy":49.69,"vel":474.56}}
    {"sr":{"posx":46.402,"posy":49.869,"mpox":46.402,"mpoy":49.869,"vel":472.95}}
    {"sr":{"posx":48.368,"posy":49.972,"mpox":48.368,"mpoy":49.972,"vel":470.22}}
    {"sr":{"posx":50.326,"posy":49.998,"mpox":50.326,"mpoy":49.998,"vel":467.56}}
    {"sr":{"posx":52.283,"posy":49.947,"mpox":52.283,"mpoy":49.947,"vel":464.92}}
    {"sr":{"posx":54.236,"posy":49.819,"mpox":54.236,"mpoy":49.819,"vel":462.61}}
    {"sr":{"posx":56.182,"posy":49.616,"mpox":56.182,"mpoy":49.616,"vel":460.91}}
    {"sr":{"posx":58.13,"posy":49.334,"mpox":58.13,"mpoy":49.334,"vel":459.84}}
    {"sr":{"posx":60.065,"posy":48.977,"mpox":60.065,"mpoy":48.977,"vel":459.61}}
    {"sr":{"posx":61.975,"posy":48.544,"mpox":61.975,"mpoy":48.544,"vel":475.91}}
    {"sr":{"posx":63.867,"posy":48.038,"mpox":63.867,"mpoy":48.038,"vel":475.51}}
    {"sr":{"posx":65.738,"posy":47.458,"mpox":65.738,"mpoy":47.458,"vel":474.36}}
    {"sr":{"posx":67.584,"posy":46.805,"mpox":67.584,"mpoy":46.805,"vel":472.46}}
    {"sr":{"posx":69.414,"posy":46.076,"mpox":69.414,"mpoy":46.076,"vel":469.38}}
    {"sr":{"posx":71.202,"posy":45.281,"mpox":71.202,"mpoy":45.281,"vel":466.58}}
    {"sr":{"posx":72.958,"posy":44.416,"mpox":72.958,"mpoy":44.416,"vel":463.93}}
    {"sr":{"posx":74.679,"posy":43.484,"mpox":74.679,"mpoy":43.484,"vel":461.76}}
    {"sr":{"posx":76.362,"posy":42.485,"mpox":76.362,"mpoy":42.485,"vel":460.34}}
    {"sr":{"posx":78.022,"posy":41.409,"mpox":78.022,"mpoy":41.409,"vel":459.63}}
    {"sr":{"posx":79.632,"posy":40.273,"mpox":79.632,"mpoy":40.273,"vel":479.17}}
    {"sr":{"posx":81.197,"posy":39.073,"mpox":81.197,"mpoy":39.065,"vel":478.74}}
    {"sr":{"posx":82.713,"posy":37.812,"mpox":82.722,"mpoy":37.805,"vel":476.9}}
    {"sr":{"posx":84.178,"posy":36.493,"mpox":84.187,"mpoy":36.485,"vel":473.68}}
    {"sr":{"posx":85.598,"posy":35.11,"mpox":85.598,"mpoy":35.11,"vel":469.61}}
    {"sr":{"posx":86.953,"posy":33.68,"mpox":86.953,"mpoy":33.68,"vel":465.47}}
    {"sr":{"posx":88.251,"posy":32.199,"mpox":88.251,"mpoy":32.199,"vel":462.11}}
    {"sr":{"posx":89.503,"posy":30.65,"mpox":89.503,"mpoy":30.65,"vel":459.84}}
    {"sr":{"posx":90.673,"posy":29.081,"mpox":90.673,"mpoy":29.081,"vel":444.35}}
    {"sr":{"posx":91.743,"posy":27.523,"mpox":91.743,"mpoy":27.523,"vel":428.63}}
    {"r":{},"f":[1,0,8]}
    {"sr":{"n":4,"posx":92.731,"posy":25.961,"mpox":92.737,"mpoy":25.953,"vel":414.04}}
    {"sr":{"posx":93.634,"posy":24.412,"mpox":93.634,"mpoy":24.412,"vel":405.64}}
    {"sr":{"posx":94.466,"posy":22.862,"mpox":94.466,"mpoy":22.862,"vel":409.25}}
    {"sr":{"posx":95.215,"posy":21.344,"mpox":95.215,"mpoy":21.344,"vel":421.67}}
    {"sr":{"posx":95.897,"posy":19.834,"mpox":95.897,"mpoy":19.834,"vel":365.96}}
    {"sr":{"posx":96.518,"posy":18.33,"mpox":96.522,"mpoy":18.321,"vel":396.16}}
    {"sr":{"posx":97.07,"posy":16.864,"mpox":97.07,"mpoy":16.864,"vel":338.09}}
    {"sr":{"posx":97.568,"posy":15.401,"mpox":97.568,"mpoy":15.401,"vel":394.39}}
    {"sr":{"posx":98.011,"posy":13.96,"mpox":98.011,"mpoy":13.96,"vel":329.86}}
    {"sr":{"posx":98.388,"posy":12.594,"mpox":98.388,"mpoy":12.594,"vel":281.62}}
    {"sr":{"posx":98.717,"posy":11.255,"mpox":98.717,"mpoy":11.255,"vel":393.23,"hold":4}}
    {"sr":{"posx":98.842,"posy":10.696,"mpox":98.842,"mpoy":10.696,"vel":0,"hold":7}}
    ~
    {"sr":{"stat":5,"vel":0.02,"mots":2,"hold":0}}
    {"sr":{"posx":99.007,"posy":9.911,"mpox":99.007,"mpoy":9.911,"vel":406.08}}
    {"sr":{"posx":99.317,"posy":8.235,"mpox":99.317,"mpoy":8.235,"vel":390.32}}
    {"sr":{"posx":99.568,"posy":6.549,"mpox":99.568,"mpoy":6.549,"vel":423.87}}
    {"sr":{"posx":99.762,"posy":4.862,"mpox":99.762,"mpoy":4.862,"vel":425.6}}
    {"sr":{"posx":99.902,"posy":3.117,"mpox":99.902,"mpoy":3.117,"vel":387.38}}
    {"sr":{"posx":99.982,"posy":1.314,"mpox":99.983,"mpoy":1.305,"vel":387.27}}
    {"sr":{"stat":4,"line":4,"posx":100,"posy":0,"mpox":100,"mpoy":0,"vel":0,"momo":4,"macs":4,"cycs":0,"mots":0}}
    

rkoe avatar Apr 27 '18 14:04 rkoe

I don't have these issues with 101.02-17-g51f9-dirty, even G2/G3 pause / resume is working with CNCJS 1.9.15 latest master

amx1 avatar May 28 '18 21:05 amx1