I have a 6 joint robot arm, and I want to move it in a circle. I want parameters to choose the radius, degrees, and resolution/quality of the circle.
How do I do this?
I have a 6 joint robot arm, and I want to move it in a circle. I want parameters to choose the radius, degrees, and resolution/quality of the circle.
How do I do this?
Copyright © 2021 Jogjafile Inc.

A quick trig review:
The hypotenuse is opposite the right angle of the triangle.
The ratio of the height to the hypotenuse is called the sine.
The ratio of the base to the hypotenuse is called the cosine.
Generating (x,y) coordinates of a circle
The circle is centered at the point (0,0). The radius of the circle is 1. Angles are measured starting from the x-axis. If we draw a line from the point (0,0) at an angle a from the x-axis, the line will intersect the circle at the point P.
To generate the coordinates along a circle, let's start with a small example. We'll use r to refer to the radius of the circle and a to refer to the angles spanned starting from the x-axis.
Let's start with just the five following angles: 0, 90, 180, 270 and 360.
(0 and 360 degrees are the same angle, which is on the positive x-axis).
Then, to generate the X and y coordinates along the circle, we use the following equations for each of the angles:
These are the x and y coordinates calculated from the two equations above:
Here's what that looks like on a graph:
In the above examples, we're only using 4 points, so it doesn't look much like a circle yet. However, if we use 17 points, we can see the coordinates are approaching a circular shape:
Here is a visualization of the math (sin cos wave):
Here is the Arduino code for a circular movement:
I recommend testing this code by creating a graph in Microsoft Excel to verify that the x y coordinates create a circle.