# TC Charger



## pdove (Jan 9, 2012)

After months of work I thought I would post some updates. With the help of some very talented friends we were able to reprogram the charge curves in a few chargers. We also repaired 3 chargers that had hardware faults.

If anyone has a TCCH Charger they need repaired or want to change the voltage or current drop me a line.

In the process we discovered that all of these chargers send out a 79 byte message out the front serial port. It reports voltage, current, Temperature, Amp hours and some other parameters. I have programmed an arduino to display this information to a serial monitor as well. I am speaking of the non-can version.


----------



## 67BGTEV (Nov 1, 2013)

Can you please share more details?


----------



## z_power (Dec 17, 2011)

pdove said:


> In the process we discovered that all of these chargers send out a 79 byte message out the front serial port. It reports voltage, current, Temperature, Amp hours and some other parameters. I have programmed an arduino to display this information to a serial monitor as well. I am speaking of the non-can version.


Hi, did you and your co-workers decide to keep your work's results "closed" or maybe you could share some information about this 79 byte message protocol? I'd like to build small instrumentation/control device with ability to trim CC/CV parameters without charger reprogramming or hardware mods; just using analog control of non-CAN version. I'm poor at reverse enguineering protocols, so far have only voltage and current readings, any help is appreciated - thanks!


----------



## pdove (Jan 9, 2012)

There are two messages that come out of the dual chargers like the 3 KW. A 15 byte message is send from the master half to the slave half. 

This smaller message is used to control the slave.

The larger message comes just from the master half of the charger.

I actually wrote a little program that runs on an Arduino, however, the voltage levels are not the same so you must be careful or you will damage the charger serial lines.

They have little opto-transistors in there that are pulled up to 12 volts so it's not RS-232 and it's not USB and not TTL serial.

I will post this later when I have time.


----------



## Coulomb (Apr 22, 2009)

z_power said:


> I'd like to build small instrumentation/control device with ability to trim CC/CV parameters without charger reprogramming or hardware mods; just using analog control of non-CAN version.


One of the things we discovered by analysing the firmware is that some of the non-CAN chargers don't have proportional analog control. If it's not analog, it's pure digital, with a hysteresis threshold. So you can do on-off control of these (much kinder to everything than just cutting off the AC supply), but not fine control, as you would want for balancing.

We're still investigating this issue; so far there doesn't seem to be any easy way of predicting from labels on the outside of the charger as to which version you might have. We have ways of reprogramming these chargers now, so we could change any charger from on-off to proportional, but the procedure is not for the faint hearted. Most (if not all) of the later chargers have write protection on all but the last sector (1kB of 8kB), which means we have to "punch a 64 byte hole" for the peek code, extract the code, disassemble it, then "repair the hole" based on experience and using comparison to other firmware images we've collected. So this is not yet ready for the average, or even better than average DIY person, at least not yet. It's also expensive to ship whole chargers, and the board with the microcontroller on it is not easy to remove on its own.

Of course, if you want to just replace the whole firmware all at once and ignore totally what was in there before, that's easier, and the DIY person with Arduino level experience could do that. But we're not at the point where we can "cook up" a firmware to anyone's exact requirements at this stage.

So just be aware that the 2-5 V 0-100% current control that is described in the TC charger documentation isn't necessarily enabled in your particular charger.


----------



## pdove (Jan 9, 2012)

FF FE Always introduces one of these packets.
F0 The destination code
4A Length byte, 74, not including overhead (these 4 and last one, the checksum)

02 EEPROM Version

0D hardware version 
14 14 Versions of software and curves

 00 00 error code

 02 AC voltage 110 = 01 220 = 02

 41 6C FC 20 internal temperature
41 6C FC 20 lowest temperature it's seen this charge
40 D2 FE 66 external temperature (enable pin)
42 96 68 DF Dc Voltage on Bus
3C 3E 54 80 DC current 

 00 00 00 00 DC ripple current

 43 1F 0E 72 Battery voltage
FF Outside temp sensor

 00 Battery temperature over error

 41 86 7E 10 Battery temperature

 00 00 00 00 

 43 C0 80 00 PFC voltage

 00 00 00 00 Voltage set point

 BE 80 00 00 Current set pointsense to me
BF 00 00 00 Battery current set point

 00 00 00 00 change in voltage over time

 3C 23 D7 0A Amp hours

 00 00 charging time minutes 

 01 charge_state 1 on 0 off

 00 relay on 1 off 2

 02 Communication error

 3D Checksum

All the four byte values are floating point


----------



## z_power (Dec 17, 2011)

Coulomb said:


> So just be aware that the 2-5 V 0-100% current control that is described in the TC charger documentation isn't necessarily enabled in your particular charger.


Seems like again I had a luck (previous time it was with voltage levels at serial interface); my both 1,5kW units have 2-5V control enabled and I'm using it now with pot to limit amp draw from wall socket in one of charging locations. 
Thank you anyway for this warning, and for all your informative postings here and on AEVA forums.



pdove said:


> FF FE Always introduces one of these packets.
> F0 The destination code
> 
> ...
> ...


THANKS! This saves a lot of headache. I'll try it first with PC to display decoded data, then use "standalone" microcontroller circuit.


----------



## pdove (Jan 9, 2012)

This is the code I used to read it.

// Display data from a TCCH charger in volts amps and degrees
// by Paul Dove

#include <SoftwareSerial.h>
unsigned long start = millis();
const uint8_t DMM_RX_PIN = A0; // DMM connected to analog pin 0.
const uint8_t DMM_TX_PIN = A1; // Analog pin 1, not used.
boolean readComplete = false; // whether the string is complete
SoftwareSerial DmmSerial(DMM_RX_PIN, DMM_TX_PIN);

uint8_t data[79]; // DMM data record
//uint32_t t = 0; // Time record was received
//------------------------------------------------------------------------------

void setup() {

Serial.begin(57600);
while (!Serial){} // wait for Leonardo
Serial.println(F("Type any character to start"));
while (Serial.read() <= 0) {}

DmmSerial.begin(2400);
//Serial1.begin(2400);

}
//------------------------------------------------------------------------------
// Read record. Abort read if Serial data is available.
void readRecord() {

int i = 0;
while (!DmmSerial.available()); //Soft Serial
//while (!Serial1.available()); //Mega and Due
int d = DmmSerial.read(); 
//int d = Serial1.read();
if (d != 255){return;}
data[i++] = d;
if (!DmmSerial.available());
//if (!Serial1.available());
d = DmmSerial.read(); 
//d = Serial1.read();
if (d != 0xFE) {return;}
data[i++] = d;
if (!DmmSerial.available());
//if (!Serial1.available());
d = DmmSerial.read();
//d = Serial1.read();
if (d != 0xF0) {return;}
data[i++] = d;
do { 
int d = DmmSerial.read();
//int d = Serial1.read();
data[i++] = d;
} while (i < 79 && DmmSerial.available()); 
//while (i < 79 && Serial1.available());
readComplete = true;
return;
} 
//------------------------------------------------------------------------------
void loop() {
readRecord();
//Serial.write(data,79);
delay(70);

if(readComplete == true){
Serial.print("Internal Temperature is: " ); 
float IT = floatconvert(data[11], data[12], data[13], data[14]); 
Serial.print("Internal Temperature Minimum is: " ); 
int ITM = floatconvert(data[15], data[16], data[17], data[18]);
Serial.print("Enable) is: " ); 
int Enable = floatconvert(data[19], data[20], data[21], data[22]);
Serial.print("DC Bus Voltage is: " ); 
float DCV = floatconvert(data[23], data[24], data[25], data[26]);
Serial.print("DC Current is: " );
float DCC = floatconvert(data[27], data[28], data[29], data[30]);
Serial.print("Battery Voltage is: " ); 
float BV = floatconvert(data[35], data[36], data[37], data[38]);
Serial.print("Battery Temperature is: " ); 
float BT = floatconvert(data[41], data[42], data[43], data[44]);
Serial.print("Voltage Temperature compensate is: " ); 
float VTC = floatconvert(data[45], data[46], data[47], data[48]);
Serial.print("Power Factor Control Output is: " ); 
float PFC = floatconvert(data[49], data[50], data[51], data[52]);
Serial.print("DC Voltage Set point is: " ); 
float DCVS = floatconvert(data[53], data[54], data[55], data[56]);
Serial.print("DC Current Set Point is: " ); 
float DCCS = floatconvert(data[57], data[58], data[59], data[60]);
Serial.print("Battery Current Set point is: " ); 
float BCS = floatconvert(data[61], data[62], data[63], data[64]);
Serial.print("f_DVDT_15M is: " ); 
float DVDT = floatconvert(data[65], data[66], data[67], data[68]);
Serial.print("f_Ah is: " ); 
float Ah = floatconvert(data[69], data[70], data[71], data[72]);
readComplete = false;
}
// uint32_t sec = millis()/1000; //Time if needed
// if (sec <= t) return;
//t = sec;
// Serial.print("Time (seconds): " );
//Serial.println(t);
}

byte floatconvert (byte w, byte x, byte y, byte z){
union
{
unsigned long a;
byte b [4];
float f; 
} floatdata;
floatdata.a = ((w << 8) | (x));
floatdata.a = ((floatdata.a << 8) | );
floatdata.a = ((floatdata.a << 8) | (z));
float l = floatdata.f;
Serial.println (l, 4);
return l;
}


----------



## Caps18 (Jun 8, 2008)

I might be interested in this. I bought a 6 kW charger, but it is set to 256V/27A. I have a 130V DC pack and it could handle more Amps than what the charger will limit it to when set to the correct voltage.


----------



## kennybobby (Aug 10, 2012)

Caps18 said:


> I might be interested in this. I bought a 6 kW charger, but it is set to 256V/27A. I have a 130V DC pack and it could handle more Amps than what the charger will limit it to when set to the correct voltage.


Does this charger consist of 3 of the 2kW units in parallel? Is it CAN controlled?


----------



## Weisheimer (May 11, 2009)

These chargers always come paired in even numbers, or so far as I have seen to present.
Thus, the 6Kw charger is 4 of the 1.5Kw chargers in parallel.


----------



## Coulomb (Apr 22, 2009)

Caps18 said:


> I bought a 6 kW charger, but it is set to 256V/27A. I have a 130V DC pack and it could handle more Amps than what the charger will limit it to when set to the correct voltage.


That's an interesting situation. When running a charger at just over half the maximum voltage, it will have plenty of spare capacity at the front end (the Power Factor Correction stage). So from that point of view, the output current could be increased safely.
However, the back end has an inductor that is designed for a particular maximum current. Also, the turns ratio of the high frequency transformer is such that it will cause more current to flow in the H-bridge than it was designed for, if you increase the output current. The consequences of this really are unknown, unless you do a thorough analysis and possibly redesign of the back end.
So while it is easy to change the current limit in this way, we don't recommend it. I've increased the current output of one of mine from 15 A per side to 18 A per side, and achieved I think 17 A (I didn't bother figuring out why the last amp would not come). It didn't seem too stressed by that, but I didn't run it for long or even with the cover on like that.


----------



## brainzel (Jun 15, 2009)

I got a TCCH192V-36 which is "reduced" by software to 189.9 Volts and 24 Amps.
max. 6.000W, max. 190V, max. 36A, no CAN, 2-5V adjustable.

I would love to get the full current out of these little bastard ;-)
Best would be 189V @ 31Amps.

Would this be possible by your CMon and Software?
Could you offer these as a kit, useful also for "lite" programmer like me? 

Michael


----------



## kennybobby (Aug 10, 2012)

That is quite a reduction from the label rating--like it is limiting to 1100 watts running on 110vac for 4 single chargers. 

This would be interesting to compare for sure.


----------



## pdove (Jan 9, 2012)

brainzel said:


> Would this be possible by your CMon and Software?
> Could you offer these as a kit, useful also for "lite" programmer like me?
> 
> Michael


We can probably work something out. 

Contact me in a PM and I'll discuss this with you.


----------

