Programming of ellipses
Definition of semi-axes of an ellipse
The semi-major axis lrSemiMajorAxis and the semi-minor axis lrSemiMinorAxis of the ellipse are defined as follows:
|
The following conditions must be fulfilled for a valid programming:
- The distance between starting point and centre as well as between target point and centre must be smaller or equal to the semi-major axis.
- The distance between starting point and centre as well as between target point and centre must be greater or equal to the semi-minor axis.
- The semi-minor axis must always be smaller or maximally equal to the semi-major axis.
- In the "equal" case, the ellipse degenerates into a circle.
- The target point must be positioned on the ellipse as well. Otherwise, the position of the ellipse is not clearly defined.
- Starting point, target point and centre must span a plane which means they must not be on one line.
Programming example 1
Blue curve: Movement along the shorter ellipse arc (CLOCKWISE) Green curve: Movement along the longer ellipse arc (COUNTERCLOCKWISE) |
Movement in different directions along the ellipse arcs
Tip!
The given direction of movement (ClockWise/CounterClockWise) conforms to the PLCopen specification for circular motion (MC_MoveCircular).
The axes group is at the position
x = 7.0, y = 3.7, z = 0;
("starting point")
The "My_MoveElliptical" function block (instance of the L_MC4P_MoveEllipticalAbsolute ) is used to program the movement along the shorter ellipse arc as follows:
My_MoveElliptical.alrAuxPoint[1] := 5.0;
My_MoveElliptical.alrAuxPoint[2] := 3.0;
My_MoveElliptical.alrAuxPoint[3] := 0.0;
My_MoveElliptical.alrEndPoint[1] := -1.565;
My_MoveElliptical.alrEndPoint[2] := 8.769;
My_MoveElliptical.alrEndPoint[3] := 0.0;
My_MoveElliptical.lrSemiMajorAxis := 13;
My_MoveElliptical.lrSemiMinorAxis := 2;
My_MoveElliptical.ePathChoice := MC_CIRC_PATHCHOICE.ClockWise;
|
The "My_MoveElliptical" function block (instance of the L_MC4P_MoveEllipticalAbsolute ) is used to program the movement along the longer ellipse arc as follows:
My_MoveElliptical.alrAuxPoint[1] := 5.0;
My_MoveElliptical.alrAuxPoint[2] := 3.0;
My_MoveElliptical.alrAuxPoint[3] := 0.0;
My_MoveElliptical.alrEndPoint[1] := -1.565;
My_MoveElliptical.alrEndPoint[2] := 8.769;
My_MoveElliptical.alrEndPoint[3] := 0.0;
My_MoveElliptical.lrSemiMajorAxis := 13;
My_MoveElliptical.lrSemiMinorAxis := 2;
My_MoveElliptical.ePathChoice := MC_CIRC_PATHCHOICE.CounterClockWise;
|
Programming example 2
Green curve: "My_MoveElliptical1" Blue curve: "My_MoveElliptical2" |
Track consisting of two related ellipse segments
The axes group is at the position
x = 0.0, y = 0.0, z = 0.0;
("starting point 1")
The function blocks "My_MoveElliptical1" and "My_MoveElliptical2" (instances of the L_MC4P_MoveEllipticalAbsolute function block) have been used to program the track shown above:
|
My_MoveElliptical1.alrAuxPoint[1] := 50.0;
My_MoveElliptical1.alrAuxPoint[2] := 0.0;
My_MoveElliptical1.alrAuxPoint[3] := 0.0;
My_MoveElliptical1.alrEndPoint[1] := 50.0;
My_MoveElliptical1.alrEndPoint[2] := 0.0;
My_MoveElliptical1.alrEndPoint[3] := 10.0;
My_MoveElliptical1.lrSemiMajorAxis := 50;
My_MoveElliptical1.lrSemiMinorAxis := 10;
My_MoveElliptical1.ePathChoice := MC_CIRC_PATHCHOICE.ClockWise;
My_MoveElliptical2.alrAuxPoint[1] := 50.0;
My_MoveElliptical2.alrAuxPoint[2] := 0.0;
My_MoveElliptical2.alrAuxPoint[3] := -50.0;
My_MoveElliptical2.alrEndPoint[1] := 100.0;
My_MoveElliptical2.alrEndPoint[2] := 0.0;
My_MoveElliptical2.alrEndPoint[3] := -50.0;
My_MoveElliptical2.lrSemiMajorAxis := 60;
My_MoveElliptical2.lrSemiMinorAxis := 50;
My_MoveElliptical2.ePathChoice := MC_CIRC_PATHCHOICE.ClockWise;
|