![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| General Metalwork Discussion Discuss everything relating to metal work. |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
OK, I have an L-shaped part which is just a load of G-code in a subroutine. I will need to do a step-and-repeat where I rotate the part 180 deg and XY offset it enough to clear the previous part. G68 rotates the coordinate system. But it also says it rotates the work offset, which would be horrible. G10 can set the origin and G52 can do a temporary offset... but Mach3 says G92 offsets CANNOT be used with G52. Which would be a problem. I'm really frustrated. I can't remake the G-code as relative moves or anything, it's CAM-generated. The idea was to do a M98 call of the routine, rotate the coordinate system 180 deg and XY offset, then call again (lather, rinse, repeat). But is this even possible?? Should I maybe try to get the work offsets from the parameter list, zero the actual offsets, rotate the system, then reassign the work offset along with the necessary XY stepping? |
|
#3
| |||
| |||
__________________ Warning: DIY CNC may cause extreme hair loss due to you pulling your hair out. |
|
#4
| ||||
| ||||
| I' ve never used coordinate system rotation, but have you played with it to see if rotating the work offset is 'horrible' or not? It may be a matter of what you think is going on, and what really goes on are two different things. In my mind, I can sort of visualize that not rotating the work offset could in fact, be a problem, depending on which coordinate systems are active. I'd take the sure route and program a right and a left, and then repeat that, rather than dealing with a bunch of complexity.
__________________ First you get good, then you get fast. Then grouchiness sets in. (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#5
| ||||
| ||||
The G52 Temporary Offsets look like they have the same sort of problem, it clobbers the original work offset. So you try to step over 1" by saying G52 X1, but that clobbers the G92 offset, putting it at MACHINE coord X=1, meaning the G52 X1 resulted in a relative move by X-4.123, and it's unpredictable at that, since changing stock and resetting the work offsets will totally change what the G-code does. Last edited by MechanoMan; 08-30-2009 at 04:33 PM. |
| Sponsored Links |
|
#6
| |||
| |||
| Ah-ha, it IS possible! I was a bit confused initially, betwen G92 offsets and WORK offsets. I didn't realize how they were different. This allows me to start with a G92 offset and offset angle (used when the stock doesn't totally line up with the axis), and restores them when done. The only thing is, if you see a problem in the run, pull a Stop, and then start again from the beginning, you will have corrupted offsets. If you didn't have any G92 or angular offset to begin with, then can just zero them and restart. As such I'd kinda recommend not setting up with stock with G92 offsets but by setting the Work offset, and avoiding using the angle if you can. This took way too many hours to figure out... Code: #100=#5211 (initial G92/G52 x-offset, #5211 is a Mach3 system param) #101=#5212 (initial G92/G52 y-offset, #5212 is a Mach3 system param) #102=0 (incremental rotation, Mach3 will not provide the initial offset so there is no way to figure it out, but by doing incrementals and recording the change alone, that'll allow us to work off it and restore it) #10=0 #11=0 #12=90 M98 P5 M98 P2 (O2 is the part to be repeated) #10=[#25] #11=-50 #12=-90 M98 P5 M98 P2 #10=[#50] #11=0 #12=90 M98 P5 M98 P2 (cleanup at end) G52 X[#100] Y[#101] (restore original G92/G52 offsets) G68 a0 b0 r[-1*#102] i0 (undo any previous inc rotation) M30 (end of program) O5 (Step, Rotate, and Repeat Offset) (#10=x offset, #11=y offset, #12=angle) G68 a0 b0 r[-1*#102] i0 (undo any previous inc rotation) G52 X[#100+#10] Y[#101+#11] (XY stepping) G68 a0 b0 r[#12] i0 (set inc rotation) #102=[#12] (remember new inc rotation state) M99 |
|
#7
| |||
| |||
| Well I'm not proud. I'm just gonna ask someone to show me how so I can get some actual cutting done. (I'm trying to surface a spoilboard) N0 G1 X20.0 F80 (Run 20 inches to the right) N1 G1 Y+=0.0100 (Increment Y by some partucular amount?) N2 G1 X0.000 (X back to zero) N3 G1 Y+=0.0100 (Increment Y again) N4 G? N0 L30 (repeat the whole mess 30 x) Any takers? Or point me in some direction, please. |
![]() |
| 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 |
| whole G-Code REPEAT command ?? | LockTech | G-Code Programing | 14 | 08-08-2010 10:21 AM |
| g code for repeat the previous move | woffler | G-Code Programing | 6 | 03-26-2008 10:07 PM |
| Step by step 3d wireframe Stl. to G-code | josh cbr900 | Mastercam | 7 | 11-12-2007 05:43 AM |
| AVR G Code Interpreter/ Step-Dir Macro Recorder | bitmannz | General Electronics Discussion | 5 | 02-01-2007 12:07 AM |
| Repeat g-code with y offset | tpaulson | G-Code Programing | 19 | 11-29-2004 01:36 PM |