Power monitoring problems

Solar dock power monitoring is working kind of, I empirically derived the formula for the counts/V at the main controller, after adding in some lowpass filtering on the ADC processor, and there is a slight issue. At about 6-7V, the response is flat, not sure why, but I suspect that there is some interaction with the regulator, as it could be infringing on the minimum input voltage (nothing as fancy as a LDO regulator here!) and at about 19V it goes flat again, I suspect this is because the voltage divider is not sized quite right (although I guess I could to the math and figure this out) but the maximum panel voltage is supposed to be about 17V, and the SLA is considered dead at about 10.5V, so it's really not too big of a problem. The slope between these is very linear, which I suspected it would be, so it's very simple math to work it out (especially as on this controller I am using C and have floating point).

However, and here is the problem....

I calibrated by measured the voltages starting at 7 and working up to 20, and when I fiddle it around like this (increasing) I get accuracy of 0.05V in comparison to my meter. If I read 17V and then turn it down to 12V it could be reading high by about a volt. I am going to try a negative slope calibration and see what that turns up, and perhaps calculate the voltage on both slopes and average them, that should get me within about 0.5V. Or I might try something clever on the ADC and put in a delay to help the ADC capacitor stabilize, or I might try a combination of all of them.

Subject: