![]() |
Servo motor help
Hello,
I'm the lead programmer for team 3706. Its my first year so i need a little help. I was wondering on how you add buttons to the servo motors in the program. I already put the three servo motors i need in the begin and finish sections.I just don't know how to add it to the teleop section. I want my joystick2 to control three motors that will move a arm on the robot. Thank you |
Re: Servo motor help
Can you give a little more detail about what you want the joystick to do? Which controls on the joystick should cause what actions to occur on the servos?
|
Re: Servo motor help
We are working on getting our arm working. For example we want the trigger button to move the arm up once squeezed and move it down when squeezed a second time. Our arm is being driven by the set of window motors from the KOP.
|
Re: Servo motor help
Quote:
|
Re: Servo motor help
If you want a single trigger squeeze to move the arm to a specific position, you'll need a way for the program to know when the arm is at that position. What will you be using to do that?
|
Re: Servo motor help
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. |
Re: Servo motor help
Quote:
|
| All times are GMT -5. The time now is 11:38. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi