Brad,
Thanks for your response.
I am using the ADXRS300EB (300 degrees/sec) gyro (Digikey PN
ADXRS300EB, price $53.75/1 piece) and attempting to integrate into
a VEX controller as a prototype for the FRC controller.
Using the 20 Hz gyro rate update information that you provided, I will
update the information on Page 4 of Jim Zondag's paper "Working the
Angles" (Team 33 - Killer Bees) to become the following:
1) ADXRS300EB has 1/2 the resolution (12.8/2 = 6.4 mV/degree/second)
but twice the range (300 degrees/sec) compared to the ADXRS150EB
(150 degrees/sec) gyro.
2) Gyro loop runs at 20 Hz (versus 38.2 Hz FRC main loop)
3) At a rotation rate of 1 degree per loop, we would thus be rotating at
20 degrees/sec. Multiply this by the output sensitivity and you get:
20 deg/sec * 6.4 mV/degree/sec = 128 mVolts
4) The 10 bit A/D on the FRC/VEX robot controller has a resolution of:
5.00 V/ 1023 = 4.89 mV/bit.
5) Thus the digital input value to the CPU at 1 degree per main loop is:
128 mVolts / 4.89 mV/bit = 26.175 bits
Therefore, if the robot turns 80 degrees in 1 second, the gyro heading should output it's nominal output (480 - 520 counts on A/D) plus 26.175 bits/ degree/main loop times (80 degrees/20 Hz = 4 degrees) = 104.7 counts per gyro heading loop.
The one gyro (ADXSR300EB) I have outputs nominally about 520 counts.
So I would expect to see about 635 (520 + 105) counts for gyro heading if I spun the robot for 80 degrees in 1 second.
But, I think there may be an integration issue problem.

The FRC controller updates at 38.2 Hz (26.2 ms), The VEX controller updates at 54 Hz (18.5 ms) (I have read). This is asynchronous to the gyro which updates every 20 Hz. Jim Zondag's method insures that his gyro reading (once) is synchronized to his main loop rate and his calculations are then valid.
So, I think the solution that is required is to not use the gyroangle function provided in Easy-C, but to treat the gyro as an analog input and just sample it once per loop.
Oops, is that a problem? How do I insure that the gyro analog input is just sample one per loop (FRC 26.2 ms/VEX 18.5 ms)? I guess I need to setup a simple timer loop in the Operator Control Loop that monitors 26.2/18.5 msec and then reads the gyro as an analog input? IF I set it to 26.2 msec timer rate, I can then move it easier from the VEX to the FRC controller.
So, I will rework Jim's page 4 all over again
) ADXRS300EB has 1/2 the resolution (12.8/2 = 6.4 mV/degree/second) but twice the range (300 degrees/sec) compared to the ADXRS150EB (150 degrees/sec) gyro.
2) Gyro loop runs at 38.2 Hz (same as 38.2 Hz FRC main loop)
3) At a rotation rate of 1 degree per loop, we would thus be rotating at 38.2 degrees/sec. Multiply this by the output sensitivity and you get: 38.2 deg/sec * 6.4 mV/degree/sec = 244.5 mVolts
4) The 10 bit A/D on the FRC/VEX robot controller has a resolution of: 5.00 V/ 1023 = 4.89 mV/bit.
5) Thus the digital input value to the CPU at 1 degree per main loop is: 244.5 mVolts / 4.89 mV/bit = 50 bits (CPU counts at 1 degree/38.2 kHz FRC controller main loop)
Therefore, if the robot turns 90 degrees in 1 second, the gyro heading should output it's nominal output (480 - 520 counts on A/D) plus 50 bits/ degree/main loop times (90/38.2 = 2.35 degrees = 117.8[117]) counts per gyro heading loop.
The one gyro (ADXSR300EB) I have outputs nominally about 520 counts.
So I would expect to see about 637 (520 + 117) counts for gyro heading if I spun the robot for 90 degrees in 1 second. This would results in a total integrated amount of 117 counts/loop * 38.2 loops or 4469 counts above
the nominal amount of 520 counts/loop * 38.2 loops or 19864 counts.
So, If I want to complete a 90 degree turn in 1 second, I will count up (integrate) the gyro and count to 19684 counts to indicate when a 90 degree turn has been completed.
