![]() |
Re: New C18 3.0+ Compatible FRC Code
Ok, I have a question (more of a comment really), but I was hoping someone could either verify my understanding, or explain what I'm missing.
It seems the current gyro code as well as some things others have mentioned depend on putting processing code inside one of the Spin functions. Generally speaking, the spin function will be executed at a very high rate (essentially only processor-limited). However, at roughly 38Hz, the spin function is going to get delayed by however long it takes to run your general execution code, e.g., Teleop(). If this code is simple and runs quickly, this isn't likely to be too much of a problem. However, there is still going to be some delay associated with this code, let's call it T_d. Now, the frequency, 1/T_d is going to be important because it's actually the maximum frequency we can count on our spin function to run at over any arbitrary time interval. Right now it looks like we are processing our Gyro at 50Hz? (800Hz / 16 samples per update). This means we need to make sure that T_d < 20ms or else we will occasionally miss gyro samples. I agree that if T_d is pushing 20ms, you're probably going to have other problems since that's a lot of computation going on. I mostly wanted to clarify this in the case someone was thinking about trying to sample an analog signal at a data rate higher than 1/T_d (probably somewhere in the 800Hz - 6400Hz range), and still do the processing in the spin loop. In this case they might start seeing data go missing every once in a while. I guess my question then is why do we count on the spin code to do our processing since it's timing seems potentially sporadic. Wouldn't it be better to just do the gyro processing in the ISR alongside the analog-to-digital conversion? Then we would have high-frequency reliable processing of the gyro (or whatever other analog sensor we are processing), without having to worry about anything other than keeping our Teleop() execution time a decent amount under the theoretical limit of 26 ms. |
Re: New C18 3.0+ Compatible FRC Code
Quote:
Quote:
Quote:
Quote:
Quote:
-Kevin |
Re: New C18 3.0+ Compatible FRC Code
Thanks for the response Kevin. Sounds like my fear (and interpretation of the code) was mostly right, but as I was hoping, also completely unjustified :)
This looks like a great set of code and I'm very excited about getting a chance to play with it soon -- things have come a long ways from where they were in 2002... I think we were screwing around with PBASIC back then. I'm missing most of the competition, but I'll be hanging around my old team for their last week and a half or so. Plenty of time for last-minute debugging of the software. Kind of funny... doesn't seem to matter what robotics project I'm helping out with: DARPA Grand Challenge, or FIRST robotics... Kevin Watson manages to be involved and giving advice :) |
Re: New C18 3.0+ Compatible FRC Code
Quote:
Quote:
-Kevin |
Re: New C18 3.0+ Compatible FRC Code
Kevin,
Upgraded to the final 3.0 version....now I get a RLOD with just 1 encoder enabled.....what can produce this condition? |
Re: New C18 3.0+ Compatible FRC Code
Quote:
-Kevin |
Re: New C18 3.0+ Compatible FRC Code
Quote:
Thanx! |
Re: New C18 3.0+ Compatible FRC Code
Quote:
|
Re: New C18 3.0+ Compatible FRC Code
I must be missing something simple. I am using your code that is a couple of versions back, and when i enable the gyro code, all i get is this:
Gyro Bias=-1 Gyro Rate=0 Gyro Angle=0 after it has initialized I then pulled your most recent code enabled the adc and the gyro in both spin and teleop the code compiles correctly, but soon as i load it, i get a code error. |
Re: New C18 3.0+ Compatible FRC Code
Quote:
-Kevin |
Re: New C18 3.0+ Compatible FRC Code
I got my code to work, there was an ifdef that i had written that blocked out part of the init, but the new code still fails to load.
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
-Kevin |
Re: New C18 3.0+ Compatible FRC Code
The code that I cannot get to load is the code off of your webpage 1/20/08 both with and without the gyro enabled
My code based off of the older version is working fine. |
Re: New C18 3.0+ Compatible FRC Code
Quote:
Make sure you're performing all the steps documented in readme.txt. -Kevin |
Re: New C18 3.0+ Compatible FRC Code
Red light of death. Code compiles fine. I then go into programming mode open the loader give it the hex file and it attempts of load. The file is loaded in, but the code error light stays solid, reset, same thing. It is not really an issue for me, as I am sticking with the old code (early version of the v3 compiler), but I do not quite get what is going on. Do you want the hex file that i generate?
|
| All times are GMT -5. The time now is 14:27. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi