01-12-2020 10:39 AM
Hi!
I'm very new to LabView and currently trying to make an algorithm determining state of charge in a battery for one of my classes. Unfortunately I've stumbled upon some obstacles in making the LabView code. For the first time I can't find the solutions anywhere, so you guys are my last resort, hopefully you can help me:(. Here are the things I don't really know how to solve;
1. How to get a percentage value out of voltage measurement where 13.5V equals to 100% and 10.5 equals 0% where there is a linear correlation between these "points". Then depending on what voltage reading I get make it the percentage value.
2. Measuring current multiple times and how to sample these readings and calculate the average value.
3. How to make an equation where I have to integrate the average current over time in the equation.
These points should be connected to get a value of the battery state of charge. All the help I can get is very very welcome!
01-12-2020
11:19 AM
- last edited on
01-12-2025
04:27 PM
by
Content Cleaner
Hi chyrren,
when you are "new to LabVIEW" (as can be seen by the way you spell LabVIEW) you should take note of those "Training resources" offered in the header of this LabVIEW board…
1. This is a simple linear interpolation:
percentage := (input - min) / (max - min) * 100
You already gave the min/max values, so this equation is rather easy to implement!
(When you have done this you might also read the help for Threshold1DArray, which does a very similar job.)
2. Have you noticed that Example finder coming with LabVIEW? When you use a DAQmx device to read your current data then you should examine some of those DAQmx example VIs…
(To learn the DAQmx basics you should read this.)
3. An "integration" mostly boils down to a summation over time when using digitized DAQ readings: all you need is a shift register and an Add function!
(You might also explore the functions listed in the Signal Processing -> PointByPoint palettes…)
@chyrren wrote:
These points should be connected to get a value of the battery state of charge.
The items 1-3 will give a rough SoC estimation for a lead battery, there are other SoC formulas in the literature…
01-17-2020 05:34 AM
Hello!
I am currently working with a project where I am programming an algorithm in LabVIEW to calculate the state of charge of a battery. Where I am planning on measuring the Open Circuit voltage and then converting that value to an initial state of charge value, and then via "Coulomb Counting" calculate the present state of charge by subtracting the integration of the measured current over time, and here is where the main problem comes up. I have tried to find the answer everywhere without any success.
How do I do this integration of the measured current over time?
And any general advice for how to program this algorithm is also very welcome.
01-17-2020 06:02 PM
Chyrren,
Members of this forum won't do your homework for you! However, we love to help out if you show us that you're trying.
If you write literally any code at all we'd love to help point out what can be improved and where the bug might be, but until you get at least that far, you won't get anything beyond the most general of advice.
You also need to provide more information. You haven't even said how you're going to be measuring voltage or current. Do you have a NI DAQ of some kind? Maybe some kind of external test equipment like a multimeter that you can connect to a PC?
01-19-2020 08:09 AM
Integration is really nothing more than adding all of your measurements. The simple method would be to use the Integrate PtByPt VI. But I would probably go the route of using a shift register to keep the count of Coulombs. You just take your current reading (Amps), multiply by the number of seconds between your samples (Amps = Coulombs/sec, therefore A*s = # of Coulombs), and then add to the count in the shift register.
01-24-2020 05:58 AM
Thank you for all of your replies! Sorry for my previous vague question and everything.
I have developed the shared code so far, and wondering if the integration technique is correct, aswell as the measuring codes. And how to connect the results from the integration and the formula.
01-24-2020 05:58 AM
01-24-2020 06:15 AM
Hi chyrren,
@chyrren wrote:
Code:
No code in your last message, just an image of (parts of?) a block diagram…
Why don't you use AutoCleanup?
What's the point in trying to subtract two control references???
What's the point if the shift register in the loop?
Why are there coercion dots at the integration function?
Which value is connected to the dt input of the integration? What is its purpose?
What about DATAFLOW when trying to subtract "IntegralX" from "SOC t0"?
So many questions - and still no code!