![]() |
Re: New C18 3.0+ Compatible FRC Code
will the encoder code work with the US Digital E4P-250-250 encoder which is built-in on the Andy Mark Super Shifter transmission? also what kind of output should u expect from the encoder and the gyro?
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
|
Re: New C18 3.0+ Compatible FRC Code
Having the same problem with the new code as someone mentioned before.
When I build the project with Initialize_ADC() uncommented, it builds fine but encounters a code error. When I build the project with ENABLE_TIMER_4 defined in timers.h, the linker encounters the error: Error - symbol 'Timer_4_ISR' has multiple definitions. I have tried commenting out the definition for Timer_4_ISR() in timers.c (because it does nothing) but we get back to the code error. Also, ENABLE_TIMER_4 is defined in ifi_frc.h. Using a 2007 RC, MCC18 3.10; Thanks! -James |
Re: New C18 3.0+ Compatible FRC Code
per Kevin's read-me
2) Enable the timer 4 interrupt service routine in ifi_frc.h 3) Make sure timer 4 is disabled at the top of timers.h. |
Re: New C18 3.0+ Compatible FRC Code
I've written replacement code for IFI's Get_Analog_Value() function. It's now included with both builds of the new code on my website. You can also just grab the files and drop then into your project.
-Kevin |
Re: New C18 3.0+ Compatible FRC Code
So, per your documentation, to use your 'quickie' adc code, you shouldn't run them with the gyro code, right?
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
-Kevin |
Re: New C18 3.0+ Compatible FRC Code
I have gotten Timer0 to work as a clock for the code. A few misadventures (like not putting the initialize function in the Initialization.c in Teleop.c), but actually is very easy to implement in the new code with the prescaling.
I have not gotten the encoder 3 and 4 to work. no error messages, but get_encoderX_count always comes back 0. any ideas? |
Re: New C18 3.0+ Compatible FRC Code
Quote:
I'm thinking about password protecting the project zip files with a password that's something like read_the_readme.txt_file_before_doing_anything :). -Kevin |
Re: New C18 3.0+ Compatible FRC Code
Okay, I'm having a little more trouble... I'm trying to get some potentiometers working on our robot, so I read the readme and did everything it told me to do:
Quote:
Quote:
Quote:
Update: I may have fixed it, but I'm unsure... Instead of Get_Analog_Value(rc_ana_in01), I used Get_ADC_Result(1). Will this work? I'm not going to be able to try this on our robot until Saturday as I'm going out of town for the next 2 days. |
Re: New C18 3.0+ Compatible FRC Code
Quote:
liftpos = Get_Analog_Value(1); or liftpos = Quick_ADC(1); Of course you'd probably want to #define these values in a header file and then the code would look like this: // this goes at the top of the source file or in a header file like robot.h #define ARM_ELBOW_POT 1 // analog input one #define ARM_WRIST_POT 2 // analog input two unsigned int elbow_pot; unsigned int wrist_pot; elbow_pot = quick_adc(ARM_ELBOW_POT); wrist_pot = quick_adc(ARM_WRIST_POT); Because it's simpler, I would use quick_adc() if you're only using potentiometers on your 'bot. -Kevin |
Re: New C18 3.0+ Compatible FRC Code
We are using Kevin's code to read the gyro and control our steering. Our steering is connected to a 10K linear pot. We are reading the pot with get_ADC_value and feeding it to a PID function. The intent is to have servo controlled steering.
We are having a lot of trouble getting the servo to respond properly. We are working on tuning our PID loop and having some success. Here is my question: We are calling the PID routine in Default_Routine so it executes very 26.2 ms. Should we be calling it in a fast loop? |
Re: New C18 3.0+ Compatible FRC Code
Thanks again for the help. I found out why the quick_adc.c and quick_adc.h were not working... Even though I said add files to project, it never did copy them to the project folder, like I expected it would... Still getting used to MPLAB. It compiled without any error (just the way I like it :D) and I'm going to try it out hopefully Saturday.
|
Re: New C18 3.0+ Compatible FRC Code
We had the enables in the IFI_FRC.h. The problem was in the format of the print statement (note to others- output from encoders is a long integer). The encoders were working just fine. Sometimes it really is just dumb stuff. (Thank you Kevin for being patient)
|
Re: New C18 3.0+ Compatible FRC Code
I just tried to build the ifi_frc_sensor project with MPLAB IDE v7.20 and C18 2.4 (had to use the project wizard to create new mcp/mcw files, as I was unable to open the ones that came with). After updating the ifi_frc.h header file to define the proper compiler macro (USE_C18_24), I now am getting these errors:
timers.c:72:Error [1205] unknown member 'PSA' in '__tag_216' timers.c:72:Error [1131] type mismatch in assignment Apparently the header file mcc18\p18f8722.h defines T0CON bit 3 as T0PS3, but the timers.c file references it as 'PSA' instead. Should the code read: #ifdef USE_C18_24 T0CONbits.T0PS3 = 1; #else T0CONbits.PSA = 1; #endif ?? |
| 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