Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Learning Simple PID (http://www.chiefdelphi.com/forums/showthread.php?t=110234)

shawn.schwartz 27-12-2012 02:38

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. :]

Adam.garcia 27-12-2012 12:57

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

BradAMiller 27-12-2012 15:02

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

shawn.schwartz 27-12-2012 16:02

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.

Ether 27-12-2012 16:06

Re: Learning Simple PID
 
Quote:

Originally Posted by shawn.schwartz (Post 1205229)
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.




F22Rapture 27-12-2012 18:39

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?

Ether 27-12-2012 20:37

Re: Learning Simple PID
 
Quote:

Originally Posted by F22Rapture (Post 1205253)
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.



DonRotolo 28-12-2012 09:16

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.


All times are GMT -5. The time now is 10:02.

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