Go to Post I guess my only option is to either stop picking on Dave or come up with an even better picture! Now, which one do you think I'll choose? - MissInformation [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 12-02-2011, 22:04
Caboose's Avatar
Caboose Caboose is offline
Programmer - LabVIEW, C++, C#, Java
AKA: James Parks
FRC #0900 (Zebracorns)
Team Role: Alumni
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Seattle, WA
Posts: 72
Caboose has a spectacular aura aboutCaboose has a spectacular aura about
Question Jaguar CAN PID Help, kSpeed and kPosition

For some test code, on a test bot, I'm setting PID values of 30, 0.005, 0.25. When I have the Jaguars in kPosition the values work fine with a +- of 0.01 of the SetPoint.
Now when I set the jaguar control mode to kSpeed the motors spaz-out barely moving, but when I have my P value negative(-30, 0.005, 0.25) it works fine.
Is this normal? I would have thought the same PID values would work for both kSpeed and kPosition, am I wrong?
__________________
navX Labview Library

"Robots are aluminum shavings, held together by zip-ties."

myManga

Last edited by Caboose : 12-02-2011 at 22:06. Reason: Miss-Spelled Title...
Reply With Quote
  #2   Spotlight this post!  
Unread 14-02-2011, 10:09
omalleyj omalleyj is offline
Registered User
AKA: Jim O'Malley
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: New Jersey
Posts: 132
omalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to behold
Re: Jaguar CAN PID Help, kSpeed and kPosition

I used different values for position and speed, but not hugely different Ps. Do you disableControl() and switch modes (and change any parameters) and then enableControl()? You also probably want to change the encoder CountsPerRev to get sensible values in both modes (counts per inch vs. per rev). Could you be sending a very small value relative to what you are trying to do?

Code?
Reply With Quote
  #3   Spotlight this post!  
Unread 14-02-2011, 10:19
Caboose's Avatar
Caboose Caboose is offline
Programmer - LabVIEW, C++, C#, Java
AKA: James Parks
FRC #0900 (Zebracorns)
Team Role: Alumni
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Seattle, WA
Posts: 72
Caboose has a spectacular aura aboutCaboose has a spectacular aura about
Re: Jaguar CAN PID Help, kSpeed and kPosition

Right now I'm just setting the kSpeed or kPosition on start-up and sticking with it for the rest of the code. I did graph the Speed from the motors when in kSpeed and what happend was the motors would get up near the speed i would want then would drop to a really low RPM, some times even in the opposite direction, then jump back up past the speed only to drop again. I could post a graph later today if it would help you or anyone understand what I'm seeing.
__________________
navX Labview Library

"Robots are aluminum shavings, held together by zip-ties."

myManga
Reply With Quote
  #4   Spotlight this post!  
Unread 14-02-2011, 10:28
omalleyj omalleyj is offline
Registered User
AKA: Jim O'Malley
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: New Jersey
Posts: 132
omalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to beholdomalleyj is a splendid one to behold
Re: Jaguar CAN PID Help, kSpeed and kPosition

There are many threads on tuning PID so I won't repeat them.
You are using the exact same motor and controller and code that works in kPosition and you are only changing to kSpeed?
Or do you have a similar setup but not the exact same HW and SW?
Reply With Quote
  #5   Spotlight this post!  
Unread 14-02-2011, 10:30
Caboose's Avatar
Caboose Caboose is offline
Programmer - LabVIEW, C++, C#, Java
AKA: James Parks
FRC #0900 (Zebracorns)
Team Role: Alumni
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Seattle, WA
Posts: 72
Caboose has a spectacular aura aboutCaboose has a spectacular aura about
Re: Jaguar CAN PID Help, kSpeed and kPosition

Everything is the same, I'm just changing the kPosition to kSpeed.
__________________
navX Labview Library

"Robots are aluminum shavings, held together by zip-ties."

myManga
Reply With Quote
  #6   Spotlight this post!  
Unread 14-02-2011, 11:48
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 803
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: Jaguar CAN PID Help, kSpeed and kPosition

I would be very surprised if the same values worked for both.

Here's a post that I wrote a bit ago about how to tune the Jaguar velocity loop, since changing the constants doesn't have the same effect on the output as they do in a position loop. (If you are really interested, I worked out the math on the previous page for why all of this is true, but the math is a bit advanced)

http://www.chiefdelphi.com/forums/sh...7&postcount=34
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 22:19.

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