|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Best way for "servo" from motor & potentiometer?
This year one of our structures on the robot will need precise control over a motor's positioning. We'd like to hook up a potentiometer to the motor and use it like a really high powered servo (an encoder would be another option; however that offers relative rather than absolute positioning). What would the best way to code this be? Should I create a new class which uses a Jaguar and an AnalogChannel and does some fancy PID routines to provide accurate positioning? Am I missing a something in the library which already does this or something similar? (I'm not talking about the built in Servo class -- that's meant for servos connected to the digital sidecar) Any ideas/input would be helpful! Thanks!
|
|
#2
|
|||||
|
|||||
|
Re: Best way for "servo" from motor & potentiometer?
Probably the easiest thing to do would be to make a PIDController object with the PIDSource set to the analog input corresponding to the potentiometer, and the PIDOutput set to the Jaguar/Victor controlling the arm.
Look at the documentation for PIDController to see exactly how to do this. |
|
#3
|
||||
|
||||
|
Re: Best way for "servo" from motor & potentiometer?
Do I need to have a tightly controlled time loop to use the PIDController? What's the best way to do that?
|
|
#4
|
|||||
|
|||||
|
Re: Best way for "servo" from motor & potentiometer?
The WPILib implementation of PIDController actually does all of its processing in a separate thread in the background - you just tell it to start (and stop), and where to go to, and it does the rest.
|
|
#5
|
||||
|
||||
|
Re: Best way for "servo" from motor & potentiometer?
Nice, thanks so much for your help!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Team 1943 - "Neat-Team" - From Rosh Haayin, Israel. BEST ROBOT EVERRR!!! | Gal Yaad | Robot Showcase | 7 | 05-04-2008 05:44 |
| White Paper Discuss: "18 Tips for in the Pits for FIRST Teams" | RoboMom | Extra Discussion | 2 | 11-02-2006 19:42 |
| pic: My vote for the best design from the team spirit "drawn" in the stands. | CD47-Bot | Extra Discussion | 4 | 07-09-2004 00:19 |
| Conflict between "Initialize_Tracker()" and "pwm13 & pwm15"? Kevin? | gnormhurst | Programming | 3 | 22-02-2004 02:55 |