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:

Anyone feel like looking at a V9 post? Limit rotary to ±180º


Recommended Posts

Good morning everyone. I have a rotary fixture that prohibits the A axis from rotating the full 360º so I want to use negative directions. The problem is I am getting weird feedrates scattered throughout the program using my changes. Post is based off of mpmaster

 

Relevant code changes are here, marked "#NEW LINE":

pfcout		 #Force C axis output
 if index = zero & rot_on_x,
 [
 if cabs > 180, cabs = cabs - 360 #NEW LINE
 if absinc = zero, *cabs, !cinc
 else, *cinc, !cabs
 ]
pcout		 #C axis output
 if index = zero & rot_on_x,
 [
 if cabs > 180, cabs = cabs - 360 #NEW LINE
 if absinc = zero, cabs, !cinc
 else, cinc, !cabs
 ]
ppos_cax_lin #Position the rotary axis before move - rapid
 if index, pindex
 else,
 [
 if cabs > 180, cabs = cabs - 360 #NEW LINE
 if fmtrnd(prv_cabs) <> fmtrnd(cabs) & rot_on_x,
	 [
	 sav_gcode = gcode
	 gcode = zero
	 if lock_codes = 1 & not(index), pbld, n, *sunlock, "(UNLOCK)", e
	 pbld, n, sgcode, pcout, e
	 if lock_codes = 1 & not(index) & cuttype = 0, pbld, n, *slock, "(LOCK)", e
	 !cia
	 ps_cinc_calc
	 gcode = sav_gcode
	 ]
 ]

 

And output looks like so with a programmed feedrate of 135:

G00Z6.
(FINISH LEG TOP)
X-18.1449Y4.8425A-79.282
Z6.
Z1.1998
G01Z1.0498F2000.
X-18.8949Y4.8429
X-27.5866Y4.8485Z1.0507
X-36.5856Y4.853Z1.0514
X-45.5845Y4.8557Z1.0517
X-63.5805Y4.8564Z1.0515
X-76.5333Y4.8552Z1.051
X-109.2404Y4.8518Z1.0522F1456.46
X-122.8282Y4.8461Z1.0519F2000.
X-128.8644Y4.8416Z1.0522
X-134.9007Y4.8355Z1.0521
X-135.4007Y4.835
G00Z6.

 

Using V9, so flamesuit on!

Link to comment
Share on other sites

Nope because the feed rate is based off of degrees travels and since you are modifying the results after the value is established you have altered the math needed to get the correct results. Would need to send it all to a buffer and analyze it. Then from there make your adjustments. In that old of a post did they have the Axis Travel limits for the Rotary? Want to control this behavior well before where you are doing it. The total travel sent from the NCI for sake of argument is 280 degrees of travel. Depending on how you have the post set up that is degrees per minute. So in the time it takes for X to Travel .5 and A output from the NCI is told to Travel 280 degrees. To match your programmed feed rate the math has to take the liner distance traveled and then covert that into the Degrees per Minute. You had 280 degrees for the travel in Mastercam so you have math seeing one thing, but then output doing something totally different. Again need to go back and control the process before getting here and then you can have better control of the feedrate output for the A axis since it will be more based on reality. Years of doing roll dies with Pencil and Paper and get this concept real quick. Think about SFM on a lathe. When you get smaller you get faster when you get larger you slower. Here Mastercam is saying okay you need this SFM for this Travel, but then you are tricking the post by doing math after the feed rate process has already been figured out. Break it back down to basics that all any of this is. Thing it MP.DLL does some magic with stuff from the NCI people never see and that is where the real power of Mastercam comes from. The .pst is part of the equation the other part is MP.DLL once you get those two working together then you start to see where you can get away with things and where you cannot.

Link to comment
Share on other sites

Awesome, thanks Millman! I may not be able to fix it, but at least now I understand why.

.

.

.

.

Found this before I posted:

rot_feed    : 1     #Use calculated rotary feed values, (0 = no, 1 = yes)

 

Changed it to 0 and all is good. So now I can trace rot_feed through and see if I can get the math fixed leaving it as a 1.

Link to comment
Share on other sites

I think this did the trick. Thanks again everyone for the help!!

pfclc_deg_inv #Feedrate deg/min
 if prvcabs < 0, prvcabs = prvcabs + 360 #ADDED TO FIX 180 LIMIT
 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
 if cuttype = three, cldelta = sqrt((x-prv_x)^2+(y-prv_y)^2+(z-prv_z)^2)
 frinv = fr_pos/cldelta # 1/min
 #frinv = fr_pos/(60*cldelta) # 1/sec
 if rot_feed & opcode <> 3 & opcode <> 16,
	 [
	 if frinv > maxfrinv, frinv = maxfrinv
	 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
 ]

Link to comment
Share on other sites

Yes Sir like I said break it back down to basics. The math is there and once you applied your fix across the board you got what you wanted. If you wanted to be real slick you would make a switch that allowed you the control to do it full 360 like you use ot have it when this fixutre is not on there and then have it do it this way when it is. Could do with with mi or mr and really dial it down to a specific set of operations.

 

Good work BTW nice to see people putting on the thinking caps. :geek:

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