# Mathematical Modeling and Simulation of Pantograph Mechanism in MATLAB Text Only Version

#### Mathematical Modeling and Simulation of Pantograph Mechanism in MATLAB

Manasi Jeste

Department of Instrumentation and Control Engineering Vishwakarma Institute of Technology

Pune, India

Aniruddha Atre Department of Mechanical Engineering Vishwakarma Institute of Technology

Pune, India

AbstractThe paper explains the mathematics behind simulation of Pantograph Mechanism in MATLAB. Pantograph mechanism is used for copying 2D objects like photographs or different shapes, and uniformly scaling them such that the copy is enlarged or shrieked by a scale factor.

KeywordsPantograph Mechanism, Mathematical Modeling, Simulation MATLAB.

1. INTRODUCTION

Pantograph Mechanism is a 5-bar mechanical linkage in which the links are connected in a way such that if one point is tracing an image then the second point will produce identical, enlarged or miniaturized model of the same, because the links are coupled based on parallelogram principle. This mechanism has various applications in the areas such as sculpture, engraving, minting, milling, etc.

The pantograph was initially used for drafting i.e copying and scaling line drawings. However, contemporary use of it is seen in sculpture and minting, where 3 dimensional pantographs are used .

Before the advent of Computer Numeric Control (CNC) and Programmable Logic Controller (PLC), pantograph was also used in control the movement of cutting tool in milling process.

2. MATHEMATICAL MODELING

(Figure 2 Main Reference figure of the simulation.)

 Sr no Symbol Interpretation 1 Angle AOD 2 Angle between line EO and x-axis 3 Angle subtended by line formed by joining center of drawing circle and the point tracing the circle w.r.t x -axis. 4 dOA Euclidean distance between origin and point A 5 dOB Euclidean distance between origin and point B 6 dOD Euclidean distance between the origin and point D 7 Pd Center point of a drawing circle 8 Pe Center point of a Tracing circle 9 w Angular speed
 Sr no Symbol Interpretation 1 Angle AOD 2 Angle between line EO and x-axis 3 Angle subtended by line formed by joining center of drawing circle and the point tracing the circle w.r.t x -axis. 4 dOA Euclidean distance between origin and point A 5 dOB Euclidean distance between origin and point B 6 dOD Euclidean distance between the origin and point D 7 Pd Center point of a drawing circle 8 Pe Center point of a Tracing circle 9 w Angular speed

1. Nomenclature:

2. Calculations:

(Table 1)

(Figure 1- Rough Diagram of the mechanism)

The Mathematical modeling and simulation method proposed in this paper is for the engraving or drawing the circle in the enhanced format with the ratio r. Where r being the radius of the enhanced circle.

In this case we are considering the user input for link length OA and OB and AD.

Based on these three links we can calculate the entire enhancement ratio of the circle drawn by the tracing point (i.e the E point)

Using trigonometric relations in the above geometry, we calculate the angles , & .

Calculation of angle

= cos1 (

Calculation of angle

2 + 2 2 2 )

D point is the Drawing point of the Mechanism. Euclidean distance of point D from origin.

= [( + cos ) 0]2 + [( + sin ) 0]2

For

+ sin

= tan1 ( )

+ cos

Enhancement Ratio of the circle is calculated by

=

Since the simulation consist of a circle enhancement the angle will vary from 0 to 2 with the interval of 1 radian Considering, w = 0.1 radian per time instance

And t = 1:1000 – time instance

= Ã—

Then we find the coordinates of all the points in the mechanism by mapping them in X-Y plane.

= OA [cos( + )), sin( + )]

= ( + ) [cos( + ), sin( + )]

= [ + cos + cos( + ), + sin + sin( + )]

= [ + cos , + sin ]

In MATLAB the coordinates of the points are stored in an array, so to calculate the distance between them, we have to consider the Euclidean distance.

Euclidean Distance formula is as follows:

The Euclidean Distance between points is :

In MATLAB there is an inbuild function for the calculating Euclidean distance. The below equation gives distance between the point origin and point A.

= [( cos( + )) 0]2 + [( sin( + )) 0]2

Coordinates center of the Tracing Circle

= (, )

E is the Tracing Point and its coordinates are

= [ + cos , + sin ]

3. SIMULATION

For the simulation in MATLAB considering the following test case

OA = 6 units AB = 3 units AD = 4 units Pd = [5,5]

Radius of drawing circle = 1

Therefore, radius of tracing circle (r) = 1.5

1. MATLAB CODE:

clc; clear all;

a = input('input Length of Link OA');

b = input('Input length of link AB');

d = input('Input length of Link AC');

% Origin Point O=[0, 0];

%center of the Drawing circle point pd=[5,5];

%plot parameters axis(gca,'equal');

axis([-10 20 -5 20]);

%angular speed w=0.1;

Similarly, we calculate the distance between the OB, BC which are required for the further calculations.

While considering the coordinates of the drawing point (D) the constraints are

0 < (, ) < +

for t=1:1000 % Simulation run time

theta=w*t; % theta changing w.r.t angular speed

% Calculating Euclidean distance of a drawing point OD=[0,0;(pd(1)+cos(theta)), (pd(2)+sin(theta))]; dOD = pdist(OD,'euclidean');

%calculations of alpha and beta

alpha = acos((a^2+(dOD*dOD)- d^2)/(2*a*dOD));

beta = atan((pd(2)+sin(theta))/(pd(1)+cos(theta)));

%Coordinates of points of the mechanism

A = a*[cos(alpha + beta) sin(alpha + beta) ];

B = (a+b)*[cos(alpha + beta) sin(alpha + beta)]; D = [(pd(1)+cos(theta)) (pd(2)+sin(theta))];

C = [(pd(1)+cos(theta)+b*cos(alpha+beta)) (pd(2)+sin(theta)+b*sin(alpha+beta))];

% Distance calculation for OA and OB OA = [0,0 ; A(1),A(2)];

dOA = pdist(OA,'euclidean'); OB=[0,0 ;B(2),B(1)];

dOB = pdist(OB,'euclidean');

%Calculation of the enhancement Ratior=(dOB/dOA);

%Center point of the Tracing Circle Pe=r*[pd(1),pd(2)];

%coordinates of tracing point E=r*[D(1), D(2)];

%distance between BE

BE = [B(1),B(2);E(1),E(2)]

dBE = pdist(BE,'euclidean');

%The following lines represent the mechanical

OA=line([O(1) A(1)],[O(2) A(2)]);

AB=line([A(1) B(1)],[A(2) B(2)]);

BC=line([B(1) C(1)],[B(2) C(2)]);

CD=line([C(1) D(1)],[C(2) D(2)]);

CE=line([C(1) E(1)],[C(2) E(2)]);

%Drawing the trajectories of the drawing and tracing circle Pd_circ=viscircles(pd,1);

Pd_traj= viscircles([pd(1) pd(2)],1,'LineStyle','- -'); Pe_circ =viscircles(Pe,r);

Pe_traj= viscircles([r*pd(1) r*pd(2)],r,'LineStyle','- -');

%interval for updation pause(0.001);

%delete previous shapes delete(Pd_circ); delete(Pd_traj); delete(Pe_circ); delete(Pe_traj); delete(OA); delete(AB); delete(BC); delete(CD); delete(AD); delete(CE);

end

2. SIMULATION RESULTS :

(Figure 3 MATLAB simulation -1)

(Figure 4- MATLAB Simulation -2)

MATLAB Workspace:

(Figure 5 MATLAB workspace displaying all the variables )

We have successfully done the mathematical modeling of pantograph to trace a circle in MATLAB, which can be seen in above figures

VI. REFERENCES :

1. PANTOGRAPH ENGRAVING MACHINE – A REVIEW http://www.iraj.in/journal/journal_file/journal_pdf/2-449- 15244767461-4.pdf