![]() |
Gyroscope Code
For those who might be interested, I've just posted updated gyroscope interface code for IFI's robot controllers. The code has been significantly reworked to use the new ADC interface code, which allows the programmer to use other analog sensors alongside a gyroscope without affecting the performance or operation of the gyroscope. In addition, significant performance improvements can be realized using the new oversampling and deadband features. The code can be found here: http://kevin.org/frc. As always, if you find a bug in the code or a problem with the documentation, please let me know.
-Kevin Here's the readme file: Code:
The source code in gyro.c/.h contains a driver and supporting |
Re: Gyroscope Code
Quote:
Nine things must be done before this software will work correctly on your robot controller: 1) The gyro's rate output is wired to one of the analog inputs of your robot controller and gyro.h/#define GYRO_CHANNEL is updated with the analog channel your gyro is attached to. 2) A #include statement for the gyro.h header file must be included at the beginning of each source file that calls the functions in gyro.c. The statement should look like this: #include "gyro.h". 3) Initialize_Gyro() must be called from user_routines.c/ User_Initialization(). 4) Process_Gyro_Data() must be called when the ADC software generates an update. An example of how to do this can be found in user_routines_fast.c/Process_Data_From_Local_IO(). 5) You must select the gyro you're using from a list in gyro.h and if needed, remove the // in front of its #define. 6) The default angular unit is milliradians. If desired, this can be changed to tenths of a degree by editing gyro.h 7) A gyro bias calculation must take place using the functions Start_Gyro_Bias_Calc() & Stop_Gyro_Bias_Calc() described below. This must be done several hundred milliseconds after the gyro powers-up and is allowed to stabilize. 8) For optimal performance, you'll need to calibrate the gyro scaling factor using the instructions above or those included in gyro.h. 9) Follow the instructions found in adc_readme.txt for installation instructions. -Kevin |
Re: Gyroscope Code
Thanks for the contribution to the First effort. I have a What if question.
What if First includes the EasyC environment for the 2006 season? Could your code be wrapped up and included into it? How about your serial port code? Just curios as to you opinion if First goes down this path. |
Re: Gyroscope Code
Quote:
-Kevin |
Re: Gyroscope Code
Is it possible to use a Murata gyro with the innovation controllers. If so, what changes would have to be made to the code so the controller can read the output from the gyro?
|
Re: Gyroscope Code
Quote:
-Kevin |
Re: Gyroscope Code
Quote:
|
Re: Gyroscope Code
Quote:
-Kevin |
Re: Gyroscope Code
I've updated the gyro code with version 0.3 of the analog to digital conversion code. As always, the code can be found here: http://kevin.org/frc
-Kevin |
Re: Gyroscope Code
Well, I finally posted the ADC and Gyro code for the 2006 robot controller. Sorry about the delay, but I ran into a nasty bug that caused me to spend a few days in the fourth and fifth levels of programmer hell. The bug was in the design of the PIC18F8722 (yes, a bug in the sillicon) and I had to figure out what was going on. Anyway, the gyro code works really, really well with the gyro in the kit of parts. The accelerometers also work really well, but I need to do more testing before I unleash that code.
-Kevin |
Re: Gyroscope Code
Quote:
Thans Jon Mittelman mentor Team236 |
Re: Gyroscope Code
Kevin, you're like my own personal Jesus.
|
Re: Gyroscope Code
Quote:
The actual Yaw Rate Gyro chip used on the 2006 YRG is the AD22304.As far as I can tell, the only significant difference is the 80 degree/sec turning rate limit (vs. 150 dps on the ADXRS150). Is there anything that needs to be adjusted in the code to handle this particular chip, or is it good enough just to leave the DEFINE the way it came? Thanks again, Dave |
Re: Gyroscope Code
I've been having trouble getting the KOP gyro to work. I attached the two PWM cables to it and installed the gryo code. The output I get from the program seems to be in no way related to what is happening to the gyro. :confused: Also, why are two PWM cables used on the gyro, is one a temparture sensor(I read that it maybe somewhere)? I'm really a bit confused and any help would be greatly appreciated.
|
Re: Gyroscope Code
Quote:
JBotAlan |
| All times are GMT -5. The time now is 21:58. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi