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

Did you compute the bias?

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.

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.

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

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 :smiley: ), 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;}


// Set limit bands


also, geartooth can tell distance, gyro can’t. The geartooth can also tell you direction, think about it.

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

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:
[li]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…
[/li][li]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. :wink:

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

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.

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.

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

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?

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.

So… my gyro is better connected now, but the only value that i can get is 0 :ahh:

what’s this?

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.

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