Page 1 of 2 12 LastLast
Results 1 to 12 of 13

Thread: Inverting values.

  1. #1
    Registered
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4
    Downloads
    0
    Uploads
    0

    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


  2. #2
    Moderator tobyaxis's Avatar
    Join Date
    Jan 2006
    Location
    USA
    Posts
    4,394
    Downloads
    0
    Uploads
    0
    Quote 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


  3. #3
    Registered Rekd's Avatar
    Join Date
    Apr 2003
    Location
    teh Debug Window
    Posts
    1,876
    Downloads
    0
    Uploads
    0
    Quote 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)


  4. #4
    Moderator tobyaxis's Avatar
    Join Date
    Jan 2006
    Location
    USA
    Posts
    4,394
    Downloads
    0
    Uploads
    0
    Quote 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


  • #5
    Registered
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4
    Downloads
    0
    Uploads
    0
    Quote 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


  • #6
    Power User Matt Berube's Avatar
    Join Date
    Mar 2005
    Location
    USA
    Posts
    461
    Downloads
    0
    Uploads
    0
    Is there a parameter in the control you could switch to have the axis inverted ?

    Just thinking out loud here...


  • #7
    Registered Alex_Cole's Avatar
    Join Date
    Mar 2005
    Location
    usa
    Posts
    213
    Downloads
    0
    Uploads
    0
    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


  • #8
    Registered ImanCarrot's Avatar
    Join Date
    Nov 2005
    Location
    UK
    Posts
    1,468
    Downloads
    0
    Uploads
    0
    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.


  • #9
    Registered Mike Mattera's Avatar
    Join Date
    Mar 2006
    Location
    USA
    Posts
    1,011
    Downloads
    0
    Uploads
    0
    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


  • #10
    Registered
    Join Date
    Jan 2005
    Location
    USA
    Posts
    23
    Downloads
    0
    Uploads
    0
    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


  • #11
    Registered Mike Mattera's Avatar
    Join Date
    Mar 2006
    Location
    USA
    Posts
    1,011
    Downloads
    0
    Uploads
    0
    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


  • #12
    Registered Mike Mattera's Avatar
    Join Date
    Mar 2006
    Location
    USA
    Posts
    1,011
    Downloads
    0
    Uploads
    0
    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


  • Page 1 of 2 12 LastLast

    Similar Threads

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

    Posting Permissions


     


    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.