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:

compensation in computer


Duckman
 Share

Recommended Posts

Duckman, I suspect you haven't explained your problem in enough detail. What do you mean by "when writing to an NCI file"? What C-hook are you using and for what purpose. As Jamman said, for contouring and pocketing, there is selection of computer and/or control compensation at the top right corner of the second parameters page from the operations manager. Surely it's not this simple?

Hugh Venables.

Link to comment
Share on other sites
Guest CNC Apps Guy 1

I believe Duck wants to have his C-Hook set the compensation automatically in the NCI and is probably looking for the variable to define/force it.

 

See frineds, Duck is a student taking VC++, and most of his questions(so far) are related to REAL programming (the kind of programming software developers do, the kind PDG does daily).

 

cc_pos is the variable.

0 is off

1 is Left G41

2 is Right G42

 

Look in the V9Post.pdf file in your Mcam9 Directory.

 

Hope that helps Duckman.

Link to comment
Share on other sites

hehe Thanks James you understand me best!

 

However, I cannot find a reference to cc_pos anywhere...I am thinking that it should not be a post processor variable though, but that it should be a flag that should be output to the NCI from my CHOOK...

 

PDG, if you are around, please help!

Link to comment
Share on other sites
Guest CNC Apps Guy 1

You're right, cc_pos is a variable that's not shown in the NCI. I'm not really sure where to look. Have you looked in the "M_NCVARS.h" file?

 

I'm pretty sure you should be able to find the variable you're looking for in there.

 

Hope That Helps.

Link to comment
Share on other sites
Guest CNC Apps Guy 1

EXTERN real (*_cutter_corner_radius);

#define cutter_corner_radius (*_cutter_corner_radius)

 

/* The cutter compensation in computer: either 'L' (Left), 'R' (Right),

* or ' ' (no cutter comp.).

*/

 

Look for this in the M_NCVARS.h

Link to comment
Share on other sites

actually, the variable is cutter_orientation, but even after I set this to 'L' or 'R', I do not get any compensation...I've looked and looked, and by now I'm thinking it's more than a single variable that I have to set...but I'm still not sure how...

thanks anyways though!

 

I've also tried

 

operation op;

op_cc oc;

oc.type = CC_COMPUTER;

oc.direction = CC_LEFT;

op.cc = oc;

cur_op = op;

 

but this doesn't work either...

 

[ 07-16-2002, 09:43 AM: Message edited by: Duckman ]

Link to comment
Share on other sites

I've never gotten any of those variables to work properly. When it came to toolpaths and compensation, I just programatically offset the given geometry based on what compensation was needed, created "invisible" geometry in the database for the toolpath (with no comp of any kind), create the toolpath, and then toast the "invisible" geometry. It's not pretty from a code semantics point of view, but it works, which is more than I can say for the built-in vars in m_avars.h from my experience. I've learned the hard way that a little bit of math will get you a lot further than most of what's in the C-Hook SDK wink.gif

Link to comment
Share on other sites

Oh man! you can't be serious...my math isn't quite strong enough! ahhh!!! (or I'm too lazy hehe) This is pretty ridiculous...I've emailed mastercam support, but even they cannot give me an appropriate answer...

 

hold on a sec...what function do you use to create toolpath? I am using ct_lin_mill, and this only accepts a p_2d to mill to...is there a way to create toolpath based on geometry instead of points?

 

Thanks!~

 

[ 07-16-2002, 12:26 PM: Message edited by: Duckman ]

Link to comment
Share on other sites

I've used gr_lin_mill(), gr_arc_mill(), etc to create a toolpath. They work, but like I said, I had to programatically offset all the geometry first. There's probably a proper way to do it via the C-Hook API, but I haven't seen it yet. I've coded with plenty of APIs (Win16/32, WinSock, DirectX, ICQ, Winamp, Unreal Engine and OpenGL to name a few) in my time, and the C-Hook API, well sometimes me= mad.gif && me = confused.gif

 

wink.gif

Link to comment
Share on other sites

Try the following:

 

1. convert your geometry (lines and arcs) into an array of ctour_recs (see definition in m_ncvars.h)

 

2. Call cutter_comp_2d() using L or R and the signed offset distance. This will automatically offset the array of ctour_recs in the direction you want.

 

3. Program your tool to follow the lines and arcs in the new ctour_rec array generated in step 2 using gr_lin_mill() or gr_arc_mill().

 

Note:

Calling cutter_comp_2d() recursively can be used to create toolpath geometry to cut single collapse point pockets.

 

I hope this helps...

Link to comment
Share on other sites

-----------------------------------------------

btw, what is the diff between usin gr_mill and ct_mill? other than that it draws on the screen?

------------------------------------------------

 

To the best of my knowledge, drawing the move on the screen is the only difference.

Link to comment
Share on other sites

for cutter_comp_2d, what is the purpose of

cc_info[]? and how should such an array be constructed?

 

thanks a million btw MATSSMan, i might actually be able to finish my project!

 

i tried creating an empty array of cc_rec, and cutter_comp_2d seems to work...

 

however, when i set compensation to 'R', the resulting ctour_rec is not a closed chain anymore! i.e., the starting and finishing point are different...any ideas why?

 

Thanks again!

 

[ 07-17-2002, 03:39 PM: Message edited by: Duckman ]

Link to comment
Share on other sites

A couple of more suggestions when using cutter_comp_2d():

 

1. Make sure your array of ctour_recs is dimensioned to be much larger (say a factor of 3) than the maximum number of ctour_recs that you will pass to the function. The reason for this is to account for extra arcs that will be created by this function when offsetting a contour outward.

 

2. Make the array of cc_recs have the same number of entries as the array of ctour_rec's.

 

3. Zero out ALL variables in all entries in the ctour_rec and cc_rec arrays before using them.

 

4. Start filling in the ctour_rec array from ctour[1], not ctour[0], make ctour[0] a line to (0,0) and pass 1 (not 0) as the value for low_index to cutter_comp_2d(). The resulting offset ctour_rec array should also be considered '1 based'.

 

Good luck trying out these suggestions! (I learned from much trial & error...)

Link to comment
Share on other sites

I've set min_fil_ang to 180, so there should be no arcs created...

 

and thx a lot! you must've put a lot of work into trial and error! something which unfortunately i am running out of time to do!

 

btw, how do you zero out the endpoints of a gt ent?

 

[ 07-18-2002, 10:30 AM: Message edited by: Duckman ]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

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