Why does the gyro need the ADC?

Maybe I am just confused about this but why does the gyro require the adc to function. I know that the gyro measures speed of rotation.

If my memory serves me, the output of the gyro is analog. It outputs some voltage proportional to the rotational velocity. Hence, you need the ADC to turn the analog value into something that the processor can actually use.

They gyro outputs analog values. I have never used the gyro but, im not quite sure why you would have to use and ADC (Analog to Digital Converter) for it to work. Maybe thats just how Kevin decided to do it and so people just do that since it makes it easy.

The ADC is, as far as my understanding, basically what measures the voltage and “tells” the processor what it is, but in a digital signal. I think you’d have to use this for any analog measurement with the PIC

sciguy125 is correct. The gyro is an analog sensor. To convert the analog values to a digital value you need to use the Analog Digital Converter.

Kevin’s ADC code also supports oversampling. This allows the 10 bit ADC in the 18F8722(processor in the RC) to accurately measure up to 16 bits of precision. More accuracy means better gyro data and less gyro drift. :smiley:

[EDIT] Noah Kleinberg was right too, it just took me to long to post. [/EDIT]
If you need any help PM or e-mail me.

[EDIT] Here is the datasheet for the gyro included in the 2006 KOP. http://ifirobotics.com/docs/analog-devices-yrg-yaw-rate-gyro-80degree-AD22304%20Rate%20Gyro%20Datasheet.pdf [/EDIT]

Has anyone tried running the output of the Gyro through a Darlington/Double Darlington transistor amp?

I know that most the values of the gyro are very low, so it seems like it would be a good idea to try amplifying them. If no one has i’ll try it and see how it does.


The gyro puts out a voltage, typically from 0 to 5 volts indicating the rate of rotation of the sensor along its sensing axis. When it’s not moving the output ideally rests at 2.5 volts (no positive or negative rotation speed) and when it goes in one direction the voltage goes down and in the other it goes up. Since computers are digital they can only sense if the voltages is greater then about 4 volts (binary 1) or less than about 1.2 volts (binary 0) (Those numbers are fuzzy blurbs of memory, might be a bit off). The ADC converts that value to a number in the code, from 0 (0v) to 1023 (5v) for use in the integration calculations (For more info about integrating see the numerous whitepapers on gyro and PID use.)

I haven’t actually done much work with it, so I don’t know how low the values get. However, if you do want to amplify it, you’d be better off with an opamp than a transistor. The opamp will be more linear (and actually predictable).

the full scale output of the gyro matches the full scale input range of the ADC: 0 to 5V.

Darlingtons have very high gain. Depending on where you centered the bias you would greatly expand a small portion of the gyros output, and cause the rest of its signal to be over or under the range of the ADC.

If you want a more sensitive gyro there are different versions available.

Two of the more common ones used are the Analog devices 150 and 300 degree/second models. The 150 has a smaller range of measurable rotational velocity, but twice the resolution. Since 150/2.5 = 60 degree/second per 0.1 volts whereas the 300 degree/second model has a greater operating range, but half resolution of the 150 since 300/2.5 = 120 degrees/second per 0.1 volts.

I used 2.5 because half of the range is one direction (above 2.5v) and the lower half is the opposite direction (below 2.5v)

Speaking of gyro whitepapers…

Because, the gyro returns a signal ANYWHERE between 0v to 5v (e.g. 2.2v). So using an ADC would allow you to translate that particular voltage at a certain point in time into a numerical value (e.g. 0 to 255 for 8 bit) so that your program can translate that into a human related reading (like 0 to 300 degrees)

In the future an ADC may not be required to get the data out of the gyro.

There are a number of SPI* based gyros and accelerometers that are coming out. Infact, they are becoming more and more common (and cheaper too).

It is possible that IFI may offer an SPI port on future RCs. If you don’t want to wait, it is also possible to make a custom circuit to act as a bridge between the SPI and one of the traditional serial ports that are already on the RC.

One of the things I like a lot about these digital communication between sensors and the RC is that you don’t have to worry about how well the analog curcuit for the ADC is designed. Some allow for zeroing, offsets, and scaling to be handled by writing to the control registers of the sensor. Very cool. It solves a lot of issues staying all digital.

Joe J.

*SPI = Serial Peripheral Interface – a standard interface defined for communiciation. I2C is another standard that many sensors use.

I don’t really know much about this topic, but I would think there would still be an ADC involved… it would just be abstracted more from the user.


the ADC would be inside the gyro itself, with the data sent to the robot controller digitally.

the biggest advantage of this for robotic applications is that its easy to corrupt an analog signal on a wire that is running through a robot chassis. Esp if the wire happens to run along side the power wires going to motors. To keep an analog signal clean on a long wire you really need to use coax cable (which our electronics are not wired for).

Noise injection on analog signals can be very difficult to debug and isolate. You could, for example, have a steering control system that works very well most of the time, but acts up when some unrelated function is operating, like when the compressor turns on, or when a motor is under a full load.

A digital signal is not as easy to corrupt, and if it is corrupted the first effect is dropped data bytes here and there, not noise injected into the signal.

The only reason to run the output of a gyro or accel Threw an op amp would be to apply some signal conditioning or filtering. I believe the AD 150 and 300 development boards have a 400HZ filter already plus the ADC ports on the FRC have a RC filter also. I don’t remember having any issues with noise when we where playing with the gyro’s. The AD website has some app notes on changing the range on some of their sensors with op amps.

noise would really depend on the surroundings and things around the gyro and cables from the gyro going to your microprocessor. Maybe if you’d coil that wire alongside your cables going to the motor, you’d start to see weird stuff happening :ahh:
Anyway the future of robotics signalling is going towards serial comms such as I2C, SPI and RS232. Not even PWM…
You may google these terms… very useful.