so, having played with the maths of it ... and got it to work on paper, I'm going to actually set up an emc box and have more of a play at this tube laser nonsense. I see the Y being across one face of the tube, X being up its length and Z being Z axis height A being rotation of the tube. for square/rectangular tube, A is never used directly. M1xx will be called to select a new face, M101 1 selects face 1 or whatever .... so, I see the motion moving the head to say X0 (middle of face 1) ... then starting to cut. moves up to the edge line of face 1, then rotates the tube to end up on the edge of face 2, continues the cut to the centre of face 2 the slight problem there might be that M99 2 sthat selects face 2 of the tube, will cause Y, Z and A to move. we dotn really care about Z and A, they are pretty much "slaved", we dont control them directly but Y being moved might cause grief in the interpreter hmmm really, I guess face selection is obviously modal, but its also sequential (at least while cutting) you can;t go to face 2 unless you are already on face one or three and at the correct edge of the face also perhaps hijacking the G53,54,55,56 workspace commands for face selection?
Some more thinking ...
Tube cutting is a bit specialised, typically, you need to know where the tube faces are, and these may not be the same from tube to tube.
For example, you want to cut pieces from a tube, but day to day, batch to batch the tube varies by +-1mm. Your operative, or perhaps even the clamps on the machine can measure this change and take account of it when setting up the cut.
Typically, tube can be described as rectangular, with rounded corners. you get a flat face, then line marking the start of a radius, the radius, and another line for the end of a radius, then the next face.
A1 A2 D2/-----------\. | | B1 | | | | D1\-----------/ B2 C2 C1
I have chosen to name the faces A,B,C,D and the lines marking the edge of the faces A1,A2,B1,B2 etc
the simplest method of describing a cut is to "cut" the surface at say, A1. and then unroll it as a sheet of paper.
A1 A2 B1 B2 C1 C2 D1 D2 * ------------------------------------------------------- | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -------------------------------------------------------
it would then be trivial to define the left hand edge as being Y0, the right hand edge as being Y300 (or whatever the outer circumference of the tube was) and let the system, rotate the tube to get things in the righ t place.
However, this means that you have to re-write the program every time you change the tube size ... in particular, if a hole is supposed to be 10mm from the edge and another hole is supposed to be exactly on the centre line, it should be possible to describe these in our control language, and have it work even for different tube sizes.
One possibility is to assign values to some of the #variables in the interp representing the Y values of the edges in the Y axis, as it is rectangular tube, the front and back edges of the A and C faces are identical in position, as are the B and D faces
I propose to assign 4 values:
#2011 A1 and C1 #2012 A2 and C2 #2021 B1 and D1 #2022 B2 and D2
Our tube has the following parameters:
w/2 (external width across the A face) assigned to #2001 h/2 (external height across the B face) assigned to #2002 r (outer radius of a corner) assigned to #2003 A1 = w/2 - r A2 = r - w/2 B1 = h/2 -r B2 = r - h/2these can be assigned to the variables.
now it is simple, Y0 is the centre of the tube to cut a hole at the centreline of the tube:
G0 Y5, X100 M3 G2 Y5 X100 I-5 J0 M5to cut a hole 10mm in from the front edge:
G0 Y[#2001 -10], X100 M3 G2 Y[#2001 - 10] X100 I5 J0 M5
to cut from the centre of face A to the centre of face B,
<select face A> G0 Y0 M3 G1 Y[#2002] <select face B> G1 Y0 M5
the selection of a face, with M3 active can only occur if the cutter is positioned at the radius line, ie at one of the positions defined as #2001, #2002 (for the A and C faces) or the respective positions for the B and D faces. Attempting to rotate the tube to a new face, when the torch is not positioned on an edge line ready to track the radius around to the new face, will throw and error of some sort.
It is most important to note that upon selection of a new face, with M3 on, the Y value will change from (for example #2002 (for A2) to #2011 (for B1)) the adjacent pairs of edge lines are:
A1 and D2, A2 and B1, B2 and C1, C2 and D1, D2 and A1
face selection (with M3 active) always starts with the Y position at one edge of a pair, and ends with Y at the other edge of the pair. Not sure what happens with M3 off, maybe Y will remain umoved.
(later on, I think I'll expand this to allow a planar beyond the edge line, vertically into the radius area. a face selection move at this point will rotate the tube, maintining the position of the torch, until it it normal to the radius, then track the radius until the new face is selected. this should also solve the differences between normal and planar cuts on round tube)
Overall, the goal is to be able to write a program that can cut the required shapes out of a bitof tube, and not require re-writing if the tube changes shape ... eg you pull one out of the rack and its 44mm across, not 45mm ..