Go to Post To me, as a student, it doesn't really matter how old the RoboCoach is. My only concern is that they don't get ape-crazy when the game starts. - AZNkommander [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 Rating: Thread Rating: 9 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 16-02-2015, 09:11
cstelter cstelter is offline
Programming Mentor
AKA: Craig Stelter
FRC #3018 (Nordic Storm)
Team Role: Mentor
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Mankato, MN
Posts: 77
cstelter will become famous soon enough
Re: PID Subsystem -- Align With Tote

We did something similar to drive to the low goal 2 years ago. I think the best avenue is a PID command although you may only need to apply P.

We had a gyro and had the PID follow a setpoint while driving forward.

Code:
returnPIDInput() {
    return gyro.getAngle();
}

usePIDOutput(double output) {
    driveTrain.tankDrive(m_speed+output, m_speed-output);
}
So you begin driving at some intended speed (say 0.5) and an angle you want to maintain (say 0.0).

Eventually you get a picture that says you're 50 pixels off center and perhaps that calculates to a new angle of +10 degrees, so in your execute() of your PIDCommand, you observe this and do setSetpoint(10) (change to 10 degrees) and your pid starts applying the resulting output incrementally above your base speed to rotate your robot while it continues to move forward.

The picture data constantly updates the angle.

We haven't done vision yet this year (many new students-- way behind)-- but the above will only drive you to the center of the tote. when you get there, you may be at an angle to the tote, depending on your starting point, etc. but if you know you are pretty much lined up to begin with the above should keep you on target.

Generally the gyro data comes a lot quicker than the camera data which is why we chose to drive along a gyro angle and update tangle relative to the gyro as often as we acquired a new picture.

Last edited by cstelter : 16-02-2015 at 10:03.
Reply With Quote
  #2   Spotlight this post!  
Unread 16-02-2015, 16:29
Ozuru's Avatar
Ozuru Ozuru is offline
It's always the programmer's fault.
no team
 
Join Date: May 2013
Rookie Year: 2010
Location: Earth
Posts: 268
Ozuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to behold
Re: PID Subsystem -- Align With Tote

Quote:
Originally Posted by cstelter View Post
We did something similar to drive to the low goal 2 years ago. I think the best avenue is a PID command although you may only need to apply P.

We had a gyro and had the PID follow a setpoint while driving forward.

Code:
returnPIDInput() {
    return gyro.getAngle();
}

usePIDOutput(double output) {
    driveTrain.tankDrive(m_speed+output, m_speed-output);
}
So you begin driving at some intended speed (say 0.5) and an angle you want to maintain (say 0.0).

Eventually you get a picture that says you're 50 pixels off center and perhaps that calculates to a new angle of +10 degrees, so in your execute() of your PIDCommand, you observe this and do setSetpoint(10) (change to 10 degrees) and your pid starts applying the resulting output incrementally above your base speed to rotate your robot while it continues to move forward.

The picture data constantly updates the angle.

We haven't done vision yet this year (many new students-- way behind)-- but the above will only drive you to the center of the tote. when you get there, you may be at an angle to the tote, depending on your starting point, etc. but if you know you are pretty much lined up to begin with the above should keep you on target.

Generally the gyro data comes a lot quicker than the camera data which is why we chose to drive along a gyro angle and update tangle relative to the gyro as often as we acquired a new picture.
Thank you for all of that. If you want help with vision tracking this year, let me know. The gyroscope angle is an interesting idea -- it seems this competition that it may just be easier to use a gyro for that.
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:56.

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