|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
KOP Gyro seems to run-on after turn stops
Hi
I'm trying to implement a closed loop controller with the KOP Gyro, and it seems to have a major flaw !!! The initial symptoms were that if you locked the current heading when the operator stoped turning the bot (joystic returns to detent), the controller would steer the robot BACK about 30 degrees. I initially suspected my code, but finally I had to start looking at the actual Gyro input. By just wiring the Gyro to a stand-alone RC unit on analog channel 1, I could display the gyro angle whenever it changed. If I spin the gyro, the heading starts changing immediatly, but when I stop it, the heading changes continue on for almost another SECOND. Once again I suspected my software (maybe overflowing the serial port), so I changed the input to a pot so I could simulate gyro input. With the POT, the heading stopped as soon as I returned the put to neutral. So, it really looks like the Gyro output doesn't go to zero (bias) quickly when the turning stops. I even tried widenning the deadband, but that didn't help either. Can anyone verify/disprove this from recent experience? So, it seems to me that with such a long run-on, the gyro is next to useless for any sort of high speed control. The best I can expect is a drunken meander across the field. Any suggestions would be greatly appreciated. Phil. |
|
#2
|
|||||
|
|||||
|
Re: KOP Gyro seems to run-on after turn stops
I'd still suspect your code, but really the serial port buffer.
As a validation check you could bypass the serial port by adding a software check to turn on an OI LED whenever the gyro (or pot) output is not changing (significantly). P.S. I accidentally cut out that the kit gyro tested alright for us. Last edited by Mark McLeod : 03-03-2007 at 10:14 PM. |
|
#3
|
|||
|
|||
|
Re: KOP Gyro seems to run-on after turn stops
Also keep in mind that if you are printing to standard out, what you see can lag behind "real time", mainly if you are printing out every program loop. When outputting that fast, the buffer can't keep up. If you make it so that it only prints out every .1s or so, it will keep up better.
|
|
#4
|
||||
|
||||
|
Re: KOP Gyro seems to run-on after turn stops
we have the same problem, we just use a button to disable the gyro untill we can fix it, it works fairly nicely
|
|
#5
|
|||||
|
|||||
|
Re: KOP Gyro seems to run-on after turn stops
Yeah, I really did suspect the serial port, so I went out of my way to test that aspect..
I coded up a simple state machine so that the only thing that was printed was when the gyro stated moving and when it stopped. This way you could see exactly when the first and last change occured... typical output was: Started 901 Stopped 1805 Started 1801 Stopped 908 This indicate two 90 degree rotation sequences (First CW then CCW, showing tenths of a degree). So no chance of overflowing any buffers etc.. What I find odd is that the angle appears correct although the "Stopped" value was printed a second after I actually stopped. (Despite trying dead-bands all the way from 4 to 20). Also, for the record, if you output too fast using Printf's you just lose characters... they don't back up. Has anyone actually looked at the output of one of the lastest KOP Gyros on a scope? Does the output cut off immediatley after a rapid rotation? Phil. |
|
#6
|
||||
|
||||
|
Re: KOP Gyro seems to run-on after turn stops
if you guys are right i can tell our programmers to stop banging their heads against the wall.
we used a KOP gyro from a few years ago and it seemed to work better than this one. however at that point all we had was a drivetrain so i could be wrong |
|
#7
|
|||||
|
|||||
|
Re: KOP Gyro seems to run-on after turn stops
I'm having reasonable sucess using the Gyro to drive straight (for autonomous mode), but forget about using it after quick turns.
After a fast turn I need to wait for the gyro rate to drop to zero before locking in a new heading. This makes the robot look like it's having a momentary brainer... but then it takes off again, and drives straight. Phil. |
|
#8
|
|||||
|
|||||
|
Re: KOP Gyro seems to run-on after turn stops
Quote:
For use of the gyro with our drive-train on our robot this year, we purchased an additional gyro with a maximum turn-rate of 300 degrees in one second from Spark Fun Electronics. (Which has tons of great sensors, BTW.) Seeing how our drive-train this year is geared for 9 ft/sec at 85% of the CIM motor free speed, the increased turning-rate of this additional gyro was much appreciated. ![]() |
|
#9
|
||||
|
||||
|
Re: KOP Gyro seems to run-on after turn stops
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Camera Just stops!!! | Robostang 548 | Programming | 17 | 02-05-2007 09:50 PM |
| How to end an auto mode after gyro gets out of deadband | kiettyyyy | Programming | 17 | 04-20-2006 07:59 AM |
| KOP Gyro | John Gutmann | Programming | 12 | 12-12-2005 09:59 PM |
| Robot motion after the time has run out. | Randy Ai | Rules/Strategy | 1 | 01-06-2003 05:17 PM |
| #9 seed seems to be the spot to be.... | archiver | 2001 | 1 | 06-24-2002 03:00 AM |