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:

learn to write posts (not a post request)


Euclid27
 Share

Recommended Posts

Guest CNC Apps Guy 1

Where? Either your reseller or here on eMastercam.

 

How? Get the Post Guide from your reseller and ask questions in here like;

 

"Q) My code currently looks liek this when I do a certain type of cycle.

X.... Y....I....K....F... and I want this;

N.... G..X....Y....I....K....F...

Where do I change this and what am I looking for?

 

Thanks, "

 

Questions liek that will usually net you some good infomation plus you'll learn.

 

HTH cheers.gif

Link to comment
Share on other sites

I think he might also be asking what gramming classes/experience would be good to have as a base.

 

I pretty much do all the post mods here (with gracious help from the experts here). I know I would like to go the next step and write my on code for specific tasks. What gramming classes do you guys recommend? I have written some basic macros for lathe, but that's been a while.

 

Thx

Link to comment
Share on other sites

Working on posts?? It just takes doing it more than anything. Everything you need to know is listed in documentation. Look in the "Mastercam X4 NCI Parameter Reference Guide" it is 436 pages and has a wealth of information and examples in there to help someone do posts and figure stuff out. Take IMHO the best 2 post out there MPMASTER and MPLMASTER and run them through the new post debugger and watch the process. Pay attention how one section calls the next section. See how the structure works. See how strings work. See how toolchange and null toolchange work. see how drilling cycles work. see how can-text works. see how switches work. Once you have all of that down start figuring out the math in the post.

 

Take this section out of mpmaster:

code:

pfclc_deg_inv   #Feedrate deg/min

circum = zabs * two * pi$

if cuttype = two & rot_on_x = three, circum = sqrt(xabs^2 + yabs^2) * two * pi$

if circum = zero, circum = c9k #Don't allow Zero

ldelta = sqrt((xabs-prv_xabs)^2+(yabs-prv_yabs)^2+(zabs-prv_zabs)^2)

cdelta = ((abs(cabs - prvcabs))/360)*circum

if ldelta = zero, cldelta = cdelta

else, cldelta = sqrt(cdelta^two + ldelta^two)

if cldelta = zero, cldelta = c9k

if use_frinv,

[

#Feedrate inverse calculation

ipr_type = two

prv_feed = c9k #Always force feed

#result = force(ipr_type,ipr_type) #Force inverse time G code if not modal

if cuttype = three, cldelta = sqrt((x$-prv_x$)^2+(y$-prv_y$)^2+(z$-prv_z$)^2)

if inversefeed$ = 0, frinv = fr_pos$/cldelta # 1/min

else, frinv = fr_pos$/(60*cldelta) # 1/sec

if rot_feed & opcode$ <> 3 & opcode$ <> 16,

[

if frinv > maxfrinv, frinv = maxfrinv

if frinv < minfrinv, frinv = minfrinv

feed = frinv

]

]

else,

[

#Feedrate deg/min control and calculation

ipr_type = zero #Change to ipr_type = one to force new DPM

#frdeg = abs(cdelta/cldelta) * abs(fr_pos * (360/circum))

frdeg = fr_pos$ * abs((cabs - prvcabs)/cldelta)

if abs(frdeg - prvfrdeg) > frdegstp | ipr_type <> prv_ipr_type,

[

#Control output of frdeg

if rot_feed & opcode$ <> 3 & opcode$ <> 16,

[

prvfrdeg = frdeg

feed = frdeg

]

]

if frdeg < fr_pos$ & rot_feed, feed = fr_pos$

if frdeg > maxfrdeg & rot_feed, feed = maxfrdeg

if frdeg < minfrdeg, feed = minfrdeg

]

result = newfs(15,feed)

Take it apart. Look at what each line is doing.

 

1st line:

code:

circum = zabs * two * pi$  

There is the variable circum. Find out where it is called. How it used. Now for this equation the Absolute value of the current Z output times two time pie(3.1416926).

Now the second line:

code:

if cuttype = two & rot_on_x = three, circum = sqrt(xabs^2 + yabs^2) * two * pi$  

Here is cuttype equals two and rot_on_x equals three then do this next equation.

cuttype defined in the post:

code:

cuttype     : 0     #Cut type flag

#0 = Tool Plane, 1 = Axis Subs, 2 = Polar, 3 = 4/5 axis

rot_on_x defined:

code:

rot_on_x    : 0     #Default Rotary Axis Orientation, See ques. 164.  

 

#Set axis of rotation for rotary component

if prmcode$ = 17399,

[

last_rot_axis = rot_axis

rot_axis = rpar(sparameter$, 1) #Axis of rotation - +X=1,+Y=2,+Z=3,-X=7,-Y=8,-Z=9

if rot_axis > 3, rot_axis = rot_axis - 6 #Keep value positive (+X,+Y,+Z) for use in rot_on_x

]

Now we do the next part of the equation after the above conditions are met:

code:

circum = sqrt(xabs^2 + yabs^2) * two * pi$  

Again variable circum equals square root of the equation absolute value of X squared plus the absolute value of Y then multiply that value by two then that by pie(3.1415926)

 

Now you need to be able figure out the rest of it. When you can go through the post and understand that you are getting somewhere. Now look in the NCI documentation and see where it defines Mastercam varaibles an you know them by the $ at the end of them. Pages 44 to pages 137.

 

Ok now lets see I have been messing around with post for over 10 years. Still only know about 10% of things. So do you figure out posts and let a machine sit costing your company money or do you let the experts like In-House solutions provide you a post?

 

On and the above explanation is a very small part of the post and I probably explained it worng so what does that tell you???? rolleyes.gifrolleyes.gifrolleyes.gif

Link to comment
Share on other sites

My answer to this is to nicely ask your reseller for a post, then come on here to figure out how to modify the post to get it to look right, like CNC Apps Guy 1 said. All I know is that you are talking about spending tons of time on a post that most likely already exists... Haas is an extremely common machine. Why not save yourself some time use your resources and get to programming parts? When you get a minute here and there study the posts so you can understand to modify them to your preference. Or in an analogy; Don't reinvent the wheel, just find one and make it better.

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