View Single Post
  #4   Spotlight this post!  
Unread 14-03-2007, 20:24
ericand's Avatar
ericand ericand is offline
Registered User
AKA: Eric Anderson
FRC #3765 (Terrabots)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: St. Paul, MN
Posts: 148
ericand is a jewel in the roughericand is a jewel in the roughericand is a jewel in the rough
Re: PLEASE HELP!! Need help programming arm??

The way you code will depend on how the arm works. You need to do things a bit differently if the arm will hold position by itself, or if you need to
continuously apply power to keep it in position.

Early in our season, we had a prototype robot with a pivoting arm and we found that using a pot on an analog input was an easy way to detect the position without the mess of servicing an encoder.

You can still use a PID routine to adjust your speed and maintain a position once you have achieved it.

With an arm that does not hold position by itself, we found we were popping the breakers a lot. We used a big bungee to counteract the force of gravity (so the motor's didn't need to work so hard to maintain a lifted position).

Our PID looked at a target POT value to move the arm to and adjusted the power to the arm motor based on the distance. When we wanted the arm to stay in a position that we had moved it to with the joy stick, we look at the current POT value and set the target value to it. This resulted in an arm that could be pushed or pulled out of position, but which would return to where you wanted it when it was released.

Good luck.