View Full Version : Mach 3 losing machine coordinates
travisn
12-09-2011, 07:33 AM
I'm using mach 3 with a syil x4 cnc. I've modified a tool change script to reference machine coordinates to find the tool change post. Well something happens to where the machine coordinates get lost, I think after a computer restart and/or a machine turn off. So when I run the tool change it might go someplace totally different than where it's supposed to. Once this happens ref all home works.
What can I do to lock in machine coordinates?
Thanks
kf2qd
12-10-2011, 06:04 PM
If you power the machine down, or shutdown Mach and restart it you won't have a good reference. If you have good, repeatable reference switches then you have nothing to lose by calling for ref home from time to time in your operating sequence.
If you want to be able to keep position when yopu shut down you need to spend a whole lot more money and go for absolute encoders and such. Not a feature of MACH.
Jaakko Fagerlund
12-11-2011, 02:18 AM
If you power down your machine or PC, you have to reference home all axes.
travisn
12-17-2011, 08:18 PM
Ok cool. Thanks guys. As long as it's not something we are doing incorrectly or that is broken.
travisn
03-01-2012, 11:11 AM
ok, the machine is acting up again.
I am milling a small block, fairly simple. Code generated with meshCAM4.
It ran the first half of the program (roughing) great. Then I did the tool change using the script I modified from on here. For some reason after the tool change it randomly lost co-ordinates. it tool-changed in the right spot then went off to a random place to start machining.
After a few ref-all home sequences it finally went to the right place. Is there an order of operations I should be doing here? Will it act up if I have machine co-ordinates displayed? I cant figure out what I did that made it fix itself or why it even did it in the first place.
ALSO, does anyone know why it would traverse so far from the part after the tool change? See attached picture. the green on the left is my tool change post then it went way right for some reason. I'll attach the code once the program is done running
http://img706.imageshack.us/img706/3481/traverse.png
legendboy
03-01-2012, 11:43 AM
have you checked the code?
is the part your machining just a square block or does it have 3d surfaces?
how many lines is the file?
travisn
03-01-2012, 11:59 AM
here is the code:
I had to re-gen the code as I had the stock too big (to make sure there wasn't any left uncut on the top) but then it started to machine the side. so this may not have the error in it.
X1.503Y-0.947
G0Z1.456
(TOOL/MILL,0.0625,0,0.2500,0.0)
M6 T2
M3 S5000
(Waterline Finish)
G0X0.244Y-2.373
G1Z1.426F10.0
G1Z1.426F10.0
X0.226Y-2.369
AAANNNDD then I realized I had retract height set to .0001" and it broke my end mill when coming out of a hole. re-gen'ing the code and starting the finish pass again. fml
travisn
03-01-2012, 02:09 PM
great, 90% done and it broke another 1/16 bit. For some reason it is leaving a post inside the .25" diameter/.2"deep hole then trying to wreck the height of the whole thing each pass.
good thing bits are only $4
travisn
03-01-2012, 02:16 PM
have you checked the code?
is the part your machining just a square block or does it have 3d surfaces?
how many lines is the file?
I checked and nothing seemed out of the ordinary. I am more trying to figure out WHY it did it. There wasn't any thing that I noticed that should have reset the zero or anything.
Yes, it does have 3d surfaces. It's half of a mold for a cable over-mold. Fairly simple but I just cannot get it right. I've broken 4 bits on this job. Granted it's my first time cnc'ing metal. the first two were wrong speeds, the second one was retract height, and the last one was due to not recognizing a bad tool path. I'm going to pick up a couple more bits tonight and finish the finishing pass in the morning. thank fully it didn't wreck anything but the bit. Weird part is the bit broke at the collet and where the flutes tapered up to the full diameter.
macona
03-01-2012, 04:02 PM
You are not doing the whole job with a 1/16" bit, are you? You should use a larger bit and then do a remachine on the details.
Are you using a G28 at the tool change? This has caused me issues in the past.
travisn
03-01-2012, 06:48 PM
no, I'm using a .125 2 flute for roughing. m6 tool change.
macona
03-01-2012, 07:23 PM
We need to see the code before and after the tool change. And what did you do to the macro?
travisn
03-01-2012, 10:06 PM
I posted the code before and after the tool change (3-4 posts up), but like I said I think I might have written over the code after making a change. If it happens again I'll definitely post up the code in question.
All I did to the tool change script is have it go up a few inches then stop and prompt to change the tool then press ok to lower the tool onto the tool change block at a certain machine code position. (aluminum block on top of a delrin post). it has worked flawlessly so I don't think it's the code but I'll post that up tomorrow morning just in case.
macona
03-01-2012, 10:47 PM
nothing wrong with the code then. Must be something messed up in the macro. You would probably get a lot better support posting in the machsupport forums or the mach yahoo group. Probably 100 times the traffic than here.
travisn
03-02-2012, 02:53 PM
quality over quantity, right? :)
here is my button change script
code "G0 G53 Z-3.5"
code "G0 G53 X-9.798 Y-.577 f50"
MsgBox ("Change tool now, press OK to continue.")
code "G52"
If IsSuchSignal (22) Then
code "G31Z-4.5 F20"
While IsMoving()
Wend
Call SetDRO( 2, 2.07 ) '2.07 is to bottom of vice
code "G01 Z3 F40"
While IsMoving()
Wend
code "G01 X0 Y0"
MsgBox ("Tool change and Z-zero complete. Press OK then cycle start to continue")
End If
macona
03-02-2012, 03:13 PM
quality over quantity, right? :)
here is my button change script
Hmm, don't know. Better post on the other forums. You may have a bug somewhere else. Take video of the bug if you can.
MaxHeadRoom
03-02-2012, 03:43 PM
Do you have the servo package? If not and you are using steppers, this could be part of the problem?
If you have servo's, there should be no loss of position without a drive error?
Only the drives keep track of position, not Mach.
Try a G28 to see if the axis return to machine zero, if they don't, then you have lost machine zero, if they return to the right spot then it there is some other reason such as program.
Max.
travisn
03-02-2012, 04:23 PM
It doesn't happen everytime. it ran today without error. It is stepper motors as far as I know, and it does lose position if turned off, but this happened after a tool change. I even stopped the program last night and restarted this morning with zero problems
only cost me 5 bits to get my feeds/speeds/stepover/DOC/retract height correct. haha.
Hopefully the other half of the mold goes smoothly on Monday.
MaxHeadRoom
03-02-2012, 04:40 PM
There is no way i would trust a machine to be in position after power down and power up, in any case Mach has reset everything?
Steppers are more inclined to hold position when off due to the indent torque.
But If it is possible, I would do the G28 test when it loses position and it might confirm if you are losing steps.
Max.
DICKEYBIRD
03-03-2012, 10:13 AM
Wow, this is a good example of (my) "Ignorance is bliss." I'm glad I didn't know I was supposed to reset every time the machine was powered down.
I just (last night) finished a long running lathe project (1192 pieces) and the only times I had to reset the zero points in Mach was once when I stupidly turned the machine on while XP was still booting up, twice for tool insert replacements and once due to wear in the leadscrews.
I guess stepper motor "cogging" holds the axes' positions after shut-down and the controller doesn't allow any glitches to get to the steppers during shut-down or power-up. I did put all the covers back on the machine at the end of a session to keep the wife's freekin' nosey cats from adjusting things.:rolleyes:
MaxHeadRoom
03-03-2012, 02:15 PM
I just (last night) finished a long running lathe project (1192 pieces) and the only times I had to reset the zero points in Mach was once when I stupidly turned the machine on while XP was still booting up,
I guess stepper motor "cogging" holds the axes' positions after shut-down and the controller doesn't allow any glitches to get to the steppers during shut-down or power-up.
By rights you should have the charge pump/watchdog wired into the E-Stop circuit preventing power to motors and spindle when booting or shutting down.
Although the stepper detent torque will hold position to some extent, it should not be trusted to maintain position when power is off.
Max.