Duet3D / RepRapFirmware

OO C++ RepRap Firmware
GNU General Public License v3.0
928 stars 532 forks source link

Problem with pausing in CNC or Laser mode #871

Open dc42 opened 1 year ago

dc42 commented 1 year ago

Duet Forum Discussion Thread

https://forum.duet3d.com/post/317412

Firmware Version

3.5.0-beta4 and earlier

What happened?

When CNC-style GCode is used (i.e. new movement commands contain coordinates but the G0/1/2/3 is implied from a previous line), if the job is paused and then resumed, RRF doesn't execute the moves correctly because when it rewinds to the file offset of the first cancelled command, it has lost the context of that command.

dc42 commented 1 year ago

One way of fixing this would be to add a 3-bit tag to each move in the movement queue, to indicate whether this move was generated by a G0, G1, G2, G3, or some other command. This tag would be copied into the restore point alongside the file offset; then when the job file is rewound to that file offset, the command context in the GCode buffer would be copied form the tag.