by cncdrive » Mon Sep 25, 2017 7:30 am
Hi Andrew,
OK, I understand now how it works and the problem is that you sending the machine to the end of the arc and setting the line pointer to that arc which was already fully executed,
so when you then cycle start on that g-code line, the arc will mean a full circle, because an arc is defined as:
- Start point: The point the machine is standing at
- End point: The point programmed in the arc g-code line
- The Center programmed as an inceement to the Start point
So, the problem is that where the machine is at when Cycle started is on the end of the arc or over the end of the arc and the endpoint is the endpoint programmed and the direction is set by the G2 or G3, so where the machine is standing is already at the end of the arc, so executing the same arc g-code line again will mean a full circle for the software.
I think the only easy solution to resolve this issue is to handle the arc lost differently, with detecting the arc loss and then tell the UCCNC immediately that the arc was lost and so it will deccelerate and stop the motion.
Wait until the motion is stopped and so the UCCNC moved back to the arclost position, because that function is built in, so if the THC is enabled then the UCCNC moves back to the arc lost position point and gives back the proper line ID also. Also there is the builtin protection, that if that point is the very end of the arc then the software will give back the next line ID, so the next line or arc will be executed on Cycle start and the "full arc" issue will not happen.
Or you can make your own calculation and protection in your plugin, if you want to do this differently and want to add your own protection routine against this "full circle" issue, but that is harded to do in my opinion, because then you will have to check which line the motion was stopped at with getting the line ID, and get the endpoint coordinates out of that g-code line and if the arc lost point is closer to one step to the end of the arc then increment the line ID with one, because then you are already at that point, on the end of the arc then executing that line will cause a full arc execution.
However this algorithm will not work properly on full circles, because then the situation can be the same when you are on the starting point of the arc and when you are at the endpoint of the arc, because for a full circle the start and endpoints are the same, so the algorithm will be unable to decide if the circle was already cut out or not. So, there will be a limitation with this algorithm, that full circles can't be programmed, I mean the recovery could not work for 100% goodness with this algorithm, only with using the built in stop and moveback algorithm of the UCCNC.