![]() |
Re: New C18 3.0+ Compatible FRC Code
I just discovered something else interesting about the gyro code... specifically the way the angle resolution relates to the analog input scaling.
I detected this as I was logging heading data as I was driving around and around our track. On my system I have 4 Analog inputs, that I'm running 4 amples per update at 1600 Hz... This give me a Gyro update rate of 100 updates per second, and an ADC Range of 2048 and In the Gyro code... for an ADXRS150 I have Quote:
Quote:
Max Long is 2147483648 so if I divide this by 204800 I get 10485 ... Which, in theory is the maximum result I can get... But wait, this is millirads so the maximum angle I can measue is... just over 1.6 full rotations... Oops... Either I did my math wrong, or I have to reduce my update rate. In fact, this does reflect what I see in my log data... after getting to 10485 mRad, the angle starts counting down again... So I need to reduce my ADC range/rate, or reduce my measurement accuracy (like changing to tenth of a degree.) No wonder my bot corrected in the wrong direction on evey second lap :) |
Re: New C18 3.0+ Compatible FRC Code
Quote:
Code:
void Read_Yaw(void) { |
Re: New C18 3.0+ Compatible FRC Code
Quote:
-Kevin |
Re: New C18 3.0+ Compatible FRC Code
Sorry if this has been addressed before I don’t have time to go through all 288 posts but we are having an issue when we compile. Here is what our output looks like, if anyone can help it would be greatly appreciated. Thank you
Code:
Clean: Deleting intermediary and output files. |
Re: New C18 3.0+ Compatible FRC Code
You need to go to the project menu then build options then project
On the directory tab select Header Search Path (i dont have mplab infront of me right now but it is the header one), create a new one that points to the mcc18\include folder where ever that may be, it might be in C:\Program Files\ or just under C:\ Seeing as that variable is off you may also need to set the Library Search Path to mcc18\lib folder |
Re: New C18 3.0+ Compatible FRC Code
Quote:
-Kevin |
Re: New C18 3.0+ Compatible FRC Code
Quote:
-Kevin |
Re: New C18 3.0+ Compatible FRC Code
Quote:
Code:
Clean: Deleting intermediary and output files. |
Re: New C18 3.0+ Compatible FRC Code
Quote:
The clib.lib error is due to MPLAB not knowing where your compiler libraries are installed: Project > Build Options > Directories tab > Library Search Path -Kevin |
Re: New C18 3.0+ Compatible FRC Code
cool, it all works now, thank you very much :)
|
Re: New C18 3.0+ Compatible FRC Code
Just FYI, I believe that I have a single version of the code that will work with all robot controllers from 2004 on and can be built with C18 2.4 or 3.1. After seeing if I can improve the gyro integration code (per Philbot's posting above), doing some additional testing, and writing a bit more documentation, I should be able to release the code in the next few days.
-Kevin |
Re: New C18 3.0+ Compatible FRC Code
Quote:
You truly are an example that all FIRSTers can look to, including myself. Thank you for your incredible efforts!! |
Re: New C18 3.0+ Compatible FRC Code
I do like the new code layout. I would like to see the code for C18 2.4. We do prototyping on previous years' robots and having both 3.15 and 2.4 on our machines seems a bit difficult to manage.
|
Re: New C18 3.0+ Compatible FRC Code
Kevin,
Now finding that the RC is stuck in Programming Mode at the end of download if adc is initialized.......any suggestions? (I did read the readmes!!!) Jon Mittelman |
Re: New C18 3.0+ Compatible FRC Code
Hi Kevin,
We keep on getting a error that ADC_CH0 is not defined. This happens when we try to use rc_ana_in_01. We looked in all of the header files including the complier file and could not find the definition but it is clearly used in ifi_frc.h.This might be a stupid error but please can someone help us. Thanks, Julan |
| All times are GMT -5. The time now is 14:28. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi