I am working on a post processor for a 2 axis tube cutter, with linuxcnc. The rotary axis is actually a linear x-axis, and I have it set up where one full rotation of the tube corresponds to 1 inch of “linear” travel. So if you jog it 1/2” its actually rotating 180degrees.
In sheetcam I upload an unrolled 1” tube, and it is actually the circumference or pid or just 3.14in for this tube. So far I have a user input box pop up where you can input the tubes diameter and from that a scaling factor can be calculated. The goal of all this is to essentially squish or scale the x axis g-code so that it is only 0-1” of travel instead of the 0-3.14” as the part is input. Is it possible to do this type of single axis scaling.
Basically take the x-position and then multiply it by 1/(pi * d), so that it stays under this 1” which my machine is interpreting as 1 revolution. I hope this makes sense, but essentially i just want to know how to scale a single axis through the post processor.
I just cant seem to get it to scale the axis correctly no matter what I try. Could it be something getting weird with arcs? Because there are all sorts of weird curves and radii whenever you unroll the tube profile, but I wouldnt think that would cause issues because its not any complicated math, and i was able to get the whole thing to scale to inches from mm within the post.
Im not sure if i properly explained what i want to do in my post but im almost normalizing the x-axis positions. Basically i am making them almost like a percentage of the tubes circumference, hence their positions will always be between 0-1 inches, which the machine is interpretting as a full rotation.
So on the machine you can think about any value between 0-1 on the x-axis as actually a percentage of a full rotation. Not sure if that helps at all but I wasnt sure if it was clear in the post.
@Quail , kudos to you for a novel idea. To be clear for others, you are attempting to CAM this custom two axis rotary machine WITHOUT using sheetcam RotaryPlasma plugin, correct ?
FWIW- RotaryPlasma plugin ($75USD) makes life simple for you. It will also allow you to use rectangle tubing in the rotary.
re. your custom method- I’m fairly certain you’re going to need to recalculate feedrate for each motion block, using a cut distance being the hypotenuse of the arc length at circumference and Y units.
re. arcs complicating your custom method- avoid the use of G2/G3 arcs by using the ArcAsMoves() function from within OnArc(), make it the first statement. This will force all cutting motion to use G1 stmts. This way you can avoid performing the scaling math in OnArc(), just do it everywhere else that endX is posted out.
ArcAsMoves(Tolerance)
Perform the current arc as a series of short linear moves. This should only be called from the onArc() event.
Tolerance is the maximum deviation in millimetres from a true arc.All other parameters are optional. Reducing Tolerance increases the number of line segments generated.
This seemed to solve my issue. Now the x axis is effectively “squished” to fit within a range of 0-1 “inches"
Worked out really well because you can upload any tube profile that has been unwrapped, and enter the tube diameter into the dialog box, and it will scale it to 1” in the post! Then when opened up in the CNC ui it will treat that 1 unit width as 1 revolution.
I know this was sort of an unusual solution (especially when the RotaryPlasma plugin exist), but ive never done something like this before and this seemed like a really good work-around haha.
Yeah its for a simple 2-axis tube cutter im working on for a school project. No need for square profiles or anything crazy. No Z-axis or THC either, which has made setting up the LinuxCNC QTplasmaC quite a hassle actually