The first battery test utilized the following program versions:
Windows Program V0.02
Batteries voltage at start of the test (unloaded) 12.1V.
The logging program functioned correctly and was able to start the test, allow it to run its course until the battery was drained below (what it sensed) 10.5V, and allowed for the data to be saved to a csv file.
The arduino had a few problems:
1. The battery voltage is still not reading accurately. When running the test, I checked the voltage of the battery with a voltmeter. The following was observed:
Program Voltage 11.64V: Actual Voltage 11.53V
Program Voltage 11.42V: Actual Voltage 11.37V
Program Voltage 11.21V: Actual Voltage 10.99V
Program Voltage 11.16V: Actual Voltage 10.91V
Program Voltage 11.08V: Actual Voltage 10.84V
Program Voltage 11.00V: Actual Voltage 10.59V
Program Voltage 10.68V: Actual Voltage 10.27V
So as the battery drained, the voltage differential increased. The scaling of the voltage will need to be rescaled, or a different measuring device will be needed.
2. As the battery voltage dropped, there were ranges where the relays would kick in and out the loads causing drastic changes between the samples. Here is a sample of the data within one of these ranges:
Arduino Status, Time(seconds), Voltage/100, Current/10, Active Resistor Banks
At first glance it appears that as a load turns on, the voltage drops. When the voltage drops, the calculated loads requires adjusts. Then the voltage rises, causing the calculations to adjust the loads again. This seems to be related to the resolution of the loads. Either the loads can be adjusted for more resolution or the program could be adjusted to allow for a dead zone.
3. As the battery reaches near the bottom of its voltage test (10.5V), then there is a chance that a load will change and cause the voltage to drop drastically below the 10.5V due to the increased load. This might be linked to internal resistance in the battery. Here is what happened in the first test:
In the last few lines, the load increased enough to pull the voltage down below 10.5V. If the program was allowed to continue on, the loads would have increased which would cause the voltage to drop even further. This is tied to number 2 on this list and should be revisited after 2 is smoothed over.
In the order that these issues are listed should be the order that they are solved.