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:

Colin Gilchrist

Verified Members
  • Posts

    7,762
  • Joined

  • Last visited

  • Days Won

    162

Colin Gilchrist last won the day on March 19

Colin Gilchrist had the most liked content!

Profile Information

  • Gender
    Male

Uncategorized

  • Location
    Haht-fahd

Recent Profile Visitors

17,298 profile views

Colin Gilchrist's Achievements

Proficient

Proficient (10/14)

  • Well Followed Rare
  • Conversation Starter Rare
  • Dedicated Rare
  • Posting Machine Rare
  • Collaborator Rare

Recent Badges

4.5k

Reputation

  1. The purpose is multi-faceted. You are calculating the output angles, but you are not taking advantage of the architecture of the Post. The purpose is to give control over the Post and Code Output to the programmer. One of the things you may not yet know > the Post uses Miscellaneous Integers and Real Numbers > for every Mastercam Operation. This allows us as Programmers to pass data to the Post, to control the output. For example, on a Tilt-Trunnion Post, sometimes the calculations make the part "rotate away" from the Operator. The code will work, but you can't easily see and watch. Wouldn't it be nice if you could use a switch to control the Tilt Axis? Well, you can. The Generic Fanuc 5X Mill Post uses Misc. Integer #10 to control this tilt. (1 or 2 flips between Positive and Negative) The Post, in the encrypted section, keeps track of things like this. So, even though you may get G68.2 output that will rotate to the correct orientation on your machine, your XY code may be "skewed" and not match your Tilted Work Plane orientation, because you haven't matched the rotary and linear mapping calculations.
  2. Index the geometry (rotate) from the Top. Is the slot essentially "4-Axis" wrapped around a cylinder, or do you need full 5-Axis motion to cut the slot?
  3. Look in your Windows Start Menu > scroll down to the "Mastercam" folder, and find the "Quick Reference Card". Lots of shortcuts and handy tips there! In the "Data Entry Field", instead of typing a letter, Right-Click, and you'll get the full shortcut list. Also, are you aware you can do "math" in any field with a yellow background? This is a "calculatable value field", and you can not only do simple math, but can use parenthesis as well, to form more complex calculations. For example > (0.8775/2) * 1.414
  4. Change-at-Point is the best solution, because those changes are attached to the "chain", so the changes can be made in the Chaining Manager, and the modifications "stick" through regeneration.
  5. Note: change "3" to any integer digit 0-9, and you'll get different output. Some useful, others, not so much. But you can run this function multiple times, with different "string" variables to store the output, reuse the same 'result' variable, and just use a different integer value to capture "all ten possibilities".
  6. sprogrammer_name = sysinfo(result, 3) Must initialize 'sprogrammer_name', and you should check to be sure 'result' already exists as a user-defined variable in your Post. (I'd estimate 95% of Posts have a 'result' variable, although the "variable name" may vary.)
  7. Remember that every feature in the model which is included (used or not used) is just computational overhead. The more simple your objects are, the faster your calculations. This is especially true for simulation. For simulation, you only care about the "Skin" of the objects that make up the machine. Everything else is a non-value add to the process when collision detection is concerned...
  8. If you have solid pieces which are "adjacent but not intersecting" in some way, they will not boolean join together. The solution is to take one of the pieces, select it, and press "ALT + E" on the keyboard for "hide". Everything else will disappear temporarily. You can then use "Remove Solid History", to take away any history of that one piece, and then use the direct solid modeling functions to "Push-Pull" a face or feature on the solid, so it will get "just a little bigger" and actually intersect the other solid. Once the solid is modified, press "ALT + E" again, and everything will come back. If you did the push/pull right, so the solids properly intersect, you'll be able to complete your Boolean operation. It also helps in the case of a clamp, if you can "de-feature" the models as much as possible, before importing copies of the solid. I'll use "Modify Solid Feature > Remove" to remove holes and other "internal" features from a model to simplify it, then run Remove History, save the file, and then try to use Boolean Add.
  9. You can use the "Section NCI" C-hook, to break up a Toolpath Operation, and split it into multiple chunks of toolpath code, each with proper approach/retract motion, so you can run the files in sequence on a machine with small memory. After you run "Section NCI" to split a toolpath into multiple files, you must use "Import NCI" to import and stack up the operations. You can then use the NC File naming attributes to append "incrementing numbers" at the end of the file. "File-1", "File-2", "File-3", etc. Having the "approach/retract" moves inside the NCI Data, is better than asking your Post to add all the necessary approach/retract data, and include the "Tool Change" and "Retract at end-of-file" data. This solution has existed inside Mastercam since I started using the software with Version 6.1.3, back in 96'-97'.
  10. I helped setup a couple of Yasda PX30i machines with 323 Tool Magazines, and the customer quickly learned that they should have bought the 513 tool magazines! I hear Yasda is now building these magazines in a modular way, so you can just keep adding additional blocks of tools if you want to expand beyond 513 tools.
  11. The important thing to understand is that some functions were created inside the 5-Axis Post "early in the development" of the Post, and that architecture can be used to support other things. This is the case with 'n_tpln_mch'. It was originally used to support Nutating Heads/Tables for the G7 function, and using only "mechanical kinematics" to calculate the correct output for a Tool Plane, giving us XYZ P/S (Primary/Secondary) output. n_tpln_mch gets initialized to '-2'. A setting of '-2' indicates "5-Axis". A setting of "-1" indicates "a path that is not Toolplane Based (3+2 output)". For example Axis Substitution where the input is a Tool Plane, but the math tells the Post to "wrap the rotary axis". n_tpln_mch gets set to 'top_type' if 'top_map' is active. Otherwise, the post does some other calculations for 'n_tpln_mch', and eventually sets it to 0-4, indicating the type of internal processing (mapping) to achieve the desired output for angles and coordinates. When 'top_type' is set to '5', then 'n_tpln_mch' also gets set to '5', and then it just overrides all the automatic Nutating internal logic calls, and just calls the "Custom settings, ptop_type_ax and ptop_type_lim" instead. When G68.2 is implemented using the default architecture For a non-Nutating machine, 'top_map' should be '1', and 'top_type' should be '5', and the only values n_tpln_mch should have are -2 for 5-Axis, and '5' for Plane Mapping (Tilted Work Plane) output. It is only when 'top_map' is off or 'top_type' is not set to '5', when you'll get the value of 'n_tpln_mch' set in the range between -1 and 4. In a properly configured Post, using the default architecture, you should only see -2 or 5, or maybe -1 under certain circumstances. Just for clarity, the only valid values I believe the post should return for n_tpln_mch are: -2, -1, 0, 1, 2, 3, 4, or 5.
  12. That document talks about adding only "G68 single axis rotation". To add G68.2 support, you basically need to set 'top_type' to '5'. This tells MP not to use any of the automatic rotations, and lets you add code to 'pg68' and 'pg68_map', to support the Tilted Work Plane output. Some sample code (without variable definitions, just look at the structure first, to see if you can figure out what is going on). # -------------------------------------------------------------------------- # Mapping mode - # Rotations are always about the zero point # Only toolplane toolpaths by entire toolpath section use mapping mode # Modify according to specific post setup # -------------------------------------------------------------------------- pg69 #Cancel mapping mode if top_map, [ #Add your code to cancel mapping mode... pbld, n$, smap_mode, e$ ] pg68_map #Map the first postion to the machine if p_out | s_out, [ if map_mode = 0, [ tmpmtx_xx = mteq(m1$) #Copy toolplane into temp matrix ##### # Find alpha angle ieul = -atan2(tmpmtx_zy, tmpmtx_zx)-90 ##### # Rotate tmpmtx_xx matrix about wcs z by alpha angle - this should make zx equal zero axisx$ = vequ(caxisx) tmpmtx_xx = rotv(ieul , tmpmtx_xx) tmpmtx_yx = rotv(ieul , tmpmtx_yx) tmpmtx_zx = rotv(ieul , tmpmtx_zx) ##### # Find beta Angle between Tool Z Vector and WCS Z about X axisx$ = vequ(aaxisx) jeul = -atan2(-tmpmtx_zy, tmpmtx_zz) #pay attention to quadrants this is rotated 90 degrees, think of wcs z as an x axis and the vector needs to be measured counter clockwise from there ##### # Rotate tmpmtx_xx matrix about wcs x by beta angle axisx$ = vequ(aaxisx) tmpmtx_xx = rotv(jeul , tmpmtx_xx) tmpmtx_yx = rotv(jeul , tmpmtx_yx) tmpmtx_zx = rotv(jeul , tmpmtx_zx) ##### # Find gamma Angle between rotated Tool Plane X Vector and WCS x about z - tmpmtx_zx should be 0,0,1 axisx$ = vequ(caxisx) keul = -atan2(tmpmtx_xy, tmpmtx_xx) ##### # Rotate tool plane matrix - xx,yy,zz should all be equal to 1 axisx$ = vequ(caxisx) tmpmtx_xx = rotv(keul , tmpmtx_xx) tmpmtx_yx = rotv(keul , tmpmtx_yx) tmpmtx_zx = rotv(keul , tmpmtx_zx) ] if map_mode = 3, [ #Rotate xabs back xabs_s = vequ(xabs) rt_tox = vequ(tox$) axisx$ = vequ(caxisx) xabs_s = rotv(-p_vec_rot, xabs_s) rt_tox = rotv(-p_vec_rot, rt_tox) temp1_nx = vequ(aaxisx) temp1_nx = rotv(-p_vec_rot, temp1_nx) axisx$ = vequ(temp1_nx) xabs_s = rotv(-s_vec_rot, xabs_s) rt_tox = rotv(-s_vec_rot, rt_tox) if add_wrk_sht = 0, map_x = vequ(rt_tox) else, [ map_x = 0, map_y = 0, map_z = 0 #work shift is turned on, rotate around WCS origin ] ] ] pg68 #Enable mapping mode map_mode = one if p_out | s_out, [ if map_mode = 3, #G68.2 P3 Q1,2 - two vector method [ ivec = vequ(m1$) pbld, n$, *smap_mode, "P3 Q1", *map_x, *map_y, *map_z, *ivec, *jvec, *kvec, e$ ivec = vequ(m7$) pbld, n$, *smap_mode, "P3 Q2", *ivec, *jvec, *kvec, e$ pbld, n$, "G53.1", e$ ] if map_mode = 0, # #G68.2 - euler angles [ pbld, n$, *smap_mode, *map_x, *map_y, *map_z, *ieul, *jeul, *keul, e$ ] ] if p_out | s_out, prv_map_mode = one ########################## # Original mapping output # # #Primary mapping output # ivec = vequ(caxisx) # if p_out, # [ # map_r = -p_out # pbld, n$, smap_mode, *map_x, *map_y, *map_z, *ivec, *jvec, *kvec, *map_r, e$ # prv_map_mode = zero # ] # #Secondary mapping output # ivec = vequ(baxisx) # if s_out, # [ # map_r = s_out # pbld, n$, smap_mode, *map_x, *map_y, *map_z, *ivec, *jvec, *kvec, *map_r, e$ # ] # #if p_out | s_out, prv_map_mode = one ##########################
  13. 'top_map' is only the first variable used, to designate that we want to "map toolplane coordinates" to the WCS. The "mechanism" in the Post was first added to support G7 Rotation for 5-Axis Heidenhain controls. 'top_map' is just a "yes/no" (0 or 1) on/off variable. There is a helper variable called 'top_type' which has 5 possible values: 1-4 select different "automatic rotations" (in the locked portion of the Post), for Heidenhain G7 rotation. You don't want 1-4, you want '5' for Top Type. This lets you use two existing Post Blocks, ptop_type_ax and ptop_type_lim, to be able to calculate your rotation values, and set/check limits. How to enable G68 in Mastercam generic 5-axis post? Set variable ‘top_map’ to be 1; Modify the rotary axis settings in post block ‘p_nut_restore’ so that they match with the initial rotary settings right above this post block. Modify the value for variable ‘n_saxisx’, ‘n_saxisy’ and ‘n_saxisz’ if necessary. 5X uses ‘n_saxisx’ variables. Toolplane based toolpaths use ‘saxisx’ variables. Modify the value for variable ‘top_type’. If the value of ‘top_type’ is set to be 5, modify the rotary axis settings in post block ‘ptop_type_ax’ and ‘ptop_type_lim’ accordingly. In ‘ptop_type_ax’, also check the axis label, make sure they are set correctly. Modify the mapping logic in post block ‘pg68_map’ and ‘pg68’. Basically the axis to be rotated around may be modified. In ‘pg68_map’, check ‘axisx$’ and make sure it is set to be the right vector to rotate about. In ‘pg68’, check ‘ivec ‘ and make sure it is set to be the right axis vector to rotate about. Also check variable ‘map_r’ is set to be the correct angle. The sign of this angle may need to be changed depending on rotary axis type. For example, ‘map_r’ should be set to ‘p_out’ and ‘s_out’ for head/head machine. The G code for G68/G69 may be modified if necessary. Add code to turn on spindle for G68 mode in ‘p_goto_strt_tl’ and ‘p_goto_strt_ntl’. This is to fix a bug in our 5x post. Add code to turn on G90 mode in ‘p_goto_strt_tl’. This is to fix a bug in our 5x post. The post block ‘p_goto_strt_tl’ and ‘p_goto_strt_ntl’ should looks similar to code below. p_goto_strt_tl #Make the tool start up at toolchange …… …… if n_tpln_mch > m_one, #Toolplane mapping mode [ #Enter your mapping scheme here... pg68_map #spindle on pbld, n$, *speed, *spindle, pgear, e$ pbld, n$, "G43", *tlngno$, *zabs_s, e$ pbld, n$, *sg00, pwcs, *sgabsinc, "X0.", "Y0.", *zabs_s, e$ pcan1, pbld, n$, *sgcode, *xabs_s, *yabs_s, *p_out, *s_out, strcantext, e$ ] …… …… p_goto_strt_ntl #Make the tool start up at null toolchange …… …… ##### Custom changes allowed below ##### if n_tpln_mch > m_one, #Toolplane mapping mode [ #Enter your mapping scheme here... pg68_map #spindle on pbld, n$, speed, spindle, pgear, e$ pbld, n$, pwcs, sgabsinc, *xabs_s, *yabs_s, *zabs_s, *p_out, *s_out, e$ pg68 pbld, n$, *xout, *yout, *zout, e$ ] …… …… Add code to update work offset at the end of ‘p_goto_strt_tl’ and ‘p_goto_strt_ntl’. !workofs$ The G68 rotation center will always be WCS origin in our current post. This may need to be fixed if customer wants the rotation center to be the tool plane origin. Be aware of misc integer #6, that would affect the output. The fix needs to be related to the settings of ‘mi6$’. pg68_map #Map the first postion to the machine if p_out | s_out, [ #Rotate xabs back xabs_s = vequ(xabs) axisx$ = vequ(caxisx) xabs_s = rotv(-p_vec_rot, xabs_s) axisx$ = vequ(baxisx) axisx$ = rotv(p_vec_rot, axisx$) xabs_s = rotv(-s_vec_rot, xabs_s) if add_wrk_sht = 0, map_x = vequ(tox$) #work shift is not turned on, rotate around tool plane origin else, [ map_x = 0, map_y = 0, map_z = 0 #work shift is turned on, rotate around WCS origin ] ] Add the highlihghted logic below in post block ‘pg69’ as below. pg69 #Cancel mapping mode if top_map & prv_map_mode = one,
  14. Sure. Add: *e$ To force a "blank line" in the NC Code output. Add that code to the end of 'pheader$', 'psof$', 'ptlchg$', and 'ptlchg0$'.

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