This tutorial is delivered subject to the following conditions and restrictions:
This tutorial contains proprietary information belonging to Elmo Motion Control Ltd.
The text and graphics included in this manual are for the purpose of illustration and
reference only. The specifications on which they are based are subject to change
without notice.
Elmo Motion Control and the Elmo Motion Control logo are trademarks of Elmo
Motion Control Ltd.
Information in this document is subject to change without notice.
Appendix C: Intersection point of two lines defined by the end points ....................... C-1
Appendix D: Circle – line intersection points ...................................................................D-1
2-6
2-12
2-20
2-22
2-24
2-25
Maestro Motion Library Tutorial
MAN-INTUG (Ver. 1.7)
Chapter 1: General Description
1.1 Introduction
The Motion Library (ML) produces trajectories based on the PVT mechanism. It implements a set
of functions that calculate trajectories as PVT tables for the vector motion. As a result of a call to the
Motion Library functions, the user gets a PVT table for the requested trajectory. It supports two
and three-dimensional vector motion.
A PVT table is a two or three-dimensional sequence of PVT points.
Each PVT point is defined by:
• position value
• velocity for this position
1
•time interval that is necessary to arrive from the current position to the position defined by
the next PVT point
It supports
1. Single shape trajectories:
line (2D,3D)
circle (2D)
2. Trajectory built from an arbitrary set of pointes interpolated by the cubic spline (2D,3D)
3. Polyline trajectory that can include a number of single shapes:
line segments (2D,3D)
circle arc segments (2D)
spline points (2D,3D)
Inside polyline transition from one shape to another can be executed with a non-zero velocity. In
this case, an additional element – switch circle arc-- is inserted between two shapes.
In the case of two-dimensional vector motion, switch arcs can be built for the line-line, line-circle,
circle-line and circle-circle intersections. In the case of a three-dimensional polyline, switch arcs can
be built for the line-line intersection.
1.2 Vector properties
Geometry of trajectory is defined by the set of vector functions such as circle() or line(). The
Velocity profile is also influenced by the set of the following parameters (vector properties):
maximum vector acceleration/deceleration (vac/vdc)
maximum vector velocity (vsp)
end velocity (vse)
Maestro Motion Library Tutorial
MAN-INTUG (Ver. 1.7)
general trajectory time (vtt)
switch arc definitions (vsc, vsr, vsd)
admissible velocity and position errors definitions (vpe,vve)
PVT step low and high limits (VNT,VXT )
All of the vector’s properties can be set in a user program or by the Command Interpreter.
Syntax of a property:
Vector_name.property
Examples:
v1.vsp - defines maximum vector velocity
v1.vtt - defines trajectory time
v1.vsc - defines smooth type from one shape to another
2
(1 – minimal radius switch arc, 2 – fixed radius switch arc, 3 – switch with a fixed distance from
the intersection point).
Single shape trajectories can be executed in one of three modes pre-defined by the value of the
input parameter vum: 1 – max velocity, 2 – fixed time, 3 – fixed velocity.
In the maximum velocity mode, velocity defined by the parameter vsp is considered a limiting
value that cannot be exceeded. If a trajectory is not long enough to achieve such a value, then a
trajectory with a triangle velocity profile is built and some maximum vector velocity
V
max
< vsp
is achieved at one point.
The fixed velocity mode (vum=3) is used if the user is interested in building a trajectory with a
trapezium velocity profile – the main part of the trajectory (with the exception of possible
acceleration/deceleration at the initial and final parts of the trajectory) is executed with a velocity
equal to vsp. If a trajectory is not long enough to reach velocity vsp with the given vector
acceleration /deceleration (input parameters vac/vdc), the trajectory is not built and the user
receives an error message.
In the fixed time mode (vum = 2) the user must define parameter vtt – time in milliseconds for the
trajectory execution. The Motion Library chooses a velocity profile that satisfies parameter vtt. If a
trajectory with the given length, maximum velocity vsp and vector acceleration/deceleration
cannot be executed within time vtt trajectory is not built and the user receives an error message.
The user can set values for the maximum PVT step in milliseconds – parameter vxt and for the
minimal PVT step – parameter vnt ≥ 1msec. In this case, the main part of the trajectory will be
executed with the PVT step
ΔT = 0.5(vxt + vnt).
For the switch arc, connecting two shapes can be chosen from one of the three possible modes predefined by the input parameter vsc: 0 – no switch arc to be built, 1 – switch arc with the minimal
possible radius, 2 – switch arc with radius pre-defined by the user, 3 – user defined distance from
the intersection point (for the line-line or circle-line intersections).
Maestro Motion Library Tutorial
MAN-INTUG (Ver. 1.7)
1.3 Trajectory generation
1.3.1 Line
Target position for a line is defined by the parameters of the function line():
Two-dimensional line
V1.line(x,y) – produces a line trajectory from the current position to the point (x,y), where x and
y integer values in counts.
Three-dimensional line
V1.line(x,y,z) – produces line trajectory from the current position to the point (x,y,z), where x,y
and z - integer values in counts.
1.3.2 Circle
Radius, initial and sweep angles for a circle must be defined as parameters of a function circle():
V1.circle(radius, init_angle,sweep_angle), where init_angle and sweep_angle must be set in
degrees (float), radius in counts (integer).
Example (Motion Mathematic Lib Samples\ Vector_2D \CircleArc – www.elmomc.com)
v1.vac = 28000000 //max acceleration
3
v1.vdc = 28000000 //max deceleration
v1.vum = 1 //build trajectory in max. velocity mode
v1.vsp = 250000 //maximum velocity
v1.vse = 0 //end velocity
v1.circle(100000,45,-270) //build circle arc trajectory
v1.bg // start motion
while (a1.ms==2)||(a2.ms==2) //wait until both axes have stopped
wait(10)
end while
1.3.3 Spline
A spline gives the possibility to move a smooth curve through an arbitrary set of points that do not
necessary belong to a particular geometric shape as a circle, ellipse or a line.
The spline that is supported by the Motion Library is an interpolation cubic spline. All the points
Po,P1,...,P
points
given by the user belong to the spline curve. Between each pair of the neighboring
n
(Pi,P
), cubic spline is defined by a third-order polynomial.
i+1
Maestro Motion Library Tutorial
MAN-INTUG (Ver. 1.7)
Other popular types of splines like Bezier curves, B- splines or NURBS are usually not
interpolation but smoothing splines. The spline curve does not move through the given points but
near them.
So cubic splines are piecewise polynomial (built of cubic polynomials for each segment [i,i+1]) and
produce a curve with continuous first and second derivatives at the internal control points
…,
P
that, in case of motion control, means continuity of the velocity and acceleration. Denote a
n-1
cubic spline polynomial for the segment [i,i+1] as
and S
′′(ti) = S′′
i
), i = 1,2,…,n-1.
i+1(ti
Si(t) than Si(ti) = S
), Si′(ti) = S
i+1(ti
P
i+1
The spline trajectory is executed in the maximum velocity mode vum = 1. Input parameters that
define kinematics of the trajectory are maximum velocity – parameter vsp, vector acceleration –
parameter vac and vector deceleration – parameter vdc.
The Motion Library user can define points for the spline interpolation applying the following
function calls:
vector_name.splines(trj_name) - starts a sequence of points to be interpolated. The PVT table is
saved in a file named trj_name. The function parameter trj_name can be missed. In this case, the
trajectory is saved in a temporary file named vector_name.trj (where vector_name – name
defined in a resource file).
To interpolate two-dimensional points, use a function call
, P2,
1
′(ti)
4
vector_name.splinep(int PosX, int PosY) ) – adds interpolation point with coordinates (PosX,
PosY).
In three-dimensional space
vector_name.splinep(int PosX, int PosY, int PosZ) ) – adds 3D interpolation point with
coordinates (PosX, PosY, PosZ).
vector_name.splinee(parameter) - ends the spline trajectory sequence.
– If parameter = 0 the standard PVT table that in each line contains PVT points for the X and Y
axes (for 2D spline) or PVT points for X, Y and Z axes (for 3D spline) is built.
– If parameter ≠ 0 three tables for the axis X, axis Y and for the gear are built. The table for the
gear contains PVT points with the position equal to the distance along the spline from the
2
initial spline position, vector velocity V = [V
2]1/2
+ V
x
for this position and a standard time
y
step (in 3D case four tables for X,Y, Z and gear are built).
Inside the spline operator parenthesis splines(trj_name) and vector_name.splinee(parameter) can be added operators for the position calculation (for
instance ellipse points X = X
+ acos(t), Y = Yc + bsin(t)).
c
The Motion Library generates a trajectory by the cubic spline interpolation
Important note: Current position is not automatically added to the sequence of spline points.
Homing must be done to the first spline point.
Maestro Motion Library Tutorial
MAN-INTUG (Ver. 1.7)
1.3.3.1 Examples for the two-dimensional spline interpolation
Example Example (Motion Mathematic Lib Samples\ Vector_2D \ Spline_Ellipse –
www.elmomc.com)
Ellipse trajectory (2D spline interpolation)
v1.vum=1 //build trajectory in max velocity mode
v1.vac = 28000000 //max acceleration
v1.vdc = 28000000 //max deceleration
v1.vsp = 50000//max. velocity
v1.vse = 0 //end velocity
pi = 3.14159265358979
5
a = 100000
//ellipse axis a
b = 50000 //ellipse axis b
Xc = 0 //ellipse center coordinateby X
Yc = 0 //ellipse center coordinateby Y
v1.splines()//start spline trajectory
for teta = 0:pi/18:2*pi
x = Xc + a*cos(teta)
y = Yc + b*sin(teta)
v1.splinep(x,y)
// add point to the spline trajector y
end for
v1.splinee(0) // end spline trajectory
v1.bg //start motion
After homing drives must at the first point of the sequence.
Example Example (Motion Mathematic Lib Samples\ Vector_2D \ Lissajous curves –
www.elmomc.com)
v1.vac = 28000000 //max vector acceleration
v1.vdc = 28000000 //max vector deceleration
v1.vsp = 100000 //set max. velocity
v1.vse = 0 //set end velocity
v1.splines() // start spline sequence
Maestro Motion Library Tutorial
MAN-INTUG (Ver. 1.7)
for t = 0:pi/72:2*pi
x = R*cos(3*t)
y = R*sin(5*t)
v1.splinep(x,y) // add spline point
end for
v1.splinee(0) // end spline sequence
v1.bg //start motion
while (a1.ms==2)||(a2.ms==2) //wait until both axes have stopped
wait(10)
end while
6
Figure 1-1: Recording of the spline trajectory (Lissajous curves)
1.3.3.2 Examples of three-dimensional spline interpolatio n
For 3D vector motion, there must be a defined resource file with a vector built from three axes.
In the Elmo Studio it can be defined as shown in the picture below.
Maestro Motion Library Tutorial
MAN-INTUG (Ver. 1.7)
7
Figure 1-2: Resources for the 3D vector
Example (Motion Mathematic Lib Samples\ Vector_3D \ Spline_3D – www.elmomc.com)
A spline curve throws a number of arbitrary points
SetAxisStartPos(a1, 0) //set coordinate x to 0
SetAxisStartPos(a2, 0) //set coordinate y to 0
SetAxisStartPos(a3, 0) //set coordinate y to 0
v2.vsp = 50000
v2.vse=0
v2.splines() // start spline sequence
v2.splinep(0, 0, 0) // add spline 3D point
v2.splinep(50000, 100000, 150000) // add spline 3D point
v2.splinep(100000, 50000, 100000) // add spline 3D point
v2.splinep(200000, 150000, 50000) //add spline 3D point
v2.splinee(0) // end spline sequence
Three-dimensional picture can be drawn in Matlab with the use of the following Matlaboperators
%d %d %d ', -1) where 'D:\Dir_22_01\trj_file – full path to the PVT table file.
Maestro Motion Library Tutorial
MAN-INTUG (Ver. 1.7)
For this operator to work properly, the first line of the PVT table containing a text header must be
removed.
plot3(posX,posY,posZ)
axis square; grid on
8
Figure 1-3: Three-dimensional picture corresponding to the calculated
PVT table (drawn in Matlab)
Results of the recording
Figure 1-4: Projection on the XY plane
Maestro Motion Library Tutorial
MAN-INTUG (Ver. 1.7)
Figure 1-5: Projection on the XZ plane
9
Example (Motion Mathematic Lib Samples\ Vector_3D \ Helix – www.elmomc.com)
Helix curve built with the use of the spline interpolation.
SetAxisStartPos(a1, 50000) //set coordinate x to 0
SetAxisStartPos(a2, 0) //set coordinate y to 0
SetAxisStartPos(a3, 0) //set coordinate y to 0
v2.vsp = 50000
v2.vse=0
alpha = 0 //start angle degrees
beta = 3600 // sweep angle degrees
R = 50000
H = 250000 // height
X = 50000 // start pos x
Y = 0 // start pos y
Z = 0 // start pos z
n = 120 // num points
Teta = pi*(alpha/180) //radian
dTeta = (pi*(beta/180))/n // teta increment for one step
dZ = H/n //z increment for one step
Xc = X - R*cos(Teta) // X coordinate of the helix axis
Maestro Motion Library Tutorial
MAN-INTUG (Ver. 1.7)
Yc = Y - R*sin(Teta) // X coordinate of the helix axis
v2.splines() // start spline sequence
for i=0:1:n
v2.splinep(X,Y,Z) // add spline 3D point
Teta = Teta + dTeta // calc teta for the next point
X = Xc + R*cos(Teta) // calc X coordinate for the next point
Y = Yc + R*sin(Teta) // calc Y coordinate for the next point
Z = Z + dZ // calc Z coordinate for the next point
end for
v2.splinee(0) // end spline sequence
v2.bg // begin motion
Figure 1-6: Helix three-dimensional picture for the calculated PVT table drawn in MATLAB
10
1.3.4 Polyline
To build a polyline, the Maestro user program applies the following calls to the motion library
functions:
vector_name.starts(trj_name) – starts the polyline trajectory sequence with saving the PVT table
built by the Motion Library in a file named trj_name. Parameter trj_name can be missed – in
this case trajectory is saved in a temporary file named vector_name.trj.
vector_name.ends() - ends the polyline trajectory sequence.
Maestro Motion Library Tutorial
MAN-INTUG (Ver. 1.7)
Inside the polyline operator parenthesis vector_name.starts(trj_name) and vector_name.ends() can
be added function calls – addline(), addcircle(), addsplinep() and adddwell() to define polyline
segments.
For the 2D polyline
vector_name.addline (int PosX, int PosY) – adds a line segment
PosX, PosY - destination position of the linear segment (counts)
vector_name.addcircle(int Radius, float StartAngle, float SweepAngle) – adds circle arc
segment
Radius - radius of the circle segment (counts)
start_angle - start angle of the circle segment (degrees)
sweep_angle - sweep angle of the circle segment (degrees)
vector_name.addsplinep(int x, int y) - adds two-dimensional spline point
11
Important note: The user should take into account that the last point of the previous segment or the
first point of the trajectory is automatically added to the spline. The minimal number of the
addsplinep() operators that define the same spline segment inside the polyline must be great equal
2. This requirement is valid for every spline segment inside the polyline – not only for the first one.
For the 3D polyline
vector_name.addline (int PosX, int PosY, int PosZ) – adds a line segment
PosX, PosY, PosZ - destination position of the linear segment (counts).
vector_name.addsplinep(int x, int y, int z) - adds three-dimensional spline point
As in a two-dimensional case, the last point of the previous segment is automatically added to
the spline segment and the number of points defining the spline segment cannot be less than 2.
For 2D and 3D polyline
vector_name.adddwell(delay_time) – adding delay (station) between two segments
delay_time - delay value in millisecond
Smooth transition from one curve to another inside polyline.
There are four modes that define transition from one shape to another that are defined by the
parameter (vector property) vsc:
1. vsc = 0 - switch arc is not built
2. vsc = 1 – ML builds switch arc with switch radius minimally radius that satisfies kinematics
constraint r > (vse)
vse – parameter that defines end velocity on the segment preceding switch arc
vac – parameter that defines maximum vector acceleration
vae – parameter that defines admissible error for the vector acceleration
2
/[vac*vae] where
Maestro Motion Library Tutorial
MAN-INTUG (Ver. 1.7)
3. vsc = 2 – ML builds switch arc with the switch radius vsr
(this parameter must be set by the user).
4. vsc = 3 - ML builds a switch arc with the switch radius implicitly pre-defined via parameter
vsd (distance along the line from the intersection point). Parameter vsd must be set by the
user.
For vsc = 2 and vsc = 3, the user can check if the values of the parameters vsr and vsd satisfy
geometric constraints. Such a check can be done with the use of algorithms described in chapter 2 of
this document.
Switch arc building is also influenced by the previous segment end velocity defined by the parameter
(vector property) vse.
1.3.4.1 Examples for the two-dimensional polyline
Example (Motion Mathematic Lib Samples\ Vector_2D \ LineCircle – www.elmomc.com)
12
v1.vac = 28000000 //max vector acceleration
v1.vdc = 28000000 // max vector deceleration
v1.vum = 1 // build trajectory in max velocity mode
v1.starts() // begin polyline trajectory
v1.vsp = 50000 // max velocity for the line segment
v1.vse = 50000 // end velocity
v1.addline(100000, 100000) // request to add line shape
v1.vse = 0 // end velocity for the circle segment
v1.vsc = 2 // smooth intersection with fixed switch radius
v1.vsr = 10000 // switch radius
v1.addcircle(50000,225,180) //request to add circle arc shape
v1.ends() // ends polyline trajectory
Maestro Motion Library Tutorial
MAN-INTUG (Ver. 1.7)
13
Figure 1-7: Recording of the polyline trajectory
Any trajectory generated by the Motion Library (single shape or polyline) can be rotated relative to
init point due to vector property vra – rotation angle in degrees.
Example (Motion Mathematic Lib Samples\ Vector_2D \ LineCircleRotated –
www.elmomc.com)
// The same polyline rotated at –90 degrees relative to init point
v1.vac = 28000000 //max vector acceleration
v1.vdc = 28000000 // max vector deceleration
v1.vum = 1 // build trajectory in max velocity mode
v1.vra = -90 // rotate spline 90 degrees relative to init point
v1.starts() // begin polyline trajectory
v1.vsc = 2 // smooth intersection with fixed switch radius
v1.vsp = 50000 // max velocity for the line segment
v1.vse = 50000// end velocity
v1.addline(100000, 100000)// request to add line shape
v1.vsp = 50000// maximum velocity for the circle segment
v1.vse = 0// end velocity for the circle segment
v1.vsr = 10000 // switch radius
v1.addcircle(50000,225,180)//request to add circle arc shape
v1.ends()// end polyline trajectory
Maestro Motion Library Tutorial
MAN-INTUG (Ver. 1.7)
14
Figure 1-8: Recording of the rotated polyline
1.3.4.2 Examples for the three-dimensional polyline
Example (Motion Mathematic Lib Samples\ Vector_3D \ Rectangle – www.elmomc.com)
Three-dimensional rectangle
SetAxisStartPos(a1, 0) //set coordinate x to 0
SetAxisStartPos(a2, 0) //set coordinate y to 0
SetAxisStartPos(a3, 0) //set coordinate y to 0
v2.vsc=2
v2.vsr=12000
v2.vsp = 70000 //max. vector velocity
v2.vse = 70000
v2.starts()
v2.addline(50000, 50000, 0) //create line from current point to coordinate
v2.addline(50000, 50000, 50000)
v2.addline(0, 0, 50000)
v2.vse = 0
v2.addline(0, 0, 0)
v2.ends()
Maestro Motion Library Tutorial
MAN-INTUG (Ver. 1.7)
Figure 1-9: Three-dimensional polygon drawn in Matlab
15
Results of the recording
Figure 1-10: Projection on the XZ plane
Maestro Motion Library Tutorial
MAN-INTUG (Ver. 1.7)
16
Figure 1-11: Projection on the YZ plane
1.4 Transition to a new trajectory with a non-zero velocity
If a transition from one trajectory to another (for instance from a line to a circle) must be executed
with a velocity not equal to zero at the switch point, the Motion Library builds a switch curve to
achieve smooth modification of the velocity. Such a curve is implemented as a circle arc.
As a geometrical object switch arc is completely defined by:
• radius
• coordinates of the two limit points (
where (
(
•center coordinates (X
The radius
r
X
X
last
first
, Y
) – last point on the first shape
last
, Y
) – first point on the second shape
first
)
o,Yo
r of the switch arc can be:
X
last
, Y
) and (X
last
first
, Y
first
)
1. Explicitly pre-defined by the user (vsc = 2, vsr defined).
In this case, it must obey the following restriction:
r ≥ (V
where
AC
) 2/AC
end
V
- end velocity at the switch point,
end
v -
v
vector acceleration.
(1-1)
Maestro Motion Library Tutorial
MAN-INTUG (Ver. 1.7)
17
In fact, the value defined as r ≥ (vse)
the calculations.
Implicitly pre-defined by the user via smooth distance d along the line from the intersection
2.
point (vsc = 3, vsd defined). This mode can be implemented to the line – line, circle – line
and line – circle trajectory intersections.
3. Calculated as a minimal possible for the given end velocity V
AC
Regardless of the
switch arc is considered to be uniform with the constant tangent velocity
angle velocity
(vsc = 1).
v
r definition (pre-defined by the user or calculated by (1-1)) movement along the
2
/(vae*vac )
(by default vae = 0.9) must be used in
and vector acceleration
end
V = V
andconstant
end
ω = V/r (1-2)
The intersection geometry imposes constraints on the switch arc radius. So the switch radius in use
r must satisfy
(V
) 2/AC
end
< r < r
v
max
(1-3)
Chapter 2 will consider all cases of the two shapes intersections and methods for the calculation of
the switch
As a base value for the switch velocity is taken the preceding segment end velocity V
by the parameter vse. This value is considered as a limiting parameter that cannot be exceeded but
can be decreased. It’s also valid in case that polyline segments (preceding switch arc and the
following) are executed in the fixed velocity mode (vum = 3).
In switch mode vsc = 1, the initial value of a switch velocity equal vse and can be decreased to
build a switch arc trajectory equal to the integer number of PVT steps or milliseconds.
In switch mode vsc = 1, the radius of the switch arc is calculated as a minimal possible for the
intersection geometry and given vector acceleration/deceleration (input parameters vac/vdc)
meaning that the calculated value satisfies
account the requirement to build switch arc trajectory equal to an integer number of PVT steps. The
Motion Library is trying to build switch arc trajectory with velocity as close to the value given by
the parameter vse for the preceding segment as possible. The switch arc (or two arcs on both ends
of the segment) can take up almost all segment length that sometimes makes trajectory calculation
impossible.
As an example consider the following: segment initial velocity equal
radius limit valuer
max.
defined
end
(1-3). While the switch arc calculation is also taken into
Vo, end velocity V
and
e
min(V
(where ΔL – the length of the segment truncated by switch arcs, ΔT – standardPVT step). When
defining switch radius (input parameter vsr) for vsc = 2 mode or end velocity (input parameter vse)
for vsc = 1 mode, the user must take into account that it can significantly influences the whole
trajectory and in fact replaces the main part of a particular segment by switch arcs.
)ΔT > ΔL (1-4)
o,Ve
Maestro Motion Library Tutorial
MAN-INTUG (Ver. 1.7)
Input parameters and intersection geometry define the influence of a switch arc on a trajectory. The
main cases of shapes intersection are considered below. Here as an example to consider two lines
intersection. If an angle between two lines is small, even a switch arc with a small radius can
significantly change initial trajectory while an arc with the same radius can be insignificant for lines
with intersection angle close to
180
o
.
In addition to geometric constraints, the Motion Library imposes limitations on the switch arc
length. Each switch arc should not exceed 50% of the segment length. If there are two switch arcs
adjacent to some polyline segment, then both arcs should not take more than 80% of its initial
length.
18
Motion Library TutorialSwitch Radius Calculation
MAN-MLT (Ver 2.0)
Chapter 2: Switch Radius Calculation
2.1 Line – line intersection
2-1
If a trajectory contains a switch from line L
of the vector velocity cannot be changed at the one intersection point. To implement such a
switch, insert into a trajectory an additional element – circle arc is inserted into a trajectory
(see-Figure 2-1).
The switch arc radius must satisfy (1-1).
to line L
1
with non-zero velocity, the direction
2
Figure 2-1
In the case of a line-line intersection, parameters
equation
r and d are connected by the simple
r = d*tg(γ/2) (2.1-1
where γ = π – α (α - angle between vectors L
and L2) so the pre-defined parameter
1
vsd = d must satisfy
vsd ≥ (V
If ΔL1 is the length of the line L1 and ΔL2 is the length of the line L2, then there is an evident
geometric constraint for the switch radius r
r
≤ min(ΔL1, ΔL
max
(2.1-3)
In fact, due to additional limitations (50% of the segment length) used in ML, the following
should be used
)2/[ACv tg(γ/2)]
end
)*tg(γ/2)
2
(2.1-2)
Motion Library TutorialSwitch Radius Calculation
MAN-MLT (Ver 2.0)
2-2
vsr ≤ min(0.5ΔL1, 0.5ΔL
(2.1-4)
)*tg(γ/2)
2
and kinematics constraint
V
end
(2.1-5)
≤ [r*vae*ACv)]
1/2
where vae – acceleration error (default value – 0.9).
So the user defined parameters must satisfy
vse ≤ [vsr*vae*vac]
(2.1-6)
vse – segment end velocity, vsr – switch radius, vac – vector acceleration.
1/2
Example 2.1a
Line 1 is defined by its init point (50000, 70000) and end point (60000,20000). .Line 2 is
defined by the init point (60000,20000) and its end point (60000,70000). Switching from Line
1 to Line 2 must be executed with a minimal switch radius (vsc = 1). The cruise velocity is
defined as vsp = 50000 and the end velocity vse = 50000. Vector acceleration/deceleration
vac = vdc = 500000
1. The calculated minimal switch radius that satisfies kinematics constraint is
r_min = (vse)
2
/(vac*vae) = (50000)2/(500000*0.9) = 5555.6
2. The calculated distance from the intersection point that corresponds to r_min = 5555.6
d = r_min/tg(γ/2) = 5555.6/tg(0.5*0.1974) = 56105
d > ΔL1 and d > ΔL
geometric constraints. Possible solutions: to decrease the end velocity vse or increase
vector acceleration vac. Suppose that the vector acceleration is pre-defined by the
mechanical parameters of the system and decrease end velocity.
which means that the minimal switch radius does not fit the
2
d
= min(ΔL1,ΔL2) = 50000
max
Motion Library TutorialSwitch Radius Calculation
MAN-MLT (Ver 2.0)
r
_max
= d
*tg(γ/2) = 50000* tg(0.5*0.1974) = 4951
max
This value is limiting and produces singular trajectory with the switch arc that replaces
L
. So we should take some value less than limiting value 4951 for instance 0.5* r_
2
max
=
0.5*4951 = 2475. Now we can recalculate maximum end velocity (vse) that satisfies this
value:
vse = [r*vac*vae]
1/2
= [2475*500000*0.9]
1/2
= 33376
(any value less equal than 33376 can be used with the switch radius r = 2475).
Example 2.1b
Line 1 is defined by init point (50000, 70000) and end point (60000,20000). Line 2 is
defined by the init point (60000,20000) and its end point (60000,70000). Switch from Line
1 to Line 2 must be executed with the pre-defined switch radius (vsc = 2). We define
cruise velocity vsp = 50000 and end velocity vse = 50000. Vector
acceleration/deceleration vac = vdc = 500000 and switch radius vsr = 6000
2-3
1. We calculated minimal switch radius that satisfies the kinematics constraint
r_min = (vse)
2
/(vac*vae) = (50000)2/(500000*0.9) = 5555.6
Pre-defined switch radius is greater than r_min so it satisfies kinematics constraints
2. We have to check if switch radius r_switch = 6000 satisfies geometric constraints
The distance from the intersection point that corresponds to the r_switch = 6000
d= r_switch/tg(γ/2) = 6000/tg(0.5*0.1974) = 60593
The calculated value exceeds
not fit geometric constraints and must be decreased:
ΔL
1
and
ΔL
meaning that the chosen switch radius does
2
r
= min(ΔL1, ΔL
_max
)tg(γ/2) = 50000*tg(0.5*0.1974) = 4951.
2
It is possible to choose any value r_switch that satisfies r_min < r_switch and r_switch <
r_max but in this case r_min > r_max. So as r_switch, use 0.9min(r_min , r_max) =
4455.9.
The chosen value exceeds
r_min so it does not fit the kinematics constraints and the end
velocity must be decreased:
Motion Library TutorialSwitch Radius Calculation
MAN-MLT (Ver 2.0)
2-4
vse = [r_switch*vac*vae]
1/2
= [4455.9*500000*0.9]
1/2
= 44778.9
Example 2.1c
(Motion Mathematic Lib Samples \Line To Line\LineLineMinRad_Ex_2c www.elmomc.com)
Line 1 is defined by its init point (300000, 900000) and end point (700000,200000). Line 2 is
defined by the init point (700000,200000) and its end point (1100000,700000). Switch from
Line 1 to Line 2 must be executed with the minimal switch radius (vsc = 1). We define the
cruise velocity vsp = 50000 and the end velocity vse = 50000. Vector
acceleration/deceleration is vac = vdc = 28000000.
1. We calculate the minimal switch radius that satisfies kinematics constraint by
r_min = (vse)
2. Geometric description of the two lines intersecting:
so the calculated switch radius satisfies the geometric
1
Example 2.1d
(Motion Mathematic Lib Samples\Line To Line\LineLineFixedDist_Ex_2d –
www.elmomc.com)
Motion Library TutorialSwitch Radius Calculation
MAN-MLT (Ver 2.0)
Line 1 is defined by its init point (300000, 900000) and end point (700000,200000). Line 2 is
defined by the init point (700000,200000) and its end point (1100000,700000). Switch from
Line 1 to Line 2 must be executed with a distance from the intersection point pre-defined by
the user vsc = 3, vsd = 20000. We define cruise velocity vsp = 50000 and end velocity vse =
The switch radius corresponding to the given d can be calculated as
o
r=d*tg(γ/2) = 20000tg(0.5*1.193887) = 13593
1. Check the kinematics constraints. A minimal switch radius that fits kinematics
constraints can be calculated as
r
> vse*vse/(vac*vae) = 50000
min
The implicitly pre-defined switch radius is13593 >> r
A number of similar examples with a different set of user defined and calculated
parameters are considered in the Motion Mathematic Lib Samples examples
TwoLinesFixDist_Fx2D_1 - TwoLinesFixDist_Fx2D_2.
2
/(28000000*0.9) = 99.2
min.
Motion Library TutorialSwitch Radius Calculation
MAN-MLT (Ver 2.0)
2.2 Circle – line intersection
Note: C – circle arc, L – line, R – circle radius, r – switch arc radius, (Xc,Yc) - circle center,
(X
, Yi) – intersection point, (X
i
the line L, d – distance from point (X
coordinates.
There are three possible cases that influence the calculation of parameters that define a
switch arc: initial circle center and switch arc center belong to the same half-plane, initial
circle center and switch arc center belong to different half-planes (defined by the line
and when the line (or continued line) moves through the center of the initial circle. For each
of these three cases, two sub cases are possible: from the point of intersection the line goes
either outside or inside the circle.
Circle – line intersection geometry must satisfy some necessary conditions for the switch
arc to be built.
On the first stage of calculations we define switch arc radius. It can be predefined by the user
or calculated as
-admissible acceleration error
switch arc radius can be calculated as described in 2.2.2
V2/(vae*ACv), where V – end velocity andAC
, Y
last
) – last point on the circle (X
last
, Yi) to point (X
i
first
, Y
first
), (Xo,Yo) – switch arc center
first
, Y
) – first point on
first
vector acceleration, vae
v
. If the intersection was defined by the distance d than the
L),
2-6
No matter how a switch arc radius was defined it must be coordinated with a circle and
a line parameter
2.2.1 Line goes inside the circle
2.2.1.1 Switch arc center and circle center belong to two different
half planes defined by the line L
The switch arc radius must obey
(vse)2/(vac*vae) < vsr < (R – h)/2 (2.2.1.1-1)
where
circle center on the line
acceleration error.
This condition is necessary but not always sufficient. It’s sufficient only in the case that the
projection point
and the point of intersection of the continued perpendicular with the circle (point
Figure 2-2) belongs to the circle arc
If one of these conditions is not fulfilled, the maximum possible switch radius r must be recalculated due to intersection geometry. Possible cases are considered below.
R - radius of the initial circle, h – the length of the perpendicular dropped from the
This means that the parameter vsr that defines switch arc radius must obey the following
constraints:
2
(2.2.1.1-6)
(vse)2/vac < vsr < (R2 – h2 – u2)/(2R + 2h)
(2.2.1.1-8)
The switch arc with parameter vsr calculated by (2.2.1.1-7) takes up the whole line segment.
To satisfy additional requirement that switch arc cannot take more than 50% of the segment
length instead of the line end point we should use in calculations some other point
belongs to the line segment. The distance between this point and the intersection point
P2′
that
ρ
2 =
ρ(Pi,P2) must beequal k*l (where k < 0.5 , l – the length of the line).If the distance from the
intersection point Pi to P
function of the used partial length k*l of the line L.
is defined as ρ(P
1
), then (2.2.1.1-7) can be presented as a
i P1
=[R
2
– h2 – (ρ(Pi P1) – k*l)2]/(2R + 2h)
r
(2.2.1.1-9)
max
Example 2-4
(Motion Mathematic Lib Samples\Circle to Line\ Section 2_2_1_1\
CircleLine_Ex_2_4 – www.elmomc.com)
Circle arc (Figure 2-4) is defined by its init position X
init angle α = –90
point X
50000) so the line L is parallel to the axis X. From Figure 2-4, h = 50000, u = 25000. The
switch radius is calculated by (2.2.1.1-7).
= 25000, Yto = 50000. Circle end point [Xc + Rcos(-30), Yc + Rsin(-30)] = (86603,
to
r = 0.5*(1000002 – 500002 – 25000
o
(with axis X positive direction), and sweep angle = +60o. Line end
2
)/(100000 + 50000) = 22917
from
= 0, Y
= 0, radius R = 100000,
from
Motion Library TutorialSwitch Radius Calculation
MAN-MLT (Ver 2.0)
2-10
Figure
2-4
In our calculations was not taken in account additional requirement that the switch arc
should not take more than 50% of the segment length. So the calculated switch arc with the
radius 22917 takes the whole line segment.
If in the calculations, some point on the line is used, for example (65000, 50000), instead of
the line end point, then u = 65000 and the result is:
r = 0.5*(1000002 – 500002 – 65000
Perpendicular to the Line L end point P
In Figure 2-5, there is an intersecting geometric figure showing that a perpendicular line at
Line L end point P
is a switch arc with a maximum possible radius
By knowing the coordinates of a circle center O(X
it is possible to find an intersection point P
the length of the line segment
does not intersect thecirclearcC. The switch arc drawn in Figure 2-5
2
P3P6: ρ1 = ρ(P3, P6).
2
)/(100000 + 50000) = 10917
does not intersect the circlearc C
2
r.
) and a circle init point P6(X6,Y6)
c,,Yc
of two lines:(X
3
) – (X6,Y6) and L and
c,Yc
Drop a perpendicular from point P
= ρ(P6, P4). To define r, use a proportion
ρ
2
r/ρ
= (ρ1 – r)/ρ1
2
(2.2.1.1-9)
and finally
on the line L and by (2.2.1.1-4) define its length
6
Motion Library TutorialSwitch Radius Calculation
MAN-MLT (Ver 2.0)
2-11
r = ρ
As in the previous case, the user defined parameter vsr must obey
(vse)2/vac < vsr < ρ
/(ρ1 + ρ2) (2.2.1.1-10)
1ρ2
/(ρ1 + ρ2) (2.2.1.1-11)
1ρ2
Figure
2-5
Example 2-6
(Motion Mathematic Lib Samples\Circle to Line\ Section 2_2_1_1\
CircleLine_Ex_2_6 – www.elmomc.com)
The circle arc in Figure 2-6 is defined by the radius R = 100000, init angle α = -90
sweep angle β = 30
Line L end point: X
The circle arc end point P
= R*sin(-π/3) = -86602.54;
Y
5
o
and the init position X
= -40000, Yto = 0;
to
coordinates can be calculated as X5 = R*cos(π/3) = 50000,
5
from
= 0, Y
= -100000.
from
Line L is defined by two points P1(-40000, 0) and P2[Rcos(-60), Rsin(-60)] =
P
(50000, -86602.54). Its standard equation is Ax + By + C = 0,
meaning that the switch radius in use must be less than this limiting value.
Figure 2-6
Values calculated by (2.2.1.1-7) and (2.2.1.1-10) are not recommended but limiting values.
The switch radius in use must be less those values.
Such limiting values produce irregular cases of intersection. If we use (2.2.1.1-7) switch arc
replaces line L and if we use (2.2.1.1-9) switch arc replaces initial arc C.
2.2.1.2Switch arc center and a circle center belong to the same
half plane.
In this case (Figure 2-7), the switch radius must satisfy the following condition:
r ≤ (R + h)/2 (2.2.1.2-1)
Motion Library Tutorial Switch Radius Calculation
∈
MAN-MLT (Ver 2.0)
2-13
Figure
This condition is not always sufficient. Adequacy depends on arc and line lengths. If the
circle’s center projection on the line
intersection point of the continued perpendicular with the circle arc belonging to the
L (Figure 2-10), calculate the maximum switch radius r using equation
2
ρ
(Oc,P5) + (r – h)2 = (R – r)2 (2.2.1.2-4)
or
)2 + (r – h)2 = (R – r)2 (2.2.1.2-5)
(ρ
1
(ρ
)2 + r2 – 2rh + h2 = R2 – 2Rr + r
1
P1 on the line L does not belong to the line segmentL.
on the line L does not belong to the line
1
2
2-9
(2.2.1.2-6)
R2 – (ρ1)2 – h2 =2Rr – 2rh (2.2.1.2-7)
The results for
= [R
2
– (ρ1)2 – h2]/(2R – 2h) (2.2.1.2-8)
r
To define
distance from
r
ρ(Oc,P5), drop a perpendicular from the circle center Oc on the line L. The
theprojection point P
to the line end point P3 is equal toρ(O
4
c,P5
).
As well as in case when the circle and switch arc centers belong to different half planes
values calculated by (2.2.1.2-3) and (2.2.1.2-8) are not recommended but limiting ones.
Switch radius in use must be less those values.
Motion Library TutorialSwitch Radius Calculation
MAN-MLT (Ver 2.0)
2-16
Figure
2-10
Example 2-11
(Motion Mathematic Lib Samples\Circle to Line\ Section 2_2_1_2\
CircleLine_Ex_2_11 – www.elmomc.com)
Circle arc (Figure 2-11) is defined by its init position (X = 0, Y = 60000), radius R = 60000,
init angle α = 0o, and a sweep angle β = -135
o
. Line target position 25000, -42426.
Circle center coordinates (Xc, Yc) = (0 – Rcos90, 60000 – Rsin90) = (0,0). Circle end
point coordinates (Xc + Rcos(-45
line L is parallel to the axis X meaning that
=25000 and
r can be calculated by
o
), Yc + Rsin(-45o) = (42426, - 42426). Notice that
Consider the last case of the circle – line intersection: the line goes inside the circle
through the center of the circle (Figure 2-12-2-15). The following cases are possible:
2-17
a) The length of the line
orthogonal to the line intersects the circle arc:
evident geometric constraint on the switch arc radius is
ΔL is greater than the circle radius R and the circle diameter
P
C
(Figure 2-12). In this case an
1
1
r ≤ R/2 (2.2.1.3-1)
b) The length of the line
line end point intersects the circle arc:
geometric limit for the switch radius
ΔL is less than the circle radius R and a perpendicular at the
Figure
2-12
P
C
(Figure 2-13). To define the
1
1
r, use the following equation:
(R – r)2 = (R – ΔL)2 + r2
(2.2.1.3-2)
or
– 2Rr = – 2RΔL + ΔL
that leads to
r = (2RΔL – ΔL2)/2R = ΔL – ΔL2/(2R) (2.2.1.3-3)
2
Motion Library TutorialSwitch Radius Calculation
MAN-MLT (Ver 2.0)
2-18
Figure
2-13
Example 2-14
(Motion Mathematic Lib Samples\Circle to Line\ Section 2_2_1_3\
CircleLine_Ex_2_14 – www.elmomc.com)
The circle C1 (Figure 2-14) is defined by its init point (80000,0), radius R = 80000, init
α = 0 and a sweep angle β = -135. Line target position (-28284, -28284). The length
angle
of the line segment
ΔL = 28284*2
1/2
= 40000.
The circle C1 is defined by the init point (80000,0), radius R = 80000, init angle α = 0
2.2.2 Switch arc radius calculation by the distance from the
intersection point
If svc = 3 mode (vsd = d is given) is considered and it is important to know the switch arc
radius r to check if end velocity and vector acceleration satisfy (1-1). If d – distance from the
point (X
function of parameters d and R (we have to know r to check condition 1-1).
Consider three possible cases of a circle and switch arc positions relative to the line.
) to the point (X
i,Yi
first,Yfirst
) is given, then it can be useful to re-calculate r as a
2.2.2.1 Initial circle center and switch arc center belong to the
same half-plane
2.2.2.1.1 Line continues outside the circle (Figure 2-17)
As in case of the switch arc center coordinates calculation we drop a perpendicular from the
circle center
perpendicular
(Xc,Yc) on the line and get a projection point (Xp,Yp). The length of the
ρ
can be defined as
1
ρ1 = [(Xp – Xc)2 + (Yp – Yc)2]
Define point
(X1,Y1) so that
1/2
(2.2.2.1.1-1)
Motion Library TutorialSwitch Radius Calculation
MAN-MLT (Ver 2.0)
ρ[(Xp,Yp),(X1,Y1)] = r
(2.2.2.1.1-2)
The following is known:
ρ
= ρ[(Xp,Yp),(Xf, Yf)] = ρ[(Xp,Yp),(Xi, Yi)] + d
3
(2.2.2.1.1-3)
where (Xi, Yi) – circle-line intersection point .
2-21
ρ[(X1,Y1),(Xo, Yo)] = ρ[(Xp,Yp),(Xf, Yf)] = ρ
As
(R + r)
2
– (ρ3)
2
= (ρ1 – r)2
then use an equation to define r
3
(2.2.2.1.1-4)
(2.2.2.1.1-4) for rthere is
From
r = [(ρ3)2 + (ρ1)2 – R2]/(2R + 2ρ1)
(2.2.2.1.1-5)
2.2.2.1.2 Line continues inside the circle (Figure 2-18)
The following is known:
ρ
= ρ[(Xp,Yp),(Xi,Yi)] – d
3
(2.2.2.1.2-1)
Figure
2-17
Motion Library TutorialSwitch Radius Calculation
MAN-MLT (Ver 2.0)
2-22
Figure
so an equation can be written
2-18
(R – r)2 – (ρ1 – r)2 = (ρ3)2 (2.2.2.1.2-2)
that produces for
r = [R
2
– (ρ3)2 – (ρ1)2]/(2R – 2ρ1) (2.2.2.1.2-3)
r
2.2.2.2 Initial circle center and switch arc center belong to two
half planes defined by the line L.
2.2.2.2.1 Line continues outside the circle (Figure 2-19)
In this case
ρ
= ρ[(Xp,Yp),(Xi,Yi)] + d
3
(2.2.2.2.1-1)
Equation for r
2
(ρ
+ r)2 = (R + r)2 – (ρ3)
1
(2.2.2.2.1-2)
From (2.2.2.2.1-2) we have
r = [(ρ1)
2
+ (ρ3)
2
– R2]/(2R – 2ρ1) (2.2.2.2.1-3)
2.2.2.2.2 Line continues inside the circle (Figure 2-20)
ρ3 = ρ[(Xp,Yp),(Xi,Yi)] – d (2.2.2.2.2-1)
Equation for r
(R – r)2 – (ρ3)2 = (ρ1 + r)2 (2.2.2.2.2-2)
Motion Library TutorialSwitch Radius Calculation
MAN-MLT (Ver 2.0)
that produces
r = [R2 – (ρ1)2 – (ρ3)2]/(2R + 2ρ1) (2.2.2.2.2-3)
2-23
Figure
2-19
Figure
2-20
Figure 2-21
Motion Library TutorialSwitch Radius Calculation
MAN-MLT (Ver 2.0)
2-24
2.2.2.3 Circle center (Xc,Yc) Є L1 (line L1 intersects the center of
the circle)
2.2.2.3.1 Line goes outside of the circle (Figure 2.11).
2.2.2.3.2 Line goes inside the circle (Figure 2.12)
(R – r)2 = (R – d)2 + r2 (2.2.2.3.2-1)
r = (2Rd – d2)/(2R) (2.2.2.3.2-2)
Figure
2-22
2.2.3 Line goes outside the circle
If the line goes outside of the circle, the switch arc radius is limited by the length of the line
segment and the length of the circle arc segment. The connection between the switch arc
radius and distance
line
L was considered in section 3.2. The maximum switch radius for the given line
segment
ΔL can be calculated by formulas (2.2.2.1.1-5) or (2.2.2.2.1-3) from 2.2.2.1.1 where
d between intersection point and a last point of the switch arc on the
d = ΔL.
When considering the limitations imposed by the length of the circle arc (defined by the
sweep angle and a circle radius), three cases are possible:
Motion Library TutorialSwitch Radius Calculation
MAN-MLT (Ver 2.0)
1. Circle init radius intersects with the line L continued in its positive direction
(Figure 2-23);
2-25
2. Line
3. Line
L isparallel to the init radius (Figure 2-25);
L continued in the reverse direction intersects init radius (Figure 2-26) (by
the init radius there a line segment that connects the circle arc center with the
circle arc init point).
2.2.3.1 Line L and init radius continued in their positive
intersecting directions
The init circle radius continuing in its positive direction intersects with the line L continued
in its positive direction (Figure 2-23). It takes place if the circle arc init angle with the axis
positive direction
circle arc sweep angle
αis less than the line L angle with the axis X positive direction φand the
β < 0 (β < 0, α < φ) or in case:β > 0, α > φ.
X
Figure
Drop a perpendicular from the circle center
calculated by (2.2.1.1-4). Now calculate the angle
arc radius. The circle arc sweep angle
Now calculate the distance
d = ρ(Oc, P
To define the switch radius r, use a proportion
) = h/cos(λ) (2.2.3.1-1)
2
θso λ = θ + γ = θ + arccos(h/R).
2-23
O
on the line L. Its length h can be
c
γ = arccos(h/R), where R – circle
r/h = (d – R – r)/d (2.2.3.1-2)
Motion Library TutorialSwitch Radius Calculation
MAN-MLT (Ver 2.0)
or
rd = hd – hR – hr (2. 2.3 .1 -3 )
2-26
and for
r the result is
r = h(d – R)/(d + h ) (2.2.3.1-4)
Example 2-24
(Motion Mathematic Lib Samples\Circle to Line\ Section 2_2_3_1\
CircleLine_Ex_2_24 – www.elmomc.com)
The circle is defined by its radius R = 50000, init angle α = 45o and sweep angle β= -45
and the init point(35355, 35355). The line L end point is (80000, 80000). The circle end
angle =
standard equation Ax + By + C = 0,
o
0
, so the line init point coordinates (50000, 0). For the coefficients A, B, C in the line
C = X1(Y2 - Y1) - Y1(X2 - X1) = 50000(80000 – 0) – 0 = 4000000000. The length of h
can be calculated as:
h = |C|/(A
The length h of the perpendicular can be also calculated by formulas (a.16),(a1.4) and (a.17)
from Appendix1 (this approach is used in the sample program CircLine_ex_3_13a).
2.2.3.2 Line parallel to the circle arc init radius
a) Line direction coincides with the direction of the init radius
In this simple case (Figure 2-25) maximum switch radius is equal to the distance between
line L and circle arc init radius. This distance is equal to length of perpendicular
from the circle arc center
O
on the line L. To define it we can use the same formula
c
(2.2.1.1-4).
hdropped
Figure 2-2-25a
b) Line direction is opposite to the direction of the init radius
Motion Library TutorialSwitch Radius Calculation
MAN-MLT (Ver 2.0)
2-28
Figure 2-25b
Maximum switch radius is perpendicular to the line L at the line end point. h – the length of
the perpendicular dropped from the circle center on the line. We can calculate an angle
between the perpendicular at the line end point and the line that connect the centers of the
init circle and a switch arc
γ
γ = 180 – 90 – (180 – θ) = θ – 90 (2.2.3.2-1)
To define max switch radius we can use an equation
(R + r)cosγ = r + h (2.2.3.2-1)
that produces
r = (Rcosγ – h)/(1 – cosγ) (2.2.3.2-1)
2.2.3.3 Line L and init radius continued in their reverse
directions intersect
This case is shown in Figure 2-26.
1. Find the coordinates
P1(X1,Y1) – intersection point of two lines init circle radius
2.3.2 Each circle intersects the internal area of the second
2-39
Figure 2-33 shows another case of two circles intersecting: circle C
the circle
d =ρ(O
R ≤ [d – (d – R1) – (d – R2)]/2 = (R1 + R2 – d)/2
Condition (2.3.2-1) is sufficient in case line
C
and circle C2 continues inside the circle C
2
), theswitch radius must obey the following necessary condition:
1, O2
O1O
intersects circlearc C
2
. Noting that
1
C2.
comes from inside of
1
(2.3.2-1)
and circle arc
1
Figure 2-33
Line
Another case when line O
(Xc1, Yc1) – (Xc2, Yc2)
between the circle
maximum radius must belong to this line. To define maximum radius
previous cases.
(X1 – Xo)/(X1 – Xc2) = r/R
(Y1 – Yo)/(Y1 – Yc2) = r/R
(Xo – Xc1)2 + (Yo – Yc1)2 = (R1 – r)
O1O
C
does not intersect at least one of two circle segments (Figure 2-35)
2
does not intersect at least one of the two circle segments. In Figure 2-35 line
1O2
connecting two circle centersdoes not intersect circle arc C2. Draw a line O
center and its end point P
2
1(X1,Y1
(2.3.2-2)
2
(2.3.2-3)
2
). The center (Xo, Yo) of the switch arc with a
2
(2.3.2-4)
r, use the same system as in the
2P1
Motion Library TutorialSwitch Radius Calculation
MAN-MLT (Ver 2.0)
2-40
This system is similar to (2.3.2-2) – (2.3.2-4) and comes to the same solution r = –C
where
C1 = (X1 – Xc2)/R2
C
= (Y1 – Yc2)/R
2
C3 = X
c1 – X1
(2.3.2-5)
C
= Yc1 – Y
4
C6 = 2(C1C
C
= (C3)2 + (C4)2 – (R1)
7
1
3
2
+ C2C
+ R1)
4
2
7/C6
Figure 2-35
Example 2-36
(Motion Mathematic Lib Samples\Circle to Circle\ Section 2_3\
CircleLine_Ex_2_36 – www.elmomc.com)
Consider an example (Figure 2-36) of a maximum switch radius calculation for the case
similar to the one drawn in Figure 2-35 with the following parameters:
and finally for coordinate Y of intersection point the results are
Y =Y1 + k1(X3 – X1)
(a3.11)
c) X
≠ X2, Y1 ≠ Y2, X3 ≠ X4, Y3 = Y
1
To find an intersection point use
(X – X1)/∆X1 = (Y – Y1)/∆Y
Y = Y
That produces
3
1
4
(a3.12)
(a3.13)
X =X1 + q1(Y3 – Y1) (a3.14)
d) X
= X2, Y1 ≠ Y2, X3 ≠ X4, Y3 ≠ Y
1
Two lines equations:
4
X = X
(X – X
For coordinate Y of intersection point we have
(X1 – X3)/∆X2 = (Y – Y3)/∆Y
e) X
Two lines equations:
Y = Y
(X – X3)/∆X2 = (Y – Y3)/∆Y
For coordinate X of intersection point the results are
(X – X3)/∆X2 = (Y1 – Y3)/∆Y
f) X
1
)/∆X2 = (Y – Y3)/∆Y
3
≠ X2, Y1 = Y2, X3 ≠ X4, Y3 ≠ Y
1
1
= X2, Y1 ≠ Y2, X3 ≠ X4, Y3 =Y
1
X = X1, Y = Y
3
2
=> Y = Y3 + k2(X1 – X3) (a3.17)
2
4
2
=> X = X3 + q2(Y1 – Y3) (a3.18)
2
4
(a3.15)
(a3.16)
g) X
≠ X2, Y1 = Y2, X3 = X4, Y3 ≠Y
1
X = X3, Y = Y
1
4
Maestro Software Manual
MAN-MLT (Ver. 2.0)
Appendix D: Circle – line intersection
points
The line is defined by its end points (X1,Y1) and (X2,Y2). The circle is defined by its radius R and
center coordinates (X
the intersection points using