Matlab For Solidworks
Matlab For Solidworks
Matlab For Solidworks
1. Introduction
Brought to you by | University of Science and Technology Bydgoszcz/ Biblioteka Glowna Uniwersytetu
Authenticated
Download Date | 3/5/15 10:45 AM
58 DAWID CEKUS, BOGDAN POSIADAŁA, PAWEŁ WARYŚ
[7, 8], may be the Python programming language with appropriate libraries
[9]. However, in this case, the preparation of simulation models is much more
laborious and requires programming skills in Python. Matlab is intended to
solve complex mathematical problems and generate a graphical visualization
of the results. Its scope includes various fields of science and technology.
Matlab also provides numerous extensions (toolboxes), among them support
for neural networks or optimization problems. One of the extensions is the
SimMechanics Toolbox which facilitates the creation of kinematic chains,
simulation of their dynamics and visualization of results. Simulink is a tool
that allows defining the structure of the control system of mechanisms of the
created models and displaying their simulation with complete control during
a specified working cycle. This module makes it possible to create, in the
graphical window, the structure of the control system which is built of various
types of blocks representing dynamic objects, signal sources and measuring
instruments. By defined objects, the software can refer to variables existing
in memory and available in Matlab.
In the paper, the authors present a course of simulation research car-
ried out on the models elaborated with the use of SolidWorks [10, 11] and
Matlab/Simulink.
The simulation model is built in stages, that is, at first solid, surface, or
hybrid model is created in one of the CAD program. SolidWorks, Pro/Engineer
and Autodesk Inventor applications work preferably with the Matlab/Simulink
environment.
An assembly of elements can be used solely for simulation studies be-
cause in such cases there exists an interaction between individual parts, which
in turn makes it possible to introduce the control system and perform motion
analysis. Therefore, each created simulation model is an assembly of many
individual parts or sub-assemblies. For instance, the sample CAD model pre-
sented in Figure 1 consists of: 3 assemblies and 8 parts, but these assemblies
include subsequent assemblies or parts, etc.
Building of each part of geometric model in SolidWorks, similar to the
ones most currently used for this kind of applications, begins with defining
a 2D geometry that creates a solid or a surface after completing one of
numerous operations (e.g. extrusion or pocket). Then, based on expansion or
modification of the obtained element made by removing or adding material,
the creation of parts is continued. The majority of CAD systems offer nor-
malized elements that can be used to build assemblies. The product that is
the result of the final assembly of components has a permanent link to the
Brought to you by | University of Science and Technology Bydgoszcz/ Biblioteka Glowna Uniwersytetu
Authenticated
Download Date | 3/5/15 10:45 AM
INTEGRATION OF MODELING IN SOLIDWORKS AND MATLAB/SIMULINK ENVIRONMENTS 59
individual part files, which means that changes made in one of the files are
automatically ascribed to the linked files, respectively. The product doesn’t
have its own geometry, instead, it consists of a set of links to the parts and
constraints that are used to connect these elements.
The constructed geometric models should be parametric, which allows
changing dimensions of components and their positions relative to each other
in order to do analysis of motion according to the same model.
Geometrical models can be used not only for the construction of the
simulation model, but in a very simple way they can be utilized to carry
out other types of analysis, such as modal or stress analysis. In this case, the
calculation model which takes into account contact connections and boundary
conditions should be worked out.
The next stage of building the simulation model is the implementation
of the CAD assembly model in Matlab/Simulink environment (Fig. 2).
Brought to you by | University of Science and Technology Bydgoszcz/ Biblioteka Glowna Uniwersytetu
Authenticated
Download Date | 3/5/15 10:45 AM
60 DAWID CEKUS, BOGDAN POSIADAŁA, PAWEŁ WARYŚ
For this purpose, besides previously mentioned CAD software and Mat-
lab/Simulink, the SimMechanics Link utility has to be installed and linked
to the CAD program [12].
The first step of implementation process is to use the SimMechanics
Link exporter to create Physical Modeling XML file that includes informa-
tion about the mass and inertia of each part of the assembly, definitions
of constraints between parts, as well as a set of STL (stereo-lithographic)
files for representing surface geometries of the assembly bodies. The second
step is import of the received files into the Matlab/Simulink program and
generation of a SimMechanics model.
The SimMechanics model, obtained immediately after the implementa-
tion, includes a block scheme (Fig. 3) and allows only visualizing mechanism
or machine (Fig. 4), without a possibility of carrying out simulation research.
Only rarely it is optimal, and does require modifications like removing un-
necessary constraints between elements of the model or changing their types.
Brought to you by | University of Science and Technology Bydgoszcz/ Biblioteka Glowna Uniwersytetu
Authenticated
Download Date | 3/5/15 10:45 AM
INTEGRATION OF MODELING IN SOLIDWORKS AND MATLAB/SIMULINK ENVIRONMENTS 61
Simulation tests may be carried out only after the control signals (e.g.
kinematic excitations – Fig. 5) and the actuators are added to the model.
In the created SimMechanics model, the control functions are sent to the
actuators (Joint Block) with the use of the Joint Actuator block. Joint Block
elements, those which occur between the parts of the model as the signal
controllers, require movement parameters in the form of position, velocity
and acceleration for the prismatic connection (Prismatic Joint) and the an-
gular position, angular velocity and angular acceleration for the rotational
connections (Revolute Joint). Because the defined control functions usually
describe only velocity, therefore they should be integrated and differentiated
through appropriate blocks (Fig. 6) and only at that point they can be sent
to the Joint Actuator block in the form of three signals.
Brought to you by | University of Science and Technology Bydgoszcz/ Biblioteka Glowna Uniwersytetu
Authenticated
Download Date | 3/5/15 10:45 AM
62 DAWID CEKUS, BOGDAN POSIADAŁA, PAWEŁ WARYŚ
Brought to you by | University of Science and Technology Bydgoszcz/ Biblioteka Glowna Uniwersytetu
Authenticated
Download Date | 3/5/15 10:45 AM
INTEGRATION OF MODELING IN SOLIDWORKS AND MATLAB/SIMULINK ENVIRONMENTS 63
Brought to you by | University of Science and Technology Bydgoszcz/ Biblioteka Glowna Uniwersytetu
Authenticated
Download Date | 3/5/15 10:45 AM
64 DAWID CEKUS, BOGDAN POSIADAŁA, PAWEŁ WARYŚ
inserted into the existing model; the origin of that system is at the end of
the boom (Fig. 8).
Brought to you by | University of Science and Technology Bydgoszcz/ Biblioteka Glowna Uniwersytetu
Authenticated
Download Date | 3/5/15 10:45 AM
INTEGRATION OF MODELING IN SOLIDWORKS AND MATLAB/SIMULINK ENVIRONMENTS 65
constitutes the initial problem of load movement. However, before the initial
problem is solved with the help of the ode45 function available in Mat-
lab/Simulink, the above equations must be entered in the form of scripts and
functions using Matlab Function object into the SimMechanics model of the
existing laboratory truck crane and, at the same time, the following elements
must be added (Fig. 9):
– Constant block for generating initial length of the rope,
– Integrating and Differentiating Block,
– Workspace Block in which the system response is collected in the form
of data tables.
Sample studies on the above simulation model have been carried out for
two cases:
– free vibration of a mathematical pendulum moving in spatial motion,
with an assumption that the suspension point remains stationary and is
tied with the end of the telescopic boom,
Brought to you by | University of Science and Technology Bydgoszcz/ Biblioteka Glowna Uniwersytetu
Authenticated
Download Date | 3/5/15 10:45 AM
66 DAWID CEKUS, BOGDAN POSIADAŁA, PAWEŁ WARYŚ
Fig. 10. Projection of load motion trajectory on the lifted (a) and rotary plane (b)
For the case of solution of the initial conditions under the influence
of kinematic excitations, the movement began from zero initial conditions,
except for η (t)|t=0 = 0.5 m, ζ (t)|t=0 = ρ0 . The motion of lifted load was
considered for the time equal 50 s. For the first 40 s, this motion was forced
by the controls (Fig. 5) and, after their action ceased, for the next 10 s free
oscillations of the lifted load were observed. The assumed motion sequences
were directly connected with the working movements of the laboratory truck
crane and they resulted from: control of rotation of platform (fi prim), control
of the boom inclination angle (teta prim), control of the rope length which
depends on the rope motion forced by the winch (ro prim) and, finally, from
the changes in the boom length (r prim). All control functions were trapezoid
pulses and included start-up, steady and braking movements.
Brought to you by | University of Science and Technology Bydgoszcz/ Biblioteka Glowna Uniwersytetu
Authenticated
Download Date | 3/5/15 10:45 AM
INTEGRATION OF MODELING IN SOLIDWORKS AND MATLAB/SIMULINK ENVIRONMENTS 67
The system response to the taken kinematic excitations has been obtained
in the form of animation of motion of the whole system in the SimMechanics
Visualization window and in the form of projections of the lifted load motion
trajectory on the lifted (Fig. 11a,b) and rotary planes (Fig. 11c).
Fig. 11. Projection of the lifted load motion trajectory on the lifted (a, b) and rotary planes (c)
The second simulation model [17, 18] concerns research on forest crane
HIAB LOGLIFT F135 Z79 (Fig. 12), which consists of the following ele-
ments:
– the basic member (1),
– the internal arm (2),
– the external arm – two-member telescopic boom (3),
Brought to you by | University of Science and Technology Bydgoszcz/ Biblioteka Glowna Uniwersytetu
Authenticated
Download Date | 3/5/15 10:45 AM
68 DAWID CEKUS, BOGDAN POSIADAŁA, PAWEŁ WARYŚ
– the head (4), making up the place for fixing additional working equipment,
– the hydraulic cylinder (5), used to change the inclination angle of the
internal arm,
– the set of two parallel hydraulic cylinders (6), applied for changing the in-
clination angle of the external arm,
– the rotator – the hydraulic mechanism for performing rotational motion
(7),
– the manipulator – grab to wood (8),
– the support system (9).
The worked out CAD model has been converted into the form of a
physical model XML and implemented in Matlab/Simulink. Its visualization
is shown in Figure 13 and block diagram is illustrated in Figure 14.
The block scheme (Fig. 14) has been supplemented by an appropriate sig-
nal source, actuators and measuring instruments, i.e. Signal Builder objects to
create time-courses of control signals, Joint Actuators controlling movements
of individual crane arm, blocks setting the initial conditions, displacement
and velocity sensors, tools for visualization of derived characteristics.
The simulation model was used to carry out a sample simulation of
machine cycle. During the working cycle, the machine mechanisms were
controlled by time functions, presented in Figure 15, describing the changes
of velocity of the following control signals:
– control of rotation of primary column (Signal 1),
– control of telescopic boom member (Signal 2),
– control of deflection of the external arm from the vertical (Signal 3),
Brought to you by | University of Science and Technology Bydgoszcz/ Biblioteka Glowna Uniwersytetu
Authenticated
Download Date | 3/5/15 10:45 AM
INTEGRATION OF MODELING IN SOLIDWORKS AND MATLAB/SIMULINK ENVIRONMENTS 69
– control of deflection of the internal arm from the vertical (Signal 4).
Based on the defined control functions, one obtained the trajectory of
the point of attachment of the load, velocity and acceleration components in
this movement. The system response is illustrated in Figures 16-18.
Brought to you by | University of Science and Technology Bydgoszcz/ Biblioteka Glowna Uniwersytetu
Authenticated
Download Date | 3/5/15 10:45 AM
70 DAWID CEKUS, BOGDAN POSIADAŁA, PAWEŁ WARYŚ
Fig. 16. Position of the boom ends in the global coordinate system
Brought to you by | University of Science and Technology Bydgoszcz/ Biblioteka Glowna Uniwersytetu
Authenticated
Download Date | 3/5/15 10:45 AM
INTEGRATION OF MODELING IN SOLIDWORKS AND MATLAB/SIMULINK ENVIRONMENTS 71
Fig. 17. Velocity of the boom ends in the global coordinate system
Fig. 18. Acceleration of the boom ends in the global coordinate system
Brought to you by | University of Science and Technology Bydgoszcz/ Biblioteka Glowna Uniwersytetu
Authenticated
Download Date | 3/5/15 10:45 AM
72 DAWID CEKUS, BOGDAN POSIADAŁA, PAWEŁ WARYŚ
4. Conclusions
Brought to you by | University of Science and Technology Bydgoszcz/ Biblioteka Glowna Uniwersytetu
Authenticated
Download Date | 3/5/15 10:45 AM
INTEGRATION OF MODELING IN SOLIDWORKS AND MATLAB/SIMULINK ENVIRONMENTS 73
flexibility of elements should be taken into account, one can attach a block
from the Simulink Library Browser (where one exists), as well as write own
scripts or/and functions to develop the created model. In such a situation,
the capabilities of the constructed mathematical model are limited only by
knowledge and skills of the designer.
When flexibility of all elements must be taken into consideration, the
CAD models are not used. Yet, all relationships are introduced directly in the
form of blocks offered by Matlab/Simulink software, own scripts or functions.
An example of this approach is work [19], where the authors worked out a
coupled dynamical model of the forest crane and the lifted load taking into
account elastic deformations of the boom.
Acknowledgment
The study has been carried out within statutory research of the Institute
of Mechanics and Machine Design Foundations of Częstochowa University
of Technology.
REFERENCES
[1] Rusiński E.: Design principles for supporting structures of self-propelled vehicles. Oficyna
Wydawnicza Politechniki Wrocławskiej, Wrocław, 2002 (in Polish).
[2] Eberhard P., Schiehlen W.: Hierarchical modeling in multibody dynamics. Archives of Applied
Mechanics, 1998, 68, pp. 237-246.
[3] Mrozek B., Mrozek Z.: MATLAB universal environment for scientific and technical calcula-
tions. CCATIE, Kraków, 1995 (in Polish).
[4] Mrozek B., Mrozek Z.: MATLAB and Simulink. User’s guide. Helion, 2004 (in Polish).
[5] Chaturvedi D.K.: Modeling and Simulation of Systems Using Matlab and Simulink. CRC
Press, 2010.
[6] Gran R.J.: Numerical Computing with Simulink, Volume I, Creating Simulation. Society for
Industrial and Applied Mathematics, Philadelphia, 2007.
[7] Cekus D., Waryś P., Wochal M.: The application of Python environment and CAD models to
control of machine movements. Systems. Journal of Trandisciplinary Systems Science, 2012,
Vol. 16, No 1, pp. 121-130 (in Polish).
[8] Wochal M., Cekus D., Waryś P.: The application of VPython to visualization and control of
robot. Pomiary Automatyka Robotyka, 2012, R. 16 nr 12 (190), pp. 151-156.
[9] Scherer D., Dubois P., Sherwood B., VPython: 3D Interactive Scientific Graphics for Students.
Computing in Science and Engineering, 2000, pp. 82-88.
[10] Lombard M.: SolidWorks 2010 Bible. Wiley Publishing Inc., 2010.
[11] Babiuch M.: SolidWorks 2006 w praktyce. Helion, 2007.
[12] http://www.mathworks.com/help/physmod/smlink/index.html (access 25.07.2013).
[13] Cekus D.: Modeling and simulation research of laboratory truck crane motion. Systems.
Journal of Trandisciplinary Systems Science, 2012, Vol. 16, No 2, pp. 96-103 (in Polish).
Brought to you by | University of Science and Technology Bydgoszcz/ Biblioteka Glowna Uniwersytetu
Authenticated
Download Date | 3/5/15 10:45 AM
74 DAWID CEKUS, BOGDAN POSIADAŁA, PAWEŁ WARYŚ
[14] Tomski L., Chwalba W.: System for testing the vibration of a truck-crane model. Materiały
Sympozjum Naukowego “Metody Badań Maszyn Roboczych”. Prace Przemysłowego Insty-
tutu Maszyn Budowlanych, 1989, z.1,2,3, pp. 206-214 (in Polish).
[15] Posiadała B., Sklamierski B., Tomski L.: Motion of the lifted load brought by a kinematics
forcing of the crane telescopic boom. Mechanism and Machine Theory, 1990, Vol. 25, Issue
5, pp. 547-556.
[16] Posiadała B., Skalmierski B., Tomski L.: Theoretical, computational model of the telescopic
mechanisms of the cranes. Prace Naukowe CPBP 02.05. Wydawnictwa Politechniki Warsza-
wskiej, Warszawa, 1990 (in Polish).
[17] Posiadała B. Paczynski A. Waryś P.: Implementation of the geometrical model of forest crane
boom in Matlab-Simulink environment. Górnictwo Odkrywkowe, 2010, 3/2010, pp. 193-196
(in Polish).
[18] Posiadała B., Waryś P.: Modeling and simulation research of forest crane in operating cycle.
Modelowanie Inżynierskie, 2011, 10(41), pp. 331-338 (in Polish).
[19] Posiadała B., Waryś P., Cekus D., Tomala M.: The dynamics of the forest crane during the
working cycle. International Journal of Structural Stability and Dynamics, 2013, Vol. 13,
No. 7, Article Number: 1340013 (DOI: 10.1142/S0219455413400130).
Streszczenie
Brought to you by | University of Science and Technology Bydgoszcz/ Biblioteka Glowna Uniwersytetu
Authenticated
Download Date | 3/5/15 10:45 AM