G-Code for a curved print path with abrupt offsets on X-axis
In the figure attached (principal_setup_printer.png) you can see the principal setup of our printer which will be used for print operations during microgravity conditions on a parabolic flight. The printer extrudes a viscous resin which is cured by UV-LEDs while printing.
In one of our experiments we want to print a curved rod (curved_rod_example.jpg). The path of the nozzle tip should be composed of two circular segments. For that purpose, we could use the Cubic Spline G5 command. But with that command we can only move in a fix plane. For a curved rod we also need to rotate the b-axis in such a way so that the angle of the nozzle-axis is tangential at every point on the circular segment. Is there any possibility to mix the cubic spline command G5 together with a linear command G1 for the rotation of the b-axis at the same time?
So far we have a setup where we integrated an own kinematic which compensates the movement of the nozzle tip. So all movements are referred to the nozzle tip.
For the curved rod we have already generated and tested an example code which is attached to this post (gcode_of_curved_rod.ngc). There we only use G1 commands together with G91 commands for the incremental path of the nozzle tip and the corresponding angle for the b-axis. When we load the code into LinuxCNC the print path of the nozzle tip is displayed correctly. On the figures attached you can see the path and angle that results from the attached g-code (path_that_results_from_gcode.png & angle_that_results_from_gcode.png).
In the video below it looks like the nozzle is following the circular paths correctly. Only at the beginning and at the turning point of the two circular segments an abrupt movement on the x-axis can be observed. We have already checked the backlash for the b- and x-axis. We have also checked the accelerations of both axis.
Just for information: In the video the nozzle moves 3 mm upwards in z-direction before the first circular segment starts.
To sum up our questions:
Where does the abrupt offset in the x-axis come from (see video)?
Are there other or better solutions to generate the curved path with a rotation of the b-axis so that the nozzle axis is tangential on the circular segment?
Thanks in advance!
For that purpose, we could use the Cubic Spline G5 command. But with that command we can only move in a fix plane. For a curved rod we also need to rotate the b-axis in such a way so that the angle of the nozzle-axis is tangential at every point on the circular segment. Is there any possibility to mix the cubic spline command G5 together with a linear command G1 for the rotation of the b-axis at the same time?
I suspect not. (sorry).
The cubic splines were developed as a university project a several years ago. The developers of it submitted it to LinuxCNC and then disappeared.
My suspicion is that it is a cool feature that is almost never used, and that is unlikely to see any future development for that reason. (unless you want to?)
I think that for your particular purposes the answer is going to be the rather unsatisfying solution of a lot of short G1 moves, as output by most CAM systems.
At least the current motion planner should be able to blend them in to smooth motion. I actually rather suspect that the G5 moves did not benefit from the new motion planner (I have forgotten when that arrived, 2.6 or 2.7 I think)
The short G1 moves work actually very well - the motion is smooth enough. But as mentioned earlier we still have the problem that at the beginning of the first (clockwise) circular segment and on the transition to the second (anti-clockwise) circular segment the x-axis does an abrupt offset.
It's much better know...
It was our mistake. We had a typo. All the time we wrote "Backlash". But it has to be "BACKLASH". Now we can adjust backlash properly.