Go to Post If no hint or advanced BOM don't come out, will it make you not participate in FIRST this year?? - Elgin Clock [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 04-01-2017, 15:21
YairZiv's Avatar
YairZiv YairZiv is offline
Registered User
FRC #5951 (Makers Assemble)
Team Role: Programmer
 
Join Date: Oct 2016
Rookie Year: 2016
Location: Tel Aviv, Israel
Posts: 19
YairZiv is an unknown quantity at this point
Driving Straight

Hey, so as we get close to the season, there's one thing we wanna understand how to do. We wanna understand how to drive straight using autonomous period. Using a PIDController for distance will not work since the two sides of the chassis may drive in a different speed. Using a PIDController for speed might work a little better though it will be hard to land in the distance we tried to go to. So how do we go into doing something like that?

Good luck in the season everybody!
Reply With Quote
  #2   Spotlight this post!  
Unread 04-01-2017, 15:28
Poseidon5817's Avatar
Poseidon5817 Poseidon5817 is offline
Founder and CEO, DeadMemes Studios
AKA: Mitchel Stokes
FRC #5817 (Uni-Rex)
Team Role: Mentor
 
Join Date: Aug 2013
Rookie Year: 2014
Location: Clovis, CA
Posts: 392
Poseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud of
Re: Driving Straight

Quote:
Originally Posted by YairZiv View Post
Hey, so as we get close to the season, there's one thing we wanna understand how to do. We wanna understand how to drive straight using autonomous period. Using a PIDController for distance will not work since the two sides of the chassis may drive in a different speed. Using a PIDController for speed might work a little better though it will be hard to land in the distance we tried to go to. So how do we go into doing something like that?

Good luck in the season everybody!
If you have a gyro, you can run a PID on the angle so that if it turns one way or the other, it will increase/decrease the outputs on the sides to help it turn back.
__________________
My FRC History:

2014 - Team 1671: Central Valley Regional Finalist and Chairman's Award Winner, Sacramento Regional Finalist, Archimedes Quarterfinalist
2015 - Team 1671: Central Valley Regional Semifinalist, Sacramento Regional Semifinalist and Chairman's Award Winner, Newton Winner, Einstein Winner
2016 - Team 5817: Central Valley Regional Finalist and Rookie All-Star, Orange County Regional Quarterfinalist and Rookie All-Star, Newton Division
2017 - Team 5817: Return of the bench grinder


Reply With Quote
  #3   Spotlight this post!  
Unread 04-01-2017, 15:28
AustinShalit's Avatar
AustinShalit AustinShalit is offline
Registered User
AKA: אוסטין
no team (WPILib Suite Developer)
 
Join Date: Dec 2013
Rookie Year: 2008
Location: Los Angeles/Worcester/Israel
Posts: 134
AustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of light
Re: Driving Straight

When WPILib 2017 is released, take a look at the gyro example. It is a sample program to demonstrate how to use a gyro sensor to make a robot drive straight. The program uses a joystick to drive forwards and backwards while the gyro is used for direction keeping. You can replace the joystick in the example with the output from a PIDController to drive straight for a certain distance.

You can get to the Gyro example by:
File -> New -> Other -> WPILib Robot Java Development -> Example Robot Java Project -> Gyro
__________________
Reply With Quote
  #4   Spotlight this post!  
Unread 04-01-2017, 19:08
BenBernard BenBernard is offline
Registered User
FRC #5687 (The Outliers)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Portland, ME
Posts: 45
BenBernard is on a distinguished road
Re: Driving Straight

If you simply can't wait that long, feel free to look at our AutoDrive command, which locks onto the current heading (yaw) from our navX when it starts and uses PID to maintain that heading as it drives. The same approach could be used for any gyro.
Reply With Quote
  #5   Spotlight this post!  
Unread 04-01-2017, 20:48
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: Driving Straight

Quote:
Originally Posted by YairZiv View Post
Hey, so as we get close to the season, there's one thing we wanna understand how to do. We wanna understand how to drive straight using autonomous period. Using a PIDController for distance will not work since the two sides of the chassis may drive in a different speed. Using a PIDController for speed might work a little better though it will be hard to land in the distance we tried to go to. So how do we go into doing something like that?

Good luck in the season everybody!
You can also look at our library in which you will find a PidDrive class that provides a method named "setTarget". It allows you to set the target distances in X or the Y direction. It also let you specified the "heading" you want to maintain relative to current heading. Don't worry about it being a FTC project. Our library is shared between FTC and FRC, so the TrcLib portion of the library is platform independent. So it would be identical code between FTC and FRC.
https://github.com/trc492/FtcSamples...cPidDrive.java
__________________
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 10:42.

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