MoveC Rotation Direction Changes Between Program Runs

I’m trying to make a perfect circle using to movec commands with the fixed orientation relative to the center of the circle.

3 waypoints are requested from the user, from those points the radius and x,y center of the circle are computed in Java.

p1 is set as the first of the 3 waypoints from the user.
p2, p3 and p4’s x,y are computed using the center and the radius.
Visualize p1 at the bottom of the circle, going counter-clockwise p2, p3 and p4 at the end of each 90deg angle (quadrant).

The z, Rx, Ry and Rz of the center are set to be the same as the first waypoint from the user.

  1. I start with a movej to p1 then stopl(3) and sleep(0.1) to get to the exact point even with blend.
  2. Then I start my first movec via p2 to p3 with mode=1 (fixed). Most of the time this moves as expected, with the orientation fixed relative to the center. There are times it recognizes p2 as it’s center and moves accordingly, though.
  3. Then I movej back to p1 to work with the other half, adding another stopl(3) and sleep(0.1) right after the movej.
  4. I start my second movec via p4 to p3 with mode=1 (fixed). Same as the first one, it usually moves as expected but sometimes takes p3 as its center.

When I first run the program, movec usually correctly moves with fixed orientation relative to the center.
But when I run the program again, it takes p2, for the first movec, or p3, for the second movec, as its center and moves accordingly.
In between the two runs of the program, there are no changes to the the script or the program itself so I don’t know what causes these change in orientation between runs.
If anyone has any knowledge regarding this behavior, please help me out.

Hello francis,

i am facing the same problem right now, did you find any solution for it?

Thank you

hi beatrice,

i dropped this way of implementation as it is too complicated.
i went with multiple movec going in one direction.

movep(p1)
*start loop here
movec(pX, px+1)
X++
*end loop

okay thank you so much francis