Log in

View Full Version : Problem with gyro...


capenga
14-02-2006, 06:31
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
Did you compute the bias?

kaszeta
14-02-2006, 09:23
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
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
this is the exact reason we stopped using the qyro and started using geartooth. Think about it

kaszeta
14-02-2006, 16:35
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
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
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:


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
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
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:


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
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:

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..
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
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
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
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
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! :^)

ida_noeman
15-02-2006, 18:27
I think my point was that you would only need to recover if you were shooting in the center goal. And as I said, you'd be using the cam to recover. So where does the gyro come into this, I ask?

KenWittlief
15-02-2006, 18:35
There are six robots on the field.

To maximize the distance measuring precision of the camera it needs to be mounted low on the robot.

Its very likely that your bots view of the target light will be blocked from time to time.

With the gyros and accelerometers you can design an inertial guidance system that cannot be blocked or inhibited by any other objects on the field.

The more senses (sensors) you robot uses the better it will be able to perform over a wide range of variables, most of which are out of your control. Once auton starts you dont know what the other 5 robots on the field are going to do.

capenga
16-02-2006, 15:17
So... my gyro is better connected now, but the only value that i can get is 0 :ahh:

what's this?

KenWittlief
16-02-2006, 15:42
first step would be to put a volt meter on the output of the gyro, to see if the problem is sensor, electrical, or a SW issue.

next step is to make sure the signal is present on the input pin of the RC.

capenga
16-02-2006, 17:06
look... i've verified all the possible connections of the gyro with a volt meter, and i'm sure that all the connections are fine, and the signal arrives on the RC.

i think that the sensor's PIC is toasted :p

KenWittlief
16-02-2006, 19:07
I dont know if anyone has tried to repair a failed gyro sensor. You might be better off getting one shipped overnight to you from IFI.

If you have the right power supply voltage going to the gyro board, and the output stays at 2.5 V when you turn the board on its axis of rotation, then yes, the gyro board has definately failed.

capenga
16-02-2006, 19:25
well, i don't think that ordering another sensor would be a good idea...

i'm in Brazil :D