Reverse G-Code sequence to find last successful point.
-
Hello,
Is there any ways to return back without canceling present print, just return back where last successful print, It is kind of semi-automated process.
- We will manually jog and find the desired or last successful point.
- A Script finds the closes coordinates
- Allowing a test to continue from the point.
- Back and forward tests.
- Reverse or forward the sequence by steps.
- Continue running.
It could even be possible if the job seems finished but machine had issues during the print. We simply run G code in reverse to find last successful place and forward.
Best Regards
Serkan -
@sozkan not currently that i'm aware of
-
So then,
May I request a new future update in the interface?
I can donate personally 500 Euros and invite people for donation and contribution of this future for the successful result.
Because large print outs such as my case and many people plastics are wasted to restart!
We can save our pockets and environment!
-
@sozkan raise a request on github.
I don't see this being an easy task though, especially if you want to calculate the resume point during a long linear move. You'd have to analyse the start and end point, calculate if you are on that point and then dynamically create a new piece of gcode and modify the end point to ensure the extrusion amount is the same. These gcode files are massive and i'd suggest the memory wouldn't be available to do all that in standalone mode.
In which case you'd be looking at an SBC only solution and the easiest route would be to create a plugin for it. -
@sozkan said in Reverse G-Code sequence to find last successful point.:
So then,
May I request a new future update in the interface?
I can donate personally 500 Euros and invite people for donation and contribution of this future for the successful result.
Because large print outs such as my case and many people plastics are wasted to restart!
We can save our pockets and environment!
Feature Request: Enhanced Print Recovery via G-code Reversal
Overview
I'm proposing a new feature in the Duet3D firmware that would significantly enhance the ability to recover and continue a print after an interruption, such as an extruder clog. Currently, large prints can be difficult to restart precisely due to changes in temperature and positioning. To mitigate wasted material and time, I suggest the implementation of a sophisticated print recovery method that allows for the reversal of G-code to a previous successful layer.
Step-by-Step Implementation:
Capture the Last Successful Coordinate
-
Automated Capture: Implement a feature that periodically logs the current XYZ position and the corresponding G-code line number.
Manual Capture: Allow users to manually record the position and line number where the print was paused or failed.
Parse the G-code to Identify the Last Successful Point -
Load G-code: Develop a tool or script to load the G-code file.
Identify Closest Match: The tool should search the G-code for the coordinates closest to the last successful position recorded.
Reverse the Movement Sequence
-
Reverse Movements: From the identified point, reverse the sequence of movement commands (G1) while excluding extrusion commands.
-
Negate Coordinates: Reverse the direction of each movement command to create a G-code sequence that retraces the printhead's path.
Prepare the Reversed G-code -
Coordinate Adjustment: Negate the movements in the G-code while keeping extrusion (E) commands commented out.
-
Temperature Control: Ensure that the nozzle temperature is maintained or adjusted as necessary during this process.
Control Movement Speed -
Adjust Feed Rate: Modify the feed rate (F) within the G-code to control the speed of the reverse movements.
Stepwise Reversal and Verification -
Small Steps: Execute the reversed G-code in small, controlled steps, allowing for manual verification of the printhead’s position.
-
Adjustment: Provide the option to adjust the G-code or manually fine-tune the printhead’s position as needed.. Adjustment like step or multi step coordinate jump back and forward. Manual position changes should be in the adjustment as well. for some case motor step or temperature change effect on sensors.
Resume Printing
Prepare G-code: Once alignment is confirmed, prepare the original G-code to resume printing.
-
Skip to the Last Successful Point: Start the G-code from the identified successful point, ensuring all settings (temperature, extrusion mode, etc.) are correct.
-
Continue Printing: Execute the G-code to continue the print seamlessly.
Conclusion
This feature would greatly enhance print recovery options in the event of a failure, saving both time and material, especially for large or complex prints. I believe this enhancement aligns well with the innovative spirit of the Duet3D community and could be a valuable addition to the firmware. I'm willing to contribute to the development process and even offer a personal donation of 1000 Euros to support this feature's implementation.
-
-
I assume, it is not easy. You know better, hardware and software capabilities of the DUET, I am suggesting as user.
In my past I had a CNC machine 20 years old, it could find the position of the tool head and allow me to start from there, where I lost the tool and changed. I assume it is easier way. I know that I suggested complicated way that, but would maybe better and professional.
What if I offer preparing python or C# script could handle the tasks and you help to fix in the DWC interface? We could even start with script. I believe I will start making reversing post processor for now and revers the sequence geode. and as soon as satisfied, I will mark the position and second task the skip the initial code.
We really need to take it serious and rise a fund for that job. It could save tons of plastic globally.
-
@sozkan as i suggest, i would start with a plugin for SBC mode and go from there.
I don't think it will be possible in standalone mode -
@sozkan it could probably be done as a DWC plugin if it's desirable to use it in standalone mode, but that might be slower compared to a DSF plugin.
-
Dear All,
I have prepared a G-code reversing tool Console App just to use to reverse motion of the print to be able to test best position to rewind Using C#. Please feel free to use the source if you find it useful. for sometimes it will help us to work manually. But I still required the tool DWC plugin or SBC function.
https://github.com/tunerji/G-Rewind
While reversing code, the code blocks sharing Feed rates and Z height had to be critically analyzed. That's why it was a bit important to review the code a few times.
However, it is temporary solution to me and we still need to make interface buttons and functions to run drive back and forward. The method might need to different way of capturing feed-rate and Z values in real time, once reversed, it use that one.
I assume if we tag all line having G0 and G1 commands as F and Z height of each X and Y coordinates, it might be easy to produce reversing go code in real time at the client side.
However like my case, if paused, machine might lift head and we might need to disable macros like pause and resume too.
as you may notice, in the g-code, Feed rate and Z coordinate has to be shifted and placed on right place, by respecting their groups like G0 and G1 and F Values. My reversing app does that if you like to inspired from there.
Example G-Code Snippet
G1 F1500 X0.00 Y-550 Z1.25 ; Move to coordinates with feed rate of 1500 G0 F4000 X0.00 Y0.00 ; Rapid move to new coordinates G1 F1200 X476.314 Y275 ; Controlled move to new coordinates G1 X0.00 Y0.00 ; Move back to start point
Reversed G-Code Example
After processing with G-Rewind, the G-code might look like this:G1 X0.00 Y0.00 Z1.25 ; Move back to start point G0 F4000 X0.00 Y0.00 ; Rapid move to previous coordinates G1 F1500 X476.314 Y275 ; Controlled move to previous position G1 X0.00 Y-550 ; Reverse move to the starting coordinates
By the way, we have one more financial support candidate a friend of mine, who is wiling to donate 500 too. Therefore, we have total 1000 budget for now. We might rise more who is required to use it like my case. If you may accept, besides my method or code generation support, I can handover you my portion donation. Please feel free to reach me in private talk about it.