Go to Post our family has no borders... - Greg Hainsworth [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 11-03-2011, 16:01
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
CANJaguar config for pots

Our team has decided to control part of our arm with a jaguar and a potentiometer, and I was looking over the CANJaguar class and had a few questions
(We are controlling a window motor with a big, 2ish foot long piece of 80/20 attached to it, using a joystick, it took -0.6 to move up, and less than 0.1 to move down)

What does turns mean in ConfigPotentiometerTurns?
Would this be all I need to do?
Code:
CANJaguar jag(jagId, kPosition);
jag.SetPositionReference(kPosRef_Potentiometer);
jag.ConfigPotentiometerTurns(?????);
jag.EnableControl();
To set its position to 90 degrees to the right, assuming 0 is up, and its range is 0-120 degrees, what would I tell Set()?
What would the ConfigSoftPositionLimits function be taking if I want to limit it to 0 to 120 degrees?
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #2   Spotlight this post!  
Unread 13-03-2011, 17:57
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: CANJaguar config for pots

I've figured out all that I need to call, but I have a question on the SetPID function, what is the maximum P? and what does P represent? is there a way to make it track a little faster?
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #3   Spotlight this post!  
Unread 19-03-2011, 21:48
PranavSathy PranavSathy is offline
Team Captain
AKA: Pranav Sathyanarayanan
FRC #0263 (Sachem Aftershock)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Holbrook, New York
Posts: 27
PranavSathy is an unknown quantity at this point
Re: CANJaguar config for pots

http://en.wikipedia.org/wiki/PID_controller

You want to read that link... it will help a lot. PID is just a feedback mechanism and in a nutshell, takes in a current and a target, find the error between the two and tries to fix that error. The P is the proportional, and basically what it does is control how quickly you want to get to your target, we use Pots for our arm control, and use our own PID algorithm to get to the target arm location, I would suggest you use Victors rather than jaguars for such a task however, windows seem to like victors rather than jags. Either ways, there is no "maximum" P, what you need to do is tune your system according to the load on the motor, start off with a P of 1, I of 0 D of 0 and move the arm, if its too slow increase the gains (P, I, D), if its too fast just bring down the gains, make sure nothing is negative btw. Also, for your arm, I am sure you know this, but if you are using CANJaguar you can simply do jag->SetPosition(pot value here) (range being 0-1), and the jaguar will automatically get you to that position using PID. Good luck!
__________________
This is MADNESS!

NO...
THIS...
IS....
FIRST ROBOTICS!

Last edited by PranavSathy : 19-03-2011 at 21:51. Reason: Spelling
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


All times are GMT -5. The time now is 15:06.

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