![]() |
Potentiometer arm control
1 Attachment(s)
Hello again. I've finally got pots mounted on my arm but I need a little help adapting them to my code. The arm has two pivot points, with a potentiometer mounted at each. The goal of my program is to make the motors move to keep the arm level until it's above the overpass at which point I'll press a button and have the ball get "flipped" over. I'm sort of stuck, and if someone could give me a hint on how to achieve this then that would be great.
Here's a picture of what's happening: |
Re: Potentiometer arm control
You understand how to make a joint seek to a certain position, yes? The next step would be to find a list of pairs of joint values between (350,900) and (600,350), maybe 20 or 30 clicks apart, all of which keep the ball level. Then instead of going directly to the target, you instead target each intermediate point until you reach your goal. I'm having a little bit of trouble putting this into words... does it make sense?
|
Re: Potentiometer arm control
Yes, I understand what you're saying, but is there a way to put these numbers into a function to tell me what the wrist position should be at any given arm position? I would rather not program 30 different positions if I didn't have to...
|
Re: Potentiometer arm control
Remember Algebra I? Use that to make an equation that will work. It's just like x and y components. Hopefully that helps. (Find the slope using (y2-y1)/(x2-x1), then use y1 = m(x1) + b) That should get you setup. At least, I think that should work.
EDIT: Since I really love math, I had to figure it out myself to be content :D. Wrist Position = (-11/5)Arm Position + 1670 |
Re: Potentiometer arm control
I'm pretty confident that a linear approximation should do nicely... in terms of real angles (not pot values), you're trying to make it so that theta1+theta2 is always constant. How does this look?
Code:
int wristPos(int elbow) |
Re: Potentiometer arm control
And now y is the number I'm seeking, correct?
|
Re: Potentiometer arm control
Quote:
Code:
wrist_pos = (-11/5)*arm_pos + 1670; |
Re: Potentiometer arm control
Quote:
Code:
wrist_pos = -11*arm_pos/5 + 1670; |
Re: Potentiometer arm control
Quote:
|
Re: Potentiometer arm control
Quote:
|
Re: Potentiometer arm control
All right, I'll also keep that in mind in the future.
|
Re: Potentiometer arm control
Quote:
What was shown will work, but you might even get a little better precision by doing... wrist_pos = (-11*arm_pos + 1670*5) / 5; This maximizes the numerator before dividing by the denominator. |
Re: Potentiometer arm control
Quote:
|
Re: Potentiometer arm control
Quote:
Using ArmPosition = 501, here's what you'd get with all 3 methods: First Method: wrist_pos = -11/5*arm_pos + 1670 = (-2)*501+1670 = 668 2nd method: wrist_pos = -11*arm_pos/5 + 1670 = (-5511)/5 + 1670 = -1102+1670=568 3rd method: wrist_pos = (-11*arm_pos + 1670*5 )/ 5 = 2850/5 = 567.8 = 567 |
Re: Potentiometer arm control
A little off subject but could anyone recommend a model of Pot to use for this type of arm control. We had an arm last year and we used pure manual control , it was very jumpy to say the least. Trying to figure what type of pot and how to mount it on the arm to pick up position. Pre planning for next year I guess. Pictures of a mounting would be nice as well. Thanks.
|
Re: Potentiometer arm control
My recommendation is to NOT BUY RADIOSHACK POTS!!!! They are very cheap and have a lot of dead band. We've been using 10-turn pots for the past 2 years, and they seem to work great. You can buy them from many websites, and possibly from a local store.
|
| All times are GMT -5. The time now is 20:22. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi