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:

Break rotary rotation


Recommended Posts

I am setting up a post for a HMC and I want to break the rotations of B axis to limit it to 360 deg. I’m cutting a pocket substituting x axis but its winding 360 deg around. the post says to modify " pmotion_su" but I don’t know what to change. I’m not using the MD to set variables. thanks in advance

 

B -440 should read B- 80.104 and so on

 

 

G20
G0 G17 G40 G49 G80 G90
( ROUGHT POCKETS +.01 )
T1 M6
G0 G90 G54 X0. Y3.1417 B-440.104 S1500 M3
G43 H1 Z4.885
Z3.085
G1 Z2.8382 F1.
G42 D1 Y1.205 F5.
G93 B-435.825 F23.59
G94 Y3.2185 F5.
G93 Y3.1976 B-436.607 F113.61

 

rev_brkflag  : 1     #Revolution break flag. 0 = No break, 1 = Break every 90 or 360 degrees (see pmotion_su)               

 

 

pmotion_su      #Motion Setup (Set brklinestype & linarc)
      brklinestype$ = zero
      linarc$ = zero
      if rot_on_x,
        [
        if cuttype = one,  #Axis Substitution
          [
          linarc$ = one  #Linearize all arcs
          if rev_brkflag,  #Break rotation flag (set in pcoutrev)
            [
            brklinestype$ = 11  #Break all lines, use brklineslen$ for segment length
            #brklineslen$ = pi$ * rotdia$        #Break every 360 degrees
            brklineslen$ = pi$ * rotdia$ / four  #Break every 90 degrees
            rev_brkflag = zero  #Reset flag
            ]
          ]
        if cuttype = two, #Polar
          [
          brklinestype$ = rotary_axis$ + three
          linarc$ = one
          ]
        ]

 

 

  • Like 1
Link to comment
Share on other sites

Why are you changing the post?

 

The post is setup to read the settings from the Rotary Axis Component settings. All you have to do is change the option from "signed continuous", to "signed direction, absolute angle", to limit the output to +-360. If you don't want to allow "negative" positions, you can also pick "shortest distance, absolute angle (0-360).

Link to comment
Share on other sites

Ok. I don't doubt you have your reasons.

 

How did your post start life? Is it an earlier version post file that has been updated over the years?

 

The reason these questions are important, is because the modern posts are setup to read values from the Machine Definition and Control Definition, and these settings override what is happening inside the post, if your post is "modern". If your post is an "older" post that has been updated, then by all means carry on.

 

The rotary value is calculated in 'pcoutrev', not in 'pmotion_su'.

 

Here is the modern "pcoutrev":

pcoutrev        #Rotary axis revolution calculation (Modify for wind-up)
      cdelta = csav - prv_csav
      if cuttype = one & rot_type > zero & not(index) & toolchng = zero & toolchng0 = zero,  #Axis sub and signed direction or shortesat direction
        [
        cdelta_calc = abs(cdelta)
        cdelta_calc = fmtrnd(cdelta_calc)
        if cdelta_calc > 360,  #Break rotary motion  
          [
          rev_brkflag = one  #Break every 90 or 360 degrees (see plin0$)
          redo_proc$  #Reprocess NCI line
          ]
        ]
      while abs(cdelta) > ctol, #If motion exceeds ctol, add wind-up
        [
        if cdelta > zero,
          [
          rev = rev - one
          cdelta = cdelta - 360
          ]
        else,
          [
          rev = rev + one
          cdelta = cdelta + 360
          ]
        ]
      if cuttype <> one, cabs = rev * 360 + csav
      else, cabs = sav_rev * 360 + csav
      !csav
      if index <> 1 & rot_type > 0,  #Signed absolute output or shortest direction 
        [
        #Keep tablebetween 0 - 360
        while cabs < 0 & absinc$ <> 1, cabs = cabs + 360
        while cabs > 360 & absinc$ <> 1, cabs = cabs - 360
        # Calc signed direction.  Not sure why I need to flop indx_mc   
        #Phase shift delta 10 revolutions, check odd/even
        if frac(int((cdelta + 3600)/180)/two), indx_mc = zero   #indx_mc = one
        else, indx_mc = one                         #indx_mc = zero
        if cdelta < 0, indx_mc = zero
        else, indx_mc = one
        ]
      if rot_type = 1, pset_rot_label_sign  #Set rotary axis label with sign
      else, pset_rot_label  #Set rotary axis label

The variable 'rot_type' is used to set the "type of rotary" that the post is going to output.

 

'rot_type' set equal to '1' is "signed absolute". This will give you + or - 360 degrees. The output is "absolute", but the direction is "signed". So a '-' sign gives you opposite rotation, but the position value itself is absolute.

 

'rot_type' set to '2' is "absolute", 0-360, output.

 

Hope that helps.

Link to comment
Share on other sites
  • 10 months later...

Hopefully someone is still monitoring this thread....so here is my problem:

 

Machine setup is a basic VMC 4-axis Fanuc control with the rotary on the right side of the table, A-axis rotating around X so that if you are looking at the face of the rotary the face moves clockwise for the + direction....obeys right hand rule.

 

The rotary will go continuous from 0 to 359.999. If you command -30.0 deg it goes to 330.0 but in the minus direction...takes the shortest route. So it does the exact same thing if you command 330.0...it moves in the minus direction. If you command -330.0 it goes to 30.0 in the positive direction...again, the shortest route.

 

I have a cylindrical piece of stock and from the top view a line drawn at 45 deg from the center of one end. Using contour with axis substitution I am wrapping the cut (line) around the cylinder to make a spiral (helix). The cut looks fine in Mastercam (X7) but when I post it there are only 2 positions...the start and the end. But the start and the end angles are not very far apart so it takes the shortest distance (rotation) instead of the long way around.

Ex:

G20

G0 G17 G40 G49 G80 G90

T252 M6G0 G90 G54 X0. Y0. A0. S2139 M3G43 H252 Z2.75M8Z.95G1 Z.725 F6.4X4.4593 A340.662 F352.5Z.925 F6.4G0 Z2.75M5

I recognize I need to break up the A-axis moves so it walks it around closer to the final angle before it reads that A340 command but I have tried every combination I can think of in the machine definition file. Attached is a screenshot of my settings.post-70289-0-80078000-1486305577_thumb.jpg

 

Any ideas?

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