Thread: KOP Gyro Lag
View Single Post
  #3   Spotlight this post!  
Unread 14-02-2008, 00:03
FRC4ME FRC4ME is offline
Registered User
FRC #0339
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Fredericksburg, VA
Posts: 324
FRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant futureFRC4ME has a brilliant future
Re: KOP Gyro Lag

Quote:
Originally Posted by TubaMorg View Post
2 things:

1. I believe the lag you are seeing is related to your print out rather than true lag. Output to screen takes more time than the slow loop, so what you are seeing as output happened a while ago. When you are outputing a dynamic value every loop, the buffer backs up. You could try adding a counter and just print every 10 loops or so.
I thought this too, but the robot itself seems to be affected by this lag. As I described in my previous post, when told to go straight after a left turn, the robot makes a large "correction" to the right. This indicates to me that gyro is telling the robot that it is still turning left when in fact it is not.

I also doubt the printout is my problem because I am using another printout as a reference. Every single slow loop, I print out a counter called "time tic" so I know how many slow loops have passed by. When the robot turns, it does so using gear tooth sensors, and prints out a message when the turn is finished and motors have been set to 230 each again (for another straight run). After that message, the gyro value printout (which also prints every loop) indicates the robot is turning for the next 30-40 time tic printouts.

Yes, it is true that all of these printouts are delayed. But the "turn finished" prinout would also experience the same delay. Regardless, there are still 30-40 loops between the end of a turn and when the gyro stops reporting a turn.