Go to Post Don't put sprockets in an empty pizza box and then throw it into the garbage. Something we learned from experience. - Herodotus [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-01-2010, 13:54
NinJA999's Avatar
NinJA999 NinJA999 is offline
Chipmunk NinJA
AKA: Nick Aldwin
FRC #0811 (Team 811)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Windham, NH
Posts: 45
NinJA999 will become famous soon enough
Send a message via AIM to NinJA999
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!
__________________
Team 811 (Nashua, NH) - Mentor

Previously Team Lead & Programming Lead
Reply With Quote
  #2   Spotlight this post!  
Unread 18-01-2010, 14:12
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
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.
Reply With Quote
  #3   Spotlight this post!  
Unread 18-01-2010, 14:50
NinJA999's Avatar
NinJA999 NinJA999 is offline
Chipmunk NinJA
AKA: Nick Aldwin
FRC #0811 (Team 811)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Windham, NH
Posts: 45
NinJA999 will become famous soon enough
Send a message via AIM to NinJA999
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?
__________________
Team 811 (Nashua, NH) - Mentor

Previously Team Lead & Programming Lead
Reply With Quote
  #4   Spotlight this post!  
Unread 18-01-2010, 14:54
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
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.
Reply With Quote
  #5   Spotlight this post!  
Unread 18-01-2010, 16:14
NinJA999's Avatar
NinJA999 NinJA999 is offline
Chipmunk NinJA
AKA: Nick Aldwin
FRC #0811 (Team 811)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Windham, NH
Posts: 45
NinJA999 will become famous soon enough
Send a message via AIM to NinJA999
Re: Best way for "servo" from motor & potentiometer?

Nice, thanks so much for your help!
__________________
Team 811 (Nashua, NH) - Mentor

Previously Team Lead & Programming Lead
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 11:14.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi