What's new
What's new

Mazatrol G Code Question

razielaka

Plastic
Joined
Mar 3, 2020
Hi Mazakers,
I've attached a sample program I've written to test out M and G codes (I use millimeters). I'm not sure how G codes are supposed to work on Mazatrol but it seems to me that there is something wrong going on. According to my understanding, G0 Z-10 should move the turret 10mm in the home direction on the z axis from the program zero (as determined with the z-offset), and G0 Z0 should take the tool nose back to the program zero on the z axis. However, G0 Z-10 is moving the turret to the Z 159.798 position as seen in the photo. It doesn't seem like a inch-mm conversion thing. Is it ignoring the z-offset and calculating the numbers in cm instead of mm? Any suggestions or guidance? Thanks in advance.

Position.jpgSample Program.jpgz-10 position1.jpg
 
Just deciding to use metric dimensions rather than inch requires much more than just executing a G21 command. Offsets and parameters as well as tool data must all be converted. Not a simple task.

Your G0 Z10 (note lack of decimal) command should move toward the head-stock by 0.010 millimeters if all parameters are correct.

Hope this gets you started; you have a lot of parameters to study.
 
The programing in metric is all in mm.
Z10 is not 0.010mm it is 10mm.
I cant help you figure out whats wrong here but ALWAYS use "Change PT"=1 otherwise it will change tool where ever the turret is located if needed.
 
Is Z159.798 your tool index position?
Good question. I'll have to look into that. Thanks for putting in the time.

I'm currently grounded due to the virus but a fellow noob is holding down the fort. I'll see if I can get him to help me with long distance troubleshooting.

Just deciding to use metric dimensions rather than inch requires much more than just executing a G21 command. Offsets and parameters as well as tool data must all be converted. Not a simple task.

Your G0 Z10 (note lack of decimal) command should move toward the head-stock by 0.010 millimeters if all parameters are correct.

Hope this gets you started; you have a lot of parameters to study.
Thanks for the explanation.
I don't have the manuals for my machine but I've acquired some for other machines and controls so I think I have everything, albeit mixed in with unrelated and seemingly contradictory material. Even so, I'm reading up on everything I can get my hands on and I've read a lot of posts on PM. Less confused now, but still not oriented.
Regardless, the machine was metric when I bought it and I actually prefer it that way as it makes more sense to me. Inches never caught on...or maybe I never did.

The programing in metric is all in mm.
Z10 is not 0.010mm it is 10mm.
I cant help you figure out whats wrong here but ALWAYS use "Change PT"=1 otherwise it will change tool where ever the turret is located if needed.
Thanks for the tip. I didn't understand it the way it was explained in the manual, or maybe I just glossed over it and forgot, but from what you're saying, it seems to me that change pt does not make the turret move to the tool change point unless a tool needs to be changed. I thought it would go to the change point regardless of whether a tool needed to be changed, and that it should always go to the change point when changing tools.

Personally, I'm now suspecting that it might have something to do with the parameters, specifically those related to the coordinate system.
 
There's something crazy going on. I programed a G0 X0 Z0 (with Change PT=1), causing the turret to move to the program zero position immediately followed by rapid into the tailstock, crashing. I tried it again with Change PT=0 and the exact same thing happened (though I stopped the program before the crash this time around).
Gtest.jpg
 
Is Z159.798 your tool index position?
I think it is. Why do you think its moving to this position?
Now its even trying to crash into the fully retracted tailstock (it already crashed once) after executing G0 X0 Z0. It rapids to zero then bolts like a cat toward the tailstock.
 








 
Back
Top