Since the beginning of my graduate research, I have been deeply engaged in the field of computer-aided engineering for casting processes. The traditional method of casting process design has long relied on empirical experience, leading to long development cycles, frequent design modifications, and a lack of scientific rigor. To address these challenges, the integration of computer technology into casting process design has become a critical trend. In this dissertation, I present my work on developing a sand casting process CAD system specifically for shaft-type parts, built on the Pro/Engineer platform. The primary goal is to automate the design of casting processes, reduce the occurrence of sand casting defects, and improve overall production efficiency.
1. Introduction and Background
The casting industry is a cornerstone of modern manufacturing. However, compared to other processing methods, casting has historically suffered from high scrap rates and difficulty in predicting sand casting defects such as shrinkage, porosity, and sand inclusion. With the rapid advancement of computer technology, casting CAE (Computer-Aided Engineering) has matured significantly. The use of numerical simulation allows engineers to predict sand casting defects before actual pouring, thereby optimizing process design. In my research, I focused on the front-end of casting CAE—the casting process CAD system—which is essential for generating the three-dimensional model of the casting with gating and riser systems. By developing a dedicated CAD system, we can streamline the design process and minimize sand casting defects through better process control.
The system I developed is based on the secondary development of Pro/Engineer, a leading parametric 3D CAD software. The choice of Pro/Engineer was driven by its strong parametric design capabilities, modular architecture, and the availability of a comprehensive application programming interface, Pro/TOOLKIT. In addition, I selected C and Visual C++ 6.0 as the programming languages, which provide robust support for Windows-based applications and database integration. This thesis describes the complete development process, from the selection of the development platform to the implementation of specific functional modules for shaft parts.
2. Selection of Development Platform and Programming Language
When selecting a commercial CAD software for secondary development, several factors must be considered, such as system functionality, performance-price ratio, hardware compatibility, openness, reliability, and the capability for customization. I evaluated several popular CAD systems, including AutoCAD, UG, CATIA, I-DEAS, SolidWorks, and Pro/Engineer. The table below summarizes the key features of these systems from the perspective of secondary development for casting process design.
| Software | Primary Strengths | Weaknesses for Casting CAD | Secondary Development Support |
|---|---|---|---|
| AutoCAD | Excellent 2D drawing, widely used, low cost | Weak 3D solid modeling and parameterization | AutoLISP, ADS, ObjectARX |
| UG (Unigraphics) | Powerful 3D modeling, strong CAM capabilities | Complex to learn, high price | Open API (C/C++) |
| CATIA | Excellent surface modeling, integrated CAD/CAM/CAE | Very high cost, mainly for aerospace | CAA, Automation |
| I-DEAS | Excellent simulation capabilities | Less common in casting industry | Open Architecture |
| SolidWorks | Easy to learn, good 3D solid modeling | Limited CAE modules | SolidWorks API |
| Pro/Engineer | Parametric feature-based design, full associativity, built-in CAE | Steep learning curve for beginners | Pro/TOOLKIT (C), J-Link, Automation GATEWAY |
After comparing these options, I decided to use Pro/Engineer 2001 as the secondary development platform. This version offers a comprehensive Pro/TOOLKIT package that allows deep integration with C programs. Moreover, our research group had already performed preliminary work on connecting Pro/Engineer with ProCAST, making it a seamless choice for subsequent CAE analysis. For the programming language, I chose C and Visual C++ 6.0 due to their powerful visualization capabilities, rich MFC (Microsoft Foundation Classes) libraries, and excellent database access support through DAO and ODBC. With Visual C++ 6.0, I could rapidly develop user-friendly dialogs and database modules directly integrated into Pro/Engineer.
3. Secondary Development of Pro/Engineer using Pro/TOOLKIT
Pro/TOOLKIT is the official C language application programming interface (API) provided by PTC for customizing Pro/Engineer. It allows developers to create applications that run seamlessly within the Pro/Engineer environment, accessing the Pro/Engineer database and performing actions such as creating features, building menus, and handling user interactions. The fundamental concepts in Pro/TOOLKIT are objects and actions. Each function in Pro/TOOLKIT follows the naming convention of “Pro” + object name + action name. For example, ProMdlRetrieve() retrieves a model object into memory.
There are two primary modes of running a Pro/TOOLKIT application: synchronous and asynchronous. In the synchronous mode, the application is loaded and executed directly by Pro/Engineer, which ensures high communication efficiency. The synchronous mode can further be divided into two sub-modes: the dynamic-link library (DLL) mode and the multi-process mode. In the DLL mode, the application is compiled into a DLL file that is loaded by Pro/Engineer at startup. In the multi-process mode, the application is compiled into an executable file that runs as a separate process but communicates with Pro/Engineer through a remote procedure call. For development, I used the multi-process mode because it allows me to debug the application in Visual C++ without restarting Pro/Engineer each time. For final release, the DLL mode is preferred because it offers faster execution and tighter integration.
The typical steps for developing a Pro/TOOLKIT application include:
- Writing the C source code, including the mandatory initialization function
user_initialize()and termination functionuser_terminate(). - Creating resource files (menu files, message files) that define the user interface and text localization.
- Modifying the makefile to include the necessary Pro/TOOLKIT libraries and header file paths.
- Compiling the application using Visual C++ 6.0 or the command-line
nmakeutility. - Registering the compiled application with Pro/Engineer through a
protk.datregistration file.
In my development, I adopted a method to generate a Pro/TOOLKIT framework using Visual C++ 6.0 IDE. Although there are several approaches, the most practical one involves creating a regular DLL project that uses shared MFC libraries. This approach allows direct access to all MFC classes, which greatly simplifies the development of dialog boxes and database connections. After setting up the project, I added the necessary Pro/TOOLKIT library files (such as protk_dll.lib, protoolkit.lib, and prodev_dll.lib) and specified the include directories for the header files. The following figure shows the interface between Pro/Engineer and the external MFC application through a DLL-based approach.

The development of the system menu is a critical part of the user interface. I created a set of menu resource files and C code to add a new top-level menu named “Casting Process CAD” to the Pro/Engineer part mode menu bar. The menu structure is shown in Table 1.
| Level 1 | Level 2 | Level 3 |
|---|---|---|
| Casting Process CAD | Part Type | Shaft, Wheel, Plate, etc. |
| Casting Type | Sand Casting, Metal Mold Casting, Investment Casting | |
| Casting Module (specific to part type) | Material Definition | |
| Parting Surface | ||
| Process Parameters (shrinkage, machining allowance, draft angle, fillet radius) | ||
| Riser System | ||
| Gating System |
The menu resource files are available in two formats: .mnu (for complete menus) and .aux (for adding items to existing menus). The syntax consists of three-line groups for each menu button. The first line is the button name (with spaces replaced by #), optionally followed by the displayed name for localization. The second line contains the online help text. The third line provides alternative help text, which also enables localization. The following example shows the content of a Part.aux file that adds a button to the existing part menu:
PART
#
#
Casting_CAD 铸造工艺CAD
Check the current part status
#
#
In the C code, I registered the menu and auxiliary files using functions such as ProMenuFileRegister() and ProMenuAuxfileRegister(), and then set the action for the newly created button using ProMenubuttonActionSet(). This mechanism allows users to click the “Casting_CAD” button in the part menu to launch the casting process CAD module.
4. Overall Architecture of the System
The shaft part sand casting process CAD system comprises three major components: 3D solid modeling, casting process CAD, and casting CAE integration. The 3D solid modeling is performed directly in Pro/Engineer by the user. The casting process CAD module, which I developed, is the core of the system. It guides the user through the entire process design workflow, from material selection and parting surface definition to the calculation of process parameters and the generation of gating and riser systems. The casting CAE component (not fully implemented in this thesis) could be integrated with commercial simulation software to verify the design and predict sand casting defects.
The system architecture is illustrated in the following diagram (not shown here, but described in text). The workflow begins with the user creating or importing a 3D model. Then, the casting process CAD module is invoked, which the user navigates through a series of dialogs and database lookups. Finally, the completed model with gating and riser systems can be exported for numerical simulation.
In my design, the casting process CAD module for shaft parts is divided into five sub-modules: material setting, parting surface, process parameters, riser system, and gating system. Each sub-module is supported by a comprehensive database that stores empirical data from foundry handbooks and practical experience. This database management system allows users to query, add, modify, and delete records, thereby facilitating quick design iterations and reducing the risk of sand casting defects.
5. Database Development using DAO and MFC Dialogs
The design of casting process parameters relies heavily on empirical data. To make this data easily accessible within Pro/Engineer, I developed a static database using Microsoft Access 2000 and accessed it through DAO (Data Access Objects). The database contains tables for materials, machining allowances, shrinkage allowances, standard riser dimensions, gating dimensions, and other parameters. To create a user-friendly interface, I used MFC dialog boxes that are called from Pro/Engineer through a dynamic link library (DLL) mechanism. The communication between Pro/Engineer and MFC dialogs is implemented using a spawn approach, as illustrated in Figure 4.
The database was initially created in Access 2000 format. For compatibility with older DAO versions, I converted the database to an earlier Access version using the “Database Utilities” in Access. The conversion process was straightforward: Tools → Database Utilities → Convert Database → To Early Access Database Version. This step ensured that the DAO classes in Visual C++ 6.0 could seamlessly open and manipulate the database.
In Visual C++ 6.0, the MFC library provides wrapper classes for DAO, such as CDaoDatabase, CDaoRecordset, and CDaoTableDef. These classes simplify tasks like opening a database, executing queries, and modifying records. To call an MFC dialog from Pro/Engineer, I created a regular DLL project with shared MFC DLL settings. This DLL exports a function that creates and displays the dialog. The Pro/TOOLKIT application (an executable in development mode) calls this exported function. This approach allows direct reuse of MFC’s rich user interface controls and database integration capabilities.
The database module includes several practical features. For example, when designing a gating system, the user can query the recommended pouring time and sprue dimensions based on the steel weight and pouring velocity. The system also provides a database of steel rise speeds in the mold cavity to ensure that the filling rate is neither too fast (causing turbulence and gas entrapment) nor too slow (leading to surface defects and machining difficulties). These empirical values directly influence the occurrence of sand casting defects such as cold shuts and sand burn-on.
6. Implementation of the Shaft Casting Process CAD Module
To demonstrate the practical use of the system, I applied it to a crankshaft casting made of ZG270-500. The crankshaft has a maximum diameter of Φ1270 mm and a length of 1720.85 mm, with three large throws. The solid model was created in Pro/Engineer using standard modeling techniques. Then, the casting process design was performed using the developed system. The key steps are described below.
6.1 Material and Unit Setting
Before starting the design, I set the material to ZG270-500 and defined its physical and mechanical properties. In Pro/Engineer, the Setup → Material command allows users to define material name, density, and other properties. I also ensured that the unit system was set to metric (mm, kg, s). This step is crucial for accurate calculations later. The proper selection of material directly influences the shrinkage allowance and the risk of sand casting defects like hot tearing.
6.2 Parting Surface Definition
The parting surface is a critical element that affects the positioning of the casting, the design of the gating system, and the ease of shakeout. In my system, the parting surface can be created using Pro/Engineer’s datum plane or cross-section commands. For the crankshaft, I inserted a datum plane (DTM1) as the parting surface and created a cross-section for visualization. A well-chosen parting surface minimizes the number of cores and reduces mismatches, thereby reducing sand casting defects due to flashing or mold shift.
6.3 Process Parameters
The process parameter module allows the designer to add shrinkage allowance, machining allowance, draft angle, and casting fillets. These parameters are stored in the database and can be queried according to the casting material and dimensions. For steel castings, the machining allowance typically varies with the size and complexity of the part. The system provides a dialog where the user can input the casting dimensions and automatically retrieve the recommended allowances from the database. The shrinkage rate is set using Pro/Engineer’s Shrinkage function, while the draft angle and fillets are applied using the Chamfer and Round features. Applying the correct draft angle and fillet radius is essential to avoid sand casting defects like tear and distortion during cooling.
6.4 Gating System Design
The gating system was designed using the “steel rise speed” calculation method. This method determines the optimal pouring time based on the weight of the casting and the desired rise speed of the molten steel in the mold cavity. The system provides a database of minimum rise speeds for different casting sections. For the crankshaft, I selected a sprue with a diameter that gives an appropriate pouring rate. The calculation process is as follows:
First, the total weight of steel including the gating system is estimated. Let \( G \) be the total steel weight (kg), \( N \) the number of ladles, \( n \) the number of sprues per ladle, and \( V \) the pouring velocity (kg/s). The pouring time \( t \) can be expressed as:
$$ t = \frac{G}{N \cdot n \cdot V} $$
The system recommends typical values of \( V \) based on the sprue diameter. A table of sprue diameters versus average pouring velocities is provided in the database. For example, a sprue diameter of 60 mm might yield a velocity of 500 kg/s. Using the estimated weight, I calculated the pouring time and then verified that the resulting steel rise speed \( v_L \) in the mold cavity meets the minimum requirement:
$$ v_L = \frac{C}{t} $$
where \( C \) is the height of the casting in the pouring position (mm). If the calculated rise speed is too low, the system warns the user to adjust the sprue diameter or number of sprues. This iterative approach helps prevent sand casting defects such as cold laps and incomplete filling.
The cross-sectional areas of the gating system components are then determined. The system uses the ratio method: for steel castings, a common ratio is \( F_{\text{sprue}} : F_{\text{runner}} : F_{\text{ingate}} = 1 : 1.1 : 1.2 \). The user can choose the type and dimensions of each component from the database. The final gating system design for the crankshaft included a total ingate area calculated to ensure proper filling without excessive turbulence.
6.5 Riser System Design
The riser system was designed using the modulus method. The modulus of a casting section is defined as the ratio of its volume to its cooling surface area. To avoid sand casting defects like shrinkage porosity, the modulus of the riser must be greater than that of the section it feeds. In my system, I first calculated the modulus of the hot spots on the crankshaft. The system provides calculators for simple geometric bodies such as plates, cylinders, and spheres. For the crankshaft, the hot spots at the throws were approximated as equivalent cylinders. The modulus \( M \) is calculated as:
$$ M = \frac{V}{A} $$
where \( V \) is the volume and \( A \) is the cooling surface area. For a cylinder of diameter \( D \) and length \( L \), the modulus is given by:
$$ M = \frac{D}{4} \quad \text{(for an infinitely long cylinder)} $$
or more accurately by the formula for a finite cylinder. After calculating the modulus of the hot spot, I multiplied it by a safety factor \( f \) to obtain the required riser modulus:
$$ M_{\text{riser}} = f \cdot M_{\text{casting}} $$
Typical values of \( f \) are 1.2 for side risers and 1.35 for blind risers. The system includes a database of standard risers with their dimensions and maximum feeding capacity. For the crankshaft, the calculated riser modulus was \( M_{\text{riser}} = 12.02 \) cm. From the standard riser table, I selected a riser with \( M = 11.96 \) cm and a maximum feeding weight of 4340 kg, which was sufficient for the casting weight of 4338 kg. The riser weight was 2100 kg each. I placed two risers on the two large throws where the hot spots were located. The final assembly of gating and riser systems is shown in the solid model (not displayed here but represented in the system).
The following table summarizes the key design parameters for the crankshaft example.
| Parameter | Value | Remarks |
|---|---|---|
| Material | ZG270-500 | Density ~7.8 g/cm³ |
| Total weight (casting + gating) | ~4338 kg | Estimated |
| Sprue diameter | 60 mm | Average pouring velocity 500 kg/s |
| Pouring time | ~14.5 s | Calculated from G/(N·n·V) |
| Rise speed | ~35 mm/s | Meets minimum requirement |
| Riser modulus | 11.96 cm | Selected from database |
| Riser weight (each) | 2100 kg | Two risers on large throws |
| Gating ratio | 1 : 1.1 : 1.2 | Sprue : Runner : Ingate |
Using the designed gating and riser systems, I calculated the casting yield (the ratio of casting weight to total poured weight) and found it to be approximately 60%, which is a good indicator of an optimized process. The system successfully guided the design to minimize sand casting defects by ensuring adequate feeding and controlled filling.
7. Experimental Verification and Discussion
To validate the effectiveness of the developed system, I compared the designed process with a traditional manual approach. The system significantly reduced the design time from several days to a few hours, primarily because the database lookups and calculations are automated. Moreover, the system enforces logical consistency by linking each design step to relevant empirical data, which helps eliminate errors that often occur in manual calculations. The use of sand casting defects prediction modules (though not fully integrated into the CAD system) is intended to further improve the design quality. In this context, the CAD system serves as a preprocessor for CAE simulation, allowing the designer to modify the gating and riser design based on simulation results. This close coupling between CAD and CAE is essential for effective defect prevention.
In addition, the system’s menu and dialog structure are modeled after the conventional casting process design flow, making it intuitive for foundry engineers. The database is easily extensible; users can add their own process data based on their specific production conditions. This flexibility ensures that the system remains useful in various foundry environments and contributes to the reduction of sand casting defects across different casting geometries.
8. Conclusion and Future Work
In this thesis, I have successfully developed a sand casting process CAD system for shaft parts using the Pro/TOOLKIT secondary development technology of Pro/Engineer. The system includes a complete menu structure, database support, and functional modules for material definition, parting surface selection, process parameter setting, gating system design, and riser system design. The developed system was applied to a crankshaft casting, demonstrating its practical viability and efficiency in reducing design time and minimizing sand casting defects.
Several lines of future work are identified. First, the integration of the CAD system with a comprehensive CAE solver (such as ProCAST or MAGMA) should be strengthened to provide real-time feedback on potential sand casting defects. Second, the system should be extended to include more complex part types and casting methods, such as investment casting and die casting. Third, the database should be expanded to cover more alloys and process variations. Finally, the implementation of a more user-friendly interface with additional wizards could further reduce the learning curve for designers.
In conclusion, the developed casting process CAD system represents a significant step towards the digitalization of casting design. By leveraging the power of Pro/Engineer and the flexibility of C/VC++ programming, the system offers a practical solution for reducing sand casting defects and improving the overall quality and efficiency of casting production.
