DIY Electric Car Forums banner

NG3 chargers can't current limit on lithium batteries?

60286 Views 144 Replies 21 Participants Last post by  jollmo
We've been using an NG3 charger for the last several years to charge our lead acid pack. We originally had Electric Conversions install an optional low current mode switch on the NG3 so that we could charge on a standard 15 amp outlet while at work.

We're in the process now of upgrading our pack to lithium. Before we purchased the new batteries we had contacted Electric Conversions regarding modifying our NG3 to handle the lithium batteries. They said they would be able to modify the charging profile for our configuration.

Now, after just receiving the charger back from Electric Conversions we noticed that the low power option had been removed from our unit. They failed to mention this little detail to us. I contacted them and all I was told was we can't current limit on lithium batteries and it would take to much time to do. If you can current limit on lead acid why not lithium? If the hardware of the NG3 supports current limiting on lead acid it should be just as capable of current limiting on lithium. I realize that it might require a separate charging profile or something but it can be done.

My plan now is to figure out the profile programming of the NG3 and modify it myself. I have a lot of professional experience in reverse engineering electronic systems and feel that it can be done. I know a lot of people have been down this path before on here and have found some decent information. If anyone has information about the NG3 charger that would help speed up the process it would be appreciated.

Two lessons here, NG3s don't currently have a current limiting capability on lithium and avoid Electric Conversions. After reading some of the other posts on here, I'm not the only one to have problems with this company.
61 - 80 of 145 Posts
Has anyone else ordered and received their chip yet? I'm still waiting for the programmer and would enjoy hearing from others that are already playing with the device.
I have my PIC and I am trying to learn how to use the tools. I have downloaded MLAB-X and the HI-TECH compiler and they are installed. I was able to load the text file in Notepad and edit the voltage to 135 volts. My control card has a 16 position switch plugged into the pins next to the socket. While I was waiting, and before I started trying to program, i tried to get the charger to start without the micro in the socket. There was one line from the ADM chip which stayed down and inhibited it from starting. These projects are supposed to teach us some humility.

Bob
My NG3 was originally with my 914 when it had 20 6v batteries, or 60 cells. My charger is open and I can see that there are two 470k resistors connected to the battery plus terminal. One goes to pin 12 and the other goes to pin 15 on the control board.

I want to set one of my switch positions to have a minimum current such that I can turn on the charger with a light bulb load to determine the output voltage without having the battery connected.

I have MPLAB-X up and some files loaded. I found that I can edit ngc.c to change the volts and amps but I don't yet know that all the files are in the right place.

Bob
Hi,

I have a NG1 do any of you guys that are familiar with these chargers know anything about the two pin jumper that can be moved to different positions along two rows of pins? Is it for different chemistries? They are located close to the din socket on the NG1.

Thanks
I have loaded MPLAB-X and the Hi-Tech compiler. After many false starts I loaded the program from the firmware file and I was able to see the ngc.c file. I edited the CV lines to lower the voltage to fit my car. BTW, my charger has a 470k resistor between the battery and the control board. I clicked on the build and clean tab and numerous errors returned. My charger has a 16 position rotary switch connected to the programming pins. Only the first four positions of this switch are used.

If anyone has any ideas how to proceed, I'd like to know.

Bob
I have loaded MPLAB-X and the Hi-Tech compiler. After many false starts I loaded the program from the firmware file and I was able to see the ngc.c file. I edited the CV lines to lower the voltage to fit my car. BTW, my charger has a 470k resistor between the battery and the control board. I clicked on the build and clean tab and numerous errors returned. My charger has a 16 position rotary switch connected to the programming pins. Only the first four positions of this switch are used.

If anyone has any ideas how to proceed, I'd like to know.

Bob
Two things to check:

1. Make sure you opened the ngc.mcp project file, not just the ngc.c source code file.

2. Check to see that the Hi-Tech C compiler is selected under PROJECT->SELECT LANGUAGE TOOLSUITE->HI-TECH UNIVERSAL TOOL SUITE

If this doesn't help, post or email me your errors.
I have learned a few things. When I went to the firmware folder and clicked on the red icon, the program opened in MPLAB8 and the only error I saw was that I didn't have my pickit3 connected.

When I installed MPLAB-X and loaded the mplab legacy project with the same red icon, numerous errors appear.

It seems better to try to proceed with the first option. I was able to edit the voltage to 135 v. and I may be ready to connect my pickit3 and the chip and run. The nice thing about MPLAB-X is that there is a lot of hand holding along the way and MPLAB8 looks like it's made for the pros.

Bob
The project file is actually an MPLAB8 version. MPLAB8 really isn't that bad but it looks like there is a conversion function to take version 8 project files to X version.
Charger dead. Watch out.

Well I changed the voltage and current values, programed the chip and verified programming, swapped out chip in NG1. All I got when plugged in was a click from the relay and a solid yellow LED. Swapped back to old chip and got same thing. NG1 now dead and on it's way back to Zivan for repair. Wish I would have charged the batteries before the swap. No wheels for a few weeks. Thanks for trying anyway.
Any smoke or fireworks? It would be nice if we could figure out what happened.From the sounds of it your charger might still be ok. If the main relay still clicks and you have the yellow LED then most of the charger is working. This is the default behavior without a chip installed. Any chance the chips were installed backwards or have a bent pin? When you programmed the chip did you use the PicKit in debug or programming mode?
Any smoke or fireworks? It would be nice if we could figure out what happened.From the sounds of it your charger might still be ok. If the main relay still clicks and you have the yellow LED then most of the charger is working. This is the default behavior without a chip installed. Any chance the chips were installed backwards or have a bent pin? When you programmed the chip did you use the PicKit in debug or programming mode?
Could have been backwards. I oriented pin one to match the old chip's pin one. I think I programmed in debug mode. I'm not shipping until tomorrow so I could pay with it some tonight, but not hopeful. I'll try rotating the old chip 180 degrees and see if I get some life showing.
OK, I'm an idiot. When I put the old hip back in I reversed it. I also just broke a pin on the old chip taking it back out! :rolleyes:

I reprogrammed the new chip, but this time not in debug mode. I installed the new chip, and get the beep, and the LED is green this time, and fan is off. So, I beleive it thinks the pack is already at or above the charge voltage and ends charging instantly. How do the voltage and amperage trim pots currently work with the new chip? Do they have any effect right now? It's either the trim pots or the formula used to derive pack voltage from the reference voltage is not applicable for the NG-1.

Time to go solder that pin pack onto the old chip. I don't have a clue what's the matter with me today. :confused:
Is this a 3.3 volt or 5 V PIC? I've played it safe so far setting the voltage at 3.65 (3.38 at the PIC).
The PIC is a 5v unit. When its installed in the charger you have to allow the charger to provide the 5v. If you try to power the charger's entire 5v system through the PIC it's not happy.

I normally operate in debug mode but your final programming of the chip needs to be done in programmer mode. Your program won't start up without the debugger if it's only programmed in debug mode.

The trim pots still play a role with the new chip. I don't have much time so I'll try to answer this more tomorrow but what is your battery configuration? You'll likely need to modify the equations and set your pots to a specific position. The debugger comes in really handy here.
25 LiFePO cells. Been charging at ~86V (~3.45Vpc) until amps drop to ~1 Amp.

When Zivan reprogramed my NG1 for lithium, they replaced the entire logic board. This new board has a row of five jumper pairs, not four. They are labeled MD, C0, C1, TP, and AH. TP is the pair currently shorted.
I have my PIC and I have been struggling to understand it. Finally I am using MPLAB 8.4 and the compiler v9.8. Note that I downloaded the compiler as a Pro version but in the Lite mode. That is the only way to get the right version. Then I loaded MPLAB and the compiler on a computer that had not been contaminated and connected the Picket3. It told me I had no target so I connected the chip. I put the chip in a breadboard and applied 5v. I continued until the screen said "program verified". Next, I put the chip in the charger with a dummy load of 2 light bulbs in series and applied power. The result was a beep, no fan and a yellow light. Oh, I edited the c file to 135 volts and saved it before any of the above. Does anyone know what I should do next?

Bob
The result was a beep, no fan and a yellow light. Oh, I edited the c file to 135 volts and saved it before any of the above. Does anyone know what I should do next?
Hopefully Dave will have more time soon to hand hold us through the process. You are getting about what I'm getting, except you'er getting a yellow light where I was getting a green one. What model do you have? I have the NG1 72 volt version.
My charger is an NG3 which was originally used on my 914 with lead. It charged the lead to about 140 volts. When I went to lithium, I only wanted 135 volts for 40 cells. Zivan was unresponsive, so I designed my own charger, 135 volts at a maximum of 10 amps. With this design, I am able to set the voltage with no load, then press a button to start the charging. It shuts off at one amp. I used an available chassis to mount everything and it is too big to fit under the hood, which the Zivan does nicely. It would be nice if the control board in the Zivan were on a removable connector. For a fixed application, there is very little justification for Pic control, but I would surely try to use the Pic before I would try to rip out the present control board. There is also the intriguing possibility I could learn something about programmable hardware. If I do, I may never be the same again.

Bob
Sorry, its been a while. Ok, not sure where to start.

Brent, sounds like your chip is being programmed correctly but that the equations will need to be modified. This is where the debugger is required but since your charger is a 72V unit we can make some educated guesses to get started.

The first line you need to change is for the cell_voltage_setpoint on roughly line 144. Remember, the charger thinks everything is lead acid and works off the notion of the lead acid cell. For me, I had 12 12V lead acid batteries so I had 72 cells. If you had 6 12V batteries (or equivalent setup) for your 72V, then you'll need to change the 72 cells to 36 cells.

The next equation you'll have to modify is the voltage equation on line ~185. This will be derived from the comments just above, but again replacing the 72 cells with 36. This should give you now:

voltage = ((float)voltage_bits) * 27 / 1024 + 70.34

And again, that is assuming the rest of the logic board is the same. Which I believe it is based on everyone's input here. Then there are the current equations but lets start there for now.

Bob- Do you know if your charger is a 132V or a 144V model originally?

I'm a little puzzled by what you're seeing. I would expect the fans to come on if you're hearing a beep. The LED wouldn't be yellow either.

Again, my recommendation is to use the debugger. I would start off using the debugger with the chip out of the charger. All you need is the chip and the PicKit. Set the PicKit to debugger mode and have it provide 5V power to the chip. Then program your chip and use the "step into" command to walk line by line through the code. This is the best way to understand what the chip is doing. Monitor your watch variables as you go. You can set breakpoints at certain points in the code to and then hit run. The program will run until it gets to that point and then it will stop.

Once you can walk through the code and understand it outside of the charger, then you can install it and do the exact same thing. Then you can see where the program is having problems. Without using the debugger it's almost anyone's guess as to what is going on.
See less See more
I had a few more questions that I was emailed, that I will answer here.

1. Is there a way I can fake a battery pack (e.g. 2 x 10A ceramic
> heaters) so I can test my code without having the pack connected to the
> charger? I've still got a fair way to go before I'm ready to connect the
> batteries, but I'd like to get on with coding before as soon as the
> replacement arrives.

You can fake it out but since the heaters don't behave the same as the batteries you won't really be able to verify very much. If you just want to test things like is it running or how to operate the buzzer/fans/relays, you can disconnect the battery and the chip will still run. Another test you can do is to run the chip with the SS = 0; (line ~196) commented out. This will disable the charger output but still allow the chip to measure the pack voltage.

> 2. WRT the current calculations - my charger is 230V 19A in, 144V 18A
> out. Can I just use say 19 ma per bit rather than your 11 ma? or do I
> have to measure it?
> 3. Also, will I need to change the .047 divisor for the digital_pot_bits
> setting (line 154)?
>

Both of these will have to be changed. If we knew for certain what specific current sensing transformers and amplifier gain values were used for the different charger models we could figure out an exact equation, but unfortunately we don't. I didn't even know for sure what mine was so I just measured it. Remember, it's also a function of the current pot setting.

The way I figured mine out was to hard code the digital_pot_bits (line ~152) to a specific value. I then enabled the output and measured the actual current with a clamp on current meter as well as the voltage that was measured by the chip on line ~172. This means using the debugger to view the current_bits in the watch variables.

From these measurements I was able to create a table that I used to figure out the constants used on lines ~154 and ~188. For example, since the digital_pot_bits is an 8-bit value (256 possible settings), I made measurements every 64 values or (0x40, 0x80, 0xC0,...). If you do it correctly, you should be able to generate two linear plots, one for actual current vs digital_pot_bits and another for actual current vs current_bits. You can get your two constants from the slope of these lines. It's not as bad as it sounds.

> I am assuming the Voltage constants won't need to change since it's
> still 144V...

Since you have a 144V system your constants should (I say should but I can't guarantee) be the same. What you have to verify though is that the voltage variable (line ~185) is seeing the correct pack voltage. The way to verify this is to measure your pack voltage with a meter, then use the debugger to get the voltage value seen in the watch variables. If they are off, and they likely will be, you will need to adjust the voltage pot until they agree.
See less See more
61 - 80 of 145 Posts
Top