Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Getting the battery voltage (http://www.chiefdelphi.com/forums/showthread.php?t=84132)

Itamar 10-03-2010 12:43

Getting the battery voltage
 
Hi!
I would like to get the voltage of the battery in the code itself.
I belive this is very possible, but I do not know how to do it.
I have the voltage shown properly on the driver station.
If anyone knows how to get the voltage I would appreciate it.

Ziaholic 10-03-2010 15:52

Re: Getting the battery voltage
 
Since your jumper is setup correctly, you just need to read Analog Input #8

You'll need an OPEN in your BEGIN.VI, then simply do a GET from that analog input.

Itamar 10-03-2010 16:49

Re: Getting the battery voltage
 
I have already tried that, and it gave me a value of 0, than it also gave me 0 on the driver station.
I will try that again.
Meanwhile, any other suggestions?

Alan Anderson 10-03-2010 19:44

Re: Getting the battery voltage
 
The communication task already acquires Analog Input 8 on slot 1. I don't think the system will let you open it again.

You might be able to modify the Start Communication vi to save the battery voltage in a global variable for you. Find the case where it says "Read the battery voltage every 200ms." and try storing the result of the multiplication in the "0" case into a new global that you can read elsewhere in the project.

EricWilliams 11-03-2010 11:46

Re: Getting the battery voltage
 
Quote:

Originally Posted by Itamar (Post 935318)
I have already tried that, and it gave me a value of 0, than it also gave me 0 on the driver station.
I will try that again.
Meanwhile, any other suggestions?

The real question is, why are you reading the battery voltage on the robot side? That sounds interesting.

Racer26 11-03-2010 13:06

Re: Getting the battery voltage
 
Alternately, just wire the 12V into another AI port and read that.

EricVanWyk 11-03-2010 13:41

Re: Getting the battery voltage
 
Quote:

Originally Posted by 1075guy (Post 935647)
Alternately, just wire the 12V into another AI port and read that.

12V is outside of the range of the analog inputs. A voltage divider would be required for this configuration.

If you aren't seeing it on the driver station, you may be missing the jumper that selects it.

billbo911 11-03-2010 14:06

Re: Getting the battery voltage
 
Here is the odd thing. Like the OP, we do not display the battery voltage on the drivers station. It worked just fine until we applied the last updates to both the cRio and the DS. Now it only gives us "0.00".
The jumper is on the outer two pins of the analog bumper, exactly where it was before the update. Other than that, everything works perfectly.

Any ideas?

Alan Anderson 11-03-2010 16:53

Re: Getting the battery voltage
 
Quote:

Originally Posted by billbo911 (Post 935671)
Here is the odd thing. Like the OP, we do not display the battery voltage on the drivers station. It worked just fine until we applied the last updates to both the cRio and the DS. Now it only gives us "0.00".
The jumper is on the outer two pins of the analog bumper, exactly where it was before the update. Other than that, everything works perfectly.

Any ideas?

Is the green power LED lit on the analog breakout board?

billbo911 11-03-2010 16:59

Re: Getting the battery voltage
 
Quote:

Originally Posted by Alan Anderson (Post 935726)
Is the green power LED lit on the analog breakout board?

Yes sir. Our Gyro on Ch.1 works as well, so we know the board is getting power to the bumper.

It really seems odd to us. The ONLY thing we changed between when it worked and when it didn't was the curio firmware and the DS software.

Zme 15-03-2010 20:02

Re: Getting the battery voltage
 
we had an issue similar to this but the problem was intermittent, eventually traced it back to a flakey jumper, try changing it out see if that makes a difference

billbo911 15-03-2010 21:31

Re: Getting the battery voltage
 
Quote:

Originally Posted by Zme (Post 937571)
we had an issue similar to this but the problem was intermittent, eventually traced it back to a flakey jumper, try changing it out see if that makes a difference

This is what I'm leaning toward as well. It will be one of the first things we check when we open the bag.

billbo911 24-03-2010 14:16

Re: Getting the battery voltage
 
Well, the jumper checked out normal. So now we are at a loss. We will have the robot out of the bag for four hours this Saturday, hopefully we can figure this out.

Does anyone else have any ideas what may be preventing this from working correctly?
Again, it worked fine until we did the last cRio and DS updates.

Joe Hershberger 26-03-2010 00:28

Re: Getting the battery voltage
 
Quote:

Originally Posted by billbo911 (Post 942570)
Well, the jumper checked out normal. So now we are at a loss. We will have the robot out of the bag for four hours this Saturday, hopefully we can figure this out.

Does anyone else have any ideas what may be preventing this from working correctly?
Again, it worked fine until we did the last cRio and DS updates.

Any chance your code is now opening channel 8 on its own? This will cause a resource in use error. I'm guessing your module is ok since you said the gyro works... metal shavings in the db15 connectors can kill the slot and make all channels return 0.

If you have both analog modules installed, you could read the battery voltage from the slot 2 module.

-Joe

Tom Line 26-03-2010 01:18

Re: Getting the battery voltage
 
We've seen this before when the analog breakout itself went bad at MARC last year - we were helping the robot next to us and NO one could figure out why they weren't getting battery voltage - so we started swapping out hardware.

You might try swapping your analog breakout.


All times are GMT -5. The time now is 11:07.

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