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:

Jake L

Verified Members
  • Posts

    349
  • Joined

  • Last visited

  • Days Won

    8

Posts posted by Jake L

  1. We have a ton of C11000 copper parts to machine. I'm hoping someone is more familiar with this material than us, we mostly stick to aluminum and steels.

    The main pocket in this part is about 3.0" x 6.0" x .300" deep. We are planning on attacking it with a 1/2" end mill to rough it out. 

    Does anyone have any good starting parameters?

    We've done some research but everyone seems to have a different opinion on how to machine this material.

  2. Depth of hole is .200+/-.01 body diameter. Our shop is just starting to use form taps. It seems like we are going to save a lot of time threading holes with these things. I didn't realize you could get so close to the bottom of a blind hole with a form tap.

    The only other question I have is, is there an easy way to figure out what size you have to drill and/or ream the hole for a form tap? Or is trial and error our best bet?

  3. I have some 0-80 threads I need to machine in 6061 aluminum. The problem is the depth of the hole is called out as .200+/-.01 and the min thread depth is called out as .130. Also, there's 35 threaded holes per part and we have to make 50 parts, so I'm hoping whatever method is used results in good tool life.

    I was hoping I could buy a 0-80 bottoming tap but I have not been able to find one of those. It seems form tapping is the usual method for 0-80 threads, but I'm not sure I have the blind hole depth to get the called out thread depth.

    I'm sure someone on this forum has done this before and knows a good method of machining this feature. Any help is very much appreciated.

  4. That library was what I was missing, thank you! How was I supposed to know I needed to include that library? I don't see any mention of it in the SDK?

    Also, for my own future reference, The line of code that was "sel_bit_turn_on(&entity,SELECT_BIT);" ... the "SELECT_BIT" had to be changed to "TEMP2_BIT" because that's the bit that the chain_all_selected(...) function reads. So the new line is this: "sel_bit_turn_on(&entity,TEMP2_BIT);"

    I managed to get this all working, as well as regenerating the operation after applying the chain. What I'm stuck on now is trying to change the chain direction from CCW to CW. I see the chain_direction(...) function but I can't figure out how to call it. This function is in the CHAIN_HASH struct in ChainLib_CH.h. But there is also a CHAIN_HASH struct in BaseChainingTypes_CH.h and when I call CHAIN_HASH it defaults to the one I don't need. Do I need to create a seperate .cpp file and not include BaseChainingTypes_CH.h at the top so I can call the correct struct?  Thanks again for all the help.

  5. I think I just about have it. There's just one last error I can't seem to figure out:

    main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl chain_manager(struct chain_manager_info *,short,bool *,short)" (__imp_?chain_manager@@YAXPEAUchain_manager_info@@FPEA_NF@Z) referenced in function "bool __cdecl AutoChaining(void)" (?AutoChaining@@YA_NXZ)

    After some research my only guess is one of the arguments I have in the chain_manager(...) function call is incorrectly defined. I have #include "Chain_CH.h" at the top of the file. Here is the code:

    bool AutoChaining()
    {
        //variables for selection
        auto level = 0;  // Set > 0 to restrict the search to this level.
        auto color = 0;  // Set > 0 to restrict the search to this color. (max: 255)
        long selectionMask = GEOM_MASK;
        bool excludeBlanked = true; //exclude blanked entities
        auto count = 0;
        bool succf = false;
        NoStackEnt(entity);
        DB_LIST_ENT_PTR pFound = nullptr;
        DB_LIST_ENT_PTR pDB = db_start;
        
        //do while loop (do while succf is true)
        do {
            // If the 1st parameter is 'true', it will restrict the search to "visible" entities.
            //get_raw_ent gets next "alive" entity from database
            get_raw_ent(
                false,            //don't check if entity is visible
                &pDB,            //data base pointer
                &pFound,        //pointer to the entity
                &entity,        //the entity
                ALIVE_BIT,        //selection mask (bit 0) (not sure what this does)
                selectionMask,    //entity mask = GEOM_MASK
                &succf);        //returns true or false

            if (succf)
            {
                //if exluded blanked true AND if entity.bit is on (true) / BLANK_BIT = bit 8 (bit 8 = wire_flag)
                if (excludeBlanked && sel_bit_is_on(&entity, BLANK_BIT))
                {
                    continue;
                }
                //if level is 0 OR level of the entity is equal to level AND...
                //...color is 0 OR color of the entity is equal to color
                //else jump to next iteration of do while loop
                if ((level == 0 || entity.level == level) &&
                    (color == 0 || entity.color == color))
                {
                    //turn bit 2 in entity on (bit 2 = selected)
                    sel_bit_turn_on(&entity, SELECT_BIT);
                    //write .sel and .id to database (updates/saves entity in database as selected)
                    write_ent_sel(&entity, entity.eptr);
                    count++;
                }
            }
        } while (succf);


        //variables for chaining
        CHAIN* new_chains = nullptr;
        bool only_closed = true;
        bool no_pts = true;

        //chain selected entities
        chain_all_selected(&new_chains, only_closed, no_pts);

        long op_number = 1;
        short customChainType = 0;

        //apply chain to operation
        chain_manager_info chainManagerInfo;
        chainManagerInfo.op_idn = op_number;
        chainManagerInfo.chns = new_chains;//CHAIN *
        chainManagerInfo.mode = CHNMGR_ADD;
        chain_manager(&chainManagerInfo,
            TP_CHN_ALL,
            &succf,
            customChainType);

       free_chains(&new_chains);

        return succf;
    }

  6. I would like to chain wireframe. Currently I am attempting to chain for a 2D contour operation.

    I believe once I have a chain set I will just need to use the chain_manager(...) function to apply it to an operation. What I'm stuck on is how to set wireframe as a chain.

    In the link I posted the function used is chain_it(...) but, as far as I can tell, this function will prompt the user to select a chain. As I said before, I would like to automate this process.

    Out of curiosity, what is the mc_op_getChains(...)function used for?

  7. I finally found a better answer to my own question. I didn't know there was another whole forum (this eMastercam forum, as well as myMastercam forum). I am finding answers to many of my questions there. Here is a link to a post about chaining:

    https://forum.mastercam.com/Topic45815.aspx

  8. I am trying to write a chook to automatically select and set a chain to an operation. I believe the function I should be using for this is mc_op_getChains(). I need to input an entity pointer, the op index, and the chain. The op index is straight forward, I believe I understand the how to set and pass the chain into the function, what I'm having trouble with is the entity pointer. What entity do I need to pass into the function? In the Mastercam SDK the variable name is "solid" (shown in attached screenshot) which leads me to believe the function needs a solid. I don't understand why this function needs a solid, or any additional information at all.

    I feel as though I'm either trying to use the wrong function, or I'm completely misunderstanding how this function works. Any help is very much appreciated.

    I'm running Mastercam 2022 and Visual Studio Community 2019. If any additional information is needed please let me know.

    mc_op_getChains().png

  9. After a few emails back and forth we found the issue. I was building the project in VS as a debug build, then trying to run it in the release version of Mastercam. I've learned if you have a debug build you need to run the debug version of Mastercam. Likewise, to run the chook in the release version of Mastercam, you need to build a realease build of the chook. Thanks to Khary and huge thanks to Roger Martin for their help on this one.

    • Like 1
  10. Thanks for the quick response! I have altered my code as shown below and now I'm getting a completely different error. It looks like one of the pointers that I defined needs to have "aligned allocation". I'm not entirely sure what that means. If I'm understanding this correctly, it seems that sometimes you manually tell pointers where to be stored. The mastercam SDK does not say anything about aligning the allocations for each variable but maybe that's common knowledge that I didn't know about? 

    The code seems to be working as expected but I believe something is going wrong with the variables I defined after my code is executed. Again, any help is much appreciated and if more information is needed please let me know.

     

    New Code:

    void DemoImportAllOperations()
    {
        TCHAR* fname = (_T("C:\\Users\\jakelabrie\\Desktop\\junk.mcam-operations"));

        p_3di Origin_pt = { 0.0, 0.0, 0.0 };
        const p_3d* pOrigin_pt = &Origin_pt;

        std::vector< long > op_ids = { 1 };

        bool just_op = true;
        short get_groups = 0;
        bool calc_fs = false;
        bool assign_views = false;

        DUPTOOL_CHK duptool_chk;
        duptool_chk.mode = 0;

        bool expand_ops = false;
        bool display = false;

        bool tempsuccf = true;
        bool* succf = &tempsuccf;

        import_all_operations(fname,
            pOrigin_pt,
            op_ids,
            just_op,
            get_groups,
            calc_fs,
            assign_views,
            duptool_chk,
            expand_ops,
            display,
            succf
        );
    }

    Assertion_Error.png

    Align_Error.png

  11. I'm just starting out with chooks. I've downloaded a couple of the example chooks off the mastercam third party developers page, and have gotten those built and working correctly. Now I'm trying to take the Create Drafting Notes example and add in my own code. Without my code the project builds and runs as intended. What I'm aiming to do, with import operations, is automatically pull an operation from another file. I thought this would be a good place to start given my inexperience. I've gotten to a point where the project builds just fine but when I debug it, as soon as it hits the import_operations an exception is thrown as shown.

    I placed a break point right before this line to check my values and it seems there may be something in the vector that was not initialized, as shown. However, now my lack of c++ experience is coming into effect because I have no idea if this is the actual problem, and if it is, I have no clue how to fix it. It's also completely possible this has nothing to do with the actual issue, in which case I really have no clue what's causing the problems.

    Any help is much appreciated, if more information is needed please let me know. I'm running Mastercam 2022 and Visual Studio 2019. Here is the code:

     

    void DemoImportOperations()
    {
        LPCTSTR fname = (_T ("C:\\Users\\jakelabrie\\Desktop\\junk.mcam"));

        p_3di pOrigin_pt = { 0.0, 0.0, 0.0 };
        
        std::vector< long > op_ids{ 1 };

        bool just_op = true;
        short get_groups = 0;
        bool calc_fs = false;
        bool assign_views = false;

        DUPTOOL_CHK duptool_chk;
        duptool_chk.mode = 0;

        bool expand_ops = false;
        bool succf = true;
        bool display = false;

        import_operations(
            fname,
            &pOrigin_pt,
            op_ids,
            just_op,
            get_groups,
            calc_fs,
            assign_views,
            duptool_chk,
            expand_ops,
            &succf,
            display);

    }

    and in the m_main function is this:

    DemoImportOperations();

    Exception_Error.png

    Vector_Error.png

  12. Is automatic toolpath creation possible? Again, I don't have a specific function in mind, I'm just trying to learn about everything Mastercam has to offer. C-hooks seem incredibly powerful but I didn't know if they were that powerful.

    As far as which programming language to start with. I have only a basic understanding of computer programming (most of my knowledge came from AP Computer Science in Highschool). In your opinion, is it a better idea for me to start with C or C++? In the research I've done it seems like C++ is much more user friendly, but C is more of the bare bones than C++. Again, please correct me if I'm wrong.

  13. Roger, thank you for that explanation. I think my problem is that I don't understand the functions of a c-hook. And if I don't understand what they can do, then I don't understand where I may be able to implement them. I just want to start scratching the surface of chooks to see if / when I could implement them. Also, as far as I am aware, if I learn C then I at least have a decent base for C++ and C#, please correct me if that is wrong.

    Anyway, thanks again!

  14. I have what I hope will be quick question. I'm looking into starting to program chooks for a variety of reasons, and I can't seem to find a solid answer to this question. My fear is I'm going to dive into learning C or C++ then realize I need the opposite language. Any help or advice is much appreciated. If more information is needed please let me know.

    Not sure if it matters but I'm running Mastercam 2022.

  15. 1 minute ago, Aaron Eberhard said:

    Another note on the Clearance Blend Spline links, for 2022 they use the Retract rates.  In 2023, you will have independent control of it

    That's awesome to hear. It took me a few minutes to figure that out when I started using this toolpath. 

    What about the "Home / Ref. Points" tab? Instead of just having a clearance plane (or clearance area) will we also get an option to send the machine to a specified retract or home position after it finishes the toolpath? Or is this option already available and I just don't know it? We use reference points all the time if we want to have a retract height, a clearance height, and a large clearance height. (The large clearance height is usually used anytime we need to rotate the part in the 4th or 5th axis once the toolpath is finished). 

    The only three work arounds I can currently see to this problem are to put a point toolpath in to retract the tool. Have a toolpath as shown in the picture which seems like a waste of time, especially on a larger part. Or, use the clearance blend spline, which is usually but not always the ideal method. 

    C__Users_jakelabrie_Desktop_Deburr_Toolpath.mcam_ - Mastercam Mill 2022 3_17_2022 3_16_36 PM.png

  16. I now have a follow up question. On the same toolpath, with the same file, the purple transition moves are broken into line segments. Is there a way to have Mastercam automatically make those arc moves? I would rather a large arc move that travels a little farther, than segments. Some of the machines read the segments slow so they can only travel so fast on those moves. I would rather an arc so the machine just has one move and can go as fast as it can go. Usually I would look for that in the toolpath in the Arc Filter / Tolerance tab but the deburr toolpath does not contain that tab.

    I understand I could have the machine retract and rapid each time I have to change positions, but that is also slow because then I have to rapid out of the part every time. 

  17. 3 minutes ago, Jespertech said:

    In a case like this where there are blending issues I'll try to use a smaller tool to reduce the effect that Dylan pointed out above. It doesn't completely solve the issue but it does make enough of a difference to improve the toolpaths overall finish.

    I know that may not be an option depending on what tools you have in stock but if so its worth a shot.  

    That's definitely an option I'll keep in mind. It won't work for the particular project I'm on, but I'm sure I will run into this issue again. Thank you.

    • Like 1
  18. Recently I have started regularly using the multiaxis deburr toolpath on many of my parts. Most of my parts are run on some form of a 3 axis vertical machine. As shown in the screenshot, when the toolpath gets to a complex edge it seems to have a hard time figuring out a smooth path. It ends up producing a very jagged toolpath which takes a lot of extra time for the machine to run. I tried playing with the surface quality tolerance, and the chaining tolerance but that only seems to help a little. I can never seem to eliminate all of the roughness. My question is, is there a way to smooth out those corners? Or is it just a matter of being a complex edge and the software can only do so much with it?

    I have attached a mastercam file as an example. Please ignore speeds and feeds and other technicalities as I'm just trying to display the toolpath issues. I am running Mastercam 2022 and the tool I'm looking to use is a 1/4 diameter lollipop tool.

    If more information is needed please let me know, and thanks in advance for any help anyone can give on this topic.

    Deburr_Toolpath.mcam

    Complex_Corner.png

  19. Thank you so much. Apparently I was limited to 3 posts a day because I just signed up, but this was figured out yesterday morning. 

    It was mostly me not fully understanding what I was trying to do and also not fully understanding how Mastercam worked. I ended up copying, at least for the most part, the mcam file JParis posted. The biggest mistake was not drawing in the whole tower. I thought that was an unnecessary step and that I could just skip it to save time. Turns out, while it is technically unnecessary, it makes understanding this concept much more difficult. Oh well, live and learn I guess.

    Thank you again for the quick and helpful responses. I'm sure this won't be my last post here. I'll be back the next time I can't solve a problem.

    • Like 3
  20. I'm going to sound like a complete beginner here but what's HMC? My pickup for the part is; X0 / Y0 centerline of part, Z0 / B0 face of stock. Because the single part program has no rotations, my zeros don't have to be point of rotation. Because I have two separate work offsets I thought I didn't need to define and use a second T&C plane in Mastercam because the 180 rotation will be put in the offsets at the machine.

    Just to make sure I'm understanding what you did let me put it in my own words. You moved the wireframe off the origin and gave it a new T&C plane. This allows Mastercam to recognize the rotation you called in the transform toolpath, and update the B0 when G55 is called. My question is this, in this scenario, would the zeros that you have to input into the machine be the point of rotation (Mastercam origin) or would the zeros be the T&C plane origin?

    My head is starting to spin a little but I think I'm on the verge of understanding all of this.

  21. Thanks for the quick response.

    I feel as though I may be misunderstanding how translate works. When I told translate to automatically increment the work offset number I figured it would define a new T&C plane for me behind the scenes and I wouldn't have to touch my planes. I was also under the impression that when a new work offset was called up there would automatically be a safety B0 move.

    Secondly, the two parts I'm trying to machine have separate pickups (the face of each part will be B0 in the program). I could be miscommunicating that information, or misunderstanding that. Another solution for my problem is; if I posted the code for a single part, then changed all the G54's to G55's then I would be able to use those two programs to run the two parts. However, doing so would waste a lot of cycle time because all my tool changes would have to happen twice.

    I attached a mock program of a very simplified version of what I'm trying to accomplish.

    Saftey_Move_After_Work_Offset_Change.mcam

  22. I just finished programming a part and we want to run two parts at a time on the same machine with two separate work offsets (G54, G55). Because of the large number of toolpaths, I ended up using a transform toolpath for each tool to duplicating the toolpaths, and I just incremented the offset number by 1. This seemed to work great except for one thing, my parts are running in a 4 axis horizontal machine, and the two parts are setup on opposite sides of a tower. I posted the g-code, and when the program switched to G55 there was no B0 safety move like there usually is at the start of each tool. Because of this, all I have done is make a program that will ghost pass every toolpath at the same position on the same part.

    I'm hoping there is an easy fix here I but have yet to find it. One thing that did work was putting a position point at the end of each group of toolpaths, and giving that a rotation move. This caused there to be a rotation move right before calling up G55 (to B5. or any specified number) which, in turn, caused the machine to reorient to G55 B0 when it called G55. This will work it just seems like a very large work around for a problem that I'm hoping has a simple solution.

    I'm running Mastercam 2021. The machine is a horizontal 4-axis Smart SX4000 with a Fanuc 31i control. The post is an in house post but I tried a stock post and encountered the same problem so I don't think that's the issue. Attached is the original G-code as well as the G-code for the work around.

    Any help is much appreciated, I've been stuck on this one for a few days now. I ended up just putting in B moves by hand so at least the machine can be running while I figure this out, but I hate editing the G-code by hand. Hopefully I have included everything needed.

    Original_G-Code.png

    Work_Around_G-Code.png

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...