![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| G-Code Programing Discuss G-code programing and problems here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#2
| |||
| |||
| Have you done a search using G52? This has been discussed several times. G52 lets you create secondary work offset within the active main work offset which can be any of the G54, G55, etc. The G52 command has X, Y, Z values the describe the location of the secondary (G52) work offset with reference to the main work offset. For example if your G54 has the coordinates X-10. Y-8. and you programmed; G54 G00 X0. Y0. The machine moves the X-10. Y-8. in machine coordinats; that is where zero is in that work offset. Now if you program; G54 G52 X2. Y2. G00 X0. Y0. The machine moves to X-8. Y-6. in machine coordinate; this is where the G52 zero is. The machine always uses the values in the G52 register when it moves in any work offset, but of course if the value is zero it does not cause any changes. You can have as many G52 commands as you like, each with its own set of X, Y, Z, A (fourth axis) values. On some machines the G52 is zeroed on RESET or M30 and some it has to be zeroed by the command G52 X0. Y0. Z0. A0. On Haas it is mentioned in the manual; in Fanuc mode G52 ir zeroed by M30 and RESET but Haas mode is different. In Yasnac mode G52 is just another work zero, not a secondary one. It is a good idea to always have a G52 zeroing command at the end of any program using it.
__________________ An open mind is a virtue...so long as all the common sense has not leaked out. |
|
#3
| |||
| |||
| Here is a simple program that calls a sub to make a square at the current position. If this was done without a G52 the sub would need to be programmend in G91 incremental. Code: O1 G90G54X0Y0 G0Z1.0 #1=0 WHILE[#1 LT 360.0]DO1 G0X[5.0*COS[#1]]Y[5.0*SIN[#1]] G65P2 (CALL SQUARE SUB) #1=#1+30.0 END1 M30 O2 #24=#5041 (SAVE CURRENT X POSITION) #25=#5042 (SAVE CURRENT Y POSITION) G52X#24Y#25 (SET G52 TO THE CURRENT POSITION) (MACHINE SQUARE) G1Z-1.0 G1X0.5 G1Y0.5 G1X-0.5 G1Y-0.5 G1X0.5 G1Y0.0 G1X0.0 G11.0 G52X0Y0 (ZERO OUT THE G52 OFFSET) M99 |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |