|
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.
|