![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| LinuxCNC (formerly EMC2) Discuss LinuxCNC (formerly EMC2) Controlers here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| ||||
| ||||
I'm coding for my own design E-chain, and have a milling program that cuts the end of one link and the start of another as a single cut. This will be repeated across the material in a step/repeat fashion until the sheet is covered in several lines of links. Onto the saw table and out pops all the pieces . Well, that's the idea. Question. The code I have written is in absolute movements for the single pass, and I want to be able to step the pattern by a set distance each time. If my code had been incremental, I can see that using an O-code repeat/endrepeat would be the way to do it, and I expect I shall have to do this. But is there an alternative coding method I could use, where, at the end of the "step", the code could repeat at the "new" start position ? Regards John
__________________ It's like doing jigsaw puzzles in the dark. Enjoy today's problems, for tomorrow's may be worse. |
|
#2
| ||||
| ||||
| I would code using a subroutine, then pass the subroutine a x, y start point and change the g55 offset inside the subroutine then cut the part. You could call the subroutine from inside a do-while loop adding the necessary column offset for each link and nest that do-while loop inside another do-while loop to reset the starting column offset and increment the row offset to start the next row. Alan
__________________ http://www.alansmachineworks.com |
|
#3
| ||||
| ||||
| you could simply program in absolute for one part and use a looped sub call with a g52 shift . if you use a macro variable for the shift then it would be dead simple ( see eg below) g52 is one of the greatest programming tools to utilize , it saves from using a lot of code when programming multi part fixtures , if a guy picks up one work shift and uses a g 52 shift to each part then the code is shorter , easier to edit , and it makes it much easier to set up a job because only one shift needs to be picked up rather than a pile of work shifts I've created macro routines to trig and calculate shifts for rotary's and still i only need to pick up one work shift , the machine calculates the g52 shift for any rotational position with the use of the sub routine , which is to say that I've saved myself from possibly manually picking up or calculating 100's of work shifts on a complicated rotary part its not always simple but with macro variables to use in a calculative sub routine and a g52 , then a guy can let his imagination run fairly wild eg % O1212 #101=0 t1m6 m98p1000 / or m97p1000(depending upon control) m98p1100L20 g91g28z0 m30 O1100/or n1100 (depending upon control) g52 x#101+2(2 was random add whatever is necessary for the shift ) O1000/or n1000 g0g90xy g43 z2. blah blah blah blah ; ; g52x0(cancels shift) g0z2. m99 %
__________________ A poet knows no boundary yet he is bound to the boundaries of ones own mind !! http://cnctoybox.org Last edited by dertsap; 10-22-2011 at 01:40 PM. |
|
#4
| ||||
| ||||
| Thanks both. Bit puzzled at the reference to the G52 and G55 as they didn't seem familiar. Checked out my printed copy of EMC User Manual - it's dated November 2009, so I think it's time to update and do some serious reading !
__________________ It's like doing jigsaw puzzles in the dark. Enjoy today's problems, for tomorrow's may be worse. |
|
#5
| ||||
| ||||
| g55 is a simple work shift which is same as g54 typically most people use g54 g55 g56 g57 for work shift positions hopefully i can explain g52 so that it makes sense . lets say that your qualifying your part as usual and you pick up the g54 position , and your g54 values are x-10 y-10 . when you call g0g90g54x0y0 in your program your tool will go to that point that you've just picked up as x0 y0 , now lets throw in a g52 shift g0g90g54 g52 x-2. x0y0 now the tool will move an increment of -2 inches from the point that you've picked up , which is to say that the g54 shift is no longer x-10 but it is now x-12. , the machine will calculate the g52 shift of -2. inches . g52 will not physically change the g54 value but simply adds to it , until you use g52 x0 which will cancel that value and you've original position will be restored so say we've got a fixture that has 6 parts which are 3" apart . we can program for one part at g54 then use a sub routine and a g52 shift for the rest of the parts so we'll qualify g54 x0 y0 z0 from part # 1 now the program will look sort of like this t1m6 g0g90 g54 m97p1000 g52x3.(shift for part 2) m97p1000(sub call) g52x6.(shift for part 3) m97p1000) g52x9.(shift for part 4) m97p1000 g52x12.(shift for part 5) m97p1000 g52x14.(shift for part 6) m97p1000 g0g91g28z0 g90 m30 N1000(sub routine) x @$# y%$ g43 h blah blah g52x0 m99 % now we can also take the same parts and program with the addition of macro variables which can make things a bit cleaner % O0001 #101=0 (important to reset back to zero for next batch of parts) t1m6 g0g90 g54 m97p1000 m97p1100 L5 (loops 5 times) g91g28z0 g90 m30 n1100 g52 x(#101+3.) (need brackets for calculations) N1000(sub routine) x @$# y%$ g43 h blah blah g52x0(cancels the g52 shift) m99 g52 can be used on all axis , I've only gave x as an example , I use this stuff on a daily basis but I'm not the best guys for explaining crap and don't like too much typing so if I've forgotten something or my explanation isn't that great then I'm sure someone else will speak up and help .
__________________ A poet knows no boundary yet he is bound to the boundaries of ones own mind !! http://cnctoybox.org |
| Sponsored Links |
|
#6
| ||||
| ||||
| ok so after that winded explanation I checked out the emc codes and g52 isn't implimented yet : ![]() so another way is with the use of a g10 g10 will physically change the work shift values permanently g90 g10 L2 P1 x10 y10 z-6. will change the work shift values in the control to x10 y10 z-6 . l2 is the change work shift call , P is the shift to change , P1 changes g54 P2 changes g55 and so on now if you use a g91 instead of a g90 then the workshift will change incrementally , which is to say that if your g54 work shift is x10 y10 and you put in the program g91g10 L2 P1 x2 y5 , then your workshift will now be changed to x12 y15 so we'll go back to the example i showed previously but modified to use a g10 first qualify your g54 position for x y z , now add those values to the g10 below % O1212 g90 g10 l2 p1 x10 y10 z-2.( the original workshift needs to be recalled and this will do it ) t1m6 g0g90 g54 m97p1000 g91g10L2P1x3 (shift for part 2) g90( back to absolute) m97p1000(sub call) g91g10L2P1x3 g90 m97p1000 g91g10L2P1x3(shift for part 4) g90 m97p1000 g91g10L2P1x3(shift for part 5) g90 m97p1000 g91g10L2P1x3(shift for part 6) g90 m97p1000 g0g91g28z0 g90 m30 N1000(sub routine) x @$# y%$ g43 h blah blah m99 % or back to using loops O0001 t1m6 g0g90 g54 m97p1000 m97p1100 L5 (loops 5 times) g91g28z0 g90 m30 n1100 g91 g10 l2 p1 x3. (sub routine) g90 n1000 x @$# y%$ g43 h blah blah m99
__________________ A poet knows no boundary yet he is bound to the boundaries of ones own mind !! http://cnctoybox.org |
|
#7
| ||||
| ||||
| Dertsap, many many thanks for your efforts. The beauty of Axis(from my point of view, anyway) is that I can enter your code along with my modifications, and see what the tool paths look like. For me, this is the quickest way to understand, learn, and use. Regards John
__________________ It's like doing jigsaw puzzles in the dark. Enjoy today's problems, for tomorrow's may be worse. |
|
#8
| ||||
| ||||
| Hi dertsap. I had a bit of a problem getting my head round it all, but managed to work my way through OK. However, as I thought that I would need to cut more than 10 units per line, I had a go at using G92 to reset the tool position to a new zero, and enclosed it all in an O-code repeat. Here's the result -
The concept is to cut a set of identical pieces which, when glued together in pairs, back to back, you get a 3D link from a 2D cut. Two sets of these form the sides of the chain, and they are glued either side of short lengths of rectangular plastic conduit(trunking). By separating the function of the chain into two parts - 1. pivoting 2. constraining, I can make my e-chain very cheaply and to whatever size fits the available material. Regards John
__________________ It's like doing jigsaw puzzles in the dark. Enjoy today's problems, for tomorrow's may be worse. Last edited by greybeard; 10-24-2011 at 05:01 PM. Reason: afterthought |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Diseno de la Tarjeta Controladora Micro-Step Unipolar "Mardus-Kreutz" | kreutz | Spanish CNCzone | 266 | Yesterday 04:45 PM |
| "Repeat" event | Fighter | Dynapath | 3 | 09-10-2011 03:30 PM |
| "Flip" DSTV coding | pikamonk | General Metal Working Machines | 1 | 01-20-2011 12:08 PM |
| Can someone explain "Full step", "Half step", "Quater step", etc. ??? | danmst3k | DIY-CNC Router Table Machines | 4 | 12-04-2008 11:13 AM |
| Help finding information on Sanyo Denki "Step Syn" IBM stepper motor | Oracle_9 | Stepper Motors and Drives | 12 | 06-08-2007 12:55 PM |