Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Colin Gilchrist

Verified Members
  • Posts

    7,772
  • Joined

  • Last visited

  • Days Won

    162

Posts posted by Colin Gilchrist

  1. The code already exists, but you need to change the comments, to control the use.

     

    pwcs            #G54+ coordinate setting at toolchange
          if wcstype = two | wcstype > three,
            [
            sav_frc_wcs = force_wcs
            if sub_level$ > zero, force_wcs = zero
            if sav_mi9 = 1, workofs$ = sav_workofs
            if workofs$ < 0, workofs$ = 0
            if workofs$ <> prv_workofs$ | (force_wcs & toolchng) | sof,
              [
              if workofs$ < 6,
                [
                g_wcs = workofs$ + 54
                *g_wcs
                ]
              else,
                [
                if haas,
                  [
                  #p_wcs = workofs$ - five        #G154 P1 to P99
                  #"G154", *p_wcs
                  g_wcs = workofs$ + 104        #G110 to G129
                  *g_wcs
                  ]
                else,
                  [
                  p_wcs = workofs$ - five
                  "G54.1", *p_wcs
                  ]
                ]
              ]
            force_wcs = sav_frc_wcs
            !workofs$
            ]
    • Like 2
  2. You can enable the "Force Toolchange Switch", but then use "Canned Text" to enable Block Delete - Before the Toolchange, and then disable Block Delete - After the Toolchange.

    This gives you the ability to restart at any of those Operation Start sequences, while also allowing you to fully skip over the Tool Change and Retract motions, using the Block Delete function on the control.

    • Like 3
  3. 1 hour ago, BBprecise said:

    Yeah, after looking at it and running it thru my head I was thinking it could be deleted as well.

    I suppose that you could make the workofs_out switch in the post setup section like an off/on enable/disable switch for automatic plane numbering with a 0 or 1 you could accomplish the same thing. A 0 would disable auto plane numbering and the post would either always use G54 or use the value in plane manager. A 1 would enable auto numbering and would ignore any value in plane manager and increment each as it's used by 1. I suppose if you wanted to add more control you could add some logic to the post that would say "If workofs_out = 0 and  value in the plane manager is equal to or greater then 0 then workofs$ equals value in plane manager , else workofs$ equals 0. Which is already in there for the most part except it doesn't look for a value in the plane manager.

    Seems as -1 was an easier way to how to control workoffsets, but again I'm no post genius.

     

    -1 is absolutely fine to use as a control, if you are manually setting a value.

    The 'workofs$' variable will never be set automatically to '-1'' by MP during the posting process (at runtime), when Automatic Work Offset Numbering is in effect in Mastercam.

    When the value of '-1' is stored in the Binary NCI data (operation data in the Mastercam database), it is only used as a trigger by MP to load values into 'workofs$', based on "did the current Plane change from the previous plane".

    Using -1 in the Misc Values, or setting '-1' to a user defined variable like 'workofs_out', is perfectly fine, and whatever makes the most sense to you, provided it works, is a great solution.

    I just wanted to point out that even though the Operation in Mastercam shows '-1' when automatic work offset numbering is selected, that value gets overridden by MP during processing, where MP essentially controls the auto-incrementing.

    You might be thinking to yourself, "well that's dumb... why would they do that...", but there is actually a great reason for this.

    Nobody knows what you are going to select for a set of Operations, inside the Toolpaths Manager, at the time you press the "G1" button to PostFor example, you may have only selected Operations 1-3, 7, and 22-40 to Post. Or, you've got them all selected. If you are skipping Operations, MP needs to assemble the list of operations being posted first, and only then can it go through and check the stack of operations for 'plane changes'.

  4. Glad you found the error.

    Technically, I think that entire block could be deleted, and the 'call' to 'pworkofs' could be replaced with the line 'workofs_out = mi5$'.

    The reason I say this is: the value of 'workofs$' variable never gets set to '-1'.

    Users (post developers) used to think that "-1" meant that automatic work offset numbering is enabled which is technically true, but the variable 'workofs$' always gets assigned a value, starting from '0' and counting upwards. The variable is never stored with a value of '-1'.

    The '-1' value is stored internally in the Binary NCI, and during the ASCII NCI Conversion process, the value of 'workofs$' will be assigned "the current work offset value, or if the plane changes, it will be automatically assigned the next available work offset value.

     

    • Thanks 1
  5. By the way, you can use the Control Definition to edit the "displayed text" for MI5, so it tells you when you go into the operation, what that Misc. Integer is used for. (Technically, as the Post editor, you are telling the user what that control is used for. You may be both the editor and the user, but if anyone else uses the Post after you, or you do a bunch of other work on other machines, and come back to use the Post months later, having the 'label' for MI5 in the operation will help.

    • Like 2
  6. 19 hours ago, BBprecise said:

    So I put workofs$ = mi5$ in my post here and it seems to work correctly for a simple drill toolpath anyways.

    pwcs            #G54+ coordinate setting at toolchange
          if wcstype = 2 | wcstype > 3,
            [
            sav_frc_wcs = force_wcs
            if sub_level$ > 0, force_wcs = 0
            pworkofs
            if workofs$ <> prv_workofs$ | (force_wcs & (toolchng | retflg)) | sof,
              [
                workofs$ = mi5$
                if workofs$ < 6,
                [
                g_wcs = workofs$ + 54
                *g_wcs
                ]
              else,

    Could it really be that simple or am I missing something?

    Thanks.

    Yes, it could be that simple, however I'd have to look at the structure of the Post to be sure.

    For example, in the block above the "if" statement logic conditions, there is a call to 'pworkofs'. I suspect there may be logic there which is manipulating the value of 'workofs$'. Also, we need to take advantage of the condition 'workofs$ <> prv_workofs$'.

    Try testing this out:

    pwcs            #G54+ coordinate setting at toolchange
          if wcstype = 2 | wcstype > 3,
            [
            sav_frc_wcs = force_wcs
            if sub_level$ > 0, force_wcs = 0
            pworkofs

             workofs$ = mi5$
            if workofs$ <> prv_workofs$ | (force_wcs & (toolchng | retflg)) | sof,
              [
                if workofs$ < 6,
                [
                g_wcs = workofs$ + 54
                *g_wcs
                ]
              else,

    Also, Copy/Paste your 'pworkofs' block so I can take a look at what is going on in there.

    • Like 2
  7. 5 hours ago, HCProf said:

    So, I wrote up a simple little program to  refresh my memory on the ST-10's, now that I'm about to start running them again.

    I could not find the post for our ST's, I found the machine definition for our ST-10's though.

    So I reached out to our cad/cam dealer, explained the issue that it seems like I was simply missing our post file. They said: Just use generic definitions and posts....
    I may only have 5 or 6 years in industry, but I have never used a generic post before. I had a boss write his own once, but we always have used "custom" or specific posts....

    Regardless, I tried it and it didn't quite work. I wrote a quick simple lathe program, gave myself 0.050" Z-margin for the face pass. Told the pass to finish at Z=0.0 and all it did was cut air. I havent moved on to profiling as, obviously, something is off. Probed in my tools, touched off on the face, z-face measured, and it literally just barely kisses the part.
    I even found old programs from someone before me, same face pass parameters but they were using a specific machine definition. I have that definition still, but I dont have the, or cannot find, the post that went with it.

    Am I messing something up? Or is it the fact I'm using a generic post?

     

    TIA

    There is a difference between a "generic lathe post", and a "Generic Haas Lathe Post".

    Is your machine 2-Axis only (XZ) or do you have Y-Axis and/or live-tooling?

    This post, with the right Axis Combinations, will only output XZ or XZC output. (Default is XYZC, 4-Axis)

    Generic Haas ST 4X MT_Lathe.mcam-content

    With ANY Post, you must have a properly set Work Offset location, and Tool Offset settings. All of those have to match.

  8. 1 hour ago, BBprecise said:

    Is it possible to set the value of workofs_out in a post processor to use a misc or real value?

    Is is possible? Yes, absolutely.

    The values of misc. integers and real numbers are held in predefined variables:

    mi1$, mi2$, mi3$, ... through ..., mi9$, and mi10$

    mr1$, mr2$, ... through ..., mr9$, mr10$

    The call to Work Offset output is done through 'pwcs'. I would add logic to the 'pwcs' Post Block to detect a value in your Misc Integer (I would use Misc Integers for this).

    Is "G54" always your locked work offset value? If yes, you don't have to worry about using "-1". The default value for Misc. Integers is "0", so that would be easy to use "1" or "2" or another integer to force out G55, G56, or higher values.

    • Like 1
  9. 48 minutes ago, Jake L said:

    Quick follow up, ended up using a buffer. Intimidating at first but not too crazy once I got into it.

    For anyone with the same issue down the road:

     

    Glad this Post of mine from 2016 found a willing audience! I can't tell you how rewarding it is to see people still benefiting from work I did 7 years ago...

    3 hours ago, Jake L said:

    I am currently modifying a MPFAN post to reformat the sub programs output. I would like the subprogram number to be 4 digits. Digit 2-4 = tool number, and digit 1 = call number. "Call number" meaning if T2 is called 3 times in the same program I'd like the first call sub number to be 1002 the second sub to be 2002 and third to be 3002. 

    Is there a simple way to do this? My c++ brain is saying just make an array of all the tool numbers as you use them and loop thru the array every time you need to output a subprogram number to check how many times the tool has been previously used. But not sure if that code would be a pain to write into a post.

    I also see that I could use pwrtt$ to pre-read all the tool numbers. So I could track how many times each tool is used and then somehow use that when I'm ready to output sub numbers?

    Any info is appreciated! MC2023 TIA

    C++, Posts, Buffers ???

    We should talk. Do you like where you work and what you do? Opportunities abound.

    Where in Western Mass? Springfield area?

    • Like 3
  10. Use Dynamic Milling. Make your stepover 2-4% of the tool diameter, maximum 5%. You want to minimize the heat getting into the tool and stock, and maximize the heat getting into the chip. Taking a small stepover minimizes the cutting edge contact time as the tooth is shearing off a chip. To maximize material removal, you'll want to use a flute at least 2:1, depth to diameter.

    Unless you have very massive amounts of material to remove, I like using 1/2" diameter endmills because of the value. 

    https://www.helicaltool.com/products/tool-details-84511

    I use FSWizard, and love this app/software. If you don't have a copy, it is worth getting the "pro" version, with the lifetime license. Money very well spent.

    I plugged in the following parameters for the tool I recommended above:

    • Grade 5 Titanium, 6al-4v (310-350HB)
    • Solid Endmill
    • Carbide
    • ALTiN coating
    • IN units
    • 0.5 Tip Dia
    • 6 flutes
    • 1.35" stickout
    • 0.03 Corner Radius
    • Flute Length 1.25"
    • 38 degree helix angle (I guessed, this wasn't listed)
    • 90 degree lead angle
    • 0.5 shank diameter

    Engagement:

    • Depth of cut 1"
    • Width of cut 0.02"
    • Width of cut percentage 4%
    • No to slotting
    • Yes to Chip Thinning
    • No to HSM

    Overrides set to 100% for speed and feed.

     

    This gives a recommendation of 1337 RPM, a Feedrate of 68.86 IPM (68 IPM). This requires 2.14 horsepower, and results in 1.38 cubic inches per minute of metal removal.

     

     

     

    • Thanks 2
    • Like 2
  11. 2 hours ago, nickbe10 said:

    I have 2 HP laptops.

    One is an i7 and one is an i9.

    The i7 is used on my main work station laptop and is set up with max RAM and the most expensive Quadro card I could afford (5000).

    It smokes the i9 machine with an Quadro 2000 card.

    The i7 CPU allowed me to distribute my RAM evenly over my DIMs, really helps with temp. control.

    Hi Nick!

    Great point on temp control by using smaller memory modules, but filling all the slots. I prefer that as well.

    High Clock speed is essential, but I also try to remember that cache is king! 

    • Like 2
  12. Instead of defining the ± in the "initialization", you may have to use the 'no2asc' function to make sure the correct bits are held in that variable.

    Rather than repeating the code for each ASCII character, I'd try constructing a While Loop, and use a common "search string variable".

    str_test : "" #empty string

    str_warn : "" empty string

    pmyblock

          str_test = no2asc(171) #Convert ASCII Code decimal value to Plus/Minus string representation

          pstr_test

           str_test = no2asc(40) #Convert ASCII Code decimal value to Left Paren string representation

          pstr_test

          str_test = no2asc(41) #Convert ASCII Code decimal value to Right Paren string representation

          pstr_test

     

     

    pstr_test

          result = strstr(str_test, strtool$) #Test string for character assigned with no2asc

          if result <> 0,

            [

            str_warn = "BAD CHARACTER " + str_test + " FOUND IN strtool$ NAME." + no2ascii(13) + "FIX COMMENT AND REPOST!"

            result = mprint(str_warn)

            ]

     

     

     

    • Thanks 1
  13. Provided you've already activated the G54 work offset, yes.

    This is measuring Z-Axis "position", at only a single point, and the H0.001 tells the macro the +/- tolerance of the target Z position (in your case Z-Zero of the active work offset).

    You're verifying Z-Axis Position, with a +-0.001 tolerance. You call it "flatness", but it is really just positional tolerance.

    • Like 2
  14. Here is the manual from 2008. This is what is possible "out of the box", and I believe you'll have to write multiple single surface probe points (P9811), store the result variables, and write your own Macro logic to test the results of multiple points to determine "flatness" of a surface.

    Look at Chapter 3 for the "Optional Inputs". In this case I think you want "H" for the +- tolerance value. 

    If you are simply trying to determine "is my single measurement point within a +- tolerance value of the target, you'd do the following:

    G65 P9811 Z0. H0.001 Q0.4 S1. (PROB Z)

    Format 
    G65 P9811 Xx or Yy or Zz [Ee Ff Hh Mm Qq Ss Tt Uu Vv Ww] where [  ] denote optional inputs 

    english---renishaw-inspection-plus---programming-manual---2008.pdf

    • Like 5
  15. 4 hours ago, 215 said:

    Can someone tell me,  Is there a way that I can set a mark in code expert and select to that specific mark?  rather than scrolling up or down to that mark?  ive used other editors in the past that allow this,  but cant seem to figure it out in Code Expert .............Thanks

    Select each line in Code Expert. Right-Click > Bookmarks > Set Bookmark.

    After setting several bookmarks, you can then right-click > Bookmarks > "select next bookmark" or "select previous bookmark".

    Also, once they are set, the keyboard shortcuts <CTRL> + <SHIFT> + (plus or minus), will move forward or backward through the bookmarks.

    I don't believe bookmarks are permanent however.

    Another option is to add "pairs of comment tags", which create sections that are recognized by the editor, and allow you to expand or collapse whole sections.

    #REGION

    code

    code

    code

    #ENDREGION

    You must use #REGION and #ENDREGION as matched pairs. They can even be nested, but this takes some work and care to do.

    Last thing about regions > <CTRL> + <M> will both 'expand all regions' and 'collapse all regions'.

    And, I would be remiss if I didn't mention > I hope you are bookmarking sections of your Post Processor, to make edits and fix the NC Code output, and not editing your NC Programs coming out of Mastercam. But if you are talking about editing your NC Code programs, then I'd encourage you click on the link in my signature, and learn how to edit Mastercam Post Processors!

    • Like 2
  16. 4 minutes ago, crazy^millman said:

    Humbled thank you Colin for the recommendation.

    Just giving credit where it is due my friend! Glad to work with you and happy to recommend your services.

    Speaking of, I may have a project bubbling up for 5-Axis with a Heidenhain Control. The interest from the customer is big, but they aren't sure where the budget is going to come from yet. I'll loop you in if anything comes from it.

  17. 3 hours ago, phill heward said:

    what sort of timeframe and cost are we looking at for you to come here then. if its for real then i can have a word with the managers and get it organsed

     

    Ron's company supports projects with Phillips Federal for Mill-Turn Applications and Training for our government customers including NASA. Hiring him is money very well spent. Many contractors can program a part. The ones who can do what Ron does are few and far between.

    Ron delivers end-to-end solutions including training, programming, testing/prove-out of posts and machine simulation (providing proper feedback to developers and crafting custom solutions for machine control), tooling and processing recommendations, and creates paradigm shifts in capability for the companies and programmers he trains.

     

    • Like 7
  18. I also got great results with Power Surface in 2023. I did have to create Surfaces from those adjacent solid faces (didn't work well when using the solid/edges), and I had to clean up the wireframe for the "boundary" around the surface edges of the hole. Once I did that, it worked pretty great.

    • Like 2
  19. I program every "ID" path with Reference Points for Approach and Retract, in Z. To make sure the tool completely retracts from the bore.

    Note: you can "just use Z" (don't check X, for example), and let Mastercam use the "diameter" of the path, or you can opt to use "only X". You can also choose between absolute coordinates (forcing a specific X or Z location), or using "incremental", which means "distance is offset from the geometry or initial point of the toolpath" (not G91 output).

    • Like 2
  20. I cheated. I did this outside of Mastercam. I fooled around in NX for a few minutes trying to use the synchronous modeling to delete the faces. Each time, to get anything that will allow me to remove the cylinder (hole), it basically defeatures the part until there is nothing to rough.

    The problem "modeling wise", is the cutouts were made after the holes were already poked through the model. You have the 'runner' geometry (convex cylindrical surfaces), intersection with some "planar tilted pockets", and then there are just a bunch of radius features, thrown on to blend everything together.

    I gave up trying to just modify the solid. I used 'extract geometry' in NX to create composite curves, and created surface patches.

    • Thanks 2
    • Like 2

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...