|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
2-Segment Arm Control
I expect a lot of people to be using an arm of some sort this year, and on our team, at least, controlling the thing looks to be interesting, to say the least. We're using a 2-segment arm this year, assuming we don't run into major problems involving leverage, and this idea popped into my head for controlling the thing.
Given some target coordinates (Xt, Yt), relative to the base of the arm, some simple measurements, and two motors (overpowered servos, really) that can be set to any angle, this algorithm should move the end of the arm to where it is needed quickly and easily. The target coordinates (Xt, Yt) could be set by a joystick or two that moves the target point around at a constant rate. Pseudocode: Set the target coordinates (Xt, Yt) (see diagram) A = Length of first arm segment B = Length of second arm segment C = sqrt(Xt ^ 2 + Yt ^ 2) D = sqrt((Xt - Xb) ^ 2 + (Yt - Yb) ^ 2) E = sqrt(Xb ^ 2 + Yb ^ 2) <- See below Using the Law of Cosines... b = invcos((A ^ 2 + C ^ 2 - B ^ 2) / (2 * A * C)) c = invcos((A ^ 2 + B ^ 2 - C ^ 2) / (2 * A * B)) d = invcos((C ^ 2 + E ^ 2 - D ^ 2) / (2 * C * E)) Finally, set the motor angles with your algorithm of choice. Motor 1 Angle = b + d Motor 2 Angle = c Notes: E is defined as it is in order to ensure consistency between it and Xt,Yt. It may be easier to simply measure it; I'm not sure. This may be an optimization that can be done without any problem; I was queasy about it. On second thought, it should be fairly easy to obtain the (Xb,Yb) coordinates since, as laid out, they're right up against right-angle edges of the frame. Probably the most irritating part of this from a programming standpoint is getting useful math functions. Anyone know where I could find the ones I need? Questions? Comments? Grievous errors? Feel free to lob any and all of them at me. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| **FIRST EMAIL**/Public Television airs ZOOM segment featuring FLL team from 2003 Miss | miketwalker | FIRST E-Mail Blast Archive | 1 | 27-05-2004 01:08 |
| Neural Control of Robot Arm | Leo M | Math and Science | 2 | 29-03-2004 13:46 |
| What do you wish you knew about the new control system? | Joe Ross | Control System | 2 | 09-01-2004 21:47 |
| Reflected Inertia? | archiver | 2001 | 9 | 24-06-2002 03:50 |
| more control options | smokescreen | Technical Discussion | 17 | 05-03-2002 15:41 |