View Full Version : Interface with breaker
My team captain thinks I need to interface with the breaker panel to tell if a breaker blows
Do any of you have any ways to go about this. There is a pwm slot in it, but I know neither where it goes nor what to do to get information from it
Mark McLeod
05-02-2005, 16:41
My team captain thinks I need to interface with the breaker panel to tell if a breaker blows
Do any of you have any ways to go about this. There is a pwm slot in it, but I know neither where it goes nor what to do to get information from itYou use the serial port and plug it into the RC program port.
(that pwm type connector is unsupportd at this time)
The default code is already setup to send the breaker data back to he dashboard program. Take a look in user_routines.c and you'll see it towards the end of the Default_Routine.
Is it in the DDT version? What does it look like if it is because I can't really tell anything that might be it
Mark McLeod
05-02-2005, 16:57
Is it in the DDT version? What does it look like if it is because I can't really tell anything that might be itoops, my fault of course.
The breaker code is in Process_Data_From_Master_uP() of both the 2.2 and 2.4 versions of the default code.
/* Example code to check if a breaker was ever tripped. */
if (aBreakerWasTripped)
{
for (i=1;i<29;i++)
{
if (Breaker_Tripped(i))
User_Byte1 = i;
/* Update the last breaker tripped on User_Byte1 (to demonstrate the use of a user byte) Normally, you do something else if a breaker got tripped (ex: limit a PWM output) */
}
}
My DDT code did not come with it, could I just put that in there
Also, do you know where is the manual for the breaker panel is, because think our electronics people did it their way instead of the right way and the dashboard is telling me that everything is tripped
Kevin Watson
05-02-2005, 17:26
The breaker panel telemetry parser is located in IFI's serial port driver. I've taken all of the breaker code and placed it into it's own source file. It's part of the latest build of the serial port driver I mentioned in the "Updated: Serial Port Driver Code" thread.
-Kevin
Mark McLeod
05-02-2005, 17:29
My DDT code did not come with it, could I just put that in there
Also, do you know where is the manual for the breaker panel is, because think our electronics people did it their way instead of the right way and the dashboard is telling me that everything is tripped
The dashboard manual is at http://www.ifirobotics.com/circuit-breaker-panel.shtml
The code will drop right into the DDT code, however, I haven't looked at the DDT closely to see if there are any potential serial port conflicts. Try it and you can tell me if it works okay.
I dumped that code in and got 2 errors from the compilation
Z:\user_routines_DDT.c:313:Error [1105] symbol 'aBreakerWasTripped' has not been defined
Z:\user_routines_DDT.c:317:Warning [2058] call of function without prototype
Halting build on first failure as requested.
BUILD FAILED: Sun Feb 06 14:29:16 2005
I think it is because you have breaker functions and that is the only thing pertaining to breakers that i know i have
JBotAlan
06-02-2005, 17:37
our electronics people did it their way instead of the right way and the dashboard is telling me that everything is tripped
The only way you can tell if your breaker had a fuse trip is if you do it the 'right' way. Fill up the positives from 1 up (they're numbered) and for the negatives, the circuit that is using positive 1 needs to use negative 1 also. The same with 2, positive 2, and negative 2. Do the same all the way up. You can test the breaker. When you give it power, the light should flash green. Pull a fuse out without shutting off power, and if the light flashes red, it's working. As for the dashboard program, I haven't even seen one for this year. Where did you get it? I had a version from InnovationFirst.com, but they don't have it anymore.
Mark McLeod
06-02-2005, 21:11
I dumped that code in and got 2 errors from the compilation
You're right. You need the Breaker_Tripped() function as well.
What Kevin was referring to above is he has already extracted Breaker_Tripped() so you can easily add it to your DDT project.
Go to Kevin's website and pickup his http://kevin.org/frc/frc_serial_ports_0.3.zip
within that zip file Kevin has pulled the function and data structures you need into the two files:
breaker_panel.c
breaker_panel.h
Copy just these two files into your DDT project folder and add them to your list of project files (Project -> Add Files to Project...).
I just checked this combination and you'll need to add:
#define FALSE 0
to breaker_panel.h or include it from somewhere else where it's already defined.
What should my prototype for Breaker_Tripped() be, and is there any specific place I have to put it?
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8520 "user_routines_DDT.c" -fo="user_routines_DDT.o" /i"c:\mcc18\h" -D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
C:\2005 Botcode\user_routines_DDT.c:320:Warning [2058] call of function without prototype
Also, would i put my printf statement to tell me a breaker tripped in the if loop or the for loop?
Is it Ok if I just put it right here like this?
The compiler is happy
/************************************************** *****************************
* FUNCTION NAME: Process_Data_From_Master_uP
* PURPOSE: Executes every 26.2ms when it gets new data from the master
* microprocessor.
* CALLED FROM: main.c
* ARGUMENTS: none
* RETURNS: void
************************************************** *****************************/
void Process_Data_From_Master_uP(void)
{
static unsigned char i;
static unsigned char delay;
unsigned char Breaker_Tripped(unsigned char id);
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.