Sign in to follow this  
medaq

post adding B rotation in sub

Recommended Posts

Trying to use a post that was rock solid for outputting sub routines for an older machine. And now it is adding a B0. to any sub that is in a rotation other than 0. So the subs at 0 are not getting this, but say B90. is putting a B0. at the begining.  I did the post debug and took a screen shot of the affected area. It is showing in the 'pcout' I highlighted the line in the picture. Not sure what to modify to remove the wrong B axis rotation.

 

T5 M06 ( 1/8 FLAT ENDMILL)
(MAX - Z.6)
(MIN - Z.28)
G00 G17 G90 G55 X.1874 Y-1.0766 S10000 M03
B90.
G49
G94
G05.1 Q1
G43 H5 Z.6 M08
M98 P4001
G90 X.1874 Y-3.8416
M98 P4001
G90 X.1874 Y-6.6066
M98 P4001
G90 X.1874 Y-9.3716
M98 P4001
G05.1 Q0
M05
G91 G28 Z0. M09
G28 X0. Y0.
G28 B0.
G00G90G49G80G40
G90
/3 M0
M30

O4001
G91
Z-.1508 B0.

 

 

brot.jpg

Share this post


Link to post
Share on other sites

In the subprogram block is it forcing output?

Share this post


Link to post
Share on other sites
1 minute ago, Leon82 said:

In the subprogram block is it forcing output?

I honestly dont know, and can not figure out which call is calling the actual b rotation. Here is all the out and sub section.

 

pfxout          #Force X axis output
      if absinc$ = zero, *xabs, !xinc
      else, *xinc, !xabs

pxout           #X output
      if absinc$ = zero, xabs, !xinc
      else, xinc, !xabs

pfyout          #Force Y axis output
      if absinc$ = zero, *yabs, !yinc
      else, *yinc, !yabs

pyout           #Y output
      if absinc$ = zero, yabs, !yinc
      else, yinc, !yabs

pfzout          #Force Z axis output
      if absinc$ = zero, *zabs, !zinc
      else, *zinc, !zabs

pzout           #Z output
      if absinc$ = zero, zabs, !zinc
      else, zinc, !zabs

pfcout          #Force C axis output
      if index = zero & rot_on_x,
        [
        if use_rotmcode & (fmtrnd(cabs) <> fmtrnd(prv_cabs) | sof), *sindx_mc
        if absinc$ = zero, *cabs, !cinc, !cout_i
        else, *cout_i, !cinc, !cabs
        ]

pcout           #C axis output
      if index = zero & rot_on_x,
        [
        if use_rotmcode & fmtrnd(cabs) <> fmtrnd(prv_cabs), *sindx_mc
        if absinc$ = zero, cabs, !cinc, !cout_i
        else, cout_i, !cinc, !cabs
        ]

psub_call_m$     #Call to main level, single tool
      psub_call_trans

psub_call_mm$    #Call to main level, multiple tools
      psub_call_trans

psub_call_trans #Translate level calls from toolchange, user
      if wcstype <= one, result = mprint(shomeserror)
      sav_absinc = absinc$
      #pindex                    #Removed this as rotary should already be in position.  This gives redundant WCS output. WBT
      #Mirror or Rotate Coord's
      if sub_trnstyp$ = zero | (sub_trnstyp$ = one & mr_rt_actv),
        [
        #The original pattern is not mirrored or rotated
        if sub_sec_no$,
          [
          absinc$ = zero
          if sub_trnstyp$, psub_rotate
          else, psub_mirror
          ]
        mr_rt_actv = three
        ]
      else, #Translate
        [
        if sub_mny_t$,
          [
          if wcstype > one, absinc$ = zero
          if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
          pbld, n$, *sgcode, *sgabsinc, [if not(index), pwcs], pfxout, pfyout, pfzout,
            pfcout , e$# jim added * to pfcout
          if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
          pe_inc_calc
          ps_inc_calc
          ]
        ]
      absinc$ = sav_absinc
      result = nwadrs(strp, main_prg_no$)
      main_prg_no$ = main_prg_no$ + sav_progno #Add sub number offset
      if sav_progno = main_prg_no$, result = mprint(sprgnerror)
      pbld, n$, "M98", *main_prg_no$, e$
      prv_feed = c9k #Force feed in sub

psub_mirror     #Mirror start code, user
      #Mirror Y axis
      if sub_trnmthd$, pbld, n$, *sgabsinc, strns_mir_on, *sub_trnsx$, e$
      #Mirror X axis
      else, pbld, n$, *sgabsinc, strns_mir_on, *sub_trnsy$, e$

psub_rotate     #Rotate start code, user
      pbld, n$, *sgcode, *sgabsinc, strns_rot_on, *sub_trnsx$, *sub_trnsy$,
        [absinc$ = one], *sgabsinc, *rt_cinc, e$

psub_st_m$       #Header in main level
      result = nwadrs(stro, main_prg_no$)
      *e$
      *main_prg_no$, e$
      spaces$ = 0
      if scomm_sav <> snull, scomm_str, *scomm_sav, scomm_end, e$
      spaces$ = sav_spc
      #G51/G68 requires absolute position on first move
      if mr_rt_actv & absinc$ = one,
        [
        sav_absinc = absinc$
        absinc$ = zero
        prv_absinc$ = m_one
        prv_xabs = m_one
        prv_yabs = m_one
        ]
      else, pbld, n$, sgabsinc, e$

psub_end_m$      #End in main level
      n$, "M99", e$
      prv_absinc$ =   -1
      #Reset update variables for subs at main level
      #Mirror or Rotate cancel, output is forced
      if (sub_trnstyp$ = zero & esub_sec_no$ > zero)
        | (sub_trnstyp$ = one & esub_sec_no$ = esub_totl_no$-one
        & sub_trnmthd$ = two),
        [
        subout$ = zero
        no_nc_out$ = m_one
        sav_absinc = absinc$
        #Mirror cancel
        if sub_trnstyp$ = zero,
          [
          absinc$ = zero
          pbld, n$, *sgabsinc, strns_mir_off, *sub_trnsx$, *sub_trnsy$, e$
          ]
        else, #Rotate cancel
          [
          pbld, n$, strns_rot_off, e$
          ]
        absinc$ = sav_absinc
        no_nc_out$ = zero
        ]
      end_sub_mny = sub_mny_t$
 

Share this post


Link to post
Share on other sites

Look in your tool change blocks...

make sure the pindex and pcout or pfcout are called before

c_msng$

That position output without digging deeper looks to be coming from plinout, which you should only be in after the c_msng$ being invoked

Share this post


Link to post
Share on other sites

Can I ask a dumb question? Are you sure your planes are defined correctly for the source operations? Have you posted the operation without subs and all the rotations are correct?

Share this post


Link to post
Share on other sites
4 hours ago, JParis said:

Look in your tool change blocks...

make sure the pindex and pcout or pfcout are called before

c_msng$

That position output without digging deeper looks to be coming from plinout, which you should only be in after the c_msng$ being invoked

Not sure this helps in diagnosing this?

 

plinout         #Output to NC of linear movement - feed
      pcan1, pbld, n$, sgfeed, sgplane, `sgcode, sgabsinc, pccdia,
        pxout, pyout, pzout, pcout, `feed, strcantext, scoolant, e$

Share this post


Link to post
Share on other sites
1 hour ago, 5th Axis CGI said:

Can I ask a dumb question? Are you sure your planes are defined correctly for the source operations? Have you posted the operation without subs and all the rotations are correct?

They are defined correctly, and am modifying an old program that used to post fine. When taking off the subroutine check in transform and just post it long code, it posts fine. 

 

T5 M06 ( 1/8 FLAT ENDMILL)
(MAX - Z.6)
(MIN - Z.28)
G00 G17 G90 G55 X.1874 Y-1.0766 S10000 M03
B90.
G49
G94
G05.1 Q1
G43 H5 Z.6 M08
Z.4492
G01 Z.4442 F50.

Share this post


Link to post
Share on other sites
21 minutes ago, medaq said:

They are defined correctly, and am modifying an old program that used to post fine. When taking off the subroutine check in transform and just post it long code, it posts fine. 

 

T5 M06 ( 1/8 FLAT ENDMILL)
(MAX - Z.6)
(MIN - Z.28)
G00 G17 G90 G55 X.1874 Y-1.0766 S10000 M03
B90.
G49
G94
G05.1 Q1
G43 H5 Z.6 M08
Z.4492
G01 Z.4442 F50.

Sorry can't offer anything more you're getting deep into post issues and afraid you may have to get the professionals involved.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • 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