16
Dynamics of a four-bar linkage A B C O 1 A Matlab Program for m 18 . 0 m 18 . 0 m 26 . 0 m 08 . 0 OC BC AB OA m N 1 . 0 T 2 4 2 3 2 5 m kg 10 86 . 4 m kg 10 46 . 1 m kg 10 27 . 4 BO AB OA I I I kg 18 . 0 kg 26 . 0 kg 08 . 0 BC AB OA M M M 2 s m 9.8 g

Dynamics of a four-bar linkage

  • Upload
    tareq

  • View
    99

  • Download
    2

Embed Size (px)

DESCRIPTION

A Matlab Program for. Dynamics of a four-bar linkage. B. A. C. O. Mass matrix and external force vector . Jacobian matrix and γ. Computation. A convenient way with Matlab solver . Solve initial value problems for ordinary differential equations with ode45(commended), ode23, ode113… - PowerPoint PPT Presentation

Citation preview

Page 1: Dynamics of a four-bar linkage

Dynamics of a four-bar linkage

m18.0

m18.0

m26.0

m08.0

OC

BC

AB

OA

A

B

CO

mN1.0 T

24

23

25

mkg1086.4

mkg1046.1

mkg1027.4

BO

AB

OA

I

I

I

kg18.0kg26.0kg08.0

BC

AB

OA

MMM

2sm9.8g

1

A Matlab Program for

Page 2: Dynamics of a four-bar linkage

Mass matrix and external force vector

4

3

5

1086.40000000000.180000000000.180000000001046.10000000000.260000000000.260000000001027.400000000008.000000000008.0

M

2sm9.8g

kg18.0kg26.0kg08.0

BC

AB

OA

MMM

24

23

25

mkg1086.4

mkg1046.1

mkg1027.4

BO

AB

OA

I

I

I

mN1.0 T

08.918.0

00

8.926.001.0

8.908.00

g

2

Page 3: Dynamics of a four-bar linkage

0sin09.0cos09.0

sin09.0sin13.0cos09.0cos13.0sin13.0sin05.0cos13.0cos05.0

sin04.0cos04.0

233

233

233

222

233

222

222

2

222

2

2

2

γ

Jacobian matrix and γ

000000100cos09.010000000sin09.001000000

cos09.010cos13.010000sin09.001sin13.001000

000cos13.010cos04.010000sin13.001sin04.001000000cos04.010000000sin04.001

3

3

32

32

2

2

99

J

m18.0

m18.0

m26.0

m08.0

OC

BC

AB

OA

3

Page 4: Dynamics of a four-bar linkage

Computation

9 8

8 9 8 8

9 1 8 1

In numerial computing, the first step is to solve

for 0 and 0 with initial position 0 and velocity 0 .

T

q gM Jλ γJ O

q λ q q

9 9 9 8

8 9 8 8

The objective is to solve the differential equation for .T

t

q gM Jq

λ γJ O

0Then integrate , and use and

0

to repeat the above step for and .

Δt ΔtΔt Δt

Δt

Δt Δt

q qq q

q q

q λ

Repeat until.t Δt

4

Page 5: Dynamics of a four-bar linkage

A convenient way with Matlab solver

Solve initial value problems for ordinary differential equations with ode45(commended), ode23, ode113…

The equations are described in the form of z‘=f(t,z)

qq

zqq

z

,Let

3

1

1

3

1

1

yx

yx

5

Page 6: Dynamics of a four-bar linkage

The syntax for calling solver in Matlab

[T,Z] = ode45(@Func4Bar,[0:0.005:2],Z0);

column vector of time points

Solution array

A vector specifying the interval of integration

A vector of initial conditions

A function that evaluates the right side of the differential equations

function dz=Func4Bar(t,z) global L1 L2 L3 L4 torque gravity phi1=z(3); phi2=z(6); phi3=z(9);dphi1=z(12); dphi2=z(15); dphi3=z(18); M=diag([L1 L1 L1^3/12 L2 L2 L2^3/12 L3 L3 L3^3/12]); J=[ -1 0 -0.5*L1*sin(phi1) 0 0 0 0 0 0; 0 -1 0.5*L1*cos(phi1) 0 0 0 0 0 0; 1 0 -0.5*L1*sin(phi1) -1 0 -0.5*L2*sin(phi2) 0 0 0; 0 1 0.5*L1*cos(phi1) 0 -1 0.5*L2*cos(phi2) 0 0 0; 0 0 0 1 0 -0.5*L2*sin(phi2) -1 0 -0.5*L3*sin(phi3); 0 0 0 0 1 0.5*L2*cos(phi2) 0 -1 0.5*L3*cos(phi3); 0 0 0 0 0 0 1 0 -0.5*L3*sin(phi3); 0 0 0 0 0 0 0 1 0.5*L3*cos(phi3)]; 6

Page 7: Dynamics of a four-bar linkage

The syntax for calling solver in MatlabJ=[ -1 0 -0.5*L1*sin(phi1) 0 0 0 0 0 0; 0 -1 0.5*L1*cos(phi1) 0 0 0 0 0 0; 1 0 -0.5*L1*sin(phi1) -1 0 -0.5*L2*sin(phi2) 0 0 0; 0 1 0.5*L1*cos(phi1) 0 -1 0.5*L2*cos(phi2) 0 0 0; 0 0 0 1 0 -0.5*L2*sin(phi2) -1 0 -0.5*L3*sin(phi3); 0 0 0 0 1 0.5*L2*cos(phi2) 0 -1 0.5*L3*cos(phi3); 0 0 0 0 0 0 1 0 -0.5*L3*sin(phi3); 0 0 0 0 0 0 0 1 0.5*L3*cos(phi3)];

gamma=[ 0.5*L1*cos(phi1)*dphi1^2; 0.5*L1*sin(phi1)*dphi1^2; 0.5*L1*cos(phi1)*dphi1^2+0.5*L2*cos(phi2)*dphi2^2; 0.5*L1*sin(phi1)*dphi1^2+0.5*L2*sin(phi2)*dphi2^2; 0.5*L2*cos(phi2)*dphi2^2+0.5*L3*cos(phi3)*dphi3^2; 0.5*L2*sin(phi2)*dphi2^2+0.5*L3*sin(phi3)*dphi3^2; 0.5*L3*cos(phi3)*dphi3^2; 0.5*L3*sin(phi3)*dphi3^2]; g=[0 gravity*L1 torque 0 gravity*L2 0 0 gravity*L3 0]';

Matrix=[M J'; J zeros(size(J,1),size(J,1))];

d2q=Matrix\[g;gamma];

dz=[z(10:18,:); d2q(1:9,:)];7

Page 8: Dynamics of a four-bar linkage

Time response of displacement

1x

1

1y

2x

2

2y

3x

3

3y

t8

Page 9: Dynamics of a four-bar linkage

Time response of velocity

1x

1

1y

2x

2

2y

3x

3

3y

t9

Page 10: Dynamics of a four-bar linkage

Time response of acceleration

1x

1

1y

2x

2

2y

3x

3

3y

t

310

10

Page 11: Dynamics of a four-bar linkage

Time response of λ

1

t

310

2

3

4

5

6

7

8

11

Page 12: Dynamics of a four-bar linkage

A slider-crank mechanism

m2.0

m3.0

m2.0

m1.0

BO

GB

AG

AC

A

B

CO

G

24

22

24

mkg1067.6

mkg1004.1mkg1067.6

BO

AB

slider

I

II

kg2.0kg5.0kg1.0

BO

AB

AC

MMM

mN1.0 T

2sm9.8g

12

Page 13: Dynamics of a four-bar linkage

Time response of displacement

2x

2

2y

3x

3

3y

4x

4

4y

t13

Page 14: Dynamics of a four-bar linkage

Time response of velocity

2x

2

2y

3x

3

3y

4x

4

4y

t14

Page 15: Dynamics of a four-bar linkage

Time response of acceleration

2x

2

2y

3x

3

3y

t

4x

4

4y

310

15

Page 16: Dynamics of a four-bar linkage

Time response of λ

1

t

310

2

3

4

5

6

7

8

9

10

11

16