586,103 active members*
3,309 visitors online*
Register for free
Login
IndustryArena Forum > CAM Software > Surfcam > Need a little help tweaking my lathe mpost
Page 1 of 2 12
Results 1 to 20 of 21
  1. #1
    Join Date
    May 2014
    Posts
    9

    Need a little help tweaking my lathe mpost

    Hello everyone!

    Long time lurker first time poster. I have been using Surfcam for about 6 years now. The posts my company used were never truly correct and they always hand edited them. I've taken it on my self to fix this once and for all. I've managed to edit several posts successfully but one is still throwing me for a loop. What i'm looking for is the structure format Mpost uses. I now all the command, sequences and variables. I just dont understand the structure it decides to output code.

    For example:

    here is my Mori post form:

    name MORI LATHE


    % 00
    O 4
    N >3
    G >2
    X ->3.>4
    Z ->3.>4
    D >2
    I ->3.>4
    K ->3.>4
    p >4 P
    q >4 Q
    d ->3.>4
    U ->3.>4
    W ->3.>4
    P ->3.>4
    Q ->3.>4
    R ->3.>4
    F >3.>3
    A 2
    T >2
    S >4
    M >2
    u 2

    ModalLetters X Z I K F S M

    ModalGs 0 1 2 3 80 81 82 83 84 85

    Sequence#s N 0 1 10 10 100
    First#? N
    Last#? N


    HCode Z
    VCode X
    FeedCode F

    Comment ( )

    Spindle 3 4 5
    Coolant 8 9 7
    SpeedType G 97 96
    Dcomp 41 42 40

    Feed G1
    Rapid G0
    Cw G2
    Ccw G3

    Sbackdoor Supressheader

    Inc/Abs G 91 90

    Inch/MM 20 21

    CtrCode R

    Leading0s? N

    ByDiameter? Y
    RevSigns
    Spaces? Y

    Incremental? N
    CtrIncremental? Y
    ByQuadrants? Y
    ReturnPlane 98 99

    UppercaseComments? Y

    Tap
    G77 Z[H] K[Vclear] F[FRate]
    End

    Ream
    G74 Z[H] K[Vclear] F[FRate]
    End

    Bore
    G74 Z[H] K[Vclear] F[FRate]
    End

    AutoThread
    G33 X[V] Z[H] F[Frate]
    End

    Rough
    if [TipAng] = -90
    G72 p[StartN] q[EndN] d[Step] U[VLeave] W[SLeave] F[plunge]
    else
    G71 p[StartN] q[EndN] d[Step] U[VLeave] W[SLeave] F[Plunge]
    endif
    End

    Finish
    G70 p[StartN] q[EndN]
    End

    Cancel
    G80
    End

    Upon [Speed]
    M[Direct] S[Speed]
    End

    StartCode
    %0
    O0
    End

    1stToolChange
    G18
    "G0 G28 V0."
    "G0 G53 X0. Z-15."
    G50 G99 S[MaxRpm]
    G[Work]
    G0 T[Tool]
    G[Work] G99 G18
    M69
    M46
    G[SpeedType] S[Speed] M[Direct]
    G0 X[V] Z.1 M[COOL]
    Z[H]
    End

    Infeed
    G0 X[V]
    G1 G[Side] Z[H] F[FRate]
    End

    Outfeed
    G1 X[V]
    G1 G40 Z[H] F[FRate]
    End

    ToolChange
    G0 Z.3 M[coolantoff]
    "G28 V0."
    "G53 X0. Z-15."
    M5
    M01
    G0 T[tool]
    G[Work] G99 G18
    M69
    M46
    G[SpeedType] S[Speed] M[Direct]
    G0 X[V] Z.1 M[COOL]
    End

    EndCode
    G0 Z.3 M[coolantoff]
    "G28 V0."
    "G53 X0. Z-15."
    M5
    M30
    %0
    End

    Replace "C0" with "C0."
    Replace "T1" with "T0101"
    Replace "T2" with "T202"
    Replace "T3" with "T303"
    Replace "T4" with "T404"
    Replace "T5" with "T505"
    Replace "T6" with "T606"
    Replace "T7" with "T707"
    Replace "T8" with "T808"
    Replace "T9" with "T909"
    Replace "T10" with "T1010"



    To me it looks like my postform is correct but the output is still not correct.

    Below is a very basic turning canned cycle operation:

    %
    O0000
    G18
    G0 G28 V0.
    G0 G53 X0. Z-15.
    G50 G99 S3000
    G54
    G0 T01010
    G54 G99 G18
    M69
    M46
    G96 S600 M3
    G0 X1.2532 Z.1 M8
    Z.0131


    G0 X1.0674 (what controls this line)


    G71 P100 Q110 D.1 U.01 W.003 F.012
    N100 G0 X0
    G1 G42 Z0 F.006
    G1 X.35
    G3 X.45 Z-.05 R.05
    G1 Z-.2451
    G2 X.55 Z-.2951 R.05
    G1 X.6826
    G3 X.7826 Z-.3451 R.05
    G1 Z-.4886
    G2 X.8826 Z-.5386 R.05
    G1 X.9
    G3 X1. Z-.5886 R.05
    G1 Z-1.
    X1.25
    N110


    G0 X1.0674
    Z.0131 (where does this come from)


    G70 P100 (missing the Q110)

    G1 X1.25
    G40 Z-.9984 F.006 (This looks like my Outfeed sequence, but why is it way down here?

    G0 Z.3 M9
    G28 V0.
    G53 X0. Z-15.
    M5
    M30
    %

    I can't figure out where the phantom lines of code are coming from and how to change it. I'm hoping someone here can help me.

    Thanks
    -Nick

  2. #2
    Join Date
    May 2014
    Posts
    9

    Re: Surfcam Mpost help

    I also just noticed that my tool numbers aren't coming out correct either....

    T010101 should be T1010

    Replace "T1" with "T0101"
    Replace "T10" with "T1010"

    T[tool] should be outputing T10 which would be replaced with T1010 right?

  3. #3
    Join Date
    May 2014
    Posts
    9

    Re: Need a little help tweaking my lathe mpost

    Nevermind I think I figured it out. I found out how to have surfcam post the LOG file. It shows you all the CL data and what it coverted it too. I should be able to figure this out.

  4. #4
    Join Date
    May 2013
    Posts
    142

    Re: Need a little help tweaking my lathe mpost

    You could shorten those replace commands by adding t >2 to your letter addresses, then change your tool change line to T[Tool] t[Tool] , after that you only need 1 replace line Replace " t" with "" . This also wouldn't hard code limit you to 10 tools.

  5. #5
    Join Date
    May 2014
    Posts
    9

    Re: Need a little help tweaking my lathe mpost

    Quote Originally Posted by Billetgrip View Post
    You could shorten those replace commands by adding t >2 to your letter addresses, then change your tool change line to T[Tool] t[Tool] , after that you only need 1 replace line Replace " t" with "" . This also wouldn't hard code limit you to 10 tools.

    Awesome! thats one fix down, thank you.


    Now about my other problems. here are the lines in question:

    %
    O0000
    G18
    G0 G28 V0.
    G0 G53 X0. Z-15.
    G50 G99 S3000
    G54
    G0 T1010
    G54 G99 G18
    M69
    M46
    G96 S600 M3
    G0 X1.45 Z.1 M8


    G0 X1.47
    X1.4732 Z.0131
    X1.0674


    G71 P100 Q110 D.1 U.01 W.003 F.012
    N100 G0 X0
    G1 G42 Z0 F.006
    G1 X.35
    ..... etc

    Here is the same lines from the .log file:




    ---INC Type 0, 12 bytes. (Rapid) 0.1 0.735 0. #12.
    12 TM:>position< 0.1 0.735 0. 12. ""
    G0 X1.47


    ---INC Type 0, 12 bytes. (Rapid) 0.0131 0.73656 0. #13.
    13 TM:>position< 0.0131 0.7366 0. 13. ""
    X1.4732 Z.0131


    ---INC Type 0, 12 bytes. (Rapid) 0.0131 0.53366 0. #14.
    14 TM:>position< 0.0131 0.5337 0. 14. ""
    X1.0674

    What sequence controls these moves so that I can either edit them or remove them entirely?

  6. #6
    Join Date
    May 2013
    Posts
    142

    Re: Need a little help tweaking my lathe mpost

    They may be lead-in/ initial rapid/ clearance plane moves that mpost is trying to correct from the hard coded moves before it.
    Example copied from your post above:
    G[SpeedType] S[Speed] M[Direct]
    G0 X[V] Z.1 M[COOL]
    Z[H]
    End

    What is the purpose of the bolded part? Why not let surfcam take care of it?

  7. #7
    Join Date
    May 2014
    Posts
    9

    Re: Need a little help tweaking my lathe mpost

    Quote Originally Posted by Billetgrip View Post
    They may be lead-in/ initial rapid/ clearance plane moves that mpost is trying to correct from the hard coded moves before it.
    Example copied from your post above:
    G[SpeedType] S[Speed] M[Direct]
    G0 X[V] Z.1 M[COOL]
    Z[H]
    End

    What is the purpose of the bolded part? Why not let surfcam take care of it?

    My bad I should have included the changes I made.

    here is the full beginging of the .log file:

    ---OUTPUTTING SEQUENCE: STARTCODE---v
    Template: >> %0
    %
    Template: >> O0
    O0000
    ---FINISHED SEQUENCE STARTCODE---^



    ---INC Type 231, 460 bytes. (Header) 302 (Discarding 90 bytes.)
    ---INC Type 221, 190 bytes. (Text [221])
    ---INC Type 244, 80 bytes.
    ---INC Type 243, 4 bytes. 243: UNRECOGNIZED (Discarding 4 bytes.) #4.
    1 TM:>unknown< 243. 4. 0. 4. ""
    ---INC Type 208, 128 bytes. (View) (Discarding 30 bytes.) 1 1. 0. 0. 0. 1. 0. 0. 0. 1. 0. 0. 0.
    ---INC Type 203, 0 bytes. (Multi On [202] or Off [203])
    ---INC Type 10, 176 bytes. (Ext. cutter info) 2 (Discarding 48 bytes.) 0 (Discarding 4 bytes.) 1 (Discarding 4 bytes.) (Discarding 12 bytes.) 0.01563 0.55 (Discarding 8 bytes.) (Discarding 8 bytes.) (Discarding 16 bytes.) (Discarding 48 bytes.) #7.
    2 TM:>style< 0.55 1. -1. 7. ""
    ---INC Type 199, 196 bytes. (Ext. TC) (Discarding 44 bytes.) 0 0 0 0 10 10 10 0 1 600 1 1 1 (Discarding 4 bytes.) 0 0 0 0. 0. (Discarding 8 bytes.) (Discarding 36 bytes.) 0. (Discarding 20 bytes.) #0.
    3 TM:>fluid< 1. 0. 0. 0. ""
    4 TM:>speed< 600. 1. 0. 0. ""
    5 TM:>style< 0.55 1. 0. 0. ""
    6 TM:>turret< 1. 0. 0. 0. ""
    7 TM:>number< 10. 10. 10. 0. ""
    8 TM:>unitmode< 0. 0. 0. 8. ""
    ---INC Type 204, 4 bytes. (Feed rate) 0.006 #9.
    9 TM:>frate< 0.006 0.012 0. 9. ""
    ---INC Type 205, 4 bytes. (Plunge rate) 0.012 #10.
    10 TM:>frate< 0.006 0.012 0. 10. ""
    ---INC Type 0, 12 bytes. (Rapid) 0.1 0.725 0. #11.
    11 TM:>position< 0.1 0.725 0. 11. ""
    ---OUTPUTTING SEQUENCE: 1STTOOLCHANGE---v


    Template: >> G18
    G18
    Template: >> "G0 G28 V0."
    G0 G28 V0.
    Template: >> "G0 G53 X0. Z-15."
    G0 G53 X0. Z-15.
    Template: >> G50 G99 S[MaxRpm]
    G50 G99 S3000
    Template: >> G[Work]
    G54
    Template: >> G0 T[Tool] t[tool]
    REPLACING " t" with ""
    G0 T1010
    Template: >> G[Work] G99 G18
    G54 G99 G18
    Template: >> M69
    M69
    Template: >> M46
    M46
    Template: >> G[SpeedType] S[Speed] M[Direct]
    G96 S600 M3
    Template: >> G0 X[V] Z[H] M[COOL]
    G0 X1.45 Z.1 M8
    ---FINISHED SEQUENCE 1STTOOLCHANGE---^


    from my postform:

    1stToolChange # First tool change
    G18
    "G0 G28 V0."
    "G0 G53 X0. Z-15."
    G50 G99 S[MaxRpm]
    G[Work]
    G0 T[Tool] t[tool]
    G[Work] G99 G18
    M69
    M46
    G[SpeedType] S[Speed] M[Direct]
    G0 X[V] Z[H] M[COOL]
    End


    As you can see I changed it to allow surfcam to go to clearence point.


    ---INC Type 0, 12 bytes. (Rapid) 0.1 0.735 0. #12.
    12 TM:>position< 0.1 0.735 0. 12. ""
    G0 X1.47

    ---INC Type 0, 12 bytes. (Rapid) 0.0131 0.73656 0. #13.
    13 TM:>position< 0.0131 0.7366 0. 13. ""
    X1.4732 Z.0131

    ---INC Type 0, 12 bytes. (Rapid) 0.0131 0.53366 0. #14.
    14 TM:>position< 0.0131 0.5337 0. 14. ""
    X1.0674


    (the above is still a mystery move to me.)

  8. #8
    Join Date
    May 2013
    Posts
    142

    Re: Need a little help tweaking my lathe mpost

    Hmm got me...that seems to be the issue with any of the "turning" canned cycles. My threading cycle inserts a pointless line before and after the G76 line. I never use the G70/G71/G72 cycles so I can't really comment on them. If you can stand the slightly longer program try unchecking the "Enable Canned cycle" box and see if that gets you what you want.

  9. #9
    Join Date
    May 2014
    Posts
    9

    Re: Need a little help tweaking my lathe mpost

    Quote Originally Posted by Billetgrip View Post
    Hmm got me...that seems to be the issue with any of the "turning" canned cycles. My threading cycle inserts a pointless line before and after the G76 line. I never use the G70/G71/G72 cycles so I can't really comment on them. If you can stand the slightly longer program try unchecking the "Enable Canned cycle" box and see if that gets you what you want.
    That will post fine. However I like using the canned cycles. It makes it a lot easier to change by hand if needed. As of now I usually just post a finish path and copy and paste it into my blank prgram template. its works fine but it would be awesome if I could post directly from surfcam

  10. #10
    Join Date
    May 2013
    Posts
    142

    Re: Need a little help tweaking my lathe mpost

    I told you the tool change thing wrong. Replace the "t >2" with "t 2". With the way it is now it will post T44 for tool 4. The fix will post T404. My bad.

  11. #11
    Join Date
    May 2014
    Posts
    9

    Re: Need a little help tweaking my lathe mpost

    Quote Originally Posted by Billetgrip View Post
    I told you the tool change thing wrong. Replace the "t >2" with "t 2". With the way it is now it will post T44 for tool 4. The fix will post T404. My bad.
    yeah I fixed it already


    all good

  12. #12
    Join Date
    Mar 2008
    Posts
    45

    Re: Need a little help tweaking my lathe mpost

    Can you show how to make Surfcam post the log file? Thanks!

  13. #13
    Join Date
    May 2013
    Posts
    142

    Re: Need a little help tweaking my lathe mpost

    Logging? Y command in the post.ini file or take the logging command completely out. That's how the manual says to do it. Never worked for me though.

    Sent from my SAMSUNG-SGH-I747 using Tapatalk

  14. #14
    Join Date
    May 2014
    Posts
    9

    Re: Need a little help tweaking my lathe mpost

    Quote Originally Posted by marine1775 View Post
    Can you show how to make Surfcam post the log file? Thanks!

    No problem.


    Go to your surfcam directory and find the Mpost folder

    ex: C:\Program Files\SURFCAM\V5_2\MPost

    look for the post.ini file

    open it in notepad

    add this line under whatever postform you want to log

    Logging? Y

    ex:

    [MPOST]
    Format C:\Program Files\SURFCAM\POSTLIB\PostForm.m

    Logging? Y

    [LPOST]
    Format C:\Program Files\SURFCAM\POSTLIB\PostForm.l


    Logging? Y

    [EPOST]
    Format C:\Program Files\SURFCAM\POSTLIB\PostForm.e


    Logging? Y


    This will create a log file in the Mpost folder everytime you post. it may slow processing down if you have a large file, its more for debugging. it rewrites everytime.

  15. #15
    Join Date
    May 2013
    Posts
    142

    Re: Need a little help tweaking my lathe mpost

    For anything newer than v5.2 the path is C:\Program Files\SURFCAM\your version of surfcam\Apps\MPost

  16. #16
    Join Date
    Mar 2008
    Posts
    45

    Re: Need a little help tweaking my lathe mpost

    Thanks. Only problem I am having now is it will not let me save the file. I get access denied

  17. #17
    Join Date
    May 2014
    Posts
    9

    Re: Need a little help tweaking my lathe mpost

    Quote Originally Posted by marine1775 View Post
    Thanks. Only problem I am having now is it will not let me save the file. I get access denied
    right click on the .ini file > properties and uncheck the box that says read only. hit apply and you should be good to go.

  18. #18
    Join Date
    Mar 2008
    Posts
    45

    Re: Need a little help tweaking my lathe mpost

    I got it to save but I may be having the same problem Billetgrip is having. I run my post after changing the post.ini file and there is no .log file in the mpost folder. Any thoughts?

  19. #19

    Re: Need a little help tweaking my lathe mpost

    Quote Originally Posted by marine1775 View Post
    I got it to save but I may be having the same problem Billetgrip is having. I run my post after changing the post.ini file and there is no .log file in the mpost folder. Any thoughts?
    Obviously you're running Surfcam V6, and from there on Surfcam has changed the file structure; the info to find it is located in page #4 on the Whats New file;
    Mario

  20. #20
    Join Date
    May 2013
    Posts
    142

    Re: Need a little help tweaking my lathe mpost

    Quote Originally Posted by mariojl View Post
    Obviously you're running Surfcam V6, and from there on Surfcam has changed the file structure; the info to find it is located in page #4 on the Whats New file;
    Mario
    Using 2014 R2 on a Win 8.1 comp. The location of the .ini file isn't the problem. It just simply doesn't work like the manual says.

Page 1 of 2 12

Similar Threads

  1. Modify MPOST siemens840 de
    By sinan-ba in forum Surfcam
    Replies: 11
    Last Post: 02-25-2014, 01:36 AM
  2. need help with mits fx 20 wire edm mpost
    By marine1775 in forum Surfcam
    Replies: 2
    Last Post: 02-03-2014, 07:38 PM
  3. Spost vs Mpost
    By forjaco in forum Surfcam
    Replies: 21
    Last Post: 03-22-2013, 09:09 AM
  4. Surfcam Hole Cycle Types and Mpost
    By Fest911 in forum Surfcam
    Replies: 10
    Last Post: 11-30-2012, 09:08 AM
  5. Hurco & SurfCam Mpost????
    By lkenney in forum HURCO
    Replies: 0
    Last Post: 10-05-2011, 06:04 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •