Design Automation of Metal Scrap Balers by integration of SolidWorks with Excel and VisualBASIC Language

— In this study, a procedure to automate the design of metal scrap balers is presented. Balers with different sizes can easily and quickly be designed by the procedure. The solid model of a prototype baler is created in SolidWorks. The frame is considered in this work and it is modeled in SolidWorks as the assembly of parts. Each part is modeled as multibody part modeling by using the graphical user interface (GUI). The details such as holes and welding grooves are not considered in the analysis model. The initial prototype model is designed depending on the experience. After the initial analysis, iterative work is necessary to obtain the final design by making changes in the design. A method is presented for quick and easy iteration work. The method uses the computer program developed in VisualBASIC in this study. The dimensions subject to change for each part is recorded to an Excel file. The program reads the dimensions to be changed and automatically makes the changes in SolidWorks model by using the commands of the application programming interface (API). The procedure is applied to design two models of balers with different technical specifications.


I. INTRODUCTION
Steel production from scrap materials reduces emissions and uses less energy. It saves costs and provides a sustainable solution for the environment and industry. The demand for scrap bailing machines with different technical specifications increases worldwide continuously [1]. Global competitive world enforces industries to design optimized products and to launch them to market in a short time. Design process in product development uses 80 % of time in general [2]. Computer aided design (CAD) programs are used, but new approaches are necessary to reduce design time. Parametric modeling and design automation are used for this purpose [3].
Li et al. [1] presented design of heavy duty hydraulic scrap bailing press. They discussed structure, hydraulic system and electrical control system of the press. Kadam and Nimbalkar [2] explored parametric modeling and applied it to reduction type gearbox using the software Creo (Pro/Engineer). Thakkar and Pattel [3] integrated Pro/Engineer, Excel and C language for parametric modeling. Shah [4] integrated Autodesk Inventor with Microsoft Excel Spreadsheet for creation of 3D modeling and conventional 2D drafting. They applied the procedure to flange couplings. Prabaharan and Amarnath [5] used ANSYS Workbench for the structural optimization of a scrap bailing press and a hydraulic press. They obtained 26.26 percent and 24.54 percent cost reduction for the fabrication of the scrap bailing press, and the hydraulic press, respectively.
A procedure for the design automation by the integration of SolidWorks [7], Excel [8], and VisualBASIC [9] programs is presented in this work. The procedure was applied to the design of commercial scrap balers produced by AYMAS.

A. Metal scrap baler
The production model of the first prototype system (HP-350) is shown in Fig. 1 (a). The analysis model of the frame is shown in Fig. 1 (b). There are three steps in the process of scrap bailing: Step 1: Top compression cylinders press the top lid and sizes the scrap to the chamber dimensions (350 cm x 60 cm x 250 cm).
Step 2: Front compression cylinders press the scrap to the dimensions of 350 cm x 60 cm x 60 cm.
Step 3: The side compression cylinder applies 300 bar and the scrap bale with a size of Lb x 60 cm x 60 xm is produced.
The cracking pressures are 300 bar for Step 1 and 2. The rigidity of the scrap determines the pressures in these steps. The pressure is fixed as 300 bar for Step 3, and the rigidity of the scrap determines Lb in this step.

B. Flow chart of design procedure
The flow chart of the procedure introduced in this work to is shown in Fig. 2. First, the parts (bottom, left, right, front, back) are modeled in SolidWorks by using graphical user interface (GUI). The details such as holes and welding grooves are not considered in the analysis model. Sketches are drawn, boss and cutextrude operations are applied for modeling the parts. Each sketch has dimensions. The dimensions can be classified as independent dimensions and related dimensions. Related dimensions can be defined by using GUI. Equations can also be used to define dependent variables. Extrusions are not merged to obtain multi-body models of the parts. The frame assembly is constituted by defining mates by using GUI. The initial dimensions are given by experience. An Excel file is created where the geometrical values under consideration for the parametric design of the frame are defined.
The iterative process starts with the finite element analysis of the frame. The modal analysis and static analysis are performed. The rigidity of the frame is evaluated by the results of the modal analysis. The strength and deformation of the frame are evaluated by the results of the static analysis. If the results are not satisfactory, the geometrical values are redefined in the Excel file. A computer program developed in this work in VisualBASIC reads the changed geometrical values from the Excel file and automatically modifies the SolidWorks model by using the SolidWorks Application Programming Interface (API). The finite element analysis, evaluation of the results, editing the Excel file, modifying the SolidWorks model loop continues until the satisfactory results are obtained. The production model is created from the final analysis model.

III. APPLICATION OF PROCEDURE
A. Modeling Excel file contains 7 sheets titled as "param", "bottomp", "backp", "frontp", "leftp","rightp", and "shaftp". Here, Sheet-"backp", for example, indicates that there is a SolidWorks file titled as "backp.SLDPRT" where the back part has been modeled by GUI as explained in Section IA. Sheet-"param" includes the list of the part file names and the common dimensions which are used by several parts. Sheet-"backp", for example, includes the information about the model of the back part. Example data is given below: Here, for example, "Sketch11" has a dimension "D2" with a value of 862.5. It has been extruded named as "Boss-Extrude-11". The extrusion value is normally given in Cell-D17 (Row 17, Column D), which is empty for this example because the extrusion value is related to other dimensions defined in SolidWorks. The extrusion value for "Boss-Extrude-1" is 30. The values given in Column-D is used to modify the model if the text in Column-A or Column B is "a". The text "s" stands for that the modification is not requested. The text "0" stands for that the modification is not applicable. The values of Column-D can be changed if the text in Column-A is not empty. The values of Column-D are dependent if the text in Column-B is not empty, and the values are assigned by Excel formulas. The formula for Cell-D4, for example, is "=param!F1", and the value is assigned from Cell-F1 of Sheet-"param" as 3540.

VisualBASIC program (Modifying program), uses Microsoft
Office Excel Library and SolidWorks library by adding the references to the VisualBASIC project. The libraries can be used by the following commands: dim swapp as object, veri as object swapp = GetObject(, "sldworks.application") Set veri = CreateObject("excel.application") All the modifications are performed automatically in SolidWorks by using "for… next" loops in the modifying program by reading the data from the Excel file. The value at Cell-D19 in Sheet-"backp", for example, is used to change the dimension D2 in Sketch11 in the SolidWorks file by the following commands: veri.worksheets("backp").Select … cc = dnumc + "@" + sketchc + "@" + fl bs = part.Extension.SelectByID2(cc, "DIMENSION", 0, 0, 0, False, 0, Nothing, 0) Set myDimension = part.Parameter(cc) myDimension.SystemValue = dv / 100 where the text in Cell-F3 (D2), the text in Cell-E17 (Sketch11), the text "backp" and the value in Cell-D19 (862.5) are assigned to the variables dnumc, sketchc, fl and dv in the "for…next loop" in the program, respectively.
The value at Cell-D3 in Sheet-"backp", for example, is used to change the extrusion value for Boss-Extrude-1 in the SolidWorks file by the following commands: Set swFeat = part.FeatureByName(bossc) Set swExtrudeFeatData = swFeat.GetDefinition swExtrudeFeatData.SetDepth True, dv / 1000 swFeat.ModifyDefinition swExtrudeFeatData, part, Nothing where the text in Cell-F3 (Boss-Extrude-1) and the value in Cell-D3 (30) are assigned to the variables bossc and dv in the "for…next loop" in the program, respectively.
The user, changes the values in the Excel file and runs the modifying program to make changes in the SolidWorks models automatically. So, the iteration shown in Fig. 2 can easily and quickly be achieved to obtain the final design.
The SolidWorks model for the frame for HP-250 as shown in Fig. 3 is obtained by making the relevant changes in the Excel file.

B. Analysis
Modal analysis and static strength analysis are performed in SolidWorks Simulation by the finite element (FE) method. The results are given for HP-350 below. The faces contacting to the ground are fixed. The curvature based mesh was used. The default mesh size given by the program is 293.5 mm. The mesh size was chosen as 100 mm for finer meshing.

B.1 Forces
Static analysis requires finding the forces acting on the frame using the principles of mechanics. The free body diagram of the top lid shown in Fig. 4 is considered to find the forces. The opposite of the forces Fp, Fy, Fz and Fh act on the frame. The force, -Fp, acts at the bushings at A1 and A2 (See Fig.  1(b)). The forces, -Fy and -Fz, act at the bushings B1 and B2. The force, -Fh, is the distributed force in the y direction and it acts on the face of the bottom part contacting the scrap. It is assumed that there are forces at the faces contacting the scrap in the z and y directions also (Fhz and Fhy). The forces are calculated for the three steps as explained below: Step 1: The pressure in the top cylinders is taken as the maximum cracking pressure (300 bar). Then Fp is calculated. Applying the static equilibrium to the free body diagram in Fig. 4, Fh, Fz, and Fy are calculated. Fhz and Fhy are calculated by Fhz=Fhy=νFh, where ν is a constant like Poisson's ratio. The constant, ν, was taken by trial as 0.15. The pressure in the front cylinders is calculated from Fhz. The forces at C1 and C2 are calculated from the pressure in the front cylinders. The pressure in the side cylinder is calculated from Fhx. The force at D is calculated from the pressure in the side cylinder.
Step 2: The pressure in the front cylinders is taken as the maximum cracking pressure (300 bar). Then Fhz is calculated. Fh and Fhx are calculated by Fh=Fhx=νFhz. Applying the static equilibrium to the free body diagram in Fig. 4, Fp, Fz, and Fy are calculated. The pressure in the top cylinders is calculated from Fp. The pressure in the side cylinder is calculated from Fhx. The force at D is calculated from the pressure in the side cylinder. The forces at C1 and C2 are calculated from the pressure in the front cylinders.
Step 3: The pressure in the side cylinder is known as 300 bar. Then Fhx is calculated. Fh and Fhz are calculated by Fh=Fhz=νFhx. Applying the static equilibrium to the free body diagram in Fig. 4, Fp, Fz, and Fy are calculated. The pressure in the top cylinders is calculated from Fp. The pressure in the front cylinders is calculated from Fhz. The force at D is calculated from the pressure in the side cylinder. The forces at C1 and C2 are calculated from the pressure in the front cylinders.
Calculated forces are given in Table 2.   TABLE 2 Calculated forces acting on the frame for HP-350 Step-1 Step-2 Step - Calculated maximum pressure values in the cylinders are given in Table 3.

B.2 Modal Analysis
The modal analysis results are given in Table 4. The mode shape for f1 is mainly torsional vibration of the structure about y axis. The mode shape for f2 is mainly flexural vibration of the structure about x axis. The mode shape for f3 is mainly flexural vibration of the structure about z axis. Mode-2 is dominant for Step-1 and 2. Mode-3 is dominant for Step-3. It is noted that the machine under study does not have high speeds, and resonance evaluation is not done. Natural frequencies are considered for the evaluation of the rigidity of the machine. Higher natural frequencies indicate more rigid structures.

B.3 Static strength analysis
The forces for each step are defined in SolidWorks Simulation and the FE analysis is performed for the frame. vonMises stresses and deflections are evaluated. The maximum stresses in the parts of the frame are given in Table  5. The maximum deflections in the frame are given Table 6. The material for the shaft is 1040 steel and the other parts are St52. Step-2 Step-3 Step-1 Step-2 Step - Step-2 Step-3 Step-1 Step-2 Step-3 8. 5 1.4 1.9 3.7 1.3 1.6 The deformed shapes and stress distributions for the initial and final designs are shown in Fig. 5. Colors indicate stress distributions from zero to maximum value corresponding to from blue to red, respectively. The deformation scale is 100 for Fig. 5. It is noted that stresses are sensitive to mesh types and sizes.
It is observed that the stresses are high for the initial design. The iterative procedure shown in Fig. 2   IV. CONCLUSIONS Computer aided design (CAD) techniques are widely used in industry for product development. CAD programs offer wide range of graphical user interface (GUI) capabilities. Design is an activity which requires iterative work. It takes time and effort to accomplish iterative work by GUI only. The global competitive market forces companies to reduce the time from design to market. Design activity takes considerable time in this effort. Thus, design automation methods using parametric design approach are becoming popular.
A procedure is offered in this study, where a VisualBASIC program, Excel, and SolidWorks are integrated. A prototype model of the mechanical system under development is designed in SolidWorks by GUI, first. The geometric dimensions considered for the iterative work are entered to an Excel file. The data in the Excel file can be edited and changed for the iterative work. The modifying program developed in VisualBASIC reads the data from the Excel file and automatically modifies the SolidWorks model using the application programming interface (API). The modified model is analyzed and the analysis results are evaluated. The iterative work continues until a satisfactory design is obtained. The initial design is based on experience, and usually is not satisfactory. Iterative work can continue for better optimization even a satisfactory design is reached. The procedure can be applied to develop different models of the product. The procedure was applied to design a commercial scrap bailing machine successfully. Two models which have different scrap chamber dimensions have been considered. The results for one model are presented in this paper.
A satisfactory design considering the strength of structures can be obtained, but it should be noted that optimization is a continuing process and a better design may be possible. Optimization studies of the structure considered can continue. Also, the effect of mesh type and mesh size, and the boundary conditions in real systems on the finite element results should be investigated.