Hello everybody.
I have a 2-axis motor module (like an XY table) that has a circular base, so its movement is limited in a circular physical plane.
Each axis has a potentiometer to monitor the position. The reading range is 200 ~ 800 through serial reading.
I convert this value to a Cartesian plane (-300 @ 300) on both axes.
I control both engines using 4 buttons. Each button pair controls one axis. Movement can only be up, or down, or left or right. One at a time, there are no diagnal movements (two axes active at the same time)
Using an image to illustrate an example:
GREEN DOT: Let's say the module is at position -290, 10
ORANGE DOT: If I press the DOWN button, I set the target to be the minimum point on the Y axis: -290, -300
PINK DOT: To try to limit the movement in a circular plane, I convert the target to polar coordinates, limiting the radius by 300. I reconvert to Cartesian again and result is -208,5; -215,6 At this time, the X axis is shifted. And this is correct. Due to using the ZERO center as a reference, the angle resulting from the conversion changes the position of the two axes..
But I would like a way to set the target on the BLUE DOT, -290, -76,9 Moving only the Y axis, not both. And keeping the target inside the circular plane.
How do I adjust the angle to obtain the desired position?