Go to Post Sorry- therefore IOU 1 Battery- you can collect it on I-95 about 1 mile south of exit 13A in the center lane...... (ps- of course that battery is "free of charge") - Wayne C. [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #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, 134 views)
  #2   Spotlight this post!  
Unread 20-01-2005, 01:40
Anthony Kesich's Avatar
Anthony Kesich Anthony Kesich is offline
Programmer Turned Engineer
AKA: SonKenshin
#1097 (Site 3 Engineernig)
Team Role: Leadership
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Sacramento, CA
Posts: 186
Anthony Kesich has a spectacular aura aboutAnthony Kesich has a spectacular aura about
Send a message via AIM to Anthony Kesich
Re: 2-Segment Arm Control

Here is a good CORDIC math library I've found. Team 296 made it, so thank them. The only thing I added was a power function. Its a simple algorithm, but it made my code cleaner. Read the comments, for they explain the return type. Everything is integer math (Longs, I believe), so the numbers represent obscure fractions of a degree. Read the comments and you'll do fine.

-Tony K
Attached Files
File Type: zip 296 CORDIC library.zip (1.5 KB, 96 views)
__________________
C is screwing up my English--I'm ending all my sentences in semi-colons;

Horray for most things! -George Carlin

"Sure, I'll play rugby. Besides, I have a lot of experience running from really big guys who want to cream me." -Me, Freshman year
Closed Thread


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 05:47.

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