NX 8.5 MachiningKnowledgeEditor
NX 8.5 MachiningKnowledgeEditor
NX 8.5 MachiningKnowledgeEditor
Proprietary and restricted rights notice This software and related documentation are proprietary to Siemens Product Lifecycle Management Software Inc. 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved. All trademarks belong to their respective holders.
ii
CHAPTER 1
Whats new
New in NX 8.0.1
1
2
2
3
3
Function IT_Class_Iso (nominal, _upper, _lower) MKE User Interface Enhancements 4 Installed default Machining Rule Library 7 Migration of existing pre-NX 85 Machining Rule Library 8 Feature Recognition improvements 8
CHAPTER 2
Table View
27
Selecting nodes in Table View 27 Commands in Table View 27 Table View Toolbar 27 Sorting cells 29 Editing cells 29
Rule View
31
Conditions Tab 32 Constants Tab 33 Materials Tab 33 Machines Tab 33 Explanations Tab 33 Image Tab 33 Add-on Tab 34
Conditions concept
36
Application Criteria 36 Tool Attributes 39 Less Worked Feature Attributes 40 Operation Attributes 41
43
Constants concept
46
48
Find in all Rule Conditions 48 Using TableView autofilter 48 Using TableView Filter Column 49
52
CHAPTER 3
53
58
II
CHAPTER 4
65
85
What this example intends to explain Explanatory picture 85 Conditions 85 Constants 86 Materials and Machines 86 Explanation 86 What this example intends to explain Explanatory picture 89 Conditions 89 Constants 90 Materials and Machines 90 Explanation 90
92
92
Hole Milling
94
94
III
96 96
What this example intends to explain 96 Explanatory picture 97 Conditions 97 Constants 98 Materials and Machines 98 Explanation 98 Explanatory picture 99 Conditions 99 Constants 100 Materials and Machines 100 Explanation 100
101
CHAPTER 5
105
118
IV
CHAPTER 6
121
External Function declaration in the Machining Knowledge Editor 121 External Function TCL body definition 124
MOM__boot {} and MOM__halt {} 124 TCL code 126
Limitations 130
CHAPTER 7
133
137
CHAPTER 8
Wire EDM
141
142
CHAPTER 9
Feature Mapping
147
148 150
Using Feature Mapping -case 1 148 Using Feature Mapping -case 2 Example 148
CHAPTER 10
Feature Teaching
155
What is Feature Teaching ? 156 When to teach a Feature Type 156 How to teach a Feature Type 157
PMI Support in Feature Teaching 157 Use case 1: Create a new feature type and a new recognition rule 158 Use case 2: Create a new recognition rule for an existing feature type 158 Use case 3: Modify an existing recognition rule for existing feature type 159 Defining the features position and orientation 159
CHAPTER 11
161
162 162 162
CHAPTER 12
163
VI
Defining a Recognition Rule for the new Feature Type 167 Face attribute value 171 Machining Direction of C&A Features 171
CHAPTER 13
Customization View
Customization view 176
175
Default Customization 177 CAM Configuration dependent customization 178 Tools, Machines,Part Materials, UDEs 178 Operation Types 179 Features 179 Additional Customization 179 NX Version upgrades 180 Set as Cutter Diameter, Set as Cutter Length 180
CHAPTER 14
183
Teamcenter Integration for NX Compatibility 184 Mixed mode configurations 185 Commands Load Local... and Save Local... in managed mode 186
187
The FBM OOTB content kit: 187 Machining Knowledge structure in Teamcenter 188
VII
CHAPTER 15
Modify the OOTB or Start from Scratch? Workflow in a customization project 200 Analyze your products for manufacturing features 201
200
What comes OOTB 201 How to add features that are not standard. 202
Analyze your operation sequences 205 Analyze your tool libraries 205
202
What comes OOTB. 205 How to add tools that are not standard.
205
Implement Knowledge 206 Maintain Knowledge 207 Using Knowledge Fusion (KF) in Feature Based Machining 207
CHAPTER 16
Appendices
209
210
A: Glossary of Terms
B: Naming conventions for Manufacturing Features 210 C: Definition of the standard STEPPED features 211 D: Definition of the standard non-STEPPED features 214 E: Tips and Tricks 222
Choosing priority for the MACHINING_RULE 222 How to use the MACHINING_RULE conditions 222
VIII
CHAPTER 1
Whats new
This chapter contains references and explanations of new Feature Based Manufacturing functionality.
New in NX 8.0.1
New in NX 8.0.1
External functions
See Functions on page 44.
Feature Recognition
Feature recognition has been improved such that for all recognized features found in a single run (the new features found after you press the Find Features button) the feature directions are aligned as much as possible. This means that if a feature has multiple directions the main direction of a feature is aligned with other features which may not have an alternative direction. So if you have 2 STEP1HOLE features (which can be machined from 2 sides) and a single STEP1POCKET feature the main direction of the hole features will by aligned with the direction of the pocket feature. Prior to NX8 this was not always the case. This behavior is also implemented in NX755.
Whats new
New in NX 8.0.2
New in NX 8.0.2
Function IT_Class_Iso (nominal, _upper, _lower)
This function has been changed slightly in NX 8.0.2: when the 2nd and 3rd parameters are equal, the function returns value undefined. For instance: IT _Class_ISO (10,0,0) will now return undefined instead of an integer value. Consequently the rule will not be rejected. This change enables us to select a tool with a specific diameter with no tolerance. The tool diameter selection query generally has this form: tool.Diameter >= mwf.Diameter + mwf.Diameter_lower tool.Diameter <= mwf.Diameter + mwf.Diameter_upper and generally we will have an application condition to ensure the tolerance can be achieved with this rule, for instance: IT_Class_ISO(mwf.Diameter, mwf.Diameter_upper, mwf.Diameter_lower) >= 9 Now when both the _upper and _lower are defined to be 0, the IT_Class_ISO function will not reject the rule (as it did before), and the desired tool is selected. This behaviour is needed, for instance, for the pre-drill operation for tapping, when the thread feature has attribute THREAD_TAPPED_DRILL_SIZE defined. In the tapping rule we can specify the Less Worked Feature diameter as follows: lwf.Diameter = mwf.THREAD_TAPPED_DRILL_SIZE lwf.Diameter_lower = 0.0 lwf.Diameter_upper = 0.0
Whats new
New in NX 8.5
New in NX 8.5
Ofcourse your first reference is the NX 8.5 Help. Paragraphs below are supplementary about the MKE.
. This will read a source file and will update its customization against a selected cam configuration. It replaces the previous marker in the View > Options dialog where Update upon Load is taken out.
only active when the Customization Tree is active. (See New tab controls on page 5.) It toggles between database name and display name of classes and attributes. This is especially necessary when working with the new Manufacturing Resource Library (MRL) which has coded database names without any meaning for the user, and where we rather work with the display names. An example screenshot where you can see the Display Names (left) and the corresponding Database Name (right) is below:
Whats new
New in NX 8.5
New tab control for Customization Tree view which replaces the previous command View > Customization.
Whats new
New in NX 8.5
This will unlock the possibility to show and edit the generated Feature Recognition Rules source code for the features that were taught. (Not for the standard features.)
Whats new
New in NX 8.5
Whats new
New in NX 8.5
Alternative Directions
A feature can have an alternative direction from which it optionally could be machined. There are several new rules which determine if a feature has an alternative direction:
1.
Customization: it the feature is a customization feature (known in the customization) then the user can specify in the customization if the feature has an alternative direction or not. If the parametric recognizer finds multiple alternatives then the feature has an alternative direction (unless the customization says otherwise) If the feature is a through feature but blocked from both sides then the user should decide how to machine the feature and thus the feature has an alternative direction. The main direction is the direction with the largest distance between the feature and the blocking geometry.
2. 3.
4.
If the feature is a through feature but blocked from just a single side then the feature has no alternative direction . The feature should be machined from the
Whats new
New in NX 8.5
free direction.
5. 6. 7.
If the feature is a tapered thread feature then the feature has no alternative direction. If the feature is a full thread then the feature has an alternative direction. If the feature is not a full thread feature but the thread depth is greater than or equals to the feature depth then we consider the thread a full thread and thus the feature has an alternative direction.
In NX85 this functionality is extended to allow more advanced feature filtering based on machining access direction. In addition to a single vector the following types are now also supported:
Whats new
New in NX 8.5
Specify Vector. Allows feature filtering based on multiple access direction vectors. All features that match one of these vectors are returned.
Towards Point / Away from Point. Allows feature filtering based on a point.
Only features with a direction towards or away from the specified point will be returned.
Towards Axis / Away from Axis. Allows feature filtering based on an axis. Only
if the feature direction is perpendicular to this axes the feature are returned.
10
Whats new
New in NX 8.5
Selection Intent
NX85 has full support for selection intent. This allows the user to select the appropriate geometry using the standard NX selection intent controls. Main reason for this (small) change is that by doing so the geometry selection is more in line with the rest of NX (since NX75 the user was already able to select multiple faces/edges/ curves/points with the Select Geometry UI component)
Whats new
11
New in NX 8.5
12
Whats new
CHAPTER 2
The first chapter explains the concepts behind the Machining Knowledge Editor.
13
The choice for a machining process will generally also be influenced by:
14
you did not have the preferred tooling or... you had to machine 10.000 of these holes per month.
This is only one feature type. What applies to counter bore holes, also applies to most other features: generally there will be alternative ways to have them manufactured. It is the process planners task to select machining operations that are both economical and produce a part that meets the tolerances. A companys best machining practice defines their methodology of machining certain manufacturing features. It defines, for a set of machining features, which operations should be used, which tools should be used, and in which order these should be applied. The best practice is defined by sets of Machining Rules. In addition to the day-to-day advantage of generating fast, reliable and reproducible solutions, having a best practice also serves as a vehicle for standardization. The Machining Knowledge Editor, in short MKE, is the authoring tool in which you can define your companys best machining practise.
15
In general, a Machining Rule corresponds with a single manufacturing operation (e.g. drilling a hole or milling a pocket) and will describe:
when this operation is allowed what result can be achieved (which shape is created, which tolerances can be
achieved)
which tool is necessary (which type is required, what dimensions are required) which start shape needs to be there.
For brevity, in this chapter, when we talk about a Rule we actually mean a Machining Rule. The command Create Feature Process... in NX will start reasoning backward, using Rules, from the final feature (More Worked Feature) to the blank feature (Less Worked Feature). This is the most import thing to keep in mind when implementing your companys machining knowledge in the MKE.
16
RuleLibrary
RuleLibrary
Rules are always grouped in a RuleLibrary. Three different RuleLibraries, with different purposes, are used in NX:
1.
The Machining Knowledge library, which is used by the Create Feature Process... command. This RuleLibrary defines the best practice to manufacture features. The Feature Mapping library, which is used by the Find Features... command. This RuleLibrary defines how a feature of one type can be changed (mapped, transformed) into a feature of another or the same type. This functionality can be used to transform external or modeling features (User Defined Features) into manufacturing features and vice versa. Frequently this functionality is used to interprete the color of a feature. For instance when a yellow color means that a feature is threaded. See Feature Mapping on page 147. Feature Recognition library, which is used by the Find Features... command to find the features in the part models. Starting with NX 8 admin users will be able to interactively define their recognition rules. For now, these are outside the scope of this tutorial.
2.
3.
In the Machining Knowledge Editor you will see 3 different Tabs for the 3 different families of Rules you can define. The names of the Tabs are fixed.
17
Functions tab with the available FunctionLibraries. It has a pre-configured FunctionLibrary called System Functions. The default installation also has a pre-configured FunctionLibrary Sample Functions. All functions in these libraries are based on TCL command language. See External Functions using TCL on page 121. Customization tab is new here since NX 8.5. It displays all the customization objects as defined in the currently loaded machining_knowledge source file.(Previously this was accessed using View -> Customization.)
5.
Editing machining and mapping rules does not require any knowledge or skills in a particular programming language like C or C++. The Machining Rules are used by the inference engine which is dedicated to searching a solution to machine manufacturing features. Machining Rules are the elementary process steps and the application of a Machining Rule will generally result in a single NX operation object. The inference engine will be discussed in How Operation Selection works on page 53.
18
page 183. When not in managed mode, you will be reading and writing to the file system which is the default mode of operation.
19
Activity: Load a Machining Knowledge Library Open the machining_knowledge.xml which is the out of the box (ootb) library
with machining rules.
20
1. The Tree View showing the RuleLibrary tree. The Tree View is mainly used
for finding and activating nodes, and for starting specific commands. The Tabs controls allow to switch between modes for Machining Rules and Feature Recognition Rules and Feature Mapping Rules.
2. The Table View showing only the activated nodes. Nodes are activated by
clicking the small rectangular in the Tree View. The Table View is mainly used for finding and filtering on Rules.
21
The display of the Tree View and Table View can be toggled from the pull-down menu View. From the sub menu select the name of the view. This will toggle the display of the view. When checked active, it is displayed.
Activity: Change the visibility of the views Toggle the visibility of the views with the View entry in the main menu. Display all views again.
Generally you will need both the Tree View and the Table View when working with the Machining Knowledge Editor, so keep these settings checked.
22
Tree View
Tree View
The Tree View lists the Rules in a tree format. The Tree View is mainly used for finding and activating nodes, and for starting specific commands.
Activity: Navigating the tree move through the tree use the arrow-up, arrow- down, Home, End, Page Up,
and Page Down keys.
Sections of the tree can be expanded or collapsed by clicking with the left mouse
button on the +/- sign shown in front of the node name.
Sections of the tree can be expanded or collapsed by using the left and the right
arrow keys on the keyboard.
Selecting nodes
Most commands are executed on one or more nodes in the Tree View or Table View. If a command is started from the Tree View, only the selected nodes will be used as input for the commands.
23
Tree View
In the Tree View all nodes of the project can be selected. In the Table View only the activated nodes can be selected (as these are the only nodes which are displayed in the Table View). Selected nodes will be highlighted in the views where the nodes are visible. Nodes, which are (de)selected in one view (e.g. Tree View), are also (de)selected in the other view (Table View).
Activity: Selecting Nodes in the Tree View click MB1 on a node (active or not active) for single select. Control + click MB1 to modify the selection. The node will be added or removed
from the current selection.
Shift+MB1 allows multiple selection. All nodes starting from the previously
selected node will be added to the current selection.
Activating nodes
Only activated nodes are visible in the Table View. The status (activated/deactivated) is shown with the check box in front of the node.
Activity: Activating Nodes in the Tree View Click with the left mouse button on the check box in the Tree View to toggle the
status of the node. If the node is part of a selection, all other nodes will be set to the same activation status regardless of their current status.
Press the space bar to inverse the status of the node. If the node is part of a
selection, the status of all other nodes will also be inversed from their current status.
All children of a node can be activated from the Tree View popup menu by executing the Activate Children command.
24
Tree View
All nodes can be deactivated from the Tree View popup menu by executing the
Deactivate All command.
Renaming nodes
In the Tree View a node can be renamed by first selecting it, followed by another mouse click on the name of the node or by pressing F2. This will start the editing mode indicated by the box around the name. The changes can be cancelled by pressing the Esc button. The editing mode will be closed when clicking outside the editing box.
Activity: Rename a node Rename the MillDrill node into DrillMill. Ordering nodes
In the Tree View nodes can be moved by making a selection, dragging this selection with MB1 pressed within the Tree View on one of the other nodes, and releasing MB1. This will move all selected nodes to a position below the node that the selection was dragged on.
Activity: Moving nodes within the Tree View Move some of the nodes within the Tree View. Copying nodes
In the Tree View, nodes can be copied by making a selection in the Tree View, dragging this selection with MB1 pressed on the RuleLibrary parent node, and releasing MB1. This will copy all selected nodes and add them at the end of the tree. All data related to a node will be copied to the new node. This enables to quickly create a new Rule from an existing Rule.
Activity: Copy a node Copy some of the nodes within the Tree View. Rename these nodes.
25
Tree View
Undo
All commands can be undone by Ctrl+Z or by Edit > Undo.
Deleting nodes
In the Tree View nodes can be deleted by making a selection, and pressing the Delete button or by selecting Delete from the popup menu. This will delete all selected nodes.
Activity: Delete a node Delete the nodes that were created in the previous exercise.
26
Table View
Table View
The Table View shows the data of activated nodes in an Excel style tabular representation. The Table View is mainly used for finding and filtering nodes.
MB1 on the beginning of a row is single select. If the mouse is moved while the
MB1 is pressed (and you should see an arrow cursor), multiple lines will be selected.
Control + MB1 on the beginning of a selected row modifies the selection. The
node will be removed from the current selection.
Shift+MB1 on the beginning of a row allows multi selection. All nodes from the
previous selected node will be added to the current selection.
MB1 on the top left Cell will select all rows in the Table View. Commands in Table View
Node specific commands can be started from the popup menu of the Table View. This popup menu only appears when using MB3 on the beginning of the row.
27
Table View
Page Setup of Table View: Pops up the Page Setup window for the Table View.
In this window the setup of the Table View can be changed.
Export Table View to Microsoft Excel: Saves the content of the Table View to
an MS Excel file format.
Zoom in Table View by 20%: does what it says. Zoom out Table View by 20%: does what it says. Reset Zoom: Resets the zoom of the content of the Table View to 100% Replace: Searches the column for entries containing the search string and replaces the search string with the replacement string. The search string does not support wildcards. in the selected column. To display all rows again, the filter button has to be pressed again. If a cell is selected instead of a column, then the data of this cell is used to preset the search string for filtering the column containing the cell. The search string supports wildcards: * replacing zero or more characters ? replacing exactly one character ; separating elements of a vector
Filter: Hides all rows that do not have data matching the search string
28
Table View
Toggle Freeze rows/ Toggle Freeze columns: moves the selected rows/
columns to the first positions, where they will remain visible when scrolling through the Table View. Pressing the button again will restore the normal display of the rows/columns.
Hide rows / Unhide rows: Will hide the selected rows. Unhide rows
will show all hidden rows again.
Activity: Using some Table View commands Activate all Rules. In the name column find the nodes starting with Tap by using the filter
Tap*
Use the filter wildcards command on the name column to display all rows that
have S1H at the beginning, at the end, or somewhere in the string.
Use the freeze/hide commands. Use the Autofilter command to filter on the OperationClass and the OutputFeatures column values.
Sorting cells
In the Table View the rows can be sorted by attribute by clicking on the name of the column.
Editing cells
In the Table View the attributes of nodes can be edited. Cells are:
29
Table View
light gray, if the value in the cell is read-only, dark gray, if the attribute does not exist for the node.
The Table View displays both single value attributes (for example the name attribute), and vector attributes (for example the OutputFeatures and the ProductMaterials attribute). Several cells, either single value or vector values, in one column can be set to the same value by:
select one Cell having the value you want to copy, 10 in the example screenshot. select a corner of that Cell such that the cursor shape changes to a small rectangular.
Several single value cells, not necessarily in one column, can be set to the same value by:
Select several cells Ctrl-click in one of the fields that you want to change Edit the value of the last selected cell and press Enter; the values of all selected
cells are changed to the new value.
Activity: Editing Cells Activate all Rules. In the Table View click on the name column to order the data. Change the priority of all the TAPPING operations to 10 using the two
described methods.
30
Rule View
Rule View
The Rule View shows the data of a selected Rule. This is shown in a set of tabs, which are described later, and six Rule Definition Components. These are:
Name. Contains the name of the Rule. OperationClass (oper.). Contains the class of the operation that is to be generated based on this Rule. Pressing the F8 key in the field will pop-up the hierarchy with operation classes. Select one item from the list, type the value manually, or use a copy/paste sequence. The operation class and its parameters determine the motions of the tool during the operation. The display color will change when a valid OperationClass is defined. This also applies for the feature classes and the tool classes. The classes and related information are defined in the customization belonging to the RuleLibrary. There is a special class DummyOperation that can be used to change one feature type into another feature type. Rules of this class have no tool class. Priority. Contains a numerical value which determines the relative priority of the Rule, compared to other Rules producing the same More Worked Feature. The priority defines which Rule will be tried first, when there are more Rules that can machine the same feature. Generally, we give Rules that correspond to cheap operations (like drill operations) a higher priority than Rules that correspond to expensive operations (like reaming operations). This way we can be sure the system will try cheap Rules first and when these can not be applied, try the next more expensive Rule etcetera. OutputFeatures (mwf.). Contains the class of the Output Feature that is produced by the operation when the Rule is applied. This corresponds to the shape of the feature at the end of the operation. Pressing the F8 key in the field will pop-up a scrollable list with feature classes. Select one item from the list, type the value manually, or use a copy/paste sequence. When the Rule produces multiple features, they are separated by commas.
31
Rule View
InputFeatures (lwf.). Contains the class of the Input Feature that is expected by the operation before the Rule is applied. This corresponds to the shape of the feature at the beginning of the operation. Pressing the F8 key in the field will pop-up a scrollable list with feature classes. Select one item from the list, type the value manually, or use a copy/paste sequence. When the Rule consumes multiple features, they are separated by commas. Resources (tool.). Contains the class of the tool that is used by the operation when the Rule is applied. Pressing the F8 key in the field will pop-up a scrollable list with tool classes. Select one item from the list, type the value manually, or use a copy/ paste sequence. When you locate the mouse pointer in any of the above fields you get a short help text. In addition to the six Rule Definition Components, there are seven Tabs containing more detailed aspects of the Rule Definition. These are described in the following sections.
Conditions Tab
This tab shows the conditions pertaining to the Rule. Conditions are used to describe specifics of the Rule, like when a Rule can be applied, which specific tool should be selected, operation parameters etc. All conditions are interpreted as logical expressions and must be true. If one or more conditions are false, the Rule will be rejected. The conditions are described in an easy, Visual Basic style, text based editing environment. This allows for free text editing (manual typing, delete, insert, copy, paste, etc.) with support for standard windows shortcuts:
TABLE 1. Shortcuts
for condition editing Select all text. Cut selected item. Copy selected item. Paste Goes to beginning of current line. Goes to beginning of document
32
Rule View
TABLE 1. Shortcuts
for condition editing Goes to end of current line. Goes to end of document. Highlights from current position to beginning of line Highlights from current position to end of line Moves one word to the left at a time Moves one word to the right at a time.
End Ctrl + End Shift + Home Shift + End Ctrl + Left arrow Ctrl + Right arrow
Constants Tab
This tab shows the constants that can be used within conditions to improve consistency and readability. Constants can be used instead of hard-coded values in expressions. See Constants concept on page 46.
Materials Tab
This tab shows the list of materials that are defined as part materials within NX. A Rule can be made valid for selected materials. By checking the All Materials check box, a Rule will be valid for any material, also for materials that will be added in the future.
Machines Tab
This tab shows the list of machines that are defined within NX. A Rule can be made valid for selected machines. By checking the All Machines check box, a Rule will be valid for any machine, also for those that will be added in the future.
Explanations Tab
Contains a free textual explanation of the Rule.
Image Tab
You can add a picture to the Rule. The image can have as format .jpeg or .jpg. Use the command Add Image... that is available in the popup menu of the Image tab.
33
Rule View
Add-on Tab
This Tab enables the creation and editing of what we have called Rule Add-ons. Depending on the Rules Operation Class, different types of Rule Add-ons can be defined. Examples of Add-on Object Types for a Drill Rule are:
Cycle - enables definition of the cycle type and its specific parameters Start of Path Events - like Approach Markers, opstop and many more End of Path Events Knowledge Fusion (KF) - all parameters of the Rules Operation Class can be defined via KF if desired. If you have quotes inside the kf expression like in this example, use a backslash so the expression will pass the Check Validity command:
34
Rule View
35
Conditions concept
Conditions concept
A condition is a logical expression which can evaluate to TRUE or FALSE. We distinguish four categories of Conditions:
Application Criteria see page 36. Tool Attributes see page 39. Less Worked Feature Attributes see page 40. Operation Attributes see page 41.
Although NX does not know these categories, it is good to keep them in mind and organize the condition in these four categories.
Application Criteria
Application criteria state when a Rule may be applied. In general, application criteria are related to the size and quality of the More Worked Feature. Examples are:
The roughnesses that can be achieved: e.g. drilling is only allowed until a certain roughness, otherwise reaming/boring should be used.
The size tolerances that can be achieved: e.g. drilling is only allowed until a certain diameter tolerance, otherwise boring or reaming should be used.
The shape of the feature: e.g. drilling with a straight drill will finish the shape
only when there are no chamfers.
The size of the feature: e.g. drilling is only allowed when the feature is not too
deep or too large, otherwise another operation type should be used. A Rule can only be applied to a feature when all its application criteria are TRUE. When the expression evaluates to FALSE, evidently the Rule may NOT be applied. An example of an application criterion for using a twist drill is :
36
Conditions concept
REM Application Criteria mwf.DEPTH / mwf.DIAMETER_1 < 6 $$ Feature is too deep for DRILL cycle
Each line in this example has a different function. The first line starting with REM is considered as remark and does not have any effect on the behavior of the program. The programmer can use remarks to include short explanations or observations. It is advised to add remarks so others can understand the behavior of the Rule and the reason for the conditions. There can be several lines of remarks following each other, but each line needs to start with REM . The second line mwf.DEPTH / mwf.DIAMETER_1 < 6 is the actual condition. In this case defining that the DEPTH attribute of the mwf (More Worked Feature) should be smaller than 6 times the DIAMETER_1 of the mwf. When applied to a manufacturing feature, with its actual parameter values for DEPTH and DIAMETER, this condition is false, the Rule will be rejected and the system will continue evaluating the next Rule. The third line starting with $$ defines the message that will be output when the condition is false and thus the rule is rejected. This message is part of the messages that users will see if they want to analyze why a certain solution was found. As a consequence, these messages should be clear enough for the users to be able to understand why a Rule was not used. When the Rule is denied because of this condition, the text prefixed with $$ will be printed in the Information window (if displayed) and to the MSAnalysis.lis file on the $TEMP directory. In the above examples, DEPTH and DIAMETER_1 are attributes of STEP1HOLE. In order to obtain a complete list of attributes you can use in expressions, type mwf followed by a dot . and select one from the list. When the editor recognizes valid entries, it will display them in a different color. These colors are defined in the Preferences.xml that can be found in the MACH\machining_knowledge_editor directory. Another example of an application criterion is:
37
Conditions concept
IT_class_ISO(mwf.DIAMETER_1, mwf.DIAMETER_1_UPPER, mwf.DIAMETER_1_LOWER) >= 11 $$ Feature's tolerance class cannot be achieved with this Rule
In the IT-class system for tolerancing dimensions, a low value denotes a tighter tolerance than a high value. So if the IT class of an actual feature is 7, it is too tightly toleranced to be drilled. Then this application criterion will evaluate to FALSE and the Rule will not be applied. In the above example, IT_Class_ISO( ) is a function delivering an integer number as result. When placing the mouse over the function text, a tool tip will appear explaining the function, see left. The default values for _upper and _lower bandwidths of dimensional parameters like the DIAMETER are in file mach\resource\feature\metric | english\feature_tolerances.xml. When _upper and _lower bandwidth have the same value, i.e. the tolerance is zero, then the function returns undefined. The rule will not be rejected on this test. In order to obtain a complete list of functions you can use in expressions, press F8 and select one from the list. Some other examples of rather common Application Criteria are:
mwf.SIDE_ROUGHNESS_1 > 12.5 $$ Features side roughness cannot be achieved mwf.DIAMETER_1 < 63 $$ Feature's diameter is too large mwf.DEPTH_TOP_CHAMFER > 0.01 $$ Feature must have a top chamfer
38
Conditions concept
Tool Attributes
The Tool Query defines the size of the tool that will be used for the operation. Examples are:
The diameter of the tool should be corresponding to the diameter of the mwf:
e.g. the drill diameter should be smaller than the maximum toleranced size of the mwf diameter but should be larger than the minimum toleranced size.
The tool should be long enough: e.g. the length of the drill should be larger than
the depth of the hole. A Rule will have one or more expressions to specify tool attributes like:
tool.Diameter >= mwf.DIAMETER_1 + mwf.DIAMETER_1_LOWER tool.Diameter <= mwf.DIAMETER_1 + 0.5*(mwf.DIAMETER_1_UPPER + mwf.DIAMETER_1_LOWER) tool.FluteLength > mwf.DEPTH
The expressions above were entered using copy and paste, see screenshot below.
In the above example, Diameter, and FluteLength are attributes of TWIST_DRILL. In order to obtain a complete list of attributes you can use in expressions, type tool followed by a dot . and select one from the list. The text printed, when one of these conditions evaluates to FALSE, says Conflict in one of the tool size specifications. That would happen, for instance, if we had mistakenly entered something conflicting like:
tool.POINT_ANGLE = 120 AND tool.POINT_ANGLE = 118
Note The operator AND is equivalent to putting the expressions on separate lines.
A Rule should not be rejected based on conditions defining tool Attributes. When the cutting tool of the class is not available, the Rule will not be applied and NX will try the next Rule. In that case, the $$text will not be displayed. NX will try to use the tool with the biggest Cutter Diameter that is still smaller than the maximum as specified by the expressions. As a consequence, the lower limit only needs to be defined when it is essential for a correct tool selection, like for drill
39
Conditions concept
type operations. For milling operations a lower limit is most of the times not necessary. For this to function, NX must know which attribute holds the size of the Cutter Diameter. This is a trivial issue, but since the tool classification is free, it is necessary to appoint one of the tools attributes to be the Cutter Diameter. This is done in the Customization View with command Set as Cutter Diameter...See Set as Cutter Diameter, Set as Cutter Length on page 180. Tool Sort Order Generally, more than one tool of the desired class satisfies the tool query. It is important to avoid choosing a too long and therefore unstable tool. Tools are ordered by their length. For this to function, NX must know which attribute holds the size of the Cutter Length. This is a trivial issue, but since the tool classification is free, it is necessary to appoint one of the tools attributes to be the Length. This is done in the Customization View with command Set as Cutter Length.
When defining Less Worked Feature attribute values we define the in-process geometry. The screenshot above shows the drill point that exists before drilling the hole. If no Less Worked Feature is required, the class BLANK is used. This means the operation does not need a defined starting geometry.
Note In general, there should be at least one operation with BLANK as LWF
for every MWF feature type. Otherwise there will be no complete solution found for a specific feature type. In order to calculate the dimensions we need to be familiar with the feature classes and their attributes. To specify the dimensions of the drill point (class POCKET_ROUND_TAPERED) we need following expressions:
40
Conditions concept
In the above example, DIAMETER_1, DIAMETER_2 and DEPTH are attributes of Less Worked Feature POCKET_ROUND_TAPERED. In order to obtain a complete list of attributes you can use in expressions, type lwf followed by a dot . and select one from the list. When there is no expression for the LWF attribute, NX copies the corresponding value from the MWF. This works only if the attribute names match exactly. So, if the DEPTH of the feature does not change, you do not need to enter the expression:
lwf.DEPTH = mwf.DEPTH
When the LWF is of class BLANK, we do not care about the LWF class and hence do not need to specify any LWF attributes. For readability, it is good practice to have lwf attributes on the left side of the equation.
Operation Attributes
The last category of conditions specifies attributes of the Rules operation. Examples are:
The operation should go deep enough What is the control point on the tool
41
Conditions concept
Above a screenshot with some examples of assignments to operation attributes. In order to obtain a complete list of attributes you can use in expressions, type oper followed by a dot . and select one from the list. In MKE 8.0.1 you can use the + operator to concatenate any number of strings. Examples are depicted below:
New in MKE 8.0.1 is the possibility to define operation parameters in Add-ons. It was already possible to define operation parameters in the rule's conditions with the prefix oper.. If the same operation parameter is defined both in the condition tab and in an Add-on and the values are conflicting then the Add-on will be rejected. The main reason for having operation parameter assignments in an Add-on, rather than in the condition tab, is the timing of the assignment. This is a little bit complicated but it's sufficient to know that expressions in the Add-on are evaluated at the very end of Create Feature Process, when the operation is selected and a tool is selected. Whereas the expressions in the Conditions tab are continuously re-evaluated during the operation and tool selection process. This behavior may lead to unexpected and undesirable results in situations where feature parameter ranges and tool parameters are used to set operation attributes such as the operation name. It is recommended to define the operation parameters in the Rules Add-ons, rather than in the Rules Condition tab. This ensures that operation parameter assignments will not influence the operation selection itself. In other words: a rule will never be rejected due to an operation parameter assignment when the assignment is done in the Rules Add-on.
42
Table 2Operators
Operator Explanation
equal smaller than smaller than or equal greater than greater than or equal not equal addition(numbers or char strings) subtraction multiplication division power logical logical logical left parenthesis right parenthesis
IF THEN ELSE conditional expression Note a - b + c is evaluated as (a - b) + c . It is advised to use brackets for clarity
and correct evaluation.
43
Functions
Press F8 while in the Conditions Tab to obtain a list of functions:
TABLE 3. Functions
to be used in expressions
explanation returns the arc cosine. returns the arc sine. returns the arc tangent. returns the cosine. returns the sine. returns the tangent. returns the smallest integer >= input value. The input value can be a range, bound single or double sided. IF (a<=number<=b) THEN CEIL((a+b)/2) Otherwise same as CEIL(number)
function(argument) ACOS (number) ASIN (number) ATAN (number) COS (degrees) SIN (degrees) TAN (degrees) CEIL (number) CEIL_RANGE (number)
returns the largest integer <= input value. Similar to CEIL_RANGE returns TRUE if arg is defined; FALSE otherwise. returns FALSE if arg does not exist; arg can be of type real, integer or string; Example: IT_class(20,0.021,0) = 7 Note: returns undefined if 2nd param = 3rd. returns the roughness value of an attribute returns true if the two features are on the same axis returns the distance between two features converts a number in string format to real New in 8.0.1
[integer]
44
TABLE 3. Functions
to be used in expressions
explanation converts a whole number in string format to real New in 8.0.1 converts a real to a char string with (int) decimals shown. More decimals are truncated. New in 8.0.1
output [integer]
function(argument) ToInt(string)
[string]
ToString(param,int)
In addition to the functions above which are hard-coded, see the system functions defined in the Functions tab.
45
Constants concept
Constants concept
Constants are objects with a name, a type and a value. We use them in conditions instead of hard-coded values, for instance:
oper.Depth = mwf.DEPTH + constant.DEPTH_EXTEND
instead of
oper.Depth = mwf.DEPTH + 2
Using constants instead of hard-coded values eases the readability and maintainability of expressions. Another advantage of using constants is the possibility to vary the values for any combination of machine / material. If there is no value specified then the default is used.
Above screenshot shows a constant.Pre_Drill_Limit with a different value for material ALUMINIUM. A constant can be of datatype double, integer, or string. Different constant values can be defined for metric and inch part files. Based on the units used in the part file, NX will automatically select the correct values of the constants.
If you define a constant value in metric (mm) only then NX will calculate the
english (inch) value by division by 25.4.
If you define a constant value in english (inch) only then NX will calculate the
metric (mm) value by multiplication with 25.4.
If you define a value for both english (inch) and metric (mm) unit systems then
-however- these values will be used by NX.
46
Constants concept
Scope of a Constant
Preferably we declare a Constant globally, that is on the RuleLibrary level, with its default value and if applicable its values per machine / material combination. We use the Constant locally in a Rules Conditions and when the value should be different from the global value we can define the Constant locally at Rule level.
These commands are also available in the pop-up menu of the list of constants.
47
Find/Replace
To search for any text in the conditions and replace that text. When at the end of the Rules condition, the command asks if it should continue to search in the next Rule unless the Wrap around search is checked active.
Using TableView autofilter Use Table View to filter the RuleLibrary on any criteria, like Rules for machining a feature of class STEP1HOLE.
48
Using TableView Filter Column You can search a selected column using the Wildcard search. For instance you
can find all activated Rules whos name starts with Chamfer:
Activity: Searching the Rules Use the table view to find all Rules with the TAPPING OperationClass. Find all Rules that use the condition tool.Diameter < mwf.DIAMETER_1
49
Select one or more lines in the conditions Tab and execute Check Validity
(selection) from the pop-up menu.
Select the Rule node in the RuleLibrary and execute Check Validity from the
pop-up menu. If the compiler discovers mistakes these are indicated by bookmarks. Locate these bookmarks and correct the mistakes with the help of the compilers error message.
Activity: Check Validity Select a Rule and check the validity of some of the conditions. Select several Rules and check the validity of the Rules. Testing in NX with Create Feature Process
Once a library has been saved, the Create Feature Process command in NX can be used to test the Rules. This can be done by selecting features in the NX Manufacturing Feature Navigator and starting the Create Feature Process from the popup menu.
When a Rule is denied because of a condition which evaluated to False, the $$text after that condition will be printed. For instance:
50
51
direct
mwf OR mwf OR mwf Attributes in conditions are prefixed with mwf. Since only attributes can be used that are in all mwf classes there can be no confusion.
composed
mwf AND mwf AND mwf Attributes in conditions must be pre-fixed with mwf_1, mwf_2 etcetera. This is not yet supported in for operation selection rules. It is supported in NX6 for feature mapping rules.
indirect
Rule will be filtered out in any case during Create Feature Process... command.
52
CHAPTER 3
This chapter deals with the Operation Selection that was introduced in NX6. It gives some background on how things work. NX CAM programmers do not necessarily have to be aware of this. What is Operation Selection? Rulebased operation selection is a proven technology seamlessly integrated into NX that helps you automatically create operations such as milling, drilling and tapping from a generic template. Rulebased operation selection is also applicable to Turning and Wire EDM operations. It lets you select features such as holes, slots, and pockets from any source, including features that are user defined, identified, recognized or tagged. It applies best practice machining rules on the features while taking into account any defined PMI. Benefits of feature based Operation Selection are:
Standardize on best practice machining knowledge. The software finds the best
solution for a machining task within a companys environment.
53
There is a clear separation between the tool of the Subject Matter Expert, the Machining Knowledge Editor (above the dashed line) and the NX Programmer.
54
The Machining Knowledge Source is created using the MKE. NX can be configured to use this source file. See CAM Configuration dependent customization on page 178.
55
The command Create Feature Process... in NX will start reasoning backward, using Rules, from the final feature (Output Feature) to the blank feature (Input Fea-
56
ture). This is the most import thing to keep in mind when implementing your companys machining knowledge in the MKE. Observe that Spot_Drill and Drill_S1H and Chamfer_S1H are three elemental operations that appear in the solution for both features. This is an essential concept: elementary rules are defined only once and are applied whenever appropriate. This sets aside the NX FBM solution to other systems or custom made solutions which find solutions by definining the complete set of operations for every case that needs to be automated. In NX FBM, a modification to a Rule will have effect in all instances where the rule will be applied.
57
First the candidate rules will be selected. These are the rules that produce a feature of type STEP1HOLE. By filtering the Table View on STEP1HOLE we can create that list in the MKE. NX Operation Selection will create the same list internally. Operation Selection will first try the candiate Rule with highest priority. We have given the rules priorities such that the least expensive has the highest priority. In the example this means that Drill_S1H is tried first. It cannot be applied because a diameter tolerance of H7 is not achievable when using a twist drill. That is one of the Rules application criteria. This road ends which is denoted by:
58
Then the next expensive Rule, Drill_in_center_S1H is tried. Also this Rule will fail for the same reason as Drill_S1H : a tolerance of H7 cannot be achieved with a twist drill.
59
We skip a few candiate Rules that are rejected and arrive at Ream_S1H. For this Rule all conditions are true, and it is really applied which is denoted by a new node:
60
The new node is an in-process feature of, again, type STEP1HOLE. The Ream_S1H conditions will have loosened the tolerance on its diameter. The in-process STEP1HOLE is the new target for the Operation Selection. And what we have seen before happens again: the candidate list with Rules is tried in order of priority, highest first. We see that Drill_S1H is rejected because of a general application settings that rejects drilling directly without centering first. The second Rule is Drill_in_center_S1H. For this Rule all conditions are true, and it is really applied which is denoted by a new node:
61
The new node is an in-process feature of type POCKET_ROUND_TAPERED. The in-process POCKET_ROUND_TAPERED is the new target for the Operation Selection. And what we have seen before happens again: the candidate list with Rules is tried in order of priority, highest first. The applied Rule is Spot_Drill. For this Rule all conditions are true, and it is really applied which is denoted by a new node: The input feature of Spot_Drill is of type BLANK. The Operation Selection has successfully found a suitable set of rules to completely machine this feature. The resulting process in this simplified example is : Spot_Drill => Drill => Ream. NX will now create the operations in the Operation Navigator. As you have surely noticed, the result is found in the reversed order, reasoning backward from the final feature to the blank feature. Please take a few moments to consider the human approach in finding such a solution. Do we solve this sort of problems much different ?
Information Window
On your %temp% directory you will find a file MSAnalysis.lis. It has the analysis of the reasoning process including candidate Rules that were rejected. For a full understanding of how the solution came about, this file is essential.
62
With File > Utilities > Customer Defaults...you can activate the check box Display Information...etc to have the file popping up after each Create Feature Process...
63
64
CHAPTER 4
Before proceeding, please make sure you have completed reading Machining Knowledge Editor Concepts. In this chapter you find exercises to create a number of example MachiningRules:
After completing these exercises you are well equiped to translate your companys best manufacturing practices into MachiningRules that can be used by NX. The exercises provide detailed instructions. It should be possible to follow this training off-line, self-paced.
65
MachiningRules (tab Machining Knowledge) FeatureRecognitionRules (tab Feature Recognition) MappingRules (tab Feature Mapping) a FunctionLibrary (tab Functions) the Customization
We will focus on MachiningRules in this part of the Tutorial. There are two options when creating a new RuleLibrary file:
1.
Copy an existing RuleLibrary file. Advised when your new MachiningRuleLibrary will have a lot in common with the old MachiningRuleLibrary. This is for example when you are going to add extra MachiningRules to an existing MachiningRuleLibrary. Create a new RuleLibrary file and start from scratch. You will still have the possibility to import rules from other libraries, using the commands MB3 > Export/Import .
2.
Go to the UGII_CAM_MACHINING_KNOWLEDGE_DIR directory. Copy the file machining_knowledge.dat. Rename the copy to train_machining_knowledge.dat. Edit train_machining_knowledge.dat and assign a new library name to the MACHINING_KNOWLEDGE_LIBRARY entry. UGII_CAM_CONFIG_DIR directory or the UGII_CAM_CUSTOM_DIR directory.
66
Copy the configuration file that is linked to the existing RuleLibrary. Rename the copy to, for instance, train_feature_machining.dat Edit the copy of the configuration file. Change the
MACHINING_KNOWLEDGE entry to point to the new train_machining_knowledge.dat file that was created in the UGII_CAM_MACHINING_KNOWLEDGE_DIR configuration directory.
Start the Machining Knowledge Editor. Open the existing RuleLibrary file using command Open and Update. When
the NX Configuration Files dialog appears, select the .dat file that you created and press the OK button.
Save the file with the new library name using the File > Save As command. Creating a new RuleLibrary file.
This requires the following steps:
Copy an existing file, like machining_knowledge.dat. Rename the copy to, for instance, train_machining_knowledge.dat Edit the copy of the configuration file. Assign a new library name to the
MACHINING_KNOWLEDGE_LIBRARY entry.
Copy the configuration file that pointed to the original file in the
UGII_CAM_MACHINING_KNOWLEDGE_DIR.
Rename the copy to, for instance, train_feature_machining.dat Edit the copy of the configuration file. The MACHINING_KNOWLEDGE
entry must point to the new file that was created in the UGII_CAM_MACHINING_KNOWLEDGE_DIR configuration directory, say train_machining_knowledge.dat.
Start the Machining Knowledge Editor. Choose File >New. In the NX Configuration Files dialog box, from the Configuration Folders list,
select the location for the configuration file:
67
- If you use a standard NX configuration, select UGII_CAM_CONFIG_DIR. - If you have custom configurations, select UGII_CAM_CUSTOM_DIR. - Or you can use Browse to select a configuration file from anywhere on the file system.
From the Configuration Files list, select the file you copied and renamed, like
train_feature_machining.dat.
Select the unit system and click OK. Save the file with a new name using the File > Save As command. The name
must be as defined in train_machining_knowledge.dat. As we will start from scratch we need to create a new RuleLibrary file.
Activity: Creating a new RuleLibrary file Create a file my_feature_machining.dat on the UGII_CAM_CONFIG_DIR
with a MACHINING_KNOWLEDGE entry pointing to MyRules.dat.
Launch the MKE from the Start menu > Siemens NX 8.5 > Manufacturing Tools
> Machining Knowledge Editor.
Create a new RuleLibrary with File > New. Use my_feature_machining.dat from the UGII_CAM_CONFIG_DIR. Save the initial source file as MyRules.xml Activity: Setting the Cutter Diameter and Cutter Length
Since we are working on a new source file, we must appoint one of each tools attributes to be the Cutter Diameter.
Open the Customization View by pressing the Customization tab. Expand the Drilling tree in the Tools tree. Select node Drilling Right-click Diameter attribute in the attributes list and select Set as Cutter Diameter ....
68
The Diameter attribute in inherited by all Drilling tools and is now used by the software as the Cutter Diameter.
Select node Twist Drill Right-click FluteLength attribute in the attributes list and select Set as Cutter
Length.... The Flute Length attribute is specific for the Twist Drill and is not further inherited. It is now used by NX as the Cutter Length.
Do the same for classes TAP and CHUCKING_REAMER. Press Save to file your edits.
69
Explanatory picture
We start by defining a MachiningRule which describes how to drill a straight hole in full material using a twist drill. When creating a new MachiningRule, we have to define the following items:
The More Worked Feature class, describing the shape of the end geometry. The Less Worked Feature class, describing the shape of the starting geometry. The cutting tool class. The operation class describing the machining strategy.
More Worked Feature: a straight through hole corresponds to the feature class
STEP1HOLE.
Less Worked Feature: when starting from full material this corresponds to the
feature class BLANK.
Tool: the twist drill corresponds to the TWIST_DRILL cutting tool class. Operation: the drill motion is defined by the DRILLING strategy. Activity: Create a MachiningRuleLibrary Press the Machining Knowledge tab in the TreeView. Move the mouse over MachiningKnowledge, right-click and choose New...
from the menu.
Check class MachiningRuleLibrary and leave the amount to 1. Press OK to create a new empty library. Rename MachiningRuleLibrary* to TrainingRules.
70
Activity: Create a MachiningRule for Drilling a Step1Hole Move the mouse over node TrainingRules, right-click and choose New... from
the menu.
Check class MachiningRule and leave the amount to 1. Expand TrainingRules by clicking the + sign and select MachiningRule*. Rename MachiningRule* to Drill_STEP1HOLE_Direct.
You now have created this:
Press F8 in the More Worked Features field and select STEP1HOLE from the
list.
71
Click in the Less Worked Features field and enter the class name BLANK .(You
can select from the list as well.)
Press F8 in the Tool field and select TWIST_DRILL in the tool class tree. Set the Priority = 3. Conditions
By creating the MachiningRule, we only defined that you can drill a straight hole with a drill. But we did not yet define any such detail conditions as:
when we want to use this MachiningRule, what size of tool do we want to use, or how deep we want to drill.
Without these conditions, the system will use this operation for any hole independent of size or quality, and will select any drill without regard of the size. In order to create a useful MachiningRule, this information needs to be added. This is done by defining conditions for the MachiningRule. In general, the conditions can be grouped into 4 categories:
(1) Application Criteria describing when the MachiningRule is allowed. (2) Tool attributes describing the details of the tool. (3) Less Worked Feature attributes describing the details of the starting geometry.
The roughnesses that can be achieved: e.g. drilling is only allowed until a certain roughness, otherwise reaming/boring should be used.
The size tolerances that can be achieved: e.g. drilling is only allowed until a certain diameter tolerance, otherwise boring or reaming should be used.
72
The shape of the feature: e.g. drilling with a straight drill will finish the shape
only when there are no chamfers.
The size of the feature: e.g. drilling is only allowed when the feature is not too
deep or too large, otherwise another operation type should be used. Conditions are defined as text in the Conditions tab of the Machining Knowledge Editor. An example of a condition is the following group of lines:
REM This condition checks for the achievable side roughness roughness_value( mwf.SIDE_ROUGHNESS_1 ) >= 1.6 $$$$ Cannot achieve roughness on side surface
Each line in this example has a different function. The first line starting with REM is considered as remark and do not have any effect on the behavior of the program. You can use remarks to include short explanations or observations. It is advised to add remarks so others can understand the behavior of the MachiningRule and the reason for the conditions. There can be several lines of remarks following each other, but each line needs to start with REM . The second line
roughness_value(mwf.SIDE_ROUGHNESS_1) >= 1.6
is the actual condition defining in this case that the SIDE_ROUGHNESS_1 attribute of the mwf (More Worked Feature) should be larger or equal than 1.6. The MachiningRule is allowed if the condition is true. In this example, the MachiningRule will be allowed if the SIDE_ROUGHNESS_1 = 1.6 or larger but will not be allowed if SIDE_ROUGHNESS_1 is smaller. If a condition is false, the whole MachiningRule will be rejected and the system will continue with evaluating the next MachiningRule. The third line starting with $$ defines the message that will be displayed when the previous condition is false. This message is part of the messages that users will see if they want to analyze why a certain solution was found. Therefore these messages should be clear enough for the users to understand why a MachiningRule was not used. Another good example of an application criteria condition is: IT_class_ISO(mwf.DIAMETER_1,mwf.DIAMETER_1_UPPER, mwf.DIAMETER_1_LOWER) >= 10
73
$$ IT class Diameter_1 cannot be achieved. Another good example of an application criteria condition is: mwf.DIAMETER_1 <= 25 $$ Diameter_1 is too big to drill at once
The diameter of the tool should be corresponding to the diameter of the mwf:
e.g. the drill diameter should be smaller than the maximum toleranced size of the mwf diameter but should be larger than the minimum toleranced size.
The tool should be long enough: e.g. the length of the drill should be larger than
the depth of the hole. This corresponds to criteria like:
tool.Diameter >= mwf.DIAMETER_1 + mwf.DIAMETER_1_LOWER tool.Diameter <= mwf.DIAMETER_1 + mwf.DIAMETER_1_UPPER tool.FluteLength > mwf.DEPTH + constant.Thru_Hole_Clearance
The operation should be deep enough: e.g. the depth of the drill motion should
be equal to the depth of the mwf feature, or in case of a through hole should be larger than the depth of the hole.
The tool diameter can be larger than the modeled diameter, as long as it stays
within the tolerance range.
74
oper.Maximum_Depth_Distance = mwf.DEPTH + constant.Thru_Hole_Clearance oper.Through_Clearance = constant.Thru_Hole_Clearance oper.Allow_Oversize_Tool = "true" oper.Oversize_Tool_Percent = 100.0 * mwf.DIAMETER_1_UPPER / mwf.DIAMETER_1
Special remark on Output Load Tool. When you activate this option, the system outputs a LOAD or TURRET command in the CLSF file, even if the tool has not changed. This option can be defined as an operation parameter.
oper.Output_load_tool_Status ="true"
Activity: Define Conditions for Drilling a Step1Hole Click the Conditions Tab of MachiningRule Drill_STEP1HOLE_Direct Create or Copy the conditions from the previous sections into the conditions
area. Add the REM in front of the remarks. You can copy from a PDF document if you choose Tools > Basic > Select in the Adobe Reader.
Move the mouse into the conditions area, click MB3 and choose Check Validity
(selection)
The result should look as depicted above. The lines containing an undefined
Constant are bookmarked.
75
Constants
The only constant used in the Conditions, Thru_Hole_Clearance, should be declared and have a default value. It is good practice to declare a constant on the MachiningRuleLibrary level, so its default value is shared by all MachiningRules in the MachiningRuleLibrary.
Activity: Defining a Constant Select TrainingRules and Press the Constants Tab. Define a new constant, either by clicking MB3 > New in the constant area or by
clicking the New icon.
Define as Name = Thru_Hole_Clearance and as Default Value = 3 mm. Select the inch to mm factor = 25.4. OK in the Options Dialog window. In the Machine/Material matrix, define a value = 4 mm for when the product material is CARBON_STEEL. This overrides the value 3 mm for all machines when the workpiece material is CARBON_STELL. tions and choose Check Validity (selection).
In the tree, select node Drill_STEP1HOLE_Direct, right-click in the Condi There should be no more compiler errors now. Materials and Machines Activity: Select for which Materials and Machines the MachiningRule is valid
Select Drill_STEP1HOLE_Direct and click the Materials tab. Unselect All Materials and select only ALUMINIUM. Click on the Machines tab. Unselect All Machines and mark only some of them. Undo your previous changes by checking All Materials as well as All Machines.
76
Activity: Learn to use the explanation field Click the Explanation tab of rule Drill_STEP1HOLE_Direct Enter a clear textual explanation of this MachiningRule. Be sure it will be
understandable for another person.
Ask your tutor to review your explanation. Activity: Adding an Image file to a MachiningRule
Save the picture on page 70 to a file named Drill_STEP1HOLE_Direct.JPG Click the Image tab From the popup menu select Add Image.... Locate file Drill_STEP1HOLE_Direct.JPG and press OK.
77
Delete all features. Save the model. Activity: Testing the MachiningRule
Before we can test the rule, we must have at least one feature of type step1hole. Since we deleted all features in the previous activity we first have to recognize the features again.
Switch to the Feature Navigator. Start the Find Features... command. Recognize only the STEPS feature
types.
Press the Find Features command icon. A large number of stepped hole features is recognized.
Select all recognized features of type step1hole and execute Create Feature
Process...
Press OK
78
The rule is applied on the step1hole features. Two Feature Geometry Groups were created automatically. One of them contains all the 9.5 mm step1holes.
Note If we had not previously deleted the 9.5 mm drill and the 10 mm drill in
the Machine Tool View, these tools would have been selected since they take precedence over library tools not yet in the part file, and they satify the tool query conditions of our MachiningRule.
Note The default values for _upper and _lower bandwidths of dimensional
parameters like the DIAMETER are in file mach\resource\feature\metric | english\feature_tolerances.xml. Only when PMI is defined you will see deviating values for the diameter_1_upper diameter_1_lower. In cam_sample_fbm_1_mm.prt you can see PMI in the Feature Navigator for feature step1hole_14, among others, as depicted below:
Generate the toolpaths for the operations. Verify the tool path of the operations. Detailing the MachiningRule with Add-ons
In these activities we will further
79
(1)Define the Cycle Type and Parameters This is done by creating an Add-on
to the rule.
(2) Define a Start/End UDE. (3) Define Markers Activity: (1)Define the Cycle Type and Parameters Click the Add-ons Tab Click New Add-on You can choose any
name for the object, like dd in this example.
The Type of the Add-on object is Cycle. Choose the class of Cycle, like Drill_Deep in this example.
80
In the expression area you can enter expressions by typing the name of the object followed by a dot. You get a list of attributes that can be used in your expressions.
In your expressions you can use more worked feature attributes (mwf.) and tool attributes (tool.) to calculate the values of the cycle attributes. Also you can use conditional constructions with IF THEN ELSE. Use of less worked features attributes (lwf.) and operation attributes (oper.) is allowed but this seems not very likely in practice.
81
On a single MachiningRule you can define multiple Cycle Add-on objects as shown below.
The system will create the first Cycle object of which all conditions are True. In this example the criterion is the depth/diameter ratio of 3.
Create a second Add-on named bc with expressions as in screenshot above. Activity: (2) Define a Start/End UDE.
If you define multiple UDEs, the system will create all UDE objects of which all conditions are True. This is different from Cycle type objects where only one object will be created. To create a User Defined Event (UDE) you first create an Add-on object of type UDE_Start_of_Path or UDE_End_of_Path. Choose a name and the class, like ude1 below.
In the expression area you type the name of the Add-on Object followed by a dot. Then you can choose from the list of available attributes.
82
The sequence of the UDEs in the 'Defined list' is the order in the list of Add-ons. UDEs can be moved up and down using the arrow buttons.
Create an Add-on like ude1 with expressions as in screenshots above. Activity: (3) Define Markers
Markers will generally not have any conditions. Markers serve to tell the system where to output an event. For instance, the Tool Change Marker allows you to specify where you want the system to output the tool change event. When you insert this marker into the list of Add-ons, the system writes the commands above the marker to the CLSF before the LOAD or TURRET command, and it writes the commands below the marker to the CLSF after the LOAD or TURRET command.
83
Activity: Copy the first rule and make changes In the TreeView, select Drill_STEP1HOLE_Direct and drag this rule onto its
parent node TrainingRules. Then release MB1.
Select the copied rule and make the following changes: - change OutputFeatures to STEP1POCKET
- change Name to Drill_STEP1POCK_Direct - change the Conditions since the tool should go to the bottom and not thru:
In NX, test the second rule by executing command Create Feature Process... on one or more features of type STEP1POCKET.
84
In addition to the previous example, you learn the basics of in-process geometry by specifying Less Worked Feature attribute values. Tapping a feature will rarely be the only operation. There will usually be a drillling operation before. And we will see that Drill_STEP1POCK_Direct, which we defined earlier, can do that job too. We only need to define the Tapping MachiningRule.
Note The instructions for defining the MachiningRule will be less detailed now. Explanatory picture
Tool attributes
85
Since machine taps are usually standard tools from a catalogue, it is enough we specify just the selection criteria to select the correct tool. Most importantly these are the diameter, pitch and length.
tool.Diameter = mwf.THREAD_MAJOR_DIAMETER tool.Pitch = mwf.THREAD_PITCH
Operation Attributes
REMARK the tapping tool should go as deep as the thread length.
oper.Maximum_Depth_Distance = mwf.THREAD_LENGTH
Constants
We do not make use of a constant parameter in this MachiningRule.
Explanation
Tapping by cutting is done whenever a thread feature has been defined.
Activity: Create rule Tap_STEP1POCKET_THREAD Create the MachiningRule and change the name to
Tap_STEP1POCKET_THREAD.
86
Define the MachiningRule definition components to match the explanatory picture on page 85.
Create or Copy the above conditions into the conditions area. In the Materials tab, select ALLOY STEEL. Provide an Explanation in your own words. Add an Image to the MachiningRule. Create one yourself if you have time. Store the image on page 85 as a JPG and attach it to the rule.
Activity: Test the tapping Rule Save the machining knowledge source file. Test the MachiningRules with Create Feature Process on all features of type STEP1POCKET_THREAD. Check the selected tools and operations Generate Tool Path Verify Tool Path
At this point it is important to understand that Rule Drill_STEP1POCK_Direct is used for machining a feature that is a final manufacturing feature, as well as for an in-process feature. The MachiningRule is the same in both cases. Below you see two different Feature Geometry Groups. In the second group the rule Drill_STEP1POCK_Direct is applied to create the pre-drilled hole.
Note Collisions will be detected during tool path creation because the tools are not
sticking out long enough to avoid the walls in this part. A longer tool must be selected manually to avoid the collisions.
87
88
Explanatory picture
Tool attributes
tool.Diameter >= mwf.DIAMETER_1 + mwf.DIAMETER_1_LOWER tool.Diameter <= mwf.DIAMETER_1 + mwf.DIAMETER_1_UPPER
89
Operation Attributes
oper.Maximum_Depth_Distance = mwf.DEPTH + constant.Thru_Hole_Clearance oper.Through_Clearance = constant.Thru_Hole_Clearance
Constants
We introduced new constants in the Less Worked Feature Attributes conditions above.
Declare constant.ALLOWANCE_REAM_MAX with default value = 2 mm. Similarly, declare constant.ALLOWANCE_REAM_MIN with a default
value = 1 mm. Declare both constants on the TrainingRules library, better than on the reaming rule itself.
Explanation
Enter an explanation text in your own words.
Activity: Reaming a Step1Hole Copy Rule Drill_STEP1HOLE_Direct by dragging it onto its parentMachiningRuleLibrary.
Since Reaming is more expensive than Drilling we should give Reaming a lower
priority. Give this MachiningRule a priority = 1 and verify this is lower than the priority of Drill_STEP1HOLE_Direct.
Work on all Tabs, starting with Conditions, and enter the expressions provided
above.
90
Replace the image and delete the Add-ons (all were copied). When finished, File > Save the library. In NX, test the rules on all step1hole features with Create Feature Process...(First delete all previously generated operations, tools and geometry groups.)
Note you will see that the results are not different from the previous run. In
order to trigger the reaming operation we must tighten the tolerances of a feature. Let us modify the side roughness of one of the step1holes. This is normally done using command PMI > Surface Finish and will then be picked up by the Feature Recognition. Alternatively, we can modify the feature attribute directly like this:
Create Feature Process... on this step1hole. Locate file MSAnalysis.lis on your %TEMP% directory and try to understand
how the reasoning process found a solution for this feature. Observe that MachiningRule Drill_STEP1HOLE_Direct is rejected the first time because it cannot achieve the required surface roughness.
91
Then Ream_STEP1HOLE is the next in the priority list and it is applied. The inprocess geometry is then made by Drill_STEP1HOLE_Direct.
Explanatory picture
Conditions
Starting with a copy of Drill_STEP1HOLE_Direct, only a few conditions need to be changed, these are:
92
Application Criteria
mwf.DIAMETER_1 > 25 $$ Rejected because Diameter_1 is too small
Tool Attributes
No changes.
Note Instead of hard-coded numerical values, you can also use constants here. Operation Attributes
No changes.
Constants
No new constant used here. But if you want you can replace the 0.2 and 0.4 by Constants.
Explanation
Please enter a text in your own words.
93
Hole Milling
The in-process diameter must be within 20% and 40% of the More Worked Feature diameter. For a mwf.DIAMETER_1 = 30 this means: 6 <= lwf.DIAMETER_1 <= 12
Activity: Create a MachiningRule for drilling a big hole Drag Drill_STEP1HOLE_Direct on its parentTrainingRules. This will create a copy.
Rename the copy to Drill_STEP1HOLE_Big. Change the Less Worked Feature to STEP1HOLE. Set the priority to 2 Work on all Tabs, starting with Conditions, and enter the expressions provided above. Replace the Image and delete the Add-ons that were copied. applied or not.
In NX, run Create Feature Process... on the biggest hole and see if this rule is
Hole Milling
What this example intends to explain
The hole with Diameter = 85 is too big for even the largest drill in the standard NX ascii tool database. This calls for a rule that uses an end mill that starts from a predrilled hole.
94
Hole Milling
Explanatory picture
Tool Attributes
tool.Diameter < lwf.DIAMETER_1 tool.FluteLength > mwf.DEPTH + constant.Thru_Hole_Clearance
LWF
lwf.DIAMETER_1 >= mwf.DIAMETER_1*0.5 lwf.DIAMETER_1 <= mwf.DIAMETER_1 - 2.0 lwf.DIAMETER_1_LOWER = -0.2 lwf.DIAMETER_1_UPPER = 0.2
Operation Parameters
oper.Check_Collision = "true" oper.Region_Cut_Method = "Spiral"
95
Thread Milling
oper.Hole_Diameter = mwf.DIAMETER_1 + (mwf.DIAMETER_1_LOWER + mwf.DIAMETER_1_UPPER)/2 oper.Maximum_Depth_Distance = mwf.DEPTH + constant.Thru_Hole_Clearance oper.Predrill_Hole_Diameter = lwf.DIAMETER_1 oper.Cut_Level_Max_Depth = 0
Thread Milling
Thread Milling is new since NX 7.5. There are a few examples in the ootb machining rules using THREAD_MILLING. Note the Add-ons that are mandatory.
Using functions
What this example intends to explain
We will define two MachiningRules: Drill_chamfered_STEP1POCKET for drilling a step1pocket with a chamfer starting from a centerpoint, and Spot_drill for drilling the centerpoint. In addition to the previous examples, you learn to use some functions available in the Machining Knowledge Editor.
96
Using functions
Explanatory picture
We first will define a new MachiningRule Drill_chamfered_STEP1POCK. This rule can be started as copy from the existing Drill_STEP1POCK_Direct. The main changes will be in the less worked feature, which will be changed to a POCKET_ROUND_TAPERED and we will give the rule a higher priority.
Conditions
Starting with a copy of Drill_STEP1POCK_Direct, only a few conditions need to be changed, these are:
Application Criteria
We need to add 2 additional conditions to check for the existance of a top chamfer:
mwf.DEPTH_TOP_CHAMFER > 0 $$ There is no top chamfer defined. mwf.ANGLE_TOP_CHAMFER > 0 $$ Feature has no top chamfer angle.
Tool Attributes
No changes in the copied MachiningRule.
97
Using functions
Operation Attributes
No changes.
Constants
No changes.
Explanation
Please enter a text in your own words.
98
Using functions
Explanatory picture
Next we define a new MachiningRule SpotDrill for drilling the POCKET_ROUND_TAPERED. This requires a new MachiningRule with as more worked feature a POCKET_ROUND_TAPERED feature, a less worked feature BLANK, a tool SPOT_DRILL and an operation class SPOT_DRILLING.
Conditions
All conditions need to be defined since we are not copying an existing rule.
Application Criteria
We will not need any application criteria as the operation should be used whenever there is a POCKET_ROUND_TAPERED.
Tool Attributes
The tool should be large enough for the diameter and have the correct point angle. This is defined with: tool.Diameter > mwf.DIAMETER_1 tool.PointAngle = 2*ATAN(0.5*mwf.DIAMETER_1/mwf.DEPTH)
99
Operation Attributes
No extra conditions, so we will use the template settings.
Constants
No constants needed.
Explanation
Please enter a text in your own words.
Activity: Create MachiningRule for spot drilling Create a new Rule SpotDrill according to the description above. When finished, choose File > Save. Test the rules with Create Feature Process on the threaded pockets around the
large hole.
Activity: Searching MachiningRules with MWF = STEP1HOLE Activate all Rules of your own Library with command Activate Children.
100
Execute Find in all Rule Conditions... Enter something as search string, like DIAMETER_2 and press OK. Verify if the activated Rule(s) have a condition on DIAMETER_2. Activity: Using Find/Replace Replace REM by REMARK and find out that both compile OK.
101
Additional stuff
Additional stuff
What this example intends to explain
This exercise prepares us for knowledge acquisition that is part of each customization project and further elaborated in Machining Knowledge Customization Project on page 195. In case theres still time, create a set of Rules for machining a POCKET_RECTANGULAR_STRAIGHT feature. In general, defining a RuleLibrary requires:
identifying the feature types that should be covered defining possible operation sequences for each feature type defining the decision criteria to select between the sequences defining MachiningRules for each step in the sequence
This analysis always starts by questioning the experts on common work practices. During the process, iterations are often necessary as common work practices contain decision criteria or sequences that are not always clearly and consistently defined (I always do it that way) and sometimes implicitly (Of course, you never use the same tool for roughing and finishing). This normally calls for additional criteria to get the right sequences. The task of the knowledge engineer is to identify possible problem areas and to ask for additional information in these areas. An example of the definition of a set of sequences can be the following (based on the feature type POCKET_RECTANGULAR_STRAIGHT):
Finishing is only necessary if one of the surfaces has a roughness < 6.3 Only the surfaces with a roughness < 6.3 should be finished. This finishing
requires a stock of 0.5 mm.
Bottom and side surfaces can only be finished together if the depth <= 5 mm If roughing requires more than two passes along the side surfaces, then roughing should be split in to two operations: one with the largest possible mill removing the bulk of the material, followed by a second operation removing the remaining material in the corners.
102
Additional stuff
Activity: Create a set of MachiningRules for POCKET_RECTANGULAR_STRAIGHT features (1) Based on the description in the previous section, identify how many MachiningRules are necessary.
Analyze if the data is complete What should a test product look like?
In this specification there are already lots of unspecified items where additional information is necessary, like:
What operation types should be used? Which tool classes should be used? Can the same tool be used for roughing and finishing? If not: what is the difference between a roughing tool and a finishing tool?
Are the specified limits general or specific for a certain material? When only a section of the feature is finished, what is the required distance to
the other surfaces that are not going to be finished in the operation?
When the operation is manufacturing the corners: can the tool diameter be equal
to the corner radius of the feature or should the tool diameter be smaller?
When does roughing require more than two passes? Activity: Create a set of MachiningRules for POCKET_RECTANGULAR_STRAIGHT features (2) Define the MachiningRules. Use OperationClass=CAVITY_MILL for roughing operations and OperationClass=FACE_MILLING_AREA for finishing operations. Use as Resources=END_MILL_NON_INDEXABLE.
103
Additional stuff
104
CHAPTER 5
105
The MachiningRule has the following definition components (see screenshot below):
OutputFeatures: the complete original feature. In this example the hole with chamfers on both sides is recognized as a STEP1HOLE. InputFeatures: the same STEP1HOLE but without a bottom_chamfer. Resources: COUNTER_SINKING tool. Priority: If this rule should be tried first then the priority must be higher than other rules creating a STEP1HOLE. Operation Class: as in picture above. Name is free. However: do stick to your own naming convention scheme. Defining the conditions
The decision when to use this MachiningRule is at first sight simple: there has to be a bottom chamfer, otherwise it is not necessary to chamfer from the back side of the feature. This can be defined with the following Application Criteria conditions: mwf.DEPTH_BOTTOM_CHAMFER_1 > 0 $$ This feature does not have a chamfer on the back side.
106
mwf.ANGLE_BOTTOM_CHAMFER_1 > 0 $$ This feature does not have an angled bottom chamfer. The Less Worked Feature does not have a bottom chamfer because thats whats being machined by this rule. Not having a bottom chamfer is defined by: REM remove the bottom chamfer from the lwf top feature lwf.ANGLE_BOTTOM_CHAMFER_1 = 0 lwf.DEPTH_BOTTOM_CHAMFER_1 = 0 lwf.RADIUS_BOTTOM_CHAMFER_1 = 0 REM the tools diameter must be bigger than the hole diameter: tool.Diameter > mwf.DIAMETER_1 REM the machining direction is in the opposite direction of the feature: oper.Hole_Axis_IJK[1] = mwf.X_ORIENTATION_D oper.Hole_Axis_IJK[2] = mwf.Y_ORIENTATION_D oper.Hole_Axis_IJK[3] = mwf.Z_ORIENTATION_D In some cases (depending on MCS.Tool_Axis_Type) it is necessary to define the operation vector: oper.X_ORIENTATION_D = -mwf.X_ORIENTATION_D oper.Y_ORIENTATION_D = -mwf.Y_ORIENTATION_D oper.Z_ORIENTATION_D = -mwf.Z_ORIENTATION_D
Activity: Creating a MachiningRule for machining the back chamfer of a STEP1HOLE feature Create a MachiningRule with Rule definition components as described above. Use the conditions provided above File > Save when youre ready. Testing the rule
You can design your own model for testing this rule. A simple block with a thru hole that is chamfered on both ends will do. Create a manufacturing setup for this part and perform Find Features...
107
Create an MCS with Tool Axis = All Axes. In case the dialog on the MCS does not show the Tool Axis box, you must use mb3 Object > Customize... on the MCS object and add ToolAxis to the dialog. Alternatively you can create 2 MCSs with opposite directions with Tool Axis = +Z of MCS.
Activity: Test the Rule for chamfering a STEP1HOLE feature with back chamfer Define the necessary MCS objects for the test model, as below.
Run Create Feature Process... In the Location box, choose Geometry = Automatic.
The Automatic allocation to Geometry moves the operations under an MCS if they match the MCS direction. The MCSs are tried in a top-down order. Operations that cannot be moved under the first MCS are subsequently tried under the next MCS etc. Since we have a first MCS where Tool Axis = All Axes we can expect that all operations are allocated there.
Press OK
The result for a feature with top and bottom chamfers looks like this:
108
If we have 2 MCSs with opposite directions with Tool Axis = +Z of MCS, the result looks like this:
109
Enter the Title MACHINE_TWO_SIDED and Value YES fields as shown above
and press Apply or OK.
We introduced a feature attribute MACHINE_TWO_SIDED, type String, with value YES or NO. This attribute and its value were assigned to a model face prior to command Find Features... It can also be added automatically using a Knowledge Fusion function. See Automating 2-sided machining using KF functions on page 114. Another convenient way of adding attributes to model faces and features is by feature tagging. See the NX help and command finder with keyword tag.
110
Activity: Adding an Attribute to the Customization With MyRules.xml loaded in the MKE, choose View > Customization Drill down to STEP1HOLE
111
Save MyRules.xml
112
The lwf features are both of type STEP1HOLE. In the conditions we need to have the following: REM Application Criteria is_defined(mwf.MACHINE_TWO_SIDED) $$ Attribute MACHINE_TWO_SIDED has no value or does not exist on the feature mwf.MACHINE_TWO_SIDED = "YES" $$ Attribute MACHINE_TWO_SIDED exists with value other than YES. REM Less Worked Feature Attributes A few notes apply:
Both STEP1HOLE features need to keep the same diameter as the original. The position of lwf_2 will be at the bottom and its orientation reversed. The depths will be half the original mwf depth. The top chamfer attributes of lwf_2 are the bottom_chamfer attributes of the mwf. another round of splitting.
Both lwf_1 and lwf_2 must get MACHINE_TWO_SIDED = "NO " to prevent
113
Activity: Creating a rule to split a STEP1HOLE Create Split_S1H_into_2S1H. Work out the LWF assignments as outlined above. When in doubt you can import the MachiningRule Split_S1H_into_2S1H
from the machining_knowledge.xml into your source file. (Use the Export/ Import functions)
Activity: Testing a rule to split a STEP1HOLE You can use the same steps as described in Test the Rule for chamfering a
STEP1HOLE feature with back chamfer on page 108 The result for a feature that is split looks like right picture. (With operations generated.)
This function retrieves an ordered list of pairs of MCS names and tool axes.
The tool axis of an MCS is based on the tool axis parameter, if the tool axis
114
parameter is All axes or when the tool axis parameter is not available, like in MCSs of turning or wireEDM, the vector (0,0,0) is returned.
Sample input:
Sample output:
{ {MCS_ALL_AXES,Vector(0,0,0) }, {MCS_SETUP11, Vector(0,0,-1) }, {MCS_SETUP12, Vector(0,0,1)}, {MCS_SETUP2, Vector(0,1,0) }, {MCS_WEDM,Vector(0,0,0) }, {MCS_SPINDLE_TURN,Vector(0,0,0) } ug_fbm_postCreateFeaturesCustomFunction_MachineFeatures FromTwoSides() [ug_cam_samples.dfa]
115
Choose Tools > Knowledge Fusion > DFA Manager and select file
ug_cam_samples.dfa.
116
# First check if the alternative feature direction is available, if not do not split if member( $alt_dir, $tool_axes ) & member( $major_dir, $tool_axes ) then @{ $major_index << Position( $major_dir, $tool_axes ); $alt_index << Position( $alt_dir, $tool_axes ); # Check if the alternative feature direction is before the major feature direction, # if so split the feature otherwise do not split the feature if ( $alt_index < $major_index ) then true else false; } else false; } else false; # Function result printValue( $feat_name + "> Split feature = " + StringValue( $do_split ) ); $do_split; } Boolean;
117
118
For this purpose we can create a DummyOperation with a tool. When there is a drill with a diameter equal to the feature diameter and a length greater than half the feature depth, the rule will set lwf.machine_two_sided to YES. So, the actual splitting of the mwf into 2 lwfs is not done by this rule, it merely sets the lwf attribute which means I can be split up in two.
Use oper.Hole_Axis_IJK[1,2,3] with one MCS with Tool Axis = All Axes. Alternatively set oper.XYZ_ORIENTATION_D = mwf.XYZ_ORIENTATION_D etc. if you use different MCSs for each direction with Tool Axis = +Z of MCS.
119
3.
120
CHAPTER 6
GetEnv is one of them. It does what it says: get the (string type) value of an environment variable.
121
Here's how you would define a function yourself. In this example we will glue a string after a real number, just like the new + operator introduced in NX 8.0.1. The TCL function concat is used for that.
Use the MB3 New command to create a new FunctionLibrary, like MyFunctions.
Note Don't add your own functions to the "System Functions" library to avoid
future conflicts with additional OOTB functions.
In the FunctionLibrary, use the MB3 New command to create a new Function
and change the name to concatNumberString.
Use the MB3 New command to create 2 new FunctionParameters; They will
hold the names and types of the input parameters:
122
You can freely choose the parameter names, like R1 and Str1.
Right click the node Str1 and choose MB3 Attributes select Type = "String"
from the drop-down list.
Right click the node R1 and choose MB3 Attributes select Type = "Double"
from the drop-down list Press A in the attributes window to see All attributes.
Now you see the comment field, which can be used to enter a description of what the function does.
This completes the declaration of the example function. Upon pressing F8 in the Conditions area of a machining rule you now can select the function concatNumberString just like any other function.
When hovering the mouse over the function you see its output type and the number and type of the input parameter(s). Also the comment field value is displayed. Next we will define the function body in the TCL language.
123
Mandatory name must be used for the output parameter. Can be one and only
one of three: [mke_string_result, mke_integer_result, mke_double_result].
Mandatory prefix mke_ for the input parameters. The TCL Proc header and the input parameter declaration are automatically
generated. Only the TCL function body needs to be defined. This concludes the definition of the example function.
Note There is no interference between this MOM_boot{} and the post processor's.
The body of MOM_boot {} is in the TCL language and can be inserted in attribute FunctionLibrary.Initialize. You must do this through editing directly in the attributes window of the User Functions.
Note Do not edit the System Functions library since it will be updated in future
release. Instead, create your own Function Library, like the Sample Functions.
124
The body of MOM__halt {} is in the TCL language and can be inserted in FunctionLibrary.Close. You must do this through editing directly in the attributes window of the Functions Library.
Note Do not edit the System Functions library since it will be updated in future
release. Instead, create your own Function Library. During execution of NX command Create Feature Process..., MOM__boot {} will be generated and output to a temporary file with the same name as the machining knowledge source file, with extension tcl.
125
Screenshot above gives an example of a boot sequence for TCL which initializes the TCOM interface. This file is written to the %Temp% directory. Please note that the this file will be overwritten by each subsequent Create Feature Process... command. Users should only edit their TCL code using the MKE. Do not attempt to change the temporary TCL file.
TCL code
During execution of NX command Create Feature Process..., all TCL functions that are used in rule conditions will be generated and appended to a previously mentioned temporary file with the same name as the machining knowledge source file, with extension tcl. So if your source file is machining_knowledge_short.xml then the generated code of the TCL functions is found in machining_knowledge_short.tcl.
Screenshot above shows the TCL code of the (system) function GetEnv.
126
Save the knowledge source file used by the Create Feature Process command.
In this example we are informed that the input parameter EnvName has value "Place". The output (result) of the function GetEnv is the string with value "Berlin". Therefore the condition will evaluate to TRUE and the rule is used (assuming that all other conditions are also TRUE).
127
Next to GetEnv there are other simple functions implemented in TCL. Their TCL body is a single line of code using internal function AskAttributeValue. The first input parameter for AskAttributeValue is a keyword with value PART_ATTRIBUTE or EXPRESSION or PROGRAM_ROOT. This keyword directs the function to the correct hierarchy in the NX environment. The second input parameter is the name of the attribute or expression we wish to interrogate.
GetPartAttribValue
GetPartAttribValue returns the (string) value of an NX part attribute.
GetExprValue
GetExprValue returns the (string) value of a named expression.
GetProgRootAttribValue
GetProgRootAttribValue returns the (string) value of an attribute in the NC_PROGRAM view.
You can inspect the TCL body of the function in the TCL viewer by selecting the function node. These functions always return a string, also when the requested value is itself an integer or real value. This avoids having to implement 3 duplicate
128
functions for integer, real and string. Please use functions ToReal or ToInteger to do the conversion when required by your application.
1.mke_test.xlsx with a worksheet named OPER; See Image tab of this rule for details. 2. excel_tcl_dll.tcl with content as specified in function AskExcelValue. It must be copied from AskExcelValue body.
129
If all works fine then this operation gets a calculated depth which is the sum of the feature depth and the value '3' from Excel sheet.
Limitations
1.External customer functions can NOT be used in the mapping rule Library (although the functions are shown when you use F8 in the conditions window). 2.Cannot use customer functions on parameters that are not fixed value as in example below:
You will see this message in the TmaRecMethod.log when this happens:
130
Limitations
Script GetRealValue: set real p1: input must be a fixed value (ranges are not supported)
131
132
CHAPTER 7
Feature Recognition Load cam_sample_fbm_2_mm.prt from mach\samples Start Manufacturing if necessary. Use Ctrl_Shift+K or the command icon
workpiece solid model visible. in the Tool Bar to make the
Click on the Machining Feature Navigator icon. In the MFN, right click in the background and choose
( hint: when you double click the icon, you can dock the MFN)
In dialog box Type, select Parametric Recognition. In dialog box Geometry to Search, select Workpiece or All Geometry.
134
Click the Find Features icon in the lower right corner of the dialogue.
The Recognized Features shows 6 features ( 2 of each type that is currently recognized automatically) ..
Click OK to accept the result. In addition to the turning features, you will find a STEP1HOLE that was
already recognized before.
Browse through the new TURNING features one by one. When you select a Feature in the MFN, its faces are highlighted in the selection color. Note: the TURNING_GROOVE_ID faces are inside the model.
135
Operation Selection Hide the model geometry by pressing Ctrl + B and select the body, or use the
Show/Hide command icon in the Tool Bar.
Press Ctrl + Alt + T for an orthogonal view on the Workplane. In the Machining Feature Navigator, select all Features, right click and execute In the Create Feature Process dialog, verify the Type field is set to Rule Based. In the Knowledge Libaries dialog box, select Turning and click OK.
In the Operation Navigatir, switch to Program Order View and move the operation to the Unused Items folder.
Select the Program folder and execute command Generate Tool Path. Verify the Tool Path with 2D Material Removal switched on.
136
Start > Siemens NX 8.x > Manufacturing > Machining Knowledge Editor File > Open. Select machining_knowledge.xml and press Open. Click on the Machining Knowledge Tab Expand Turning library and select rule Rough_Groove_OD.
Click on the tab Add-ons. Select the add-on of type GeometryParent and class CONTAINMENT.
On the right hand side you see the definition of the axial and radial containment, which can be expressed using the parameters of the TURNING_GROOVE_OD feature.
137
This specifies the axial and radial containment limits for the turning operation:
Click on the Conditions tab to inspect the conditions that were defined for Rule
Rough_Groove_OD.
Note that the Non Cutting Moves (NCM) for the turning operation are attributes of the GROOVE_OD operation type.
Choose View > Customization in the menu bar. Expand the customization tree until TurningRough like this:
138
The right-hand side of the customization view displays all attributes for the
TurningRough operations which include GROOVE_OD. Click once on the Display Name column header to sort alphabetically on Display Name.
This field is used to display the path in the OOTB NX user interface dialog for each operation Attribute. It helps the knowledge engineer in finding the NX operation Attribute when the place in NX user interface is known and vice versa.
Close the customization view by clicking the Exit the Machining Knowledge Editor.
Activity: Create a turning rule for a Surface Planar Round In NX, recognize surface_planar_round in
cam_sample_fbm_2_mm.prt. Keep the ones to the right, delete the other two.
create a turning rule in the MKE with the definition components as depicted below:
139
The rule needs a geometry parent of class containment. Add this to the rule:
Key in the expression for the containment following the exammple. Save the knowledge and test on the surface_planar_round feature in NX. Verify the Cut Regions defined by the trim planes:
140
CHAPTER 8
Wire EDM
141
Wire EDM
The recognition rules for these features are identical to those without the WEDM_ prefix. Only the rule priority is lower. Consequently, when for instance both WEDM_RECTANGULAR_STRAIGHT and HOLE_RECTANGULAR_STRAIGHT are selected in the Find Features... dialogue, the latter will be recognized, if found in the geometry. Therefore, if you want to recognize a WEDM feature, make sure you deselect the others.
142
The (only) reason for having special feature types for WEDM is the additional attributes for the start hole as shown below.
The start hole attributes are automatically extracted if a curve with an attribute PDW_WIRE exists in a sketch within the contour of the wedm feature.
The feature can also be created using the Mold Wizard/PDW wizards. Look in command finder for command Start Hole in NX for instructions.
143
Wire EDM
It is currently not a supported workflow to define the PDW_WIRE as the InputFeature of a WEDM operation. It is also not supported to define a STEP1HOLE as the InputFeature. We would need DRILL_GEOM for that which is not yet available as fbm geometry parent.
found with command Find Features... in NX. The recognition mode must be Feature Identification. PDW_WIRE will appear in the list only when such a feature is created as described in the previous paragraph.
Rule Add-on
Rules for WEDM need an Add-on of type Geometry Parent and class WEDM_GEOM. Please inspect the OOTB rules for examples. The start point for the operation as well as a number of other important parameters get their values on the Add-on. See screenshot below for details.
144
In MyRules.xml, create a MachiningRuleLibrary for WEDM rules Create or copy the rule where mwf = magenta. The rule definition components are.
145
Wire EDM
146
CHAPTER 9
Feature Mapping
Feature Mapping is a powerful capability enabling us to transform features immediately after the NX command Find Features and before they appear in the Machining Feature Navigator. Feature Mapping is treated in this tutorial since mapping rules are created with the MKE, very similar to machining rules.
147
Feature Mapping
By mapping recognized features to customer specific UDF features. So existing automatic process selection can be applied to components that were
not designed using customer specific UDF features.
Example
The below picture illuminates how a SCREW_CLR_COUNTER_BORE_HOLE
(identified feature) can be mapped to a STEP2HOLE (parametric feature) and vice versa. Not only the type of the feature is changed by the Mapping Rule, also most of the parameter values can be deduced. Sometimes parameter values are identical so they can simply be copied.
148
Example
Mapping Rules are defined with the Machining Knowledge Editor (MKE) very similar to machining rules.
The Conditions of the mapping rule define how the parameters of the features map
on each other.
Note a mapping rule always has operation class DummyOperation and has no
Resource.
Note the mapping rule library does not need a build since it is directly interpreted
by NX.
149
Feature Mapping
When DEPTH_LIMIT does not exists or it has no value or its value is not one of the three mentioned above, there is a rule to map to a POCKET feature. The mapping rule to a pocket feature has a slightly lower priority.
Activity: Feature Identification not followed by feature mapping Load the testmodel.prt and delete all operations and features. Execute Find Features... on the testmodel
150
In the Type box, select Feature Identification. In Features to Identify, select the 3 check boxes as in screenshot above. Press the Find Features command icon. The resulting features in the MFN:
Note The source column of Identified features is CAD. Activity: Feature Identification followed by feature mapping Load the test_model.prt and delete all operations and features. Execute Find Features... on the testmodel. Switch On Map Features
151
Feature Mapping
In the following exercise you will create a mapping rule from simple_hole to step1hole. Estimated 30 minutes.
Conditions
REM Application Criteria: there are none in this example. REM Tool Attributes: there are none since mapping rules have no tool. REM Less Worked Feature attributes: just copy the attributes: lwf.DIAMETER_1 = mwf.DIAMETER lwf.DIAMETER_1_LOWER = constant.LWF_DIAM_LO lwf.DIAMETER_1_UPPER = constant.LWF_DIAM_UP lwf.DEPTH_LOWER = constant.LWF_DEPTH_LO
152
Identification or Recognition
lwf.DEPTH_UPPER = constant.LWF_DEPTH_UP lwf.SIDE_ROUGHNESS_1 = constant.achievable_Roughness_DRILL_Upper_str REM Operation Attributes: there are none.
Activity: Transformation of classes using a DummyOperation Create a MachiningRule with MWF SIMPLE_HOLE, LWF STEP1HOLE, OperationClass DummyOperation Enter the Conditions as presented under Conditions on page 152. Work on all Tabs and when finished save the xml source file. Execute Find Features and identify a feature SIMPLE_HOLE. Verify that the SIMPLE_HOLE is mapped to a STEP1HOLE.
With Feature Mapping you can do a lot of powerful things like:
Transform legacy feature types like SIMPLE_HOLE into STEP1HOLE. Transform STEP1HOLE into feature types like SIMPLE_HOLE. Interpret user-attributes for tolerance information and translate them into
explicit numerical tolerance values.
Identification or Recognition
Feature Identification Re-uses the design features Type and Attributes The model faces are retrieved from the design feature.
Strength:
Directly re-use information from the Design model No loss of information No need for recognition
Weakness:
153
Feature Mapping
Requires that Designers model with machining features only A machining feature must REMOVE material (a rib can not be machined) Works only for models designed in NX Does not work together with Synchronous Modeling Design features often dont really define correctly what needs to be machined.
You work predominantly with in-house designed parts and the parts have been modeled using UDFs and your company is not yet using PMI You work with MW and/or PDW
Feature Recognition Performs geometrical search against a library of known feature types to find
features and their faces
Performs attribute extraction per feature type. Recognition is not trivial and can not guarantee 100% perfect results, sometimes
due to feature intersections. The way to go when Feature Identification is not applicable.
154
CHAPTER 10
Feature Teaching
155
When a specific geometric shape (a feature type) occurs frequently in your companys products and...
you can clearly define the sequence of operations to machine this feature type.
A feature type can be recognized by one or more recognition rules. All parametric feature types that come out of the box with your NX installation have at least one recognition rule. These rules cannot be changed by the user. What you can do is to create new (additional) features types and/or create new (additional) recognition rules. The possiblities are summarized in the table below.
New Recognition Rule New Feature Type Existing Feature Type Use case 1 Use case 2 Modify Recognition Rule Use case 3
Use case 1: Create a new feature type and a new recognition rule. Use case 2: Create a new recognition rule for an existing feature type Use case 3: Modify an existing recognition rule for existing feature type
156
Add a tolerance to the dimension PMI to indicate that you want to recognize a toleranced parameter.
Since NX 8.5 the Teach Features command supports the following additional PMI dimension types which reference feature geometry:
An inferred length dimension between a plane and a straight edge. An angle dimension between a plane and a straight edge. A dimension to the centerline of a cylindrical face.
157
The Find Features... command now recognizes the length and angle dimension tolerances that correspond to the annotation PMI Also annotated PMI Surface Finish is used to define the MKE feature customization. The Title attribute is used to determine the feature attribute name
Use case 1: Create a new feature type and a new recognition rule
Please refer to the NX CAM technical documentation for details.
Use case 2: Create a new recognition rule for an existing feature type
Please refer to the NX CAM technical documentation for details.
158
Use case 3: Modify an existing recognition rule for existing feature type
Please refer to the NX CAM technical documentation for details.
This will unlock the possibility to show and edit the generated Feature Recognition Rules source code for the features that were taught. (Not for the standard features.)
159
160
CHAPTER 11
161
162
Operation Teaching
CHAPTER 12
163
how a feature is declared, how to define a recognition rule and how to use these in NX Feature Based Machining. Exercise: Declaring a new "Color&Attribute" Feature Type
Start > Siemens NX 8.x > Manufacturing > Machining Knowledge Editor File > Open Select MyRules.xml or otherwise machining_knowledge.xml and press Open. Choose View > Customization Expand Features > CustomerFeature, right click and choose Add Class
164
Note you can add a new class anywhere in the tree, CustomerFeature is just an
example.
In the Add Class dialog, enter Name = MAGENTA and press OK.
165
Right click in the attributes area (right part of the screen) and choose Add to
add an extra attribute to the feature class. Give it any name you like, and choose the rest of the fields as shown in this example:
Click OK when ready. Add another attribute names Height, choose type = double as shown below.
166
Press the Save icon Dismiss the Customization view window by clicking the
corner of the screen. This concludes the declaration of a new feature type. in the upper right
Defining a Recognition Rule for the new Feature Type Click on the Feature Recognition Tab Create a new Library node by right clicking node Recognition and choose
New
Create a new ColorAndAttributeRecognitionRule under the new library. Rename the ColorAndAttributeRecognitionRule* to MyMagentaFeature. (You
are free to choose any name.)
167
In the Definition Block, select the previously declared Feature class MAGENTA
from the drop down list.
In the Face grouping block, leave Face grouping at Connected faces. This
means that the faces of a recognized feature of type MAGENTA must be connected.
In the Surface types block, check Plane, Cone and Cylinder. This means that the
faces of a recognized feature of type MAGENTA must be of one of these Surface types.
168
In the Edge types block, mark all connection types. This means that all connection types are allowed. (This is only meaningful when option 'Connected faces' was chosen previously, which we did.)
This condition means that each face belonging to the feature must have display color = 181.
Note The value (=181 in this case) corresponds to an RGB value set and a color
name as defined in the Color Definition File used by the Part.
Right click in the header area or hit the Insert key to add a second condition.
169
This condition means that each face belonging to the feature must have a Face Attribute named MY_LOGICAL_ATTRIB having value = "true".
Note If a face has no such attribute or it has but its value is not "true" then it will
not be in the recognized feature's face list.
Start NX Load cam_sample_fbm_3_inch.prt from MACH\samples\. Start Manufacturing if necessary. Open the feature navigator Right-click and choose Find Features In the Type box, choose Parametric Recognition In the Geometry to Search box, choose All Geometry In the Features to Recognize window, check MAGENTA Press Find Features icon. Press OK and select the recognized feature. Note that MY_LOGICAL_ATTRIB is one of the feature's attributes. Also note that one of the cavity's faces is not part of the feature: when you select the feature, this face is not highlighted in the selection color.
170
Select this face, right click for the Properties and you see why: Change the value of MY_LOGICAL_ATTRIB to true. Delete feature MAGENTA_1. Right-click and choose Find Features Verify that the recognized feature has al faces of the cavity.
Approve the feature using the right mb. Machining Direction of C&A Features
The direction of C&A features is chosen arbitrarily. In many cases this will result in a wrong direction. We can manually adjust the direction by supplying the correct values for the depth orientation vector, as done in screenshot below:
171
Exercise: Create a Machining Rule for a Color and Attribute Feature Launch Machining Knowledge Editor if necessary and open the xml source file. Create a new Rule under the RuleLibrary Further specify the Rule as per this suggestion:
Choose a tool with a Diameter that is small enough to machine the corners:
172
Cut Levels
Use of Cut levels in not limited to Color and Attribute features. Cut Levels can be defined as Rule Add-ons for certain operation types. The following notes appy:
The top of Range 1 is automatically determined based on the selected geometry. Range definition is always Measured From Top Level. The sequence of Add-ons of class ZLevelRange is not important. Exercise: Define Cut Levels Select rule Mill_Magenta and click the Add-ons tab. Create Add-ons of class ZlevelBase and ZLevelRange according to examples
below:
173
174
CHAPTER 13
Customization View
175
Customization view
Customization view
The customization defines which classes are available and which attributes can be used. Once a RuleLibrary is loaded, the customization can be viewed by selecting View > Customization from the main menu.
This opens the customization view consisting of a tree view on the left listing the classes. On the right hand side you find an attribute view listing all attributes of the selected class, and a relation which shows the relations of the selected class with other objects in the customization. In the relation view, for instance, we find that all operations under HoleMaking have a 1:1 relation with the Cycle object which you can find back under the NXObjects node. The tree views contains:
Features, Operations and Tools classes. For the Operation classes, field Container Type holds the name of the operation template where the class is defined.
176
Customization View
Customization view
The attributes view shows, for each attribute in the selected class:
Attribute: the name of the attribute as it is used in the MKE. Display Name: the path to the parameter in the NX Operation Dialogue. It helps
to find the purpose of the operation parameters. When you hoover the mouse over an Operation Parameter in a condition, the Type and the Display Name is shown. For instance see the Maximum_Depth_Distance attribute below:
Type: the type of the attribute Enum Type: the type of enumerated defining the allowed values of the attribute. Activity: Customization view Open the Customization view and explore the customization. Default Customization
In directory MACH\machining_knowledge_editor\data there is one single system file containing the base customization of the knowledge library.
customization_base.xml
Customization View
177
Customization view
This file should not be modified as it will be replaced during NX software updates. This file can be read into the MKE just like a machining knowledge source file. This file contains the customization that is not depending on your CAM configuration.
178
Customization View
Customization view
LIBRARY_TOOL (the tool library) LIBRARY_MACHINE (the machine library) LIBRARY_PART_MATERIAL (materials library) USER_DEFINED_EVENTS (ude.cdl)
Operation Types
The TEMPLATE_OPERATION entry defines which template parts will be available and hence which operation types. If an operation type is used in more than one of the template parts, then the definition in the last template part will be used, in order of appearance in the .opt file.
Features
When you generate or update the customization with the Machining Knowledge Editor, the feature customization is built up from the following parts:
The parametric feature types which can be recognized by command Find Features.
Any additional customer defined feature for which a recognition rule exists in
the Recognition Rule Library.
The UDF library (User Defined Features). Feature_definitions.def for legacy feature recognition. Feature_identification.def. Additional Customization
Your company's specific additions can be added interactively. Typical additions to the customization are:
Customization View
179
Customization view
On each node in the Features branch in the Customization View you can can click MB3 and use commands to Add, Remove and Edit a feature class.
NX Version upgrades
With each NX version, improvements and extensions to customization_base.xml can be expected. The knowledge library customization can be updated by checking active the Update Upon Load in the View > Options. Then reload the machining_knowledge xml source.
Activity: Understanding the customization files Trace back the files mentioned in feature_machining.dat in the
UGII_CAM_CONFIG_DIR. Open them in NotePad and read their contents.
180
Customization View
Customization view
These commands are only enabled for Single Double fields. The commands on an empty field (row) or on the header will remove the value
from this class. If a value is defined on the base class then that will be used.
Customization View
181
Customization view
182
Customization View
CHAPTER 14
183
Configuration
With the Machining Knowledge Editor in managed mode we have the xml source file stored in Teamcenter. The only thing we notice when working in managed mode is the different User Interface when we Load or Save the xml source file. You will see a Teamcenter dialogue instead of the usual Windows Explorer. Normally you will only work in managed mode when also NX is used in managed mode. To startup NX in TCIN mode, change the shortcut in your startmenu to something like this (with username/password = user1/user1): C:\Program Files\UGS\NX 8.5\UGII\ugraf.exe" -pim=yes u=user1 -p=user1 Please refer to the NX documentation for additional configuration requirements.
Configuration
Both NX and the MKE make use of the same configuration file referenced by environment variable UGII_CAM_CONFIG. The defaults for full native mode are in cam_general.dat. For full TCIN mode this is cam_part_planner_mrl.dat.
184
Configuration
How to configure the Machining Knowledge Editor when working with TCIN is described in the NX Documentation under Manufacturing > Feature-based Machining and then follow the path as depicted below.
Native as in cam_general.dat
TEMPLATE_ OPERATION MACHINING_ KNOWLEDGE
${UGII_CAM_TEMPLATE_SET_DIR} cam_general.opt ${UGII_CAM_MACHINING_ KNOWLEDGE_DIR} machining_knowledge.dat
TCIN
${UGII_CAM_TEMPLATE_SET_DIR} cam_teamcenter_general.opt
as in cam_part_planner_library.d
${UGII_CAM_MACHINING_KNOWLEDG DIR}machining_knowledge_part_planner.dat
185
Configuration
With command Load/Save Local in the Machining Knowledge Editor all combinations in the above table are possible. The only remaining limitations as of NX 6.0.3 are:
In Teamcenter Integration your Parts are always managed by Teamcenter. Part materials are always in native NX.
As of NX 8.5 we have a new configuration possibility:
You can work in native mode and retrieve only you cutting tools from the MRL
when using cam configuration cam_native_rm_library.dat.
186
customization uses the Description (CD) attribute of the machine to classify the MachineTools. In order to see a Machine Tool in the MKE customization, you must, in Teamcenter Classification, enter a class name (of choice) in the Description field. Then Open and Update... or File > New... in the MKE.
187
If Item machining_knowledge is not present you can either create it manually or use the MKE like this:
1. 2. 3. 4. 5. 6.
Start Machining Knowledge Editor Choose View > Options. "Use Teamcenter Integration" must be marked and 2tier or 4-tier parameters must be supplied, see useful links above for details. Restart Machining Knowledge Editor if you had to change the View options in previous step (2). Choose File > Open and Update... Press Load Local Select machining_knowledge_tc.xml (from directory mach/resource/ machining_knowledge).
Choose File > Save As Enter machining_knowledge in the Number field and press OK.
188
This will create a new Item, Item Revision and Data set as depicted in screenshot below.
10.
189
Teamcenter Preferences
In NX, File > New uses PAX files pointing to Setup templates. PAX files also include a section with TypeTemplates (these are Operation templates, not Setup templates.) When multiple versions of the operation template co-exist in Teamcenter, the version is indicated by a postfixed number. NX will use the template which belongs to its version if the template is named in a PAX file that is referred to by a special Teamcenter Preference. There is one Teamcenter preference for each NX release, e.g. TC_NX_FileNewPAXFiles_NX85 for NX8.5.x release etc. These preferences will not be shipped with Teamcenter, but the Teamcenter administrator has to create them. The preference value is an array of strings of PAX file item_id or item_id<separator>revision_id. If the preference is set, the PAX files are retrieved from Teamcenter at the start of the NX session using the preference Values. The Preferences in Teamcenter are accessed via Edit > Options... and the Index tab.
190
If the preference is not set, the PAX files in native NX will be used.
The value of the preference is an Item which has a Dataset attached. This dataset contains the PAX file.
191
If the Teamcenter Preference is set and we Open and Update... in the MKE or we create a new source with File > New... in the MKE, then the TypeTemplates from the PAX file are NOT used to update / create the customization. MKE does not work in master model mode and will not use the PAX file. Instead it uses the .opt file which lists the template parts. To ensure that the MKE customization uses the correct version of the template parts in Teamcenter, you must modify the template set file in your native file system and add the NX version post-fix. See the screenshot of a modified cam_teamcenter_general.opt.
192
%UGII_BASE_DIR%\MACH\resource\template_part\english\ %UGII_BASE_DIR%\MACH\resource\template_part\metric\
The item_id of an imported template will be the name of the template suffixed with _inch_NX? or _metric_NX?, where ? is the release version of the NX. For example, the metric template MillTurn_Express.prt in NX6 will be imported into Teamcenter with item_id equal to MillTurn_Express_metric_NX6. The script tcin_cam_template_setup.bat is located in folder %UGII_BASE_DIR%\UGII\ templates\sample\. The script can be executed as follows on a cmd prompt: %UGII_BASE_DIR%\UGII\templates\sample\ tcin_cam_template_setup u=<username> -p=<password>
193
194
CHAPTER 15
This chapter describes the OOTB content, the tasks commonly found in a customization project and the milestones to be reached. In the context of this tutorial, the term Customization is used to describe a universe of
195
OOTB content
OOTB content
The ootb rule content is shipped with each major release of NX. It is continuously improved based on feedback from the field. Please visit the FBM site and pull the latest Content Kit from there: https://myc2005.ugs.com/marketing/partmfg/nxfbm/default.aspx The ootb rule content is captured in the following source file:
MACH\resource\machining_knowledge\machining_knowledge.xml
You can easily view the ootb rule content outside the Machining Knowledge Editor application with:
machining_knowledge.chm
The ootb rule content is based on this template part (only the unit system is different):
MACH\resource\template_part\metric\machining_knowledge.prt MACH\resource\template_part\english\machining_knowledge.prt
196
was taken from the Machining Knowledge Editor. The names of these constants are always something like Achievable....
Roughing operations like Drill can be applied when these 2 conditions are both true:
IT_class_ISO(mwf.DIAMETER_1,mwf.DIAMETER_1_UPPER, mwf.DIAMETER_1_LOWER) >= constant.Achievable_IT_Class_DRILL_Lower roughness_value(mwf.SIDE_ROUGHNESS_1) >= constant.Achievable_Roughness_DRILL_Lower
Finishing operations like Ream and Bore can be applied when either the roughness or the diameter tolerance is in the achievable interval for reaming and boring.
197
The expressions have a form like this and are found in the conditions of all finishing rules in the library:
IT_class_ISO(mwf.DIAMETER_1,mwf.DIAMETER_1_UPPER, mwf.DIAMETER_1_LOWER) >= constant.Achievable_IT_Class_REAM_Lower AND ( roughness_value(mwf.SIDE_ROUGHNESS_1) >= constant.Achievable_Roughness_REAM_Lower AND roughness_value(mwf.SIDE_ROUGHNESS_1) <= constant.Achievable_Roughness_REAM_Upper ) OR roughness_value(mwf.SIDE_ROUGHNESS_1) >= constant.Achievable_Roughness_REAM_Lower AND ( IT_class_ISO(mwf.DIAMETER_1,mwf.DIAMETER_1_UPPER, mwf.DIAMETER_1_LOWER) >= constant.Achievable_IT_Class_REAM_Lower AND IT_class_ISO(mwf.DIAMETER_1,mwf.DIAMETER_1_UPPER, mwf.DIAMETER_1_LOWER) <= constant.Achievable_IT_Class_REAM_Upper )
Note Since NX 6.0.3 the roughness condition and IT class condition are logically
OR. That implies that only one of them needs to be TRUE and the rule will be applied. It was a design choice not to restrict possible application of Rules too much. You may want to be more strict by changing the Roughness condition and the IT_class condition to be logically AND.
Exercise: Find conditions on the PMI in the rules. Select a rule, for instance Drill_Up_S1H Press the Conditions Tab Find the section as depicted here
198
All this information can be captured into a single table from which we can derive the required tool, given a combination of IT-class and Surface Roughness. We made the assumption that Drilling is cheaper than Boring which is cheaper than Reaming. When in this table we read D,B,R the preferred solution is using a Drill, when that is not available, try a Boring bar and when that is not available look for a suitable Reamer.
TABLE 1. Operation
(Tool) selection in order of priority for combinations of IT grade and Surface Roughness
IT IT IT IT IT IT IT IT IT IT IT 5 6 7 8 9 10 11 12 13 14 16 R R R B R R B R R B R R B R R B R R D B R D B D D R D B R D B D D R D B R D B D D R D B R D B D D R D B R D B D D
Roughness Ra 0.4 m (16 in) 0.8 (32) or 1.6 (63) or 3.2 (125) 6.3 (250) or 12.5 (500) 25 (1000) 50(2000)
R R R
B R B R B R
B R B R B R
B R B R B R
B R B R B R
B R B R B R
Exercise: Understanding the tolerance threshold values Lookup the Achievable... constants in the Machining Knowledge Editor. What is the only tool that can machine a feature with a diameter tolerance =
IT5?
For which combinations of IT-class and surface roughness, all tools (Drill,
Bore, Ream) could be used?
199
You do not have User Defined Features or your UDFs can easily be mapped on
the standard parametric feature types.
You use the standard tool library that comes with NX or Teamcenter. Your processes are relatively simple and you are quite satisfied with the results
that are generated ootb. When is it better to start from scratch.
Your company has defined its own best practices or is planning to do so. You think your processes are very different from what is supplied ootb. You do not want to invest in understanding the ootb content.
Milestone: List of Operation Sequences for all selected features. Milestone: A list with all tool types Milestone: Implemented Rule Library
200
The parametric feature types which can be recognized by command Find Features.
201
Exercise: Creating a Manufacturing Rule for the new UDF Create a new rule with Output Feature = MY_UDF.
try them on your selected features. explore them in the Machining Knowledge Editor. explore them in the generated documentation which is obtained with MKE command Write Documentation.
202
In fact that is more than likely. Analyze your operation sequences. For every feature type all possible operation sequences should be described. Although there is no single best way of doing this, it helps to use forms like Sequence Form: Step2Hole on page 132. This allows for a common sequence description. Important is to identify why this sequence is chosen and not one of the other possible sequences, and if this sequence will change based on material or available resources. It is necessary to check if the decision criteria are based on feature attributes or on other factors. In the last case, it can be worth to add additional attributes to the features, which allow the user to define the choice, and to add tagging for these feature attributes to the system. A next step in the analysis of your operation sequences is to create a table as in the example below. It lists all sequences identified in the previous step and enables you to identify common steps within the sequences.
203
Horizontally you have the produced features. These are the ones obtained from the first milestone. And directly below you have a column for each anticipated sequence of operations that will finally produce that feature.
204
The first column holds the individual operations, sorted by the feature it produces, which can be an in-process feature. The matrix is then filled by numbers which define the exact order in which the operations are performed. Note, for instance, that sequence nr 3 which produces a STEP1HOLE is defined as: Spot_Drill Drill_in_center_S1P Gun_Drill_S1H [Chamfer_S1H_Drill, Chamfer_S1H_Mill] (one of the two) The following step is to describe the separate operations in more detail. An example could be as in Step2hole operation on page 133. With all this information available, you must decide which operation sequences need to be implemented. It could be that some operation sequences are exotic and it is not worth to implement them. Milestone: List of Operation Sequences for all selected features. This should detail which operation sequences must be implemented.
How to add tools that are not standard. When you need tool classes that are not standard you must add the tool class
and then update the customization (only once). This is done automatically with MKE option Update upon Load.
205
Implement Knowledge
When adding a new tool class, tell NX which attribute is to be interpreted as the
Cutter Diameter and Cutter Length. This is done with MB3 commands in the customization view.
When you need tools of existing classes with dimensions that are not in the standard database you only need to add that tool to the library population.
Implement Knowledge
This section is just a collection of a few notes. But its the bulk of the project. In general, it is worth to consider, that the users always will need to define some operations manually. To speed up the process and assist the users, customized templates will be used for operations that are created frequently. It is wise to use these templates also in the knowledge definition. This results in uniformity between manually and automatically generated operations. To use a customized operation template (like a customized Drilling) in the MKE it must be in a part file that is referenced by the configuration. This configuration must be chosen when loading the xml source file with option Update upon Load = on (only once). It is important to understand that other changes to the default software configuration can help in the success of the implementation. Examples are:
Adding tagging data for features, which help the user to force the generation of
certain sequences.
Adding default Program Order Groups, which help in generating an initial program sequence that will work without the user having to move operations.
206
Maintain Knowledge
Maintain Knowledge
Of course the manufacturing knowledge should be kept up-to-date. As best practices change also the knowledge should change accordingly. Regularly the knowledge should be checked against:
How many manual changes need to be made before the operations generate correctly?
So called PostCreate functions. These functions allow you to do extra things after the standard FBM commands. ug_fbm_postCreateFeaturesCustomFunction() (e.g. add or change feature attributes)
Use the MKE to assign dynamic KF operation parameters. You can use the MKE to assign KF operation parameters for the 4 KF enabled operation types (Hole Making, Hole Milling, Face Milling and Cavity Milling only). This is done in the Add-Ons tab of the MKE. As an example, you can assign a KF function that determines the feed rate: k.Feed_Cut = "my_kf_feedrate_function();". Instead of using a fix value, NX will evaluate your KF function after every
207
change in the operation. This example allows you to automatically use a different feed rate when the user modifies the depth of cut.
208
CHAPTER 16
Appendices
209
A: Glossary of Terms
A: Glossary of Terms Machining Rule: Captures 'best practices', describes the relation between manufacturing features, operations and tools. Often abbreviated to Rule.
Knowledge Engineer: Superuser who is able to modify the machining knowledge in the Machining Knowledge Source.
OOTB is abbreviated OutOfTheBox which means you get this with your NX
installation.
HOLE features have no bottom, and can generally be reached from 2 sides. POCKET features have a bottom and can be machined from one side only. STEP1,2,3,4,5,6 features describe a single feature with a number of diameters. STEP3POCKET for instance is a blind hole with 3 diameters where the 1st diameter is larger than the 2nd and the 2nd diameter is larger than the 3rd.
STEP3HOLE1 is a hole with 3 diameters where the 3rd is larger than the 2nd.
210
STEP4HOLE1 is a hole with 4 diameters where the 4th is larger than the 3rd.
STEP5HOLE2 is a hole with 5 diameters where the 4th is larger than the 3rd
and the 5th is larger than the 4th.
Picture above shows the most general constitution of a STEP2HOLE. For features with more STEPPED levels, section STP with elements 4,5,6,7 is repeated. Each added cylinder will get a higher index number.
211
Picture below show the parameters of the most general constitution of a STEP2HOLE.
212
Picture below shows constituent faces and parameters of the most general form of a STEP2POCKET.
213
214
TABLE 1. Feature Types occurrence Feature Type name GROOVE_ INS_ RAD_ RECT Notes
215
TABLE 1. Feature Types occurrence Feature Type name POCKET_ OBROUND_ STRAIGHT Notes
216
TABLE 1. Feature Types occurrence Feature Type name SIDE_ NOTCH_ ROUND_ CONCAVE_2 Notes
SLOT_ 90_DEGREE
SLOT_ DOVE_TAIL
217
TABLE 1. Feature Types occurrence Feature Type name SLOT_ OBROUND_1 Notes
SLOT_ OBROUND_2
218
TABLE 1. Feature Types occurrence Feature Type name SLOT_ RECTANGULAR_1 Notes
SLOT_ RECTANGULAR_2
SLOT_ RECTANGULAR_3
SLOT_ ROUND_1
SLOT_ ROUND_2
SLOT_ T_SHAPED
219
TABLE 1. Feature Types occurrence Feature Type name SLOT_ UPSIDE_DOWN_ DOVE_TAIL Notes
SLOT_ U_SHAPED_1
SLOT_ U_SHAPED_2
SLOT_ V_SHAPED
220
TABLE 1. Feature Types occurrence Feature Type name SURFACE_ PLANAR Notes Any flat surface, not necessarily rectangular.
221
222
mwf.MACHINING_RULE = "BORE" Consequently, the boring rules will be rejected when the Tapping rule was applied before. (Of course the operation sequence in time is the reverse.) This condition is not causing conflicts when the drilling operation should be the first operation. This is because the attribute MACHINING_RULE is normally not defined for recognized features so it will not exist on the feature or it will exist but without a value. In both cases the condition on MACHINING_RULE will not block the MachiningRule. An exception would be if a face attribute MACHINING_RULE were defined on the model with a certain value. In that case the feature recognition will define the attribute on the recognized feature and as a consequence the conditions containing the mwf.MACHINING_RULE must be true otherwise the MachiningRule will be blocked. This way, you can use face attributes to force the sequence of operations.
223