Go to Post So perhaps those that are so eager to complain might realize that if they spent a little less time complaining and a little more time analyzing the problem and developing solutions, then they might have a little less to complain about. - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Electrical
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 10-10-2007, 15:38
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
no team
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Austin, TX
Posts: 1,127
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Project Questions about Programming and Electrical

I partially found the problem. My power relay's contacts were stuck closed because my connection pushed the contact up, but... that doesn't explain why it would turn off then after a few minutes, it would turn back on unless the copper connections were bending slightly after it cooled down.
__________________
Taking a break from mentoring for a few years. (Is that allowed?!?)

Controls Mentor
@rnazaretian

Previous teams:
Team Fusion, FRC 364
Garnet Squadron, FRC 4901
  #17   Spotlight this post!  
Unread 10-10-2007, 15:45
Unsung FIRST Hero
Al Skierkiewicz Al Skierkiewicz is offline
Broadcast Eng/Chief Robot Inspector
AKA: Big Al WFFA 2005
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Wheeling, IL
Posts: 10,798
Al Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond repute
Re: Project Questions about Programming and Electrical

Ryan,
When linking to your schematic the connection is refused so I can't be sure of what you are doing.
As to the power relay, did you solder directly to the relay contacts? Often this melts the base material and leaves enough slop in the contact to move around with heat/cool and vibration. Add to this a few errant metal shavings or whiskers and you end up with a contact that you can't really see but is there none the less. The best way to use realys is to add a socket. The socket is made for soldering and the relay merely plugs into it. Relays are notorious for acting weird especially on low current signals.
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
Storming the Tower since 1996.
  #18   Spotlight this post!  
Unread 10-10-2007, 16:21
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
no team
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Austin, TX
Posts: 1,127
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Project Questions about Programming and Electrical

Quote:
Originally Posted by Al Skierkiewicz View Post
Ryan,
When linking to your schematic the connection is refused so I can't be sure of what you are doing.
As to the power relay, did you solder directly to the relay contacts? Often this melts the base material and leaves enough slop in the contact to move around with heat/cool and vibration. Add to this a few errant metal shavings or whiskers and you end up with a contact that you can't really see but is there none the less. The best way to use realys is to add a socket. The socket is made for soldering and the relay merely plugs into it. Relays are notorious for acting weird especially on low current signals.
I didn't solder it at all. I used female connections and it doesn't look melted at all. I think it may just be a defective connection. Here are the pictures I uploaded to facebook since my server doesn't want to cooperate:


__________________
Taking a break from mentoring for a few years. (Is that allowed?!?)

Controls Mentor
@rnazaretian

Previous teams:
Team Fusion, FRC 364
Garnet Squadron, FRC 4901
  #19   Spotlight this post!  
Unread 11-10-2007, 07:40
Unsung FIRST Hero
Al Skierkiewicz Al Skierkiewicz is offline
Broadcast Eng/Chief Robot Inspector
AKA: Big Al WFFA 2005
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Wheeling, IL
Posts: 10,798
Al Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond repute
Re: Project Questions about Programming and Electrical

Ryan,
Are you using the backup battery input to the RC? Since the relay outputs of the RC are intended for Spike connections, I am not sure what the actual signal output is. They may actually send a keep alive output which could turn the relay driver on. The Spike input circuit is pretty complex and has a lot of input filtering. I suspect that the RC is actually triggering the relay drive transistor. Also, the relay output only has to rise to 0.6 volts to turn the relay driver on in this configuration. You could simply try a 1k resistor in series with the base of the transistor and I would add a 0.1mfd cap base to emitter to quench any noise and see what happens.
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
Storming the Tower since 1996.
  #20   Spotlight this post!  
Unread 11-10-2007, 21:14
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
no team
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Austin, TX
Posts: 1,127
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Project Questions about Programming and Electrical

Actually all seems to be working well just after replacing the relay. I got my charger connected and it seems to work perfectly. I only have the LEDs and sensors to connect now. I like how it is wrapping up and I hope to post some pictures of the spaghetti I have made into my project. TOO MANY SIGNAL WIRES!!!!! Oh well, as long as it doesn't break I'll be fine, and if it does, I just need to set aside a day to fix it . Thanks for all the help. If I encounter any trouble with the transistors, I will do what you said and add a resistor and a capacitor to the transistors. I actually found the Spike signal system to be very very simple. They output 5V (my personal favorite voltage for transistors and LEDs) It switches using IFI's seemingly favorite H bridge. If you put both fwd and rev to 1, then it outputs positive signals on the spike outputs, and they are both 0, then it's a negative signal. So what I've done is take like fwd and rev to turn individual spikes to only forward since accidentally reversing them will fry some things. Hopefully this all makes sense. If there are any questions for me, please don't hesitate to ask.
__________________
Taking a break from mentoring for a few years. (Is that allowed?!?)

Controls Mentor
@rnazaretian

Previous teams:
Team Fusion, FRC 364
Garnet Squadron, FRC 4901
  #21   Spotlight this post!  
Unread 12-10-2007, 07:33
Unsung FIRST Hero
Al Skierkiewicz Al Skierkiewicz is offline
Broadcast Eng/Chief Robot Inspector
AKA: Big Al WFFA 2005
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Wheeling, IL
Posts: 10,798
Al Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond repute
Re: Project Questions about Programming and Electrical

Glad you got it working the way you want. I love when that happens.
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
Storming the Tower since 1996.
  #22   Spotlight this post!  
Unread 12-10-2007, 22:21
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
no team
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Austin, TX
Posts: 1,127
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Project Questions about Programming and Electrical

Quote:
Originally Posted by Phalanx View Post
Look in ifi_aliases.h, You will find the variables for the battery.
I hope this helps.

/*
*-----------------------------------------------------------------------------------------------------
*---------- Aliases for Battery Voltage bytes --------------------------------------------------------
*-----------------------------------------------------------------------------------------------------
* Formula to calculate voltage in volts:
* current_voltage = battery_voltage * 0.038 + 0.05;
*/

#define battery_voltage rxdata.rc_main_batt*15.64/256
#define backup_voltage rxdata.rc_backup_batt*15.64/256
I've gotten to the part of programming where I'm trying to get my charger working, but obviously there is something wrong with the code.
User_routines_fast.c
Code:
/*** DEFINE USER VARIABLES AND INITIALIZE THEM HERE ***/
int powerrelay;
int tempb;
int tempc;
int tempd;
int pwrofftmout;
int powerout;
int poweroutb;
int volts;
(Skip a lot of the stuff that doesn't matter in this post)
printf("volts %d\n","battery_voltage %d\n");
volts = battery_voltage*0.038+0.05; /*Should give the correct voltage*/
With my novice programming skills, all this seems good to me, however, when using the printf command (which I'm not sure I'm using it correctly) it says "volts 15865" meaning that it has no value for volts and when I manually convert: 15865*0.038+0.05 = 602.92V which is obviously not correct. Any help is greatly appreciated.

Also, the value 15865 does not change at all. It is constant when I disconnect the charger or when I put a load on the battery, which indicates something else is not working properly.
__________________
Taking a break from mentoring for a few years. (Is that allowed?!?)

Controls Mentor
@rnazaretian

Previous teams:
Team Fusion, FRC 364
Garnet Squadron, FRC 4901

Last edited by RyanN : 12-10-2007 at 22:23.
  #23   Spotlight this post!  
Unread 12-10-2007, 22:45
bear24rw's Avatar
bear24rw bear24rw is offline
Team 11 Programming Captain
AKA: Max T
FRC #0011 (MORT)
Team Role: Programmer
 
Join Date: Sep 2005
Rookie Year: 2005
Location: Flanders, NJ
Posts: 385
bear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to behold
Send a message via AIM to bear24rw
Re: Project Questions about Programming and Electrical

Quote:
Originally Posted by RyanN View Post
I've gotten to the part of programming where I'm trying to get my charger working, but obviously there is something wrong with the code.
User_routines_fast.c
Code:
/*** DEFINE USER VARIABLES AND INITIALIZE THEM HERE ***/
int powerrelay;
int tempb;
int tempc;
int tempd;
int pwrofftmout;
int powerout;
int poweroutb;
int volts;
(Skip a lot of the stuff that doesn't matter in this post)
printf("volts %d\n","battery_voltage %d\n");
volts = battery_voltage*0.038+0.05; /*Should give the correct voltage*/
With my novice programming skills, all this seems good to me, however, when using the printf command (which I'm not sure I'm using it correctly) it says "volts 15865" meaning that it has no value for volts and when I manually convert: 15865*0.038+0.05 = 602.92V which is obviously not correct. Any help is greatly appreciated.

Also, the value 15865 does not change at all. It is constant when I disconnect the charger or when I put a load on the battery, which indicates something else is not working properly.
For your printF your not printing any values.. try it like this
Code:
printf("volts %d\n","battery_voltage %d\n",volts_variable, battery_voltage_variable);
  #24   Spotlight this post!  
Unread 12-10-2007, 22:58
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
no team
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Austin, TX
Posts: 1,127
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Project Questions about Programming and Electrical

Quote:
Originally Posted by bear24rw View Post
For your printF your not printing any values.. try it like this
Code:
printf("volts %d\n","battery_voltage %d\n",volts_variable, battery_voltage_variable);
The Code:
Code:
printf("volts %d\n","battery_voltage %d\n",volts_variable,battery_voltage_variable);
The Build:
Code:
C:\FrcCode2005v2.2\user_routines_fast.c:168:Error [1105] symbol 'volts_variable' has not been defined
C:\FrcCode2005v2.2\user_routines_fast.c:168:Error [1105] symbol 'battery_voltage_variable' has not been defined
C:\FrcCode2005v2.2\user_routines_fast.c:168:Warning [2058] call of function without prototype
Halting build on first failure as requested.
I also tried
Code:
printf("volts %d\n","battery_voltage %d\n",(int)volts,(int)battery_voltage);
That compiled, but it's still giving me a ridiculously high number, which is now constant at 16025.
__________________
Taking a break from mentoring for a few years. (Is that allowed?!?)

Controls Mentor
@rnazaretian

Previous teams:
Team Fusion, FRC 364
Garnet Squadron, FRC 4901
  #25   Spotlight this post!  
Unread 13-10-2007, 00:26
bear24rw's Avatar
bear24rw bear24rw is offline
Team 11 Programming Captain
AKA: Max T
FRC #0011 (MORT)
Team Role: Programmer
 
Join Date: Sep 2005
Rookie Year: 2005
Location: Flanders, NJ
Posts: 385
bear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to behold
Send a message via AIM to bear24rw
Re: Project Questions about Programming and Electrical

Are you doing the volts equation before printf?
  #26   Spotlight this post!  
Unread 13-10-2007, 00:28
bear24rw's Avatar
bear24rw bear24rw is offline
Team 11 Programming Captain
AKA: Max T
FRC #0011 (MORT)
Team Role: Programmer
 
Join Date: Sep 2005
Rookie Year: 2005
Location: Flanders, NJ
Posts: 385
bear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to behold
Send a message via AIM to bear24rw
Re: Project Questions about Programming and Electrical

Code:
printf("volts %d\n","battery_voltage %d\n",(int)volts,(int)battery_voltage);
Try making that

Code:
printf("volts %d\n battery_voltage %d\n",(int)volts,(int)battery_voltage);
  #27   Spotlight this post!  
Unread 14-10-2007, 00:07
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
no team
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Austin, TX
Posts: 1,127
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Project Questions about Programming and Electrical

Well, I tried your code and same thing... I then defined battery_voltage in user_routines_fast and it's now updating, but the values are still in the 15 and 16000 range. I totally took out all the multiplication and stuff to get the normal volts and just created values using that equation so now I'm doing stuff like:
Code:
if (battery_voltage < 361)
{
relay02_fwd =  1 (<- this may be wrong, I'm writing this from memory)
}
The problem still remains: Why is my battery voltage appearing so high (like 600 volts)? I can't really see any relation. I may end up just making my own equation tomorrow or something that will allow me to get the voltage correct. Well, now I'm off to bed.

Edit: Just thought of another problem. My charger should stop charging when the value is greater than like 370 or something, but even though it's 16000, the charger remains on. I can connect the charger to a switch with the software and it works, so I'm probably screwing something up with the programming.
__________________
Taking a break from mentoring for a few years. (Is that allowed?!?)

Controls Mentor
@rnazaretian

Previous teams:
Team Fusion, FRC 364
Garnet Squadron, FRC 4901
  #28   Spotlight this post!  
Unread 21-10-2007, 22:43
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
no team
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Austin, TX
Posts: 1,127
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Project Questions about Programming and Electrical

Well, no one has replied in over a week, so I'm going to ask again...
Okay... I've tried to program the controller to read the battery voltage, but it's giving me raw values of over 16,000 (if you go to this post, they're experiencing the same problem). No body answered their question, and I posted there yesterday and also got no answer. Please please, any ideas are greatly appreciated, otherwise this thing will overcharge as it did last time.
__________________
Taking a break from mentoring for a few years. (Is that allowed?!?)

Controls Mentor
@rnazaretian

Previous teams:
Team Fusion, FRC 364
Garnet Squadron, FRC 4901
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
two electrical questions mechanicalbrain Electrical 9 11-07-2005 09:41
Problems and questions about programming hedgehogger Programming 4 15-01-2005 18:18
Questions about DNS, URL Forwarding, and Cloaking sanddrag Website Design/Showcase 7 22-10-2004 21:32
Questions about Textures and Models thoughtful 3D Animation and Competition 28 11-02-2004 22:13
Pneumatics electrical wiring and programming archiver 2001 1 23-06-2002 23:10


All times are GMT -5. The time now is 20:43.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi