Go to Post FIRST is, of course, a grand social experiment in American culture - jonathan lall [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 19-01-2005, 18:16
Orborde Orborde is offline
Registered User
FRC #1747
Team Role: Mentor
 
Join Date: Apr 2004
Rookie Year: 2003
Location: Indianapolis, IN
Posts: 44
Orborde has a spectacular aura aboutOrborde has a spectacular aura about
Send a message via AIM to Orborde
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.
Attached Images
File Type: bmp diagramsm.bmp (45.2 KB, 133 views)
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 10:22.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi