Quote:
Originally Posted by justindd
Has anyone figured out what in the world is going on with these current numbers? It seems like either there is a bug in the SG II, we are using incorrect scaling factors, or something on that order, because these numbers don't make sense to be the result of a binary math error. Unless we should only be looking at 15 bits or 12 bits? If so, that might explain all of the problems.
|
I assume you are referring to the traction battery current xgauge not giving correct readings for both charge and discharge. This is due to the PID being a scaled 2's complement format. In the case of PID 4915, the scaling is .030518 (1000/32768). So, 20A of discharge would have a PID value of 656 (290h) and 20A of charge would have a value of -656, which is FD70h in 2's complement form. So if we take the negative value and scale it with the MTH, we get (FD70h*0271h/800h+0)/10 and get in decimal 1979.9. No bugs in the SG, just the limitation of the simple math. The SG assumes any numer 8000h or higher to be a negative value and displays it as such in the xgauges.
Reading fewer bits and then adding them back flips the sign and gives wrong values for discharge current. I have tried various other things without success so far. I mentioned this to Ron at Linear Logic in August of 2007 when I was beta testing the xgauges, but he has not had time to look into it due to other pressing concerns.