Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: Ken_HaWK on February 10, 2023, 04:32:23 PM
-
Hello out there! My friend Mark and I have finally gotten the build (mostly) complete for our custom machine. It is a rebuild of the scratch built Ornamental Lathe we made in 1992. The original machine ran on a stepper motor control board and custom software. I am an electrical engineer (retired) - but a hardware guy, not software. For the rebuild we decided on MACH4 and Practical Micro Design PMDX-424. The machine (for lots of reasons) is configured as a MILL, but without a Y axis.
I am relatively new to CNC programming for our machine. I wrote a short program to make a "basket weave" pattern. I want to have the program run in incremental mode so it can be reused along the spindle. It is also required to return to the starting point after completing the cut. I tried to use #5021 and #5024 stored in a #var to return. In the attached it is 36, 37, 44, 45, 46. It works in simulation, but not on the machine. Each time the program runs the X axis offsets further in the +X direction (X= 0.72, 0.144, etc). Any input would be appreciated.
-
I would use the G52 command.
-
Thanks Graham,
The issue is that I need to return to whatever the previous position was, not to the origin. I'm not sure I am correctly saving the original position. If I understand G52 correctly it still needs to know where to go?
-
You may need to add the G53 commands as the coordinates you are reading are Machine figures.
( MOVE BACK TO THE STORED STARTING POSITIONS SO ANOTHER PASS WILL BE ALIGNED )
G90 (ABSOLUTE MODE)
G53 G00 X#254 (MOVE X BACK TO THE STARTING POINT)
G53 G00 A#253 (MOVE A BACK TO THE STARTING POINT)
G91 (BACK TO INCREMENTAL)
M30 (STOP THE PROGRAM)
-
Thanks again Graham. We will give it a try and update this question for future generations. ;-)
If I read the positions from #5041 rather than #5021 would I read the work rather than machine coordinates?
-
#5041 would give you the position relative to the current active fixture e.g. G54