jymdman
03-08-2007, 11:03 AM
Hi
I need to edit the standrad MPFAN postprocessor for MC 9 to invert the values of X and Y
For example: postprocessor outputs X125.0 and I wan't to have X-125.0
I think I need this for I and J also.
Is this doable??
I'm having a Fanuc 21i system.
/Fredrik
tobyaxis
03-08-2007, 02:52 PM
Hi
I need to edit the standrad MPFAN postprocessor for MC 9 to invert the values of X and Y
For example: postprocessor outputs X125.0 and I wan't to have X-125.0
I think I need this for I and J also.
Is this doable??
I'm having a Fanuc 21i system.
/Fredrik
You could spend a few bucks and get this www.ncplot.com :rainfro:
Hi
I need to edit the standrad MPFAN postprocessor for MC 9 to invert the values of X and Y
For example: postprocessor outputs X125.0 and I wan't to have X-125.0
I think I need this for I and J also.
Is this doable??
I'm having a Fanuc 21i system.
/Fredrik
:confused:
Are you programming it backwards? Not sure the reasoning here.
tobyaxis
03-08-2007, 03:56 PM
:confused:
Are you programming it backwards? Not sure the reasoning here.
Maybe he is doing a Mirror Image for Left/Right Hand Parts.:)
I'm confused too;)
jymdman
03-08-2007, 04:02 PM
:confused:
Are you programming it backwards? Not sure the reasoning here.
The reason is that the coordinates is reversed in my machine compared to MC.
In MC all values to the right an top of the origin is positive, but in my machine those values are negative...
Or can I work around this with some G-code in my system.
Anyway, I wrote a small C# program to invert the values, but it would be great if I didn't have to do that. :)
/Fredrik
Matt Berube
03-08-2007, 06:50 PM
Is there a parameter in the control you could switch to have the axis inverted ?
Just thinking out loud here...
Alex_Cole
03-09-2007, 09:30 AM
This can be done you just need to determine if changing it in the post is the best way for you to do it or not. If you do not have a large number of programs already for your machine tool you might be better off changing them in the machine to match the standard right hand rule. If you want to do it in the post processor you can though. I have done it several times and it seems to work great.
I am not going to tell you exactly how because I do not know your post, but to reverse the sign of a variable you use the logic below.
xabs is my variable for this example.
xabs = xabs * -1
This will take the value of xabs and change it from positive to negative or from negitive to positive. This is the easy part. The hard part is making sure you have this in the right location of your post. Where you need to put it will vary based on if your post supports rotary logic or not. Typically this is done where the XYZ and IJK matrix is mapped to the current plane.
I strongly sudgest you take this information to your Mastercam dealer and request this change. They should be able to make this change for you.
Thanks and I hope this helps
PS You have a PM
AC
ImanCarrot
03-09-2007, 09:39 AM
Change the GCode filename extension to .TXT and open the file using Word for Windows as a text document.
Click the Edit Tab and then Replace.
Stick X in the replace bit and X- in the Replace With bit.
Do the same with Y.
Watch out for any X0 and Y0 values.. you'll need to change these manual cos the Replace will change these to X-0 which might mess up your program.
Save the file then rename it with the appropriate filename extension.
Hope this helps!
Mike Mattera
03-09-2007, 10:00 AM
theres a variable for changing that. If you search in the post (dia_mult) you'll find .....
dia_mult : 2 #Multiplier for output on X axis (Neg. switches sign of X)
y_mult : 1 #Multiplier for output on Y axis (Neg. switches sign of Y)
z_mult : 1 #Multiplier for output on Z axis (Neg. switches sign of Z)
dia_mult is what changes the output for Radius ot Dia.
Every X value runs thru it before getting output. Changing it to -2 will invert the value and make the output 2 times the radius.
Mike Mattera
post_guy
03-09-2007, 10:12 AM
The default MPFAN in V9 contained some limited logic for this. To do it properly, open the .pst file and find the following section:
pxyzcout #Map coordinates
if rot_on_x,
[
if cuttype = zero, pxyzcout0 #Toolplane Positioning
if cuttype = one, pxyzcout1 #Axis Substitution
if cuttype = two, pxyzcout2 #Polar Conversion
if cuttype = three, pxyzcout3 #Simulatneous 4 axis (Multi-axis)
if rot_ccw_pos = one, csav = -csav
if mr_rt_actv <> two,
[
pcoutrev
if index, pindxcalc
pfcalc
]
else, feed = fr_pos
]
else,
[
xabs = vequ (x)
feed = fr_pos
]
#Check flags and change orientation # - eap 1/17/03
if xflip = yes, xabs = xabs * -1 # - eap 1/17/03
if yflip = yes, yabs = yabs * -1 # - eap 1/17/03
if zflip = yes, zabs = zabs * -1 # - eap 1/17/03
The xflip and yflip and zflip variables are the ones you are really interested in. The logic needs to be modified to work properly. Change it to:
#Check flags and change orientation # - eap 1/17/03
if xflip = yes,
[
xabs = xabs * -1
i = i * -1
]
if yflip = yes,
[
yabs = yabs * -1
j = j * -1
]
if zflip = yes,
[
zabs = zabs * -1
k = k * -1
]
Now find the variable initializations in the post:
xflip : no #Reverse X axis orientation - eap 1/17/03
yflip : no #Reverse Y axis orientation - eap 1/17/03
zflip : no #Reverse Z axis orientation - eap 1/17/03
and change them to:
xflip : yes #Reverse X axis orientation - eap 1/17/03
yflip : yes #Reverse Y axis orientation - eap 1/17/03
zflip : no #Reverse Z axis orientation - eap 1/17/03
Mike Mattera
03-10-2007, 01:28 AM
Why did I think he was asking abouy a lathe post ? :confused:
Mike Mattera
Mike Mattera
03-10-2007, 01:35 AM
Good Point Post_Guy. The I J K arc values also have to be flipped for the circles to come out right. It seems that code was missing from the original MPFAN.
:cheers:
Mike Mattera
jymdman
03-11-2007, 02:32 PM
Thank you all for helping me out here.
I found a way myself to flip the values after posting, but I will change to use post_guy's solution as it look more clean than my way! :)