![]() |
Inovation First FRC Robot Controller
I am trying to use the FRC-2008-RC robot controller to control another robot for testing purpose. The thing is i dont have any documentation at all.
I need to know what i need to program it and get it running and configured for a Tank drive robot configuration. At this time i will only have it control 2 Vex esc's for the drive control. Can someone help me out? Also, What utilities do i need to program it? Thanks! |
Re: Inovation First FRC Robot Controller
You need 5 things.
1) MPLAB - Download MPLABX from Microchip.com 2) C18 Lite Compiler - Also from Microchip.com, and on the same page as above. 3) Kevin Watson's Robot Code, mainly because it works with the above compiler and IDE. 4) IFI Loader (Website might be down?) IFI Loader 4VEX will NOT work. 5) Serial cable for programming. |
Re: Inovation First FRC Robot Controller
When i open the robot code folder i notice that there are many files, what do i change to configure how i use the joystics to operate the victors and which do i upload?
|
Re: Inovation First FRC Robot Controller
1 Attachment(s)
You'll need:
You should be able to install everything with the default settings. I'm not sure about C18 v3.x, but the older version had to be installed in a folder directly on a drive (i.e. c:\mcc18\ or there would be weird issues. If you use the default you should be safe, just don't change the install location. Post back once you've gotten this far, we'll try to help with specific issues. |
Re: Inovation First FRC Robot Controller
Quote:
Code:
pwm01 = p1_y; //Set PWM#1 to the value of the Y axis of joystick 1 |
Re: Inovation First FRC Robot Controller
Alright
So i have finished installing: MPLab C18 Complier IFIoaded Now i need to know how to open and upload the code to it. can u please tell me how i would do this? how do i open the files in mplabx? Also i need to know the wiring diagram of the programming cable because i do not have it. Also if you can, can someone tell me the power supply ratings to the Driver station, operator interface, and robot controller. Thanks Sorry if i sound like a noob. like i said i have no documentation at all and even my robotics club has never used this in such a long times so i took on the challenge of getting it to work for a seperate robo build. |
Re: Inovation First FRC Robot Controller
Quote:
Quote:
Quote:
Go to http://www.ifirobotics.com/ for more information, they still have a lot of their legacy documentation posted. |
Re: Inovation First FRC Robot Controller
for clarification on the programming cable, i connect the rx from the cable to tx on controller and tx from cable to rx on controller right?
Also, what is the wiring on the radio and tether cables? Can i please get a wiring diagram of both of them? Thanks |
Re: Inovation First FRC Robot Controller
Quote:
![]() If you have old IFI systems laying around you should have some of these somewhere. |
Re: Inovation First FRC Robot Controller
for the radio i have tried a cable that i had and none of the lights lit up on the radio. i did plug the robot controller to the robot radio.
in the refrence guide it says to use a db9 male-female Pin to Pin cable. can someone give me a diagram for this pin to pin cable? thanks |
Re: Inovation First FRC Robot Controller
Would any one have the dashboard installer for this controller so i can read data from it?
Thanks |
Re: Inovation First FRC Robot Controller
Quote:
Remember, if it relates to the IFI Control System, chances are, it can be found on http://www.ifirobotics.com |
Re: Inovation First FRC Robot Controller
Thanks!
|
Re: Inovation First FRC Robot Controller
ok so i have got all the wiring finished and turned it on and it works. They can comunicate between both the OI and RC.
I have also installed these: •MPLab http://www.microchip.com/pagehandler...family/mplabx/ •C18 compiler. http://www.microchip.com/stellent/id...ame =en010014 •IFILoaded, attached since the site appears to be done or gone. It would normally be at www.ifirobotics.com •Sample code. Since you'll be using C18 v3.x, the IFI default code won't work, so you'll need to use Kevin Watson's version. ifi_frc_simple.zip from http://kevin.org/frc/ •You should only have to modify code in teleop.c. Can someone help me configure my settings in mplab so that i can build it properly? Also what file do i open to open the project in mplab. Just some info: MPLAB X IDE v1.10 MPLABC18 v3.4 IFI LOADER V1-1-0 im using the code ifi_frc_simple.zip from http://kevin.org/frc/ Thanks |
Re: Inovation First FRC Robot Controller
Quote:
The settings you'll have to make are found under: Project -> Build Options -> ProjectYou might have to choose Suite Defaults, to reset everything. Make sure these paths are both assigned correctly:
Do you have a serial port (to transfer the program) on your computer or a USB-to-serial converter? |
Re: Inovation First FRC Robot Controller
yes i do have a serial port and a usb converter
|
Re: Inovation First FRC Robot Controller
When i go to open project it does not allow me to choose the mcp file. it lets me choose ifi_frc.X
Is that right? I am using mplabx v1.10, not mplab 8.00 so i dont know if there is any differences. If it makes a difference, my install directory for mplabx v1.10 is: c:\prgram files(x86)\microchip i used default settings for everything i installed Also i dont find this: Project -> Build Options -> Project how do i choose Suit Defaults? And i not sure how to make sure these paths are assinged correctly •Include Path c:\mcc18\h •Library Path c:\mcc18\lib |
Re: Inovation First FRC Robot Controller
Sorry, my directions were for MPLab.
The project you got from Kevin Watson's site is an MPLab project, so if you're using MPLabX you'll need to construct a new project and include/import the .c/.h/.lib files from the Kevin files. |
Re: Inovation First FRC Robot Controller
Ok so i downloaded mplab ide v8.84
will it work on that? i opened the project in it now i just need help configuring it and building it. I can do the coding i just need help to configure it... Can u give me steps please? |
Re: Inovation First FRC Robot Controller
Quote:
|
Re: Inovation First FRC Robot Controller
yes i did
|
Re: Inovation First FRC Robot Controller
ok so i got everything so far to work
i got it to build properly i got it to upload code to the rc Now i need to test it to make sure it really does work. can someone tell me how i can do this? mabye some code? i dont have any joystics so i will have to do something thats robot sided. maybe take an input from a variable resister on an analog input and use that controll a servo? anything that will show me that it works. Can someone help me on this? remember that im using mplab v8.84 Thanks |
Re: Inovation First FRC Robot Controller
An easy test is to set the OI panel lights to different values in the RC code.
Code:
Pwm1_green = 1; //or = 0 |
Re: Inovation First FRC Robot Controller
I would do that but i dont know what the variable names are for the pins.
is there a site or document that will tell me what the variables are? |
Re: Inovation First FRC Robot Controller
You'll find all the names defined in the ifi_frc.h file, which is part of your project.
Most of them can just be set or read directly, however, the Digital I/O pins must be defined as inputs or outputs before you can use them. (defaults are defined in teleop.c). The analog inputs can only be read using the Get_Analog_Value() function. PWM outputs are all: pwm01, pwm02,...pwm16 Relay outputs are all: relay1_fwd, relay1_rev, relay2_fwd, relay2_rev,...relay8_rev Analog inputs are: rc_ana_in01,...rc_ana_in16 (special handling required though) Digital inputs are: rc_dig_in01,...rc_dig_in18 Digital outputs are: rc_dig_out01,...rc_dig_out18 The OI LED names are as I posted earlier. |
Re: Inovation First FRC Robot Controller
when i try to build it i get an error
"could not find definition of symbol "delay" in ile './teleop.o'". i just used: delay(1000) so i can delay the time it takes for the oi switch lights to turn after each other |
Re: Inovation First FRC Robot Controller
Did you just make that function up?
Normally, you don't want to delay any of this code. Because this was used for FRC, there is a built-in safety that will disable the PWM outputs if the code is delayed. In the case of just blinking the OI lights you probably won't notice that, though. The Teleop routine is set to execute every 26.2ms. If you want to time a blink, then just use a counter to toggle the LED value every 38 counts for a one second blink. |
Re: Inovation First FRC Robot Controller
im new to coding so im good with the basics but stuff like counters i dont know what to do.
is there a way to delay things so i can still have operation of pwms? how would i do this? |
Re: Inovation First FRC Robot Controller
I forgot you were using the Watson code rather than the IFI default code.
In Teleop, if you're changing the OI LEDs, then be sure to comment out the line Code:
Update_OI_LEDs();
|
Re: Inovation First FRC Robot Controller
does any one have code that they have used on their robot that i can try?
i will be using mplab 8.84 so please try to give me somthing that will be error free. Thanks |
Re: Inovation First FRC Robot Controller
is there a way that i can delay something without delaying the rest of the code?
i want to do things with delays but i need pwm 99.9% of the time. for example- im driving the robot forward and a sensor is triggered, 1 second after the sensor is trigered i want to turn on a motor for 3 seconds then turn it off. i want this to be done while im driving and never do i want to lose control of the pwms. is this possible? what would the code be? |
Re: Inovation First FRC Robot Controller
The way it's done on this system is by way of something called a state machine.
Essentially, you just keep track of what your task(s) should be doing (delay, change a light, drive a motor, etc.) and keep checking every time you pass through the code. If it's supposed to delay, then each time through the code checks to see if enough time has elapsed (e.g., has 38 counts gone by?). At the end of that delay the state changes to do whatever the next thing through might be. |
Re: Inovation First FRC Robot Controller
Quote:
driving a motor forward and having a delay of 1 second after a sensor is triggered to start another motor for 2 seconds then stop the motorn after the 2 seconds? |
Re: Inovation First FRC Robot Controller
A state machine looks something like this, but this hasn't been tested of course.
Code:
static unsigned int state=0, timecounter; |
Re: Inovation First FRC Robot Controller
i get a syntex error at
static unsigned int state = 0, timecounter; what did i do wrong? |
Re: Inovation First FRC Robot Controller
Quote:
Should be written as static unsigned int state, timecounter = 0; |
Re: Inovation First FRC Robot Controller
i got it, its actually:
unsigned int state, timercounter = 0; Thanks though, it helped:D |
Re: Inovation First FRC Robot Controller
I had the error sensor has not been defined but i just did
int sensor = rc_dig_in01 and that solved it. but now i get this error: symbol timecount has not been defined ivalue required what code do i add to fix this? |
Re: Inovation First FRC Robot Controller
unsigned int state;
int timecounter; int timecount = 0; int sensor = rc_dig_in01; // this is the robot drive for a tank drive pwm01 = 255; // full forward pwm02 = 255; // full forward // if some button is pressed, then set state = 1(i have to figure this out.) timecounter = timecount + timecounter; switch (state) { //check sensor if (sensor == 1) { state = 2; timecounter=0; } break; //Delay for 1 second after trigger timecount++; if (timecounter == 38) { state = 3; timecounter=0; } break; //Run motor for 2 seconds pwm03 = 255; timecount++; if (timecounter == 76) { state = 4; } break; //stop the motor pwm03 = 127; state = 0; // go back to waiting } Does this seem right? i fixed the code posted in the reply and this is it. it built successfuly. does it look like it will work? if its wrong what do i do to fix it? |
Re: Inovation First FRC Robot Controller
Since i could not get the code to work, can someone give me just a simple counter that i can use to count how many times the code has looped.?
Thanks I will build on top it |
Re: Inovation First FRC Robot Controller
The telop code is called through a function.
If you initialize your variable within the function, then the variable will be lost once that function is done executing. You will need to make a global variable at the top of the teleop.c file to keep the value throughout multiple iterations of the function. You're also not using the switch (case) statement properly, and as you might be able to tell, you're missing the case part. switch(variable) { case 0: //execute some code on condition 0 break; case 1: //execute some code on condition 1 break; case 2: //execute some code on condition 2 break; default: // execute some code if it falls outside of any of the above } Again, there is no way to do a true timer on the robot controller. You can make a timer using an if statement and a counter though, much like what it appears you are trying to do. I'm trying to recall information from 2008, but I think the teleop function is called every 26.4ms. Use that to do your timers. If you want to wait for about 1 second, you'll need to count 37 or 38 times. I would also be a bit careful with your motor values. 255 is full speed... I'm not sure about your robot, but full speed is hard to stop if you don't want it to run, especially if you don't have a competition box with a disable switch. |
Re: Inovation First FRC Robot Controller
i tryed to use just a basic counter to tell me how many times code has looped but it never worked. can some one give me the code for a counter?
Thanks |
Re: Inovation First FRC Robot Controller
Actually i just got it. the problem was i left out the part that resets the counter to 0 and i placed the variables in the wrong place.
|
Re: Inovation First FRC Robot Controller
For the state machine i finally got it to work. here is the working code. i used it to flash lights on the OI and use Pwm03.
int time; int count; int state = 1; int sensor; switch (state) { case 0: // do nothing break; case 1: //check sensor if (sensor == 1) { time = 0; count = 0; state = 2; } break; case 2: //Delay for 1 second after trigger time = count; count++; if (time == 16) { // for 1 second time == 38 time = 0; count = 0; state = 3; } break; case 3: //Run motor for 2 seconds pwm03 = 255; Switch1_LED = 1; Switch2_LED = 1; Switch3_LED = 1; time = count; count++; if (time == 16) { // for 1 second time == 38 time = 0; count = 0; state = 4; } break; case 4: // stop them pwm03 = 127 ; Switch1_LED = 0; Switch2_LED = 0; Switch3_LED = 0; state = 1; } |
Re: Inovation First FRC Robot Controller
I was told that the analog inputs can only be read using the Get_Analog_Value() function.
Analog inputs are: rc_ana_in01,...rc_ana_in16 How do i use this function if i want to read data from rc_ana_in01? What would the code be? Thanks |
Re: Inovation First FRC Robot Controller
For the Watson code you're using, the analog inputs are read like this:
Code:
unsigned int myinput; |
Re: Inovation First FRC Robot Controller
but how would i read from Analog-in 1? what do i change to read from other inputs?
would "myinput" be the input value? what input is it of? |
Re: Inovation First FRC Robot Controller
Quote:
you call Quick_ADC(n); where n=the number of the analog input you wish to read. so, analog1Val = Quick_ADC(1); analog2Val = Quick_ADC(2); analog3Val = Quick_ADC(3); ...and so on |
Re: Inovation First FRC Robot Controller
Thanks
I thought it was so. i just wanted clarification. |
Re: Inovation First FRC Robot Controller
Why exactly cant delays be used on these controllers?
|
Re: Inovation First FRC Robot Controller
It's not that you can't use delays - it's just not a bright idea given the structure of the code. The code executes in an infinite while loop, which runs once every ~26 milliseconds - this is how often the master processor gives the user processor new data to work with. You want your robot code to execute in less than that time, otherwise there will be data available to process that won't be processed because your code is still executing the preceding iteration (with old data). It's akin to putting long loops/delays in the teleop code with the current control system - you'll miss packets from the DS and have considerable lag (at least with LabVIEW, not sure about cpp/java).
It's not a matter of the controller's ability to work with delays, but rather a matter of processing without missing input values. So try to avoid long delays and make sure your code executes in <26.2 ms. general disclaimer: IFI control systems are from before my time with FRC, just keep that in mind; however, I've spend lots of time understanding the control system and have used it with modest success |
Re: Inovation First FRC Robot Controller
is there a way that i can remove things or modifiy things in the code to make it faster? so maybe running once every ~14 milliseconds instead of 26 milliseconds? If so, how can this be achieved?
|
Re: Inovation First FRC Robot Controller
Well, you can't make the master processor send data any faster than it already does.
If you're using Kevin's code, then you can put code in Teleop_Spin(), which is called every iteration of teleop (as opposed to Teleop(), which is called only upon the arrival of new data - see the main() routine in ifi_frc.c). There are also Disabled_Spin() and Autonomous_Spin() for the appropriate modes, defined in the appropriate files. If you using the "standard" default code, you can modify user_routines_fast.c as a place to put code that executes much faster. The obligatory efficiency question: do you really need your code to run that much faster? In many situations, that much saved time doesn't make much of a difference. Just a thing to keep in mind - especially since these controllers have limited resources (which I don't remember off the top of my head). |
Re: Inovation First FRC Robot Controller
Quote:
http://kevin.org/frc/ Back in the archived 2005 code you'll find an example for the old EDU-RC controller that implements the functionality of a wall clock. The internal state machine may be of interest. -Kevin |
Re: Inovation First FRC Robot Controller
First, sorry to revive an old and dead thread. I'm trying to find information about the IFI controllers and so far what I have found is fairly limited. What I really am trying to find out is whether there are any data-flow or non-text based programming methods for the old FRC control system, something simliar to labview is really what I want, as I hate text based coding. If there are no other methods that can be used I can suck it up and use the tools mentioned in the thread.
Thanks. |
Re: Inovation First FRC Robot Controller
Quote:
You may be better suited getting an Arduino solution and using ArduBlock (on SourceForge). Additionally, you can get an Arduino and use the LabVIEW Arduino toolkit. I'm not sure if the toolkit works with the FRC version of LabVIEW or if you need to buy the package through SparkFun. |
Re: Inovation First FRC Robot Controller
C or Basic as in either could be used? I do have an arduino that I have been playing with, along with the labview toolkit. The arduino and toolkit work pretty well it's just that the toolkit is kind of limited for what I would like to do, but with some more time messing with it I think I can figure it out.
Would i be able to swap the robot processor out for the arduino and still be able to use the IFI DS and radio set? Thanks. |
Re: Inovation First FRC Robot Controller
Quote:
I don't know how the IFI DS and radio function. I am fairly certain the modem was a standard RS-232 900 MHz serial port radio modem, so you could just plug the TX and RX into the Arduino's respective pins (look up how to do serial port communication with Arduino). You may have to decode how the DS sends commands over serial. That's about the extent of my IFI controller knowledge. I'm sure the others will chime in more information. |
Re: Inovation First FRC Robot Controller
My team has at least one from every year I think, so Im sure there will be one or two at least that are Basic capable.
Thanks for that, I think it should be fairly easy to at least try to rig something up and see if I can figure out whether or not that would work. Thanks. |
Re: Inovation First FRC Robot Controller
The pBasic versions of the IFI robot controller (2000-2003) will have two DB25 connectors.
The C versions of the IFI robot controller (2004-2008) have banks of 3-pin headers instead. The Ewave SCREAMER422 radios or the later (2007-2008) and bulkier IFI radios can be used with other equipment, but you'll have to write some code to handle the RS-422 I/O. see the Ewave specs. Packets: Whenever two consecutive 0xFF bytes are received it is considered a packet header, and any prior bytes that were being assembled into a packet are discarded. The receiving modem then starts assembling the latest 26 byte packet. Only when a complete packet has been fully received is it sent out the receiving modem's RS-422 connection. The OI/RC software makes sure no packet has consecutive 0xFF's in the 24 byte data portion of the packet, otherwise, no complete packet will ever get through. This is why you'll never see a joystick or PWM output value of 255 coming out of the IFI OI. Any 255's set by the user code or detected on an OI analog input are converted into 254's by the RC master processor and the OI processor instead. For Robot Control & Telemetry (FIRST), the modems are set for "RM2000" or fixed-length, 26-byte packets with no retries, therefore, no CRC check is performed on the transmitted data packets. The Radio Packet size is fixed at 26 bytes long. The packet format is:
|
Re: Inovation First FRC Robot Controller
Quote:
|
Re: Inovation First FRC Robot Controller
Quote:
The 2004-2008 IFI Controllers could be programed with the Microchip MPLAB C18 compiler and with intelitek easyC PRO (for at least 2007-2008, not sure if this is an option for earlier controllers). This document describes the software available in 2007. While the IFI links seem to be dead now, many of those documents can be found on Team 358's control system archive: http://www.team358.org/files/programming/ easyC offered a GUI programming environment, although unlike LabVIEW I believe it generated C code. I've never used it, so I'm not entirely sure. I did find some archived workshops on it, though, again from Team 358: http://team358.org/files/workshops/ Unfortunately, both the MPLAB C18 compiler and easyC Pro are non-free (the MPLAB IDE is free, but not the compiler). If your team is old enough to have the controllers, you might have the software cd's somewhere as well? If you use MPLAB, make sure you check out Kevin Watson's FRC code respository: http://kevin.org/frc/ |
Re: Inovation First FRC Robot Controller
Quote:
|
Re: Inovation First FRC Robot Controller
Thanks for all the info! My team has been around for 14 years now, so we should have some of the software laying around, however are there alternatives for programming them if the software cant be found? Also how was labview incorporated into the robots in 2008? I've been looking for that information and have found nothing and am just curious.
Thanks again! |
Re: Inovation First FRC Robot Controller
Quote:
Labview didn't become an option until 2009. Unless you're thinking of a data acquisition system that was made available as early as 2006, but I don't think you're thinking of that. |
Re: Inovation First FRC Robot Controller
Im not sure how Labview was supposed to be used in 2008, but I have seen references of it in documentation from that year. Was it for data acquisition? Did it replace the dashboard viewer? I know it wasnt used to program the RC.
Sorry for the delayed response. Thanks for the answers! |
Re: Inovation First FRC Robot Controller
Quote:
Quote:
|
Re: Inovation First FRC Robot Controller
Quote:
|
| All times are GMT -5. The time now is 20:14. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi