Analysis On The Shaft And Shaft Component Computer Science Essay

Published: Last Edited:

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

The word parametric means the geometric definitions of the design, which can be varied at any time in the design process. The parametric design technique can help the designer to incorporate the original design into the construction of the model. Parametric modelling is accomplished by identifying and creating a description of a component based on certain parameters. For an example, the usual description of a circle is by using its radius, but it also can be represented parametrically in term of x and y coordinates in a parametric equation. The parametric description could then, can be used by developing macros using suitable programming language.

SolidWorks is an example of solid modelling CAD software that allows the creation of solid model and manipulation the data using user develops macros. Solid modelling is the computer model that allows us to modify the instruction using API. API is an (application programming interface) that have a set of functions, procedures and methods to support requests made by computer programs. SolidWorks also allows for the integration of third-party modules. Some of these modules can be represent, such as generating a special shaped hole, extrude and others.

With this parametric design, it is possible to build the model of a single model or a whole system. The project goal is to develop a new design module in order to:

Perform the calculation on the shaft design

Create a solid model of the shaft design

The design module will create using available API in SolidWorks. From this design module, the reduction of the design development time for modification process can be optimised.

1.2 Project Background

Integrating the design process is a process to modify the existing design. The main benefit from this process is a platform to begin the analysis. This process is an effective way to reduce product development time and to increase the list of function capabilities such as performance, speed and others. Integrating process is similar to the modular design. Modular design is create in initial design phase before the product is produce. Both of the processes are aim to develop and reusable at the component and system levels.

Parametric design module is one of a phase in integrating the design process. The module will developed to help designer in the process of a component analysis and specification of shaft size, deflection, vibration characteristics, required keys and/or splines.

The module will perform the calculations on the shaft and create a solid model of the designed according to the user input. Hence, this project will determine the functions and ability of the macro recorder in SolidWorks. The module will develop by implement the parametric design in the CAD system. The implementation needs the languages to be use such as Visual Basic, or one of the C families. The suitable languages will be tries on this project and will use the chosen language to perform a module.

1.3 Objectives

The objective of this project is to develop a parametric shaft components design module for SolidWorks. The module can perform the design calculation for:

Size of shaft based on



Shaft deflection

Shaft vibration characteristic

Whirling Vibration

Torsional Vibration

Size required for key and/or splines at a shaft design

1.4 Scopes

To full fill the objective given, there are some working scopes to be accomplished:

Background study on SolidWorks API.

Indentify the suitable language on ease implementation.

Program interaction structure

Background study on requirements for design of shaft:

Size of shaft based on



Deflection on shaft

Vibration characteristic

Whirling vibration

Torsional Vibration

Required keys and/or splines

Development of macros:

Calculations programming for:

Shaft diameter

Shaft deflection

Shaft critical speed

Key size and number of splines teeth.

Parametric model based

User form interaction.

Output result and drawing.

Debug and testing


1.5 Expected Outcomes

The specific outcomes are:

Analysis on the shaft and shaft component

Size of shaft (diameter and deflection)

Vibration characteristic

Whirling vibration

Torsional vibration

Key size and number of splines teeth

Component drawing in SolidWorks

Shaft size

Key size and/or number of splines teeth at a shaft design



2.1 Parametric Design using CAD

Elasis and FIAT Auto started to test parametric and associative (P/A) techniques since 6 years ago. Fiat is one of the first automotive companies that have test P/A features in development of a new car. Car body design is very critical and time-consuming activity for design modifications during car development of a new car body and the same parametric model is reuse for future platforms are the reasons to develop a new P/A design methodology.

The methodology is base on P/A but should have the concept of archetype. An archetype is a set of logical and parametric features of an object. The system can be use to build the relative CAD model. The generated CAD model can be modified in flexible way and automatic procedure. In figure 1-1 is illustrated the flow process of an anterior pillar using archetype design.

The phases of design methodology were the following:

Define the vehicle reference model( developed with explicit CAD systems and procedure)

Build the design development history (list of modification)

P/A modelling of new vehicle model.

Optimization phase

Model update during vehicle development

The traditional process of modelling and the new method based on P/A approach have been comparing in qualitative. The development time of model is longer for P/A method, because it is necessary to build P/A library archetypes. P/A library enables to reduce time design because it is reduced the modifying phase. The explicit design takes always the same time for every style change [1].

The advantage of the parametric design is can generate components with simply changing its parameter values. The P/A approach seems to be strong enough to manage several style modifications, saving time and costs. However, the approach is not suitable to use in this project because the phase of parametric design methodology are use on the higher and whole design development. Basically, this project is only use the parametric design only to perform a component using CAD.

2.2 Integrated Process Design

The use of constraint modelling technique has provided a framework where the various element and tools involved in a design process. Design process can be integrated through numerous communication methods and led to the development of integrated design environment. An integrated design environment manages information, set up the analysis, communication between different tools, control the design solution and publish result to required standard.

The researchers have describes the application to the conceptual design of a gas turbine engine component. The software of MSC.Patran, MSC.Nastran, Excel and SolidWorks are combined with Inca as the modelling package. Modelling package provide an environment for the design of the component that satisfied the principles of a design process [2].

There are a lot of benefits of the integrated process, such as:

Providing a platform for the decomposition of the design tasks.

Ensuring that the result and the process are captured and can repeated.

Increasing the efficiency of the use of the various tools.

Providing a design process that is flexible and rapid enough to cope with requirement change.

In this project, has presented one of the early stages of the integrating process. Initially, this project will used MathSoft MathCAD as a tool to extend the disk design environment. MathSoft MathCAD could be used to provide the mathematical calculation capability. Moreover, to design a shaft component has use many of engineering calculations and MathCAD is the ultimate tool for documenting those calculations. Unfortunately, MathCAD software has to use legally with Windows XP-32 operation system (OS) and SolidWorks 2007.

2.3 Application Programming Interface

An application programming interface (API) is an interface implementation by a software program. The program can interact with the other software. API is similar to the user interface on interaction between human and computers. The implementation is via applications, libraries and operating system to decide their vocabularies and calling back conventions and used to access their service. API have include specifications such as routines, data structure, object class and protocols and used them to communicate with the user and the implementer.

The research has presented an application of Visual Basic Application Programming Interface (API) to develop numerical and procedural algorithm into CAD software. The focus is on Reverse Engineering embedded into SolidWorks. There are many applications is need to remodel the tessellated surface into an editable solid feature, to analyze it and to manipulate.

SolidWorks is widely used commercial software about engineering modelling and computer aided design. SolidWorks is base on parametric definition of component and feature and it can be use in very intuitive way. Other engineering modellers (such as Catia) have dedicated module for reverse engineering. Specific reverse engineering software (such Rapidform) does not allow the building of parametric feature-based models.

In many cases their also need to implement specific algorithm to perform dedicated an accurate computation which cannot be found in any commercial software. These are the main reason to API within commercial software. Recent SolidWorks have improved the method supported by native object and they have been interlaces with very powerful Mathematical Utility. Using API into SolidWorks we can manipulate three kind of object from:

SolidWorks (model native entities)

math utility database (math entities)

User defined entities

The native geometrical objects concern the sketch entities (point, line, circle, splines, etc) and their constrain, the features (extrusion, revolution, loft, etc) the assembly management (mating, inserting, moving, etc). The math native objects concern point, vectors and transformations for manipulate entities (projecting from model space to sketch space and vice versa, performing basic operation on vector, etc).

The software without API, the user can only access to single model entity and the direct access to internal database is not permitted. Using API database of entity can be directly access saving time to execute command and model entities can interlaced with math and user defined ones [3].

The software that researcher have been use is similar in this project. In beginning, C++ will be use a language in API. It is because C++ is common language runtime and it also a multi-paradigm language. This allows programmer to choose the programming style that is right for the task at hand, but it only can be use with a legal SolidWorks 2010. However, the facilities are only provides a legal SolidWorks 2008 software. Therefore, in this project, Visual Basic is the language to use in SolidWorks API.

2.4 Macro

Cadet Officer Shahrul from National Defence University has created a macro using AutoCAD for conveyer Belt Drawing. The macro is only for vertical conveyer belt. The disadvantages of this macro is using AutoCAD so, the output of the drawing is in 2D drawing. Compare with this project, the SolidWorks macro output is in 3D solid drawing and the properties of the solid can be change according to the user input.

2.5 Conclusion

Software engineering concept such as encapsulation and modularity are critical to making large. Most designer has not much formal education in mathematics, computing and software engineering. It seems clear to this project that it may well appropriate to structure an introduction of parametric design.



3.1 Introduction

This chapter discuss on the methodology of the project. In general has four phases. Program structure designs in this project are shown in Figure 3-1. Firstly, it is necessary to do the background research and design a planning on the project to avoid any problems in a future. Then, analyze the suitable language on easy implementation to use on a CAD system. After that, the parametric shaft design will be create using a standard shaft design equation. The Figure 3-2 and Figure 3-3 show the design process flow. Finally, parametric shaft design will implement in a CAD system.







Figure 3-1: Overall Program Structure.




Key and Splines


Drawing Macro



User Form

Coding Visual Basic



Figure 3-2: Design Process Flow.


Key and Splines






Types of key:





Standard straight splines

Types of splines:

-4 splines

-6 splines

-10 splines


Figure 3-3: Shaft Design Flow.

3.2 Drawing Component Using SolidWorks

Firstly to build a component, programmer needs to create the lines one by one to form the component by manually. Basically, every node represent the coordinate (address) from x, y, z (0 0 0) coordinates to coordinate of user need. The line then will revolve in order to generate a solid model.

3.2.1 Record Macro using Macro Recorder

Macro Recorder is a tool that allows the user to record whatever the mouse and keyboard done in the work area and toolbar and then play back at to simplify a task. In many program, a macro is a collection of the key strokes that can be save and then run back to repeat a process. In the case of SolidWorks, macro is a collection of SolidWorks API calls. Visual basic in SolidWorks is the alternative ways to program the coding that cannot do manually such as revolve, extrude or mirror function. The macro will record the process then it will transform or convert to the source code.

Figure 3-4: Record Macro

3.2.2 Editing a Macro

After finish record a macro, editing phase must be perform to customize the macro as necessary. The macro cannot be use for other purpose in design if the following step is not complete. Customization should replace the existing parameters to own parameters. Actually customization is at the coordinate of the point of the rectangular. Interaction between the user and the module can create with design a userform.

Figure 3.5: Code for Editing

3.3 Program Interaction

This module needs some data to be function accordingly. The user is the one who will give the data to module and users have to make sure that the data given is correct. The data must accordingly to the module needs. The main element of this interaction is the user and the module. This project uses Visual Basic to create the module according to the shaft design calculation and after all the works done the result will drawn in SolidWorks.

3.3.1 Calculation

In Visual Basic, programmer has to create an interface which is related to the calculation. In designing a shaft, the standard equation of shaft design will be use in this project. After that, the calculation will be place in Command button of Visual Basic.

Shaft design equations can be found in most machine design textbooks, and also forms the basis for current ANSI/ASME standard for the design of shaft.

Shaft diameter;

d = ({2 (3.1)

Shaft deflection;

y = (3.3)

Shaft vibration;


For key size and keyway depth will use ASME/ANSI Standards B17.1-1967 and B17.2-1967.

For splines, there have three classes of fit for straight splines have been standardized as follow:

Class A fit: permanent connection- not to be moved after installation.

Class B fit: accommodates axial sliding when no torque is applied.

Class C fit: accommodates axial sliding with load torque applied.

Dimension for straight splines operating under any these conditions may be determined from Table B-2.

3.3.2 Data Structure

Some of macro function cannot record all the function in SolidWorks. So the programmer needs to use appropriate methods. In this project will use array function and multiple-selection structure method to store the data.

Case a



Case b

Figure 3.6: Flowchart for select case

3.3.3 User Form

User form is a window that will help the user to interact with the module. The main task of user form is for user to keep in data that needed from the module. Without the user form, the interaction between user and the module cannot be done. It is because the module does not have data and the user cannot call back the module.

Figure 3.7: Userform in Visual Basic

3.3.4 Visual Basic Coding Form

This is other types of interaction, program to program interaction. The first element is the program by itself; in this case the program is a Visual Basic and SolidWorks. These two programs should have a language that the information or data can be understood by both program. In this project, Visual Basic is choosing because it is an easy language. Actually, all the instruction and data keep by the user will translate to Visual Basic coding. When the module got all the data, it will transform into Visual Basic coding and perform the command such as calculation by the program.

3.3.5 Run a Macro.

Run or Play icon in SolidWorks macro is the last process of development of macro. In is easy to run a macro, the user should follow a few steps and SolidWorks will generate a module that have been design by the user.

3.4 Conclusion

The computer software is no substitute for the human thought process. The user is control the system and the computer is the driven to assist the user on the platform. Numbers generated by a computer can be far from the truth if the user entered incorrect input, if the user misinterpreted the application or the output of the program. The user task is to ensure the validity of the result. The user must check the application.



4.1 Userform

The all figure shows the Visual Basic userform that have been created in SolidWorks macro. As we can see, the figure 4-1 is a front page of a userform in this project.

C:\Users\user\Pictures\my love vb\5.png

Figure 4-1: Userform Front Page

There are a buttons and boxs to fill in by the user and after finish fill in the data, the user just has to click on command button (DRAW SHAFT). The module will draw the shaft according to the user input.


3C:\Users\user\Pictures\my love vb\7.png

Figure 4-2: Userform for User Input

4.2 Result

Every module that has been created has own objective. The objective on this preliminary result is to develop a simple shaft. So, the figure 4-3, 4-4 and 4-5 are the results that have been develop using the SolidWorks API. According to the user input, the radius is 3meters and the length is 10meters. As a result, the module should draw a shaft according to the user input.

C:\Users\user\Pictures\my love vb\8.png

Figure 4-3: SolidWorks Draw a Shaft


100C:\Users\user\Pictures\my love vb\9.png

Figure 4-4: Check Shaft Dimension

C:\Users\user\Pictures\my love vb\6.png

Figure 4-5: Step Shaft



5.1 Introduction

This part covers the future work for the next semester (FYP II) that need to accomplish for development of parametric shaft design module for SolidWorks.

5.2 Further Works for FYP II

FYP II would be focus on shaft design calculation and development of coding in Visual Basic. Below show the further works for FYP II:

Shaft Interaction

Vibration interaction

Key and/or splines interaction

Debug and testing