This program works for the first part of autonomous, which is going forward. However, when it gets to the next step (which is to turn), the motors just buzz. Why is that? Heres a link to the download for the aia of the project. http://www.mediafire.com/download/io...1ifo/TIMED.aia
Announcement
Collapse
No announcement yet.
Encoders in Autonomous?
Collapse
X
-
Originally posted by FTC10083 View PostThis program works for the first part of autonomous, which is going forward. However, when it gets to the next step (which is to turn), the motors just buzz. Why is that? Heres a link to the download for the aia of the project. http://www.mediafire.com/download/io...1ifo/TIMED.aia
I'm also not sure that setting the direction with a "Text" value actually works. What I've done is call the "Set <Motor>.Direction" and then use the "<Motor>.DIRECTION_FORWARD" and "<Motor>.DIRECTION_REVERSE" blocks (they're right underneath the "Set <Motor>.Direction" block in the block selector). Also, the encoders might stop the motor LESS than the specified value, so you might want to change your WHILE conditionals to be something like a procedure called "MoveComplete" which has a conditional something like this:
IF (absolute(left_drive.CurrentPosition-leftEncoderTarget) <= 5) AND (absolute(right_drive.CurrentPosition-rightEncoderTarget) <= 5)
Because it might stop the motor just before or just after the actual target you set, and if your WHILE loop is expecting it to always be MORE than what you set, you'll never exit your while loop and the motors will buzz and whine because they're holding it steady. When we use this (<= 5 either before or after our target) we've never had it just sit and buzz anymore.
I hope this helps!
-- Gordon.
Comment