View Single Post
  #7   Spotlight this post!  
Unread 13-07-2013, 15:02
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 430
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Autonomous Mode for Ultimate Ascent (Screenshot/vi included)

It's been a few years since I've worked with labview, but you should be able to easily integrate an encoder to better approximate how far you have driven.

It can literally be as simple as setting up the encoder VI (see first link below for a brief guide on using the encoder), and in the first frame of your sequence structure, have a loop which terminates when the encoder value is greater than the distance you want to travel. You can tune in your motor speeds and the distance to drive empirically.

You're not going to end up at the exact same spot every time this way, but it's going to be A LOT more accurate than time based movements. The problem with using time is that you can't account for the real world variables, like your battery voltage being different every match, wheel slippage, etc.). By adding sensors to your robot you don't have to worry about some of these variables (it doesn't matter if you get to the desired distance in 3.1s or 2.97s, you only care that you got to your desired distance).

You may also find that when sending the same voltage to the left and the right side of your drivetrain, that it doesn't drive straight. This can be accounted for in mechanical differences between each side (different amounts of slop in chains) or that the weight distribution isn't even between the sides, or that the motors themselves actually have different top speeds in fwd/rev.
To account for this you can look into adding a gyro onto your robot.

If you want to learn a few things in the off season to really help your performance in auto mode. You can give yourself a real advantage if you know how to make your robot:
- drive a set distance (encoders) and drive in a straight line (gyro)
- and turn a specific number of degrees (gyro)


Some resources:
How to interface w/ sensors in labview
FRC Mastery - An older, but awesome set of video tutorials on a large number of topics

There are is an encoder and gyro example here
And a number of good examples here
__________________
http://team2168.org
Reply With Quote