View Single Post
  #5   Spotlight this post!  
Unread 08-02-2012, 00:39
PAR_WIG1350's Avatar
PAR_WIG1350 PAR_WIG1350 is offline
Registered User
AKA: Alan Wells
FRC #1350 (Rambots)
Team Role: Alumni
 
Join Date: Dec 2009
Rookie Year: 2009
Location: Rhode Island
Posts: 1,189
PAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond repute
Re: Servo motor help

Quote:
Originally Posted by DominickC View Post
As Alan said, you'll need to have some type of sensor which supplies feedback based on a setpoint. For example, if you are reading the angle of an extension with a single pivot point, a potentiometer, gyroscope, or encoder will suit your needs.

In this example, you'd read the output, and evaluate if it's the value you want (or at least within a range of values). If it's not, you'll have to set the motor output of the motor controlling the extension to move in either direction, based on the magnitude of your error.

If you are controlling a servo, you can use the Servo Set Angle or Servo Set Position function within the WPI Robotics Library to set the servo to a specific angle or position upon the press of a button.
It is actually a lot simpler than that. The sensors you are looking for are limit switches. You need one that is triggered when the arm is up, an another that is triggered when the arm is down. Squeeze once and have the arm move up until the switch is turned off (normally on is a much better configuration than normally off). Squeeze it a second time and the arm moves down until the other switch is turned off.
__________________
Reply With Quote