DIY Electric Car Forums banner
81 - 100 of 143 Posts

· Registered
Joined
·
20 Posts
I think I posted that I got a beep when I plugged in the chip. I can't repeat that. The programming indicates that it is complete. In the debug mode it seems to hang at the sounder, whether I single step or run. I went back and tested the original chip and it still works as it did, which voltage is too high for lithium.

In the programming and debug modes I have the chip mounted in a breadboard. I did learn that I can supply 5v from the picket or not. I also used an external power supply.

Bob
 

· Registered
Joined
·
102 Posts
> 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)?
>

...

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.
Can I measure the current by using the heater trick? Can the charger limit itself even through a short? I guess the voltage will be wrong without having the pack though.

> 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.
So this I can't do until I have the pack set up. It's going to be a pain debugging this in the car - I'll need a 30 meter USB cable for the PICkit 3 :D
 

· Registered
Joined
·
20 Posts
I have been able to program the chip and the report is that it is successful. Then I switched to the debugger and used the animate mode. It slowed down when it got to the sounder so I lowered the numbers temporarily and then the program stuck trying to set up the A/D. The line where it stopped is where it says to wait.

BTW, my windows do not show line numbers and that would be nice while chatting about the program.

Bob
 

· Registered
Joined
·
48 Posts
Discussion Starter · #84 ·
Bob - If you're using MPLAB there should be two ways to get the line numbers. One is to enable them by right clicking on the editor and selecting properties, then "C File Types", and enable line numbers. The other way is just to click on a line in the editor and look at the very bottom of the MPLAB IDE window. It should say Ln ###, Col ###.

I don't recommend using the animate feature. It slows things down like you say when it comes to loops. For example, if you want to start at a particular place in the code, set a break point to it and then hit run (without animate enabled). Then you can single step through the specific parts of the code you want.

CrunchTime- This is where my laptop came in a little handy. :D

You might be able to use a heater to test your current and voltage settings but I'm doubtful. Without testing it or probing around a little more on the controller I can really say for sure. My concern is that the output stage is a switcher and not really designed for a primarily resistive load. You might end up getting a large AC switching component in your readings that would be hard to detect and make sense of without o-scoping it.

If you do end up trying the heater, start out with the current limit set extremely low and work your way up. I certainly wouldn't try it into a short either.
 

· Registered
Joined
·
904 Posts
David, I am curious if you could point me in the right direction for the data regarding the resting voltage for LiFePo4 cells. This is a very interesting discussion and I want the specs and/or data to look at with regard to what voltage a fully charged cell sits at. Are SE cells different than TS or any of the newer ones in regards to resting voltage?

Thanks,
Dave
Sorry for the delay in responding. I've been dealing with two family emergencies at once so I'm a bit behind.

This is really a bit OT for this thread but I'll post a few things to investigate. Unfortunately I haven't found a single definitive source for this information so I have had to glean from multiple sources including user's experience (and mine), user reports, technical papers and the like.

Watch this video for a good overall understanding to LiFePO4 cells. I recommend watching it more than once if you want to get a better understanding of things: http://chargecar.org/blog/main/Battery_Tech_Talk

This paper is very technical. I originally read it to learn why manufacturers say not to charge LiFePO4 cells when they are below 0°C. If you know your physics and/or chemistry you can get some info out on voltages. It is not for the "faint of heart". :D http://www.tinhoahoc.com/Battery/cr030203g.pdf

There used to be a CALIB spec sheet which showed 3.4V as the "float" voltage but I can no longer find it. I also had an email from someone who posted on the EVDL, they worked for a LiFePO4 battery manufacturer, that in testing that they could fully charge a cell if it were held at 3.4V long enough. I gathered that this was quite a long time but he didn't say how long. He also wouldn't disclose which manufacturer he worked for.

Jukka Järvinen has been testing and using LiFePO4 cells for many years. Search for his name on the EVDL and you will come up with posts by him. Basically he says that if a cell rests above 3.4V then it is evidence that all the Lithium has been moved from one side to the other indicating a fully charged cell. I do know that it takes very few ions to be transferred for the voltage to go from 0V to 3V so it makes sense that a similar thing happens at the fully charged end which my testing agrees with. For the older TS cells he said that they only need to be pushed to near 4V once in a while and at low currents. Charging them to lower voltages between them is definitely beneficial for life span.

Jack Rickard (evtv.me) has done quite a bit of battery testing but it takes a while before you can glean enough info from him to understand why he makes the claims he does. Over the past 2-3 years I have pieced together enough info from him to agree with him on the 3.4V number.

The documentation which came with my TS cells in 2009 say to stop charging when the current drops to 1% of what it was to start with where 0.5C was recommended. This would be an ending current of 0.005C which is quite low. Using this method left cells sitting above 3.5V for several days. I don't know how much of that was due to capacitance of the cells and how much was due to actual Li charge storage. Remember, these LiFePO4 cells are also big capacitors with their hundreds of plates separated by a dielectric.

Finally, the best thing you can do is get some cells and equipment and play with them.

HTH, now I'm going to keep watching this thread because I want to be able to program my Zivan chargers for LiFePO4 charging with both a voltage and current cutoff.
 

· Registered
Joined
·
20 Posts
With my latest attempt to program, I got a beep and a green light. My selector switch is in position 4 for which I have the minimum current set to zero.

A switcher like this should be able to operate with a minimum load. I know the rule of thumb is for a bleeder that provides 10% load, but my charger operates with a much lower load. I am providing the Zivan with two 100w bulbs in series for a load. There is a battery sense line on the control card but it is apparently sensitive to a voltage too high.

I still don't have a good debugging procedure down. I have tried both the mplab internal and the picket3. When programming, should I be in release mode?

Bob
 

· Registered
Joined
·
20 Posts
The Mplab internal debugger I referred to is Mplab sim, which one of the tutorials suggested using.

I have had success in getting the supply to turn on. Switch positions 6 and 7 are the ones that work, not 3 or 4 as I originally thought. I'll figure out the switch later.

I have voltage! With a load of two 100w bulbs in series, the supply comes on. I am able to adjust the voltage from 155 to 189, a good range but far too high. I got a beep to start, and fans are on. I still get a green light. Is that correct?

I have line numbers displayed so I can follow the instructions to make changes. Also, what is the procedure for erasing the present program to write in the modifications?
Bob
 

· Registered
Joined
·
48 Posts
Discussion Starter · #89 ·
You don't have to do anything special to reprogram the device. Just hit the program button again and it will download the new code.

If your LED is green now, it likely means that the program ran through all of the states and you're now sitting in the IDLE state. What is a little troubling though is that the fans are still running. I would expect them to shut off in this state. If you want to verify this, set a break point on line ~230 "state = IDLE;" then hit run. If it stops here then you know where you are in the code.
 

· Registered
Joined
·
20 Posts
I misspoke. The red is also on, making it yellow. I think that means it is in the CV stage, which it is. The voltage is too high, so I think the reference must be too high. I measured the voltage on the A/D pin and it was 4.2. That seems too high so I am going to try to lower it.

Bob
 

· Registered
Joined
·
102 Posts
Switch positions 6 and 7 are the ones that work, not 3 or 4 as I originally thought. I'll figure out the switch later.
I also have a 16-pos switch - a PT65 506L508; the board it's on is labelled "ZR87A1s".

Code:
Switch Bit - Jumper - PORT C Bit
0          - AH     - RC1
3          - TP     - RC2
2          - C1     - RC3
1          - C0     - RC4
I believe this means (although I don't have my replacement chip yet so I can't test it - correct me if I'm wrong) that we (or just me if yours is different :)) should use

Code:
unsigned char get_switch() {
      return TP << 3 |
             C1 << 2 |
             C0 << 1 |
             AH;
}
 

· Registered
Joined
·
904 Posts
Unfortunately, I don't have a switch on my board so I won't be much help.
Don't you have a row of jumper pins on yours? All three of the NG1s I've opened up and my NG3 have a row of jumper pins. One of the NG1s had a rotary switch which was hooked up to the row of jumper pins. The rest of the chargers use standard jumpers.
 

· Registered
Joined
·
102 Posts
Unfortunately, I don't have a switch on my board so I won't be much help.
Sorry - this was aimed at RWAEX, who mentioned that he has a switch that sounds like mine.

Anyway - I've now received my chip, and have plugged it all in on the bench. With nothing plugged in to the charger output, should I be able to see the voltage? The internal A/D input is getting readings (0xBD), but I'm not seeing anything on the actual output connector.

I guess this is where I need some light-bulbs or something?

[edit] More about the rotary switch - I seem to have it right, except that I don't get TP (should be the high bit of the switch value) set i.e. I get 0-7 twice as I go from 0-F on the switch. I'll be checking that I have the switch installed correctly, but does anyone have any other suggestions? (the switch works correctly - checked with a meter...)

[edit again] I may have found the problem - the initialisation function sets ANSELC = 0xE6 (line ~285) which if I'm reading the datasheet right is making LED1/2, SOFT_START, and RC2 into analog inputs (the 0x02 bit is ignored). I changed it to 0xE0 and now I get 0-F from the switch. This would presumably be different if you're going to use a temperature probe on the TP input, which I assume is its original purpose.
 

· Registered
Joined
·
20 Posts
I still have not figured out the switch. I changed line 186 to 45/1024+125 and that had no effect, so I changed line 145 to /60. With this. the minimum output is 132v and I can easily adjust it to 135v. Also, the voltage on the A/D pin is1.85. Should I change line 145 to a lower number? What other lines, including comments, need to be updated?

My car is fully charged so I will need to drive it a few miles to check the current limit.

I think the confusion over the pins is that the rotary switch has the digital inputs reversed from what this program is using. I will check the logic levels of the four digital pins versus the switch position and report that.

Bob
 

· Registered
Joined
·
20 Posts
Here's some data on the rotary switch, if you have one.

Program position 1 is switch position 6
2 8
3 7
4 9

I don't think you should put a heater load to test the CV settings. At startup, the switcher sees the whole supply voltage and you may violate the safe area. On my charger, I blew several IGBTs until I realized I had too big an output capacitor. When the charger is connected to the battery on the Zivan, the output cap is precharged. On mine, I just used a smaller cap, which is only needed for open, or nearly open, circuit testing.

Bob
 

· Registered
Joined
·
48 Posts
Discussion Starter · #98 ·
Crunchtime - The 0xBD you're reading is likely from the battery being disconnected. The analog circuitry is expecting a minimum voltage and without it you can get some unexpected values. What voltage do you see on the a/d pin if you measure it with a meter?

Bob- What was your charger originally configured as? 120V, 132V, or 144V
 

· Registered
Joined
·
102 Posts
Dave - I think I'm going to wait until I have the batteries hooked up - a combination of worsening eyesight, somewhat shaky hands and trying to use meter probes to poke tiny wee pins surrounded by high voltages leads me to think that I might be better off when the things I need to probe are bigger :)

If I hook up the batteries, and then set everything as low as it will go and work up, I hope I won't be able to damage anything...

Bob - if it matters, your numbers lead me to believe that your switch is the same as mine. You should find the following subsets:

Code:
Program   C0.C1  Switch
1         0.0    0,2,4,6
2         0.1    8,10,12,14
3         1.0    1,3,5,7
4         1.1    9,11,13,15
In any case, I'm probably going to remove the hex switch and use one of the jumpers as a BMS HV cut-off just in case, and one as a switch to select 10A or 20A charge rate.
 

· Registered
Joined
·
20 Posts
Crunchtime has a better representation of rotary switch positions. I will use positions 6,8,7,and9. My 914 originally had 20 6 volt batteries. At 7 volts per battery, that would be 140 volts, so if the choice were 142, that would probably be right. The original program arrived at this voltage in stages.

Bob
 
81 - 100 of 143 Posts
Top