Looking to control 2 servos as a grid mathematica-

Looking to take 2 servos, (a mechanism that gives me a 180° semi circle, both horizontal and vert)

And control the end result as mathematical curve functions (Using the motion path as a -90° to 90° x,y grid)

Any way to do that easily? (Any language)
Any resources I should start with?

(And I'm assuming I need independent speed control to achieve a curve too)

Thanks for your time and/or help : )
-J

If you want the servos to travel over the full range with inputs from -90 to 90 you can simply do something like this:

// move two servos over their full range with inputs from -90 to 90 
void moveServos(int x, int y)
{
  servoX.write(x + 90);
  servoY.write(y + 90);  
}

Hmm... I think I mean, so I could call, (Pseudocode?)

Move from grid point 0, -90 to 90, 0 but as a curve instead of a straight line (I got that down already :slight_smile:

(So I could program in like a figure 8, made out of 4 equations or something)

(Making a spotlight/laser dohickey)

If you don't care too much about how exact any particular curve is you could ignore the semircle and try some formulas that work in on an x and y grid of size 180.

You may want to look at some of the drawing programs for Processing to get an idea of the kinds of images you can create. Your servo version will only have a resolution of 180 steps and it will have some distortion because the servo moves in an arc, but Processing could be a help in seeing how images can be created using mathematical formula

yay! brb