How to map voltage to battery percent?
25 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Bradley
el 16 de Dic. de 2024 a las 16:25
Comentada: John D'Errico
el 16 de Dic. de 2024 a las 17:55
I am testing a battery in an autonomous vehicle for work and need help mapping values in matlab. The batteries we are using have some arbitruary battery percentage that means nothing, what ive been able to figure out through testing is a voltage of 57v means the battery is 100% charged. The battery will go until it completly dies but we dont want that, at 45v the vehicle starts slowing down so im calling that 0%. When we run our vehicles they almost never start at 57v, maybe its 56.9 what ever. I want to classify 57v as 100 percent and 45v as 0 and then map the values recorded by the boat to what ever percentage they correspond to. Any recommendations on getting started with this? Thanks!
1 comentario
Magnus
el 16 de Dic. de 2024 a las 16:41
I don't really see that this is a matlab issue? How do you get your data into Matlab, how does Matlab help you calculate anything?
Trying to answer the question: the percentage is a percentage of what, exactly? How much power is left in the battery in kWh:s? Generally speaking, there is no linear relationship between output voltage remaining power. If you can set up a test circuit where you can measure and record the output power in Watts (and contiously integrate to get used energy in J) and simoultaneously the output voltage you will have a graph of voltage vs energy(in reverse).
Respuesta aceptada
John D'Errico
el 16 de Dic. de 2024 a las 16:35
Editada: John D'Errico
el 16 de Dic. de 2024 a las 16:42
This is just a simple linear interpolation. Think about it!
Suppose you subtract 45 from the voltage. When V was zero, you now have zero. Now divide the result by (57 - 45). This is because when you had 57 volts, after subtracting 45, you would be left with 12=57-45. Got it?
Finally, since you want to see percentage units, multiply by 100.
P = @(V) 100*(V - 45)/(57 - 45);
P([45 50 57])
Of course, a better rule would recognize that less than 45 is a bad thing, and more than 57 is overcharged. So you might modify that rule, like this:
P = @(V) min(100,max(0,100*(V - 45)/(57 - 45)));
P([44 45 50 57 60])
fplot(P,[40 60])
xlabel 'Voltage'
ylabel 'Percent charge'
grid on
Finally, you might decide to do something else like make the battery explode when it is overcharged by some amount, or do something equally bad when the charge goes down below 45 volts. That would be your choice of course, but be careful. Exploding batteries can be dangerous. ;-)
3 comentarios
Magnus
el 16 de Dic. de 2024 a las 17:07
But this is not correct (depending on the specific type of battery). The voltage should not decrease linearly with the energy left in the battery. The goal of a battery is to deliver a more or less contanst voltage until the energy reserves are gone. This of course varies a bit, but usually not linearly unless in very specific cases.
John D'Errico
el 16 de Dic. de 2024 a las 17:55
Well, yes, in a sense. Of course no simple linear approximation will ever be perfectly correct in virtually any model of any physical system. But lacking sufficient information on battery type, and how the battery voltages decreases, this is the answer to the problem as requested. As good as we can do in context of the question. A better answer would involve a more complete model of a specific type of battery. If you have that at hand, and want to supply it, then feel free to do so, instead of just complaining about this admittedly not perfect answer.
Más respuestas (0)
Ver también
Categorías
Más información sobre Green Vehicles en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!