Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Problem with gyro... (http://www.chiefdelphi.com/forums/showthread.php?t=43982)

capenga 14-02-2006 06:31

Problem with gyro...
 
I don't know what's happening to my gyro... i think it works by it's own will...

Sometimes it works, or sometimes it gives me values that are always growing :ahh:

If someone knows what's this, please tell me =D

Jared Russell 14-02-2006 09:09

Re: Problem with gyro...
 
Did you compute the bias?

kaszeta 14-02-2006 09:23

Re: Problem with gyro...
 
Quote:

Originally Posted by capenga
I don't know what's happening to my gyro... i think it works by it's own will...

This is either (a) a bad connection to the ADC port, or (b) incorrect gyro bias. The bias being off even a little will cause this, especially if you have a small deadband on the gyro. For sort time periods while testing, you can just use Set_Gyro_Bias(), but for competition[1] and periodic checking you'll want to use the calibration routine.

[1] In competition, you turn on the bot and let it sit there for minutes motionless before they start autonomous, so the gyro will have plenty of time to calibrate.

KenWittlief 14-02-2006 09:51

Re: Problem with gyro...
 
this happened to someone else on the forum last week.

the wire colors called out on the gyro board are mislabeled. If you hooked up the cable to match the markings on the board it will do exactly what you are seeing.

Check the gyro documentation for the correct pinout.

paulcd2000 14-02-2006 16:19

Re: Problem with gyro...
 
this is the exact reason we stopped using the qyro and started using geartooth. Think about it

kaszeta 14-02-2006 16:35

Re: Problem with gyro...
 
Quote:

Originally Posted by paulcd2000
this is the exact reason we stopped using the qyro and started using geartooth. Think about it

Gear teeth sensors can't detect wheel slippage, but a gyro can. Think about it. :)

xolnian 15-02-2006 16:13

Re: Problem with gyro...
 
Wheel slippage (unless you have wheels with no traction(which you shouldn't)) will not be a problem with a robot over 90 pounds, as long as you account for acceleration. Though this might sound iffy (or ifi :D ), the calculation is easier than writing code for the gyro.

kaszeta 15-02-2006 16:25

Re: Problem with gyro...
 
Quote:

Originally Posted by xolnian
Wheel slippage (unless you have wheels with no traction(which you shouldn't)) will not be a problem with a robot over 90 pounds, as long as you account for acceleration. Though this might sound iffy (or ifi :D ), the calculation is easier than writing code for the gyro.

What's so hard about writing gyro code? Simple P-style feedback loop with the current heading and desired heading.

From an early version of my team's code, assuming you have Kevin's code in place already:

Code:

error=phi-theta;  // in milliradians
       
//Make sure you go the right way around the circle
if (error>3141L) {error-=6283;}
if (error<-3141L) {error+=6238;}
       
Kp=360; 

omega=(long)Kp*(long)error/2000L;

// Set limit bands
if(omega>64){omega=64;}
if(omega<-64){omega=-64;}

left_pwm-=omega;
light_pwm-=omega;


paulcd2000 15-02-2006 16:26

Re: Problem with gyro...
 
also, geartooth can tell distance, gyro can't. The geartooth can also tell you direction, think about it.

Tom Bottiglieri 15-02-2006 16:28

Re: Problem with gyro...
 
Quote:

Originally Posted by kaszeta
What's so hard about writing gyro code? Simple P-style feedback loop with the current heading and desired heading.

From an early version of my team's code, assuming you have Kevin's code in place already:

Code:

error=phi-theta;  // in milliradians
       
//Make sure you go the right way around the circle
if (error>3141L) {error-=6283;}
if (error<-3141L) {error+=6238;}
       
Kp=360; 

omega=(long)Kp*(long)error/2000L;

// Set limit bands
if(omega>64){omega=64;}
if(omega<-64){omega=-64;}

left_pwm-=omega;
light_pwm-=omega;


Phi being wanted angle to stick to and theta being the measured angle?

Tom Bottiglieri 15-02-2006 16:34

Re: Problem with gyro...
 
Quote:

Originally Posted by paulcd2000
also, geartooth can tell distance, gyro can't. The geartooth can also tell you direction, think about it.

It's ALOT easier to keep track of yourself on the field and know where you want to go with 2 different types of feedback.

What's easier:
  1. Keeping track of how far each side has travelled, their rates of motion, and calculating that out to find where you are, which would absolutely require a double feedback loop to acount for motor bias..
  2. Combining both and having not only a magnitude of travel, but also a direction to go along with it. This makes field position as easy as SohCahToa (how I hate basic algerba acronyms...) and vector addition.



I guess it's up to you though... Think about it. ;)

kaszeta 15-02-2006 16:47

Re: Problem with gyro...
 
Quote:

Originally Posted by Tom Bottiglieri
Phi being wanted angle to stick to and theta being the measured angle?

Other way around, actually. Although that only changes the sign on the result.

KenWittlief 15-02-2006 17:28

Re: Problem with gyro...
 
Quote:

Originally Posted by xolnian
Wheel slippage (unless you have wheels with no traction(which you shouldn't)) will not be a problem with a robot over 90 pounds, as long as you account for acceleration. Though this might sound iffy (or ifi :D ), the calculation is easier than writing code for the gyro.

So you are saying there is NO possibility that another robot will push you backwards or sideways, while your wheels happily keep spinning in the forward direction?

and there is no way your robot will ever hit the wall or sides, and sit there spinning its wheels, thinking its still moving forwards?

Experience is a cruel teacher. First you are tested, then you learn the lesson.

ida_noeman 15-02-2006 17:57

Re: Problem with gyro...
 
And your saying that you could recover during autonomous with your gyro? No, you couldn't. Also, if you are going for the side goals, and if you go for the nearest goal, then you'll get there before anyone could bump you (as long as your robot is decently fast.) If you get bumped while shooting, you shouldn't be worried about recovering with the gyro because you'll use the cam. And most likely you won't be using either gyro or gear tooth during non-autonomous mode.

KenWittlief 15-02-2006 18:21

Re: Problem with gyro...
 
Quote:

Originally Posted by ida_noeman
And your saying that you could recover during autonomous with your gyro? No, you couldn't....

One of the worst mistakes to make in a competition: Underestimating your opponents abilities! :^)


All times are GMT -5. The time now is 18:28.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi