CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > CAM Software > Mastercam > Post Processors for MC



This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 03-08-2007, 11:03 AM
 
Join Date: Mar 2007
Location: Sweden
Posts: 4
jymdman is on a distinguished road
Inverting values.

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
Tweet this Post!Share on Facebook
Reply With Quote

  #2  
Old 03-08-2007, 02:52 PM
tobyaxis's Avatar
Moderator
 
Join Date: Jan 2006
Location: USA
Posts: 4,395
tobyaxis is on a distinguished road
Originally Posted by jymdman View Post
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
__________________
Toby D.
"Imagination and Memory are but one thing, but for divers considerations have divers names"
Schwarzwald

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

www.refractotech.com
Tweet this Post!Share on Facebook
Reply With Quote

  #3  
Old 03-08-2007, 02:56 PM
Rekd's Avatar
Community Moderator
 
Join Date: Apr 2003
Location: teh Debug Window
Posts: 1,877
Rekd is on a distinguished road
Originally Posted by jymdman View Post
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


Are you programming it backwards? Not sure the reasoning here.
__________________
Matt
San Diego, Ca

___ o o o_
[l_,[_____],
l---L - □lllllll□-
( )_) ( )_)--)_)

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #4  
Old 03-08-2007, 03:56 PM
tobyaxis's Avatar
Moderator
 
Join Date: Jan 2006
Location: USA
Posts: 4,395
tobyaxis is on a distinguished road
Originally Posted by Rekd View Post


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
__________________
Toby D.
"Imagination and Memory are but one thing, but for divers considerations have divers names"
Schwarzwald

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

www.refractotech.com
Tweet this Post!Share on Facebook
Reply With Quote

  #5   Ban this user!
Old 03-08-2007, 04:02 PM
 
Join Date: Mar 2007
Location: Sweden
Posts: 4
jymdman is on a distinguished road
Originally Posted by Rekd View Post


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
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 03-08-2007, 06:50 PM
Matt Berube's Avatar
Power User
 
Join Date: Mar 2005
Location: USA
Posts: 461
Matt Berube is on a distinguished road
Is there a parameter in the control you could switch to have the axis inverted ?

Just thinking out loud here...
Tweet this Post!Share on Facebook
Reply With Quote

  #7   Ban this user!
Old 03-09-2007, 09:30 AM
Alex_Cole's Avatar  
Join Date: Mar 2005
Location: usa
Posts: 189
Alex_Cole is on a distinguished road
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
Tweet this Post!Share on Facebook
Reply With Quote

  #8   Ban this user!
Old 03-09-2007, 09:39 AM
ImanCarrot's Avatar  
Join Date: Nov 2005
Location: UK
Posts: 1,468
ImanCarrot is on a distinguished road
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!
__________________
I love deadlines- I like the whooshing sound they make as they fly by.
Tweet this Post!Share on Facebook
Reply With Quote

  #9  
Old 03-09-2007, 10:00 AM
Mike Mattera's Avatar
Gold Member
 
Join Date: Mar 2006
Location: USA
Posts: 1,010
Mike Mattera is on a distinguished road
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
__________________
Tips For Manufacturing Training CD's, DVD's for Mastercam, SolidWorks, Inventor, G-Code Training & More
http://www.tipsforcadcam.com
Tweet this Post!Share on Facebook
Reply With Quote

  #10   Ban this user!
Old 03-09-2007, 10:12 AM
 
Join Date: Jan 2005
Location: USA
Posts: 23
post_guy is on a distinguished road
The default MPFAN in V9 contained some limited logic for this. To do it properly, open the .pst file and find the following section:

Code:
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:

Code:
      #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:

Code:
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:

Code:
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
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #11  
Old 03-10-2007, 01:28 AM
Mike Mattera's Avatar
Gold Member
 
Join Date: Mar 2006
Location: USA
Posts: 1,010
Mike Mattera is on a distinguished road
Why did I think he was asking abouy a lathe post ?

Mike Mattera
__________________
Tips For Manufacturing Training CD's, DVD's for Mastercam, SolidWorks, Inventor, G-Code Training & More
http://www.tipsforcadcam.com
Tweet this Post!Share on Facebook
Reply With Quote

  #12  
Old 03-10-2007, 01:35 AM
Mike Mattera's Avatar
Gold Member
 
Join Date: Mar 2006
Location: USA
Posts: 1,010
Mike Mattera is on a distinguished road
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.



Mike Mattera
__________________
Tips For Manufacturing Training CD's, DVD's for Mastercam, SolidWorks, Inventor, G-Code Training & More
http://www.tipsforcadcam.com
Tweet this Post!Share on Facebook
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Torque values cncshaper Stepper Motors and Drives 2 11-23-2007 12:17 AM
Inverting a 220 to 110 v transformer elogicca General Electronics Discussion 4 01-20-2007 11:55 AM
K Values And Bend Radii lostbaka Bending, Forging,Extrusion... 1 12-04-2006 07:29 AM
List of L values for G10 L?? iMisspell G-Code Programing 3 07-30-2006 11:32 PM
Output values?? hop Machine Problems, Solutions , Wireless DNC, serial port 0 06-07-2006 06:37 AM




All times are GMT -5. The time now is 03:57 AM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353