This notebook uses the NDSolve command to solve the differential equations that govern the motion of a Roberts’ linkage. The code solves the equations in three parts, since the equations have three different limit ranges. The animation shows the linkage moving from a starting position to a final position, and it can be used to visualize the motion of the linkage.

Type 1 Robert Linkage Rev D

Parameters

​​Figure1.Type1RobertLinkage,reference[1]
In[]:=
l=6;(*length
O
1
A=lengthAB=length
BO
2
=l;length
O
1
O
2
=2l*)

Kinematic Analysis

Displacement Equations

The displacement equations are obtained analyzing the mechanism geometry​
​Figure 2. Equations 1 & 2 describe the x and z axis displacements, and Equation 3 is a geometric restriction for segment AB.
In[]:=
Clear[θ1,θ2,θ3];​​​​ξ=Cos[θ1[t]]+Cos[θ2[t]]-Cos[θ3[t]]-2==0;(*Eq.1alongxaxis*)​​ψ=Sin[θ1[t]]+Sin[θ2[t]]-Sin[θ3[t]]==0;(*Eq.2alongzaxis*)​​ρ=4Cos[θ1]+2Cos[θ1-θ3]5+4Cos[θ3];(*Eq.3isaconstraint:lengthAB=l*)​​

Velocity Equations

Clear[θ1,θ2,θ3];​​Dt[{ξ,ψ},t](*Derivingthedisplacementequationstoobtainasystemofdifferentialequationsthatarealsothevelocityequations*)
Out[]=
{-Sin[θ1[t]]
′
θ1
[t]-Sin[θ2[t]]
′
θ2
[t]+Sin[θ3[t]]
′
θ3
[t]0,Cos[θ1[t]]
′
θ1
[t]+Cos[θ2[t]]
′
θ2
[t]-Cos[θ3[t]]
′
θ3
[t]0}

Solving for the unknown variables θ2 & θ3 (Part 3 of the Animation)

The entry angle,
θ
1
, is taken as a known input (
θ
1
= t), and the input angular velocity is taken as
′
θ
1
= 1 rad/s. For more details, see reference [2].To obtain the range of the independent variable
t
, from
t
min
to
t
max
, the cosine law is applied to the mechanism when the angle θ1 reaches its maximum value.This occurs when links AB and B
O
2
are aligned, so the maximum distance between A and B through
O
2
is 2l. Note that distance between
O
1
and
O
2
is also 2l, so points A, B and
O
2
form an isosceles triangle at this instant.​
​Figure 3. Determination of the
t
min
value of the range, for the independent variable
θ
1
In[]:=
mx1=1.3181;(*
t
min
for
θ
1
range*)
The maximum value,
t
max
, of the independent variable range is simply
-
θ
1max
=-mx1
​​
​Figure 4. Horizontal reflection of Figure 3 to determine the maximum value of the range,
t
max
,
for the independent variable
θ
1
.
In[]:=
s1=NDSolve-Sin[t]-Sin[θ2[t]]
′
θ2
[t]+Sin[θ3[t]]
′
θ3
[t]0,Cos[t]+Cos[θ2[t]]
′
θ2
[t]-Cos[θ3[t]]
′
θ3
[t]0,θ2[0]==
π
3
,θ3[0]==
2π
3
,{θ2,θ3},{t,mx1,-mx1}(*SolvingtheODEsforθ1astheindependentvariable.Notethatθ1[t]isreplacedbytand
′
θ1
[t]by1intheODEsorvelocityequations*)
Out[]=
θ2InterpolatingFunction
Domain: {{-1.32,1.32}}
Output: scalar
,θ3InterpolatingFunction
Domain: {{-1.32,1.32}}
Output: scalar

In[]:=
G3=Plot[Evaluate[{θ2[t],θ3[t]}/.s1],{t,mx1,-mx1},PlotLabelsPlaced[{"θ2","θ3"},Above],FrameTrue,AxesLabel{"t (​
θ
1
​)","rad"},Axes->True,AxesOrigin{0,0},PlotRange{{-2,5},{-1,7}},ImageSize->400](*plottingthesolutions*)
Out[]=

Solving for the unknown variables
θ
1
&
θ
2
(Parts 1 and 2 of the Animation)

In[]:=
Clear[θ1,θ2,t]
To complete the movement cycle, we take
θ
3
as the entry angle and the input angular velocity as
′
θ
3
= 1 rad/s. The minimum value of the independent variable range,
t
min
, can be obtained by inspecting the figure below, which is the vertical reflection of Figure 3.​
​Figure 5. Determination of the
t
min
value of the range, for the independent variable
θ
3
In[]:=
mx2=π-mx1;(*
t
min
for
θ
3
*)
The maximum value of the independent variable range,
t
max
, is simply
π+
θ
1max
=π+mx1
​​
​Figure 6. Horizontal reflection of Figure 5 to determine the maximum value of the range,
t
max
, for the independent value
θ
3
In[]:=
mx3=π+mx1;(*
t
max
for
θ
3
*)
In[]:=
s2=NDSolve-Sin[θ1[t]]
′
θ1
[t]-Sin[θ2[t]]
′
θ2
[t]+Sin[t]0,Cos[θ1[t]]
′
θ1
[t]+Cos[θ2[t]]
′
θ2
[t]-Cos[t]0,θ1[π]==
π
3
,θ2[π]==
5π
3
,{θ1,θ2},{t,mx2,mx3}(*SolvingtheODEsforθ3astheindependentvariable.Notethatθ3[t]isreplacedbytand
′
θ3
[t]by1intheODEsorvelocityequations*)
Out[]=
θ1InterpolatingFunction
Domain: {{1.82,4.46}}
Output: scalar
,θ2InterpolatingFunction
Domain: {{1.82,4.46}}
Output: scalar


Animation

Animation Parameters

References

[1] RIUTORT, Kevin T. Applied design and implementation of straight-line mechanisms. 1996. Thesis Doctoral. Virginia Tech
[2] PAUL, B.; KRAJCINOVIC, D. Computer analysis of machines with planar motion: Part 1—Kinematics.

CITE THIS NOTEBOOK

Animating the dynamics of Roberts' linkage with numerical solutions of differential equations​
by David Balandra​
Wolfram Community, STAFF PICKS, July 2, 2023
​https://community.wolfram.com/groups/-/m/t/2949486