Hi all
I am having trouble figuring out how to program my servos in order for them to tilt my table the way I want it to.
So to explain my setup...
-From a top view, the face of the table is the XY plane and the vertical, normal axis is the Z axis.
-The table is fixed along the axial axes along the X and Y axes. So all it could do is rotate about the X-axis and/or rotate about the Y-axis.
-The system is mounted on a fixed bottom surface and the servos are also attached on said surface.
-The servo horns are linked to ball rod end jointed arms that connect to the corners of the tilting table.
--Below is a textual representation of where my servos are located. Now to sort of reemphasize what I mean...for instance if you number the corners of my table from 1 through 4, starting from the top left corner in a clockwise direction...my servo arms are jointed on corners 1 and 2.
-And also from my design, my connection points are at the square 45 degree angled corners when measuring the distance from the center of the table.
Y
^
|
| A B
| |
| Table |
|_______| _ _ _>X
-I also have a resistive touchscreen on the surface of my tilting table. The orientation of the readings are exactly as shown in the graphic above.
-So what I need my system to do is initialize by actuating my servos to tilt my table up and down about the x axis. Then recenter. Then follow up tilting about the y axis. Then recenter.
-Once that is done, it should wait for me to touch the screen and it tilts in accordance to where I touch the screen. Each coordinate of the screen would be mapped to angles that would be a rotation about the axis normal to the line between the touched point and the center point. The further away from the center point (the greater the vector magnitude) the greater the angle of rotation.
If there is anything left unclear... please let me know.
I am new to Arduino and I am really stuck. I do not know how I will tackle this one.
Edit: since @MorganS first replied
---I am using an Adafruit breakout board for STMPE610 with 4-wire touchscreen
---Two HiTEC HS-5646WP digital servos