Go to Post In the 2010 game, FRC and FVC robots will be working together to cut Dave's hair, mow his lawn, and serve him dinner. ;) - Rich Kressly [more]
Home
Go Back   Chief Delphi > Technical > Control System
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-03-2007, 13:31
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 747
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
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.
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor
  #2   Spotlight this post!  
Unread 03-03-2007, 21:17
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,817
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 03-03-2007 at 22:14.
  #3   Spotlight this post!  
Unread 03-03-2007, 22:13
TubaMorg TubaMorg is offline
Programmermechanicalelect ricalcoach
AKA: Dan
FRC #1480 (Robatos Locos)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Houston
Posts: 450
TubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond repute
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   Spotlight this post!  
Unread 04-03-2007, 02:46
Rick-906's Avatar
Rick-906 Rick-906 is offline
inventor of the hoverbot-2006
AKA: Richard
FRC #0296 (Loyola Northern Knights)
Team Role: Communications
 
Join Date: Mar 2006
Rookie Year: 2005
Location: Montreal
Posts: 129
Rick-906 is a splendid one to beholdRick-906 is a splendid one to beholdRick-906 is a splendid one to beholdRick-906 is a splendid one to beholdRick-906 is a splendid one to beholdRick-906 is a splendid one to beholdRick-906 is a splendid one to behold
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
__________________
The knack of flying is learning how to throw yourself at the ground and miss.

--Hitchhikers Guide to the Galaxy

2006 Archimedes Divisional Champions
2006 Championship Winner
  #5   Spotlight this post!  
Unread 04-03-2007, 11:06
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 747
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
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.
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor
  #6   Spotlight this post!  
Unread 04-03-2007, 14:10
Rick-906's Avatar
Rick-906 Rick-906 is offline
inventor of the hoverbot-2006
AKA: Richard
FRC #0296 (Loyola Northern Knights)
Team Role: Communications
 
Join Date: Mar 2006
Rookie Year: 2005
Location: Montreal
Posts: 129
Rick-906 is a splendid one to beholdRick-906 is a splendid one to beholdRick-906 is a splendid one to beholdRick-906 is a splendid one to beholdRick-906 is a splendid one to beholdRick-906 is a splendid one to beholdRick-906 is a splendid one to behold
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
__________________
The knack of flying is learning how to throw yourself at the ground and miss.

--Hitchhikers Guide to the Galaxy

2006 Archimedes Divisional Champions
2006 Championship Winner
  #7   Spotlight this post!  
Unread 04-03-2007, 17:03
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 747
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
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.
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor
  #8   Spotlight this post!  
Unread 04-03-2007, 18:22
artdutra04's Avatar
artdutra04 artdutra04 is offline
VEX Robotics Engineer
AKA: Arthur Dutra IV; NERD #18
FRC #0148 (Robowranglers)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2002
Location: Greenville, TX
Posts: 3,078
artdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond repute
Re: KOP Gyro seems to run-on after turn stops

Quote:
Originally Posted by PhilBot View Post
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.
The KOP gyro has a maximum number of degrees it can turn in one second before it 'overflows' and loses accuracy. To the best of my knowledge, this value is ~85 degrees in one second for the KOP gyro. If you try turning 180 degrees in one second, you will overflow the sensor and drastically lose accuracy. (This is the same as exceeding the +1G acceleration on the accelerometer.)

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.
__________________
Art Dutra IV
Robotics Engineer, VEX Robotics, Inc., a subsidiary of Innovation First International (IFI)
Robowranglers Team 148 | GUS Robotics Team 228 (Alumni) | Rho Beta Epsilon (Alumni) | @arthurdutra

世上无难事,只怕有心人.
  #9   Spotlight this post!  
Unread 05-03-2007, 12:43
Donut Donut is offline
The Arizona Mentor
AKA: Andrew
FRC #2662 (RoboKrew)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2004
Location: Goodyear, AZ
Posts: 1,301
Donut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond repute
Re: KOP Gyro seems to run-on after turn stops

Quote:
Originally Posted by artdutra04 View Post
The KOP gyro has a maximum number of degrees it can turn in one second before it 'overflows' and loses accuracy. To the best of my knowledge, this value is ~85 degrees in one second for the KOP gyro. If you try turning 180 degrees in one second, you will overflow the sensor and drastically lose accuracy. (This is the same as exceeding the +1G acceleration on the accelerometer.)
Actually, this year's KOP gyro can handle 150 degrees/second of turning. In the past it could only handle the 85.
__________________
FRC Team 498 (Peoria, AZ), Student: 2004 - 2007
FRC Team 498 (Peoria, AZ), Mentor: 2008 - 2011
FRC Team 167 (Iowa City, IA), Mentor: 2012 - 2014
FRC Team 2662 (Tolleson, AZ), Mentor: 2014 - Present
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Camera Just stops!!! Robostang 548 Programming 17 05-02-2007 21:50
How to end an auto mode after gyro gets out of deadband kiettyyyy Programming 17 20-04-2006 07:59
KOP Gyro John Gutmann Programming 12 12-12-2005 21:59
Robot motion after the time has run out. Randy Ai Rules/Strategy 1 06-01-2003 17:17
#9 seed seems to be the spot to be.... archiver 2001 1 24-06-2002 03:00


All times are GMT -5. The time now is 15:11.

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