Machsupport Forum
		G-Code, CAD, and CAM => G-Code, CAD, and CAM discussions => Topic started by: alex_st on November 01, 2016, 10:36:23 AM
		
			
			- 
				Hi guys! Not sure, but may be anybody help.
 My rotary axis have 10000 ppr, or 27.77777777777778 pulses per degree. This is  G-code of my machine
 
 G17 G90 G54 G49 G40 G80 G50
 G21
 M6 T1
 M3 S4000
 M8
 G64
 G1 A0.0 F10000
 G0 G54 X0 Y0.0
 G0 Y0
 
 M98 P0001 Q120
 G0 Y0
 G1 X0 F3500
 G1 A0 F10000
 G0 X0
 M9
 M5
 M30
 
 O0001
 G1 X0 F3500
 G01 Y-1.65 F1000
 G01 Y-1.88 F40
 G01 Y-2 F18
 G01 Y0 F1000
 
 G91 A3 F10000
 G90
 M99
 
 Subprogram is very simple. Problem is next: the software not correctly divide angle of rotary table (A). As result to end of program i have near 1.5 degree of error. Mach calculate position from table resolution with little error (2.988 on each movement in exchange of 3) but at the end of code returned to zero right. I trying to use variavles into code but nothing help. May be my math knowleges not enought. Anybody know way to write program right, that Mach calculate position not from last errored point? From axis zero point incrementally?
 Thanks all!
- 
				If you call the sub 120 times then the error must be +/-3 if your steps per are set correctly.
 
 The other thing the code is setting the A to 0 before the G54 is commanded so if its not a G54 zero to start with the incremental moves will keep it out of place.
 
 
- 
				The problem solved without Mach software and plugin. I run same code directly from KmotionCNC (machine controlled by Kflop). Rotary axis work excellent, no any errors, no problems with g54, g91 and so on..