Go to Post This system sucks more than our ball possession system. - IndySam [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 27-12-2012, 02:38
shawn.schwartz's Avatar
shawn.schwartz shawn.schwartz is offline
Lead Systems Engineer
FRC #0004 (Team 4 ELEMENT)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Lake Balboa, CA
Posts: 27
shawn.schwartz is an unknown quantity at this point
Learning Simple PID

Hello CD,

Can anyone please post tutorials or working sample Java code for someone learning PID loops and gyro programming. Iterative or Command Based Java is good! Thank you so much.
__________________
Shawn Schwartz
Programming/Head of Website & Media, Team 4 ELEMENT
team4element.com
"Innovation distinguishes between a leader and a follower." -Steve Jobs
Reply With Quote
  #2   Spotlight this post!  
Unread 27-12-2012, 12:57
Adam.garcia Adam.garcia is offline
Design Mentor
FRC #0004 (Team 4 Element)
Team Role: Mentor
 
Join Date: Aug 2009
Rookie Year: 1997
Location: High Tech LA
Posts: 133
Adam.garcia is just really niceAdam.garcia is just really niceAdam.garcia is just really niceAdam.garcia is just really nice
Re: Learning Simple PID

I know this is silly, replying to a member of my own team, but here are a few links:

http://www.chiefdelphi.com/forums/sh...d.php?t=106082
http://www.chiefdelphi.com/forums/sh...hreadid=110220
http://www.chiefdelphi.com/forums/sh...90&postcount=5
__________________
“The object of education is to teach us to love what is beautiful.”

“Never discourage anyone who continually makes progress, no matter how slow.”
Reply With Quote
  #3   Spotlight this post!  
Unread 27-12-2012, 15:02
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 592
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Learning Simple PID

Also check out http://wpilib.screenstepslive.com. There is a bunch of documentation that was posted yesterday and more coming as fast as we can write it.

Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #4   Spotlight this post!  
Unread 27-12-2012, 16:02
shawn.schwartz's Avatar
shawn.schwartz shawn.schwartz is offline
Lead Systems Engineer
FRC #0004 (Team 4 ELEMENT)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Lake Balboa, CA
Posts: 27
shawn.schwartz is an unknown quantity at this point
Re: Learning Simple PID

Thank you for the helpful links!
The main goal I want to accomplish with these resources is to implement a drive straight system with our tank drive code. I am having trouble figuring it out. Essentially I want to use the gyroscope to run and check if the robot is zeroed, (when in a "drivestraight" command), so that if it comes out of alignment, then it will "re-zero" itself, and continue driving straight.

Has anyone produced a java method for doing this yet, that they would like to share?

Thank you.
__________________
Shawn Schwartz
Programming/Head of Website & Media, Team 4 ELEMENT
team4element.com
"Innovation distinguishes between a leader and a follower." -Steve Jobs
Reply With Quote
  #5   Spotlight this post!  
Unread 27-12-2012, 16:06
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,102
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Learning Simple PID

Quote:
Originally Posted by shawn.schwartz View Post
Thank you for the helpful links!
The main goal I want to accomplish with these resources is to implement a drive straight system with our tank drive code. I am having trouble figuring it out. Essentially I want to use the gyroscope to run and check if the robot is zeroed, (when in a "drivestraight" command), so that if it comes out of alignment, then it will "re-zero" itself, and continue driving straight.
This might give you some ideas:

http://www.chiefdelphi.com/media/papers/2438


edit:

I should have mentioned: If your vehicle is not driving straight when so commanded, check the hardware first before trying to correct it in software. Check drivetrain alignment and friction on left & right sides. Check your wiring to make sure you don't have asymmetric voltage drops left vs right. Check the left & right motors to make sure they have similar performance curves.




Last edited by Ether : 27-12-2012 at 16:17.
Reply With Quote
  #6   Spotlight this post!  
Unread 27-12-2012, 18:39
F22Rapture's Avatar
F22Rapture F22Rapture is offline
College Student, Mentor
AKA: Daniel A
FRC #3737 (4H Rotoraptors)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Goldsboro, NC
Posts: 476
F22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant futureF22Rapture has a brilliant future
Re: Learning Simple PID

What's the general opinion on using PID through the Jaguars vs using it through WPILib?

And what's the correct procedure for PID (either distance or speed) when you have one encoder on each side of the drivetrain? Average the two together, or command them both separately?
__________________
Research is what I’m doing when I don’t know what I’m doing.
- Wernher von Braun
Attending: Raleigh NC Regional
Reply With Quote
  #7   Spotlight this post!  
Unread 27-12-2012, 20:37
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,102
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Learning Simple PID

Quote:
Originally Posted by F22Rapture View Post
what's the correct procedure for PID (either distance or speed) when you have one encoder on each side of the drivetrain? Average the two together, or command them both separately?
It depends on what you are trying to achieve.


Reply With Quote
  #8   Spotlight this post!  
Unread 28-12-2012, 09:16
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 7,014
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Learning Simple PID

Generally, you pick one parameter to control and then control it. Trying to control two parameters will lead to conflicts.

Using the built-in PID in the Jaguar allows you to control that Jaguars output. If you want to control the outputs from multiple Jaguars quasi-independently, such as in the drivetrain, you would need to do it at a higher level such as in your cRio.
__________________

I am N2IRZ - What's your callsign?
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 12:53.

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