![]() |
Re: New C18 3.0+ Compatible FRC Code
Quote:
-Kevin |
Re: New C18 3.0+ Compatible FRC Code
Quote:
-Guy Davidson |
Re: New C18 3.0+ Compatible FRC Code
Quote:
|
Re: New C18 3.0+ Compatible FRC Code
Kevin,
Now that I enabled the ISR's (grin) everything works fine. No need to include sonar code this year as the MaxBotix sensors have an analog output. |
Re: New C18 3.0+ Compatible FRC Code
Hmmm i dont know what the issue was, (i did have ISR enabled) I just now recompiled the code and loaded it, no issues. Serial communications issue on the load... I dont know.
|
Re: New C18 3.0+ Compatible FRC Code
Hello, this is my first year doing the programming on my team and we are having a very confusing problem. We are using an unmodified version of Kevin’s 2008 beta code with mplab v8 and c18 v3.1 and the code compiles fine and loads onto the robot fine, and it seems run on the robot, but the robot doesn't react at all. Its equally frustrating because when we load a copy of the 2007 code it works fine. It seems that no one else has had this problem (that I saw), though it seemed that Kevin referenced it in one of his posts.
Quote:
|
Re: New C18 3.0+ Compatible FRC Code
With out any code that is going to be hard to help you with, are you in teleop mode? What code do you have in your teleop function?
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
Code:
-Kevin |
Re: New C18 3.0+ Compatible FRC Code
2 Attachment(s)
I'm having a variety of problems, with the new code(http://www.kevin.org/frc/ifi_frc_sensor_30.zip), and the old encoder code (http://www.kevin.org/frc/frc_encoder.zip).
First off, I'll talk about the problems we were having with frc_encoder. When I had MPLAB 7.20 installed and was using v2.4 of the C18 compiler, everything compiled, and the encoders worked great on the robot. Here was the problem... there seemed to be about a 1/2 second delay between the robot receiving data from the OI, so I would move a joystick, then it would take 1/2 a second for the motors to start moving. I would release the joystick, and it would take 1/2 a second to stop (I almost had a bad incident with our new 80lb robot running me over). Okay, now for the 3.0 compatible code. I have MPLAB 8.00 installed and version 3.10 of the C18 compiler. I can compile the code as it is downloaded no problem, but when I try to initialize encoder 1 and encoder 2 using the code where i take out the //, it fails at the link step: MPLINK 4.1, Linker Copyright (c) 2006 Microchip Technology Inc. Error - could not find definition of symbol 'Initialize_Encoder_2' in file 'C:\Robot Code\2008\ifi_frc_sensor_30\teleop.o'. Errors : 1 If I comment out "Initialize_Encoder_2" it will say the same thing about encoder 1. Is my MPLINK out of date, since it says 2006? Here are some snapshots of MPLAB with my horrible hand-eye coordination with my trackpad: :D Attachment 6102 Attachment 6107 The other 4 errors are with this part of code: Code:
// Remove the // below to initialize encoder #1 |
Re: New C18 3.0+ Compatible FRC Code
Quote:
Quote:
-Kevin |
Re: New C18 3.0+ Compatible FRC Code
Oops, I never saw the pesky README. :D I already see what I did wrong, and I will edit this post a bit later to tell you if I got it working.
Also, the link to the beta4 software doesn't want to work. Thanks for the quick response though... I was hectically trying to get this code working because our programming mentor is about to go to Indonesia on business. EDIT: I got it working! Thanks a bunch! |
Re: New C18 3.0+ Compatible FRC Code
Quote:
Thanks a lot for the code, saves a great deal of time. |
Re: New C18 3.0+ Compatible FRC Code
I think I've found a bug in the Gyro code....
I know... it seems unlikely considering how long it's been in service, but this problem has been bugging me for a while and I finally got the clues I needed to locate it. Here is the function. Quote:
I think the problem is that GYRO_CAL_FACTOR is defined as 1000/1000, but the multiplication is being done AFTER the prior expression is cast to an integer... Therefore if ((((long)gyro_rate * GYRO_SENSITIVITY * 5L) / ADC_RANGE)) calculates to anything above 32 or below -32, then multiplying it by 1000 will cause the number to exceed the valid range of an integer. I think the second to last bracket is misplaced... I think it should be: return((int)((((long)gyro_rate * GYRO_SENSITIVITY * 5L) / ADC_RANGE) * GYRO_CAL_FACTOR)); I'm going to try it tomorrow... I'm just greatful I didn't have to write this code.... Thankyou Kevin... really. Phil. |
Re: New C18 3.0+ Compatible FRC Code
Quote:
Quote:
-Kevin |
Re: New C18 3.0+ Compatible FRC Code
Kevin,
Would it be too much to ask for an updated library for the EDU-RC? ;) |
| All times are GMT -5. The time now is 10:12. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi