A Feature Based Parametric Design Program and Expert System for Design

In this study, a feature based parametric design program including manufacturing features which are used in machining of prismatic parts by chip removal methods has been developed. Prismatic parts modelled in the feature based system can be modified parametrically by the developed parametric design module. To modify the part model parametrically enables feature based modelling process to be flexible and easy In the developed program. the features which are added to the models prepared by a feature based design program are evaluated by the expert system module and They are used in part modelling after determining of their compatibilty according to the rules. The aim of this study is to model the manufacturing features such as a pocket, slot and hole that are used in machining operations by adding to prismatic parts, to enable the modification of the part model parametrically and to warn, inform and guide the user for design and manufacturing mistakes. The system has been developed in AutoCAD using AutoLISP language.

Several definations for feature has been made so far.Henderson has defined a feature as an operation type constructed by adjacent faces; Hummel defined as dimensions of some area of a part.According to Hirschtick a feature is a geometric shape which is used in computer aided design (CAD).Luby described a feature as a section of a part which has some manufacturing spesifications [1].Features are designed regarding to their application areas such as shape features, manufacturing features, assemly features and geometric features [2][3][4][5].Product modelling can be specified as a combination methodology to determine and to define production information for different design and manufacturing purposes.Features are widely used for product modelling [6].They play an important role for integrating CAD to CAM.Therefore, they include both design and manufacturing information.Other CAD simple elements such as line, circle, arc, primitives, etc. do not have manufacturing information [7,8].Several approaches have been developed for the definition of features from geometrical elements, namely interactive feature definition, feature recognition and feature based design.Interactive feature definition approach is used in process planning systems for feature information input [9].User can define features with geometric elements specially developed for the system.There is no link with CAD systems.If the system can receive part information from a CAD system and does not include feature definitions within the data base then a feature recognition system is required to exract features from low level information in the CAD data base.In order to recognise features the following method are used [10]: • Semantic pattern recognition, • Situation change diagrams and automat, • Seperating approach, • Expert system approach, • CSG (Constructive Solid Geometry) approach, • Graph based approach.
Feature recognition systems have some problems with complex parts.It takes a lot of time to develop these systems.In order to eliminate feature recognition systems, feature based design systems have been developed [11][12][13][14].Feature based design includes geometry, topology, part model, feature information, dimension, tolerances, material, etc. [15,16].Features can be defined in the data base expilicitely and feature information can be retrieved easily from the data base.[12] developed a feature based system comprising a feature based modelling shell and feature shell map.The feature modelling shell provides necessary facilities to establish the product data base including feature information.Solid models of features are saved as product volumes.

Shah and Rogers
There are three main approaches regarding parametric design namely constructive, numerical and knowledge based approach [18][19][20][21].Constructive approach [18,[22][23][24] uses construction sequence of design.This approach compares geometric facts, rules and operations of a design model and performs geometric construction in a determined sequence.Even though use of design sequence information speeds design modifications this approach may have some problems with conventional CAD drawings.Furthermore, it forces the designer to follow a specific design order.Construction and the formulas used within the system are changed in numerical approach [25][26][27][28].Then equations are solved by the Newton Raphson numerical method.Because the first prototype model must suit to the construction until the process completed, first value must have given correctly.The system can produce wrong solutions.Knowledge based approach [29][30][31][32] uses rules including geometric and other necessary information and draws conclusions.Knowledge base is composed of facts and rules regarding design and modelling.Quian focused on one feature and developed a program for defining feature based part models.Both numeric and limit recognition approach are used to obtain constraints between features.Combination of feature level and limit primitives were used for feature operations, parametric part model and improving feature models [33].
Expert system approach which is one of the application areas of artificial intelligence provides some advantages.These systems can be used in the fields requiring expertise knowledge.Problems are solved by these systems without an expert or with little help of an expert.It has been determined that expert systems increase productivty and quality and reduce cost [34][35][36][37].Feature based parametric design has been used to solve modelling problems or to speed modelling in design applications.
However, programs used in the market do not include expert knowledge regarding design and manufacture and the design of part models is restricted to the knowledge of the user, which are the disadvantages of these programs.If the program warned the designer for manufacturing mistakes and guided him with some advises, it would prevent him from doing wrong designs.With this rearch work, these problems were tried to be solved.This work includes prismatic part features which can be obtained by machining.In the program both outer and inner features were developed and were applied to prismatic parts.Most feature based CAD programs include features as through hole, blind hole, counterbored hole etc.But they do not have other manufacturing features such as T slot, V slot, dovetail slot, angled slot, etc.Furthermore, the designer is not warned when the design a part model that can not be manufactured.In this work, a program comprising manufacturing features and warning the user when he does wrong design has been developed.The features modelled can be edited parametrically which provides easier and more flexible modelling.Thus, part models can be completed quicker.

THE DEVELOPED PROGRAM
The main structure of the system is given in figure 1. the designer starts part modelling through the use of the features library.The form features desired are selected from the menu and applied to the prismatic basic model.During form feature modelling, the expert system checks the modelling procedure and warns the designer if wrong modelling accurs according to the rules within the knowledge base.During the use of features with the expert system module it is checked whether features extend beyond the part model and features intersect each other.If a feature extends out of the limits of the part or intersects with another feature, the user is warned and asked whether he wants to continue the process or not.Furthermore, the expert system compares the dimensions of the feature and cutting tool dimensions and determines if the feature can be machined with a standard cutting tool.If the feature can not be machined with a standard tool then the user is warned.After modelling the part and features they are saved in the data base in a special format.
The features were defined through the use of AutoLISP and added to the AutoCAD menus.In the feature based module the spectrum was tried to be as large as possible and 34 inner and outer features were defined.After selecting a feature from the features menu (Figure 2 a-b), the designer enters size and location of the feature and can model the feature easily in the part model.

Modelling of features
In order to model a feature, the feature desired is selected from the features menu.The user selects the face in which the feature is to be located.Having determining the face vector the UCS (User Coordinate System) is moved on the face in which the feature is to be located.The user can enter coordinates or can select the location with the mouse (Figure 3a).Then the program locates the feature in the desired position and substracts from the part model (Figure 3b).

Parametric Design Module
Two methods of parametric design are used within the system.In the first method, ("Parametric edit 1") after making parametric changes of the feature, the feature is deleted and the feature having new parametric data is modelled.In "Parametric edit 2", the user can delete or remodel the feature.When parametric edit 1 is selected, the fratures of the model are freed.After making necessary modifications through the dialogue window, the program deletes the feature selected last and locates the new feature whose parametric data has been entered.
When "parametric edit 2" is selected the features are also freed.Figure 4a shows freed T slot located on a prismatic part.Then selected objects are substracted from the model.Having been entered new values (Figure 4b) the feature is remodelled in the part as its dimensions have changed (Figure 4c).

Expert System Module
1106 rules were defined within the expert system knowledge base.The rules were constructed on the basis of feature-part relation, intersection of features, manufacturing difficulties, diameter and depth of holes relations.If some part of the feature stays outside of the part model and there is a feature intersecting another one, the user is warned and asked whether he wants to continue the process.Rules in the knowledge base are used for this purpose.The user is also warned if he models a feature that is diffucult to manufacture by common machining operations.Rules in the knowledge base were constructed in production rule (IF-THEN) format."IF" part includes condition clauses and "THEN" part is composed of result sentences.Figure 5 shows a sample rule from the knowledge base.The inference engine uses forward chaining method when evaluating rules.When seeking a solution, the inference engine finds a rule and evaluates the conditions.If the conditions are satisfied then the result sentence is taken as a solution otherwise it seeks another rule within the knowledge base.
Figure 5.A rule for a through hole

Feature -Part Relation
When the expert system module is run, the face and edge information of the surface embedding features is extracted.The coordinates of the faces and edges are retrieved.Limits of the features (hole, slot, pocket, etc.) are determined.It is checked whether maxsimum and minimum points of the features are passed the limits of the face processed.The program finds related rules and checks if their condition sentences are satisfied or not by forward chaining.Should the conditions be satisfied, a warning message regarding the wrong process appears on the screen.The user can delete this feature or can accept and add it to the model.The face in which the feature to be located is selected.Selecting the desired feature from the features menu, the dimensions of the feature are entered.The UCS icon is located automatically on the face selected and the feature is modelled in the desired location.If another feature is to be modelled and it extends beyond the part limits the user is warned (Figure 6a).When the user chose "modify", the program delete the feature and returns to three feature window to allow the user to enter new values.Having been entered new dimensions and locating place, the feature is added to the part model (Figure 6b).If "accept modelling" is selected, the feature is modelled even though some part of it stays outside of the part model limits (Figure 6c).

Intersection of Features
In this part of the program it is checked whether the feature to be modelled intersects with other features by using the related rules within the knowledge base.If there is intersection between features, the program warns the user, otherwise it continues its normal procedures.If the feature modelled intersects one of other features a warning message appears on the screen (Figure 7a).When "accept this design" alternative is selected, the feature is replaced in the part as intersecting with other feature (Figure 7b).If "modify" is chosen, the feature is deleted from the part.The programs returns to the feature dialog window.Having done necessary modifications, new feature is modelled and located in the part.

Difficulty of Manufacturing
"Closed slot", "closed step", "pocket" and "closed pocket" features within the system are difficult to manufacture and they are required expensive machining processes.If the user wants to model one of these features, the program warns the user that machining of this feature is difficult and expensive and it can be manufactured by elektro discharge machining etc. (Figure 8a).The user can accept and model this feature (Figure 9b), or reject the feature.

Diameter and Depth Checking
Cutting tool sizes which are used to obtain "through hole", "closed slot type 2", "slot" and "diagonal slot" features were used within the expert system module.Standart cutting tools are used for modelling"through hole" feature.These tools can be obtained easily from manufacturers.Having run the related rules, the expert system warns the user if it decides that this hole can not be obtained with standart tools (Figure 9a, b) a) b) Figure 9. a) Slot feature data dialog window, b) Warning the user When "accept the design" alternative is selected, although the feature can not be machined with standard tools, it is modelled in the part.If "modify the feature" is accepted, the new sizes of the feature are entered and located in the part.

CONCLUSIONS
Obtaining manufacturing information from CAD solid models contributes to the integration of CAD and CAM.In general extracting manufacturing information from CAD data base is not adequate, since current CAD systems do not provide all manufacturing and process planning data.Part model should include not only geometric and topological information but also technological information namely fetures, surface roughness, hardness, etc. for CAM systems.
In this work, based on expert system techniques, a feature based, parametric computer aided design program has been developed.With this work, the features used in manufacturing were modelled parametrically and collected in a library.Thus using these readily available features, part models can be modelled easier and faster.Having defined manufacturing features in the library they were applied to prismatic part models.These features can be located in any face of a prismatic part.Using the feature based design module, the parts can be manufactured by machining are modelled easily.Thus, the user does not have to use primitive geometric elements to model features, which is time consuming.The parametric design module allows to modify features parametrically used in the part model.During or after part modelling, sizes of the features can be changed.Parametric modifications of the model provides easy modelling and flexibility.During modelling, when a wrong design in terms of manufacturing and geometry is made, the user is warned.Thity four inner and outer features were defined within the system.These features can be designed parametrically entering the necessary information.Part model and feature information is saved into the data base in a special format which was developed for the system.This format provides direct feature information.Thus manufacturing information can be extracted without complex feature recognation procedures by CAPP systems.
The following features can be added to the system; • By applying the system logic to rotational parts, a feature based system for cylindrical parts can be developed, • Expert system techniques can be applied to rotational parts, • After modelling, CNC codes can be generated for the part model, • The model can be represented in a CAD praphics standart, such as STEP, IGES, etc.

Figure 1 .
Figure 1.The overall structure of the system developed ) Moving UCS icon, b) Locating the feature a) Freeing the feature, b) Changing the feature values, c) The feature after modification a) Warning message, b) Adding a hole feature, c) Adding the hole feature exceeding the parts limits a) Warning message, b) Feature applied in the part a) Warning message, b) Application of the closed slot feature