Friday, April 16, 2010

Sbilife Unit Plus 2 Pension

battery monitor / management for LIPOS new processor, new display ad itself

So now is restarted with new hardware! The ATtiny2313 was definitely not too. But the display was too large. To access useful and installation dimensions are sufficient memory I replaced the parts with more appropriate. What's hot in the program or during the operation? The configuration menu is running! I can now parameterize the system without the microprocessor to reprogram it. However, the whole is still very memory intensive. Since I have to turn so cheap even fit in more features. Hardware: 1 new display instead of the old NO NAME is now a part of EA DIP204 been used. These things are right now, what is sold everywhere. Only 68 * 26 mm in size and also inexpensive. AAAAAAAber ............ the controller ....... The part is different than the others .... In Bascom must be the thing a little differently configured otherwise, the lines and letters thrown into turmoil. So it was not broken, as I thought at first. Just one little thing, but says no one can! Whole Internet forums deal with the topic. The solutions are far too complicated! Since libraries do not need to be edited! it suffices to display the Config Lcd = 20 * 4, Chipset = Ks077 to declare (not a typo) rather than Config Lcd = 20 * 4 then running! Would only have been nice if someone would have said the one! Reassuring that so many others stumbled over this problem. Well, yes, if running a great display! The processor is now an Atmega 48 is a further development of the Atmega 8 but with the 4k memory but there are 8 or 16k than 88 or 168th I will try to get along with 4k. (Hmmmmm. ..................) This is what allows the "free" version at the Bascom code. New to the program: There is now a configuration menu and the Eistellungen are stored in EEPROM, so that after switching everything is back.


Cell count, high and low thresholds can be set.

The function is fine, but the memory footprint is too large.

After all, it is already too many additional functions mal.Aber I could pack so no more. I've since been an idea, but has yet to be implemented ....... wait ..........

is important that the storing and reading out the values folded in and out of the EEprom. It does!






The keys must be associated with interrupts. always trigger the same function, and then must be replaced depending on the menu, the respective values.

missing now basically remains the inclusion of the average value, so the total voltage / cell count, since the total value will be specially measured to be to be out of date (add takes too long) you need for a separate measuring channel,

in certain limits be adjusted for the number of cells must . So I have the Mutiplikator the measuring input for the total stress to make even adjustable. The voltage divider should always have even-numbered ratios, the voltage applied to the AD converter is 5V

To measure I would take the Atmega of the display, which can in 25ms making, in which he has anyway waiting for the response of the measuring units. The value is then never more ms than about 10.

would of course also a collection of used or reloaded energy sensibly.

But whether my current state of knowledge already

enough to get the reliable add ????? In principle, measure only very often, multiply, and subtract or add up. That would be no problem at DC. The whole must also take into account the losses during loading and the different capacities at different temperatures and the aging of the batteries and then again clearly complicated. The energy display is currently still quite far from the rear.
Right now I will just hammer out the rest times useful

.

first times regular monitoring including the consideration of average voltage.


In LIPOS unfortunately the state of charge is very difficult to determine because the voltage says nothing about it. The changes due to temperature and current're doing much more aus.Insofern do not even really
once fixed voltage values as a basis for error sense. A value of 2.5 V as the lower limit is well under acceleration times below, without a full battery it would have a problem. 2.5 V open circuit voltage on the other hand most bedenklich.Die cell is certainly

empty and in danger.


But if take the irritating sound of flashes or beeps sooner or later ......... There's still plenty to do! Then, a configurable control of a balancer with charger.

The use of the vehicle heating Balancerwiderstände as I will not lose sight of, but that's still some time.

Last but not least an energy display. If I should hammer out yet, but what would be for a small series.

But I can not and will as ever now do not make empty promises. I finally have something to do with something else.

so much for today, more on that in the older posts. Addendum April 21, 2010:
I have another small step forward:


The entries and keystrokes and the display in the menu to run differently now. The keys are now running on interrupt, and the display always on the same subroutine. I need not therefore display any more time loop and programmed individually, but only define for each menu level to the changing values and their limits. that has tremendous impact on the program size. The functions remain roughly the same.

"buttons on interrupt" which means that each keystroke immediately interrupts the program and something triggers.

In this case, simply a value increased by ice or decreased. What is it, is defined in the respective menu.

On the one now runs the command much more fluid, for others, has an additional menu level much lower memory requirements.

I am now with the same functionality at 85% instead of 98% of the used flash memory, this is a very important difference, there is still some clean must ................ let's see, obs last!

at least the average voltage monitoring .......... (A lot of effort)
for the battery temperature, or a limit (small, when set)

and the commands for "heating or for balancing! (Little effort)


The residual energy display is certainly an independent module. Slowly I go the numbers for the commands ......... at least read and to zero should go ask, I think this is a device with its own display, etc. somewhere in the trunk and I read only the current value and show it to or not even that which could be coupled with the fuel gauge ..... .......... Why is it gaaaaaaaaaanz employed far back



Addendum April 22, 2010

Now that I have purely programmed also the average voltage monitor and the accompanying menu is once again the memory is full!

Without splash screen and status message after power is possible, but that's not the point.

How are you since then? Take a fixed limit? .. Is the easiest!
average monitoring leave out? I do not want!

revise program ... no longer bears much larger

controller .... obviously, is to some extent already provided for, but .... Since I need the full version of Bascom! about 100 € ..... is probably the best solution! The Atmega 88 costs € 1.85 to € 1.30 instead of the ATmega48 and then has 8k instead of 4k memory. The 88 is pin compatible to the top 48.


Then I'm back "place without end" because then the 168er 16k (2.85 €) could be readily used. (Bill Gates also thought at some point that no one would write full 640k RAM ...................)

The display now fits even for now!

For my other tests I'll leave out the first time average surveillance. The relevant parts of the program so far very useful work, and the storage space problem is solvable, if I do not like the investment in Bascom, but I probably do not come around drum.

My assembler knowledge are still not sufficient to program all of it, this would place the rich loose.



it will come at some point .......





















Here you can see What is currently possible.

from above:

12Zellen, average total voltage 3.60V 43.2V

Highest: Lowest cell 9 with 3.72 V: 3.58 V cell 7 cell 8

was measured just 3.62 V, the vehicle battery has 13, 65 V

come in the bottom line of the status or error messages.

The memory is used to the last byte.

For OK! in the last line of hats no longer served ;-)


letting me now just that easily, as it is.

The other functions, menus and messages
fit quite well, but not simultaneously because of lack of memory.
There has now the full version by Bascom and ATmega88 ago.
(Bascom has bitched not yet, but the ATmega48)

supplement 10.05.2010: I've now found yet another way
to save a little code.
With "debounce" I can program the inputs significantly smaller than the
is currently the case. Moreover, the typing so essential
pleasant. A couple of "locate" and "LCD" can also
wegrationalisieren.und the whole "wait" I do not need anymore.
perhaps the 4k range of ATmega48 yes!
with the number formatting I'm still not quite satisfied.
This must go but also less memory-eating, as
convert until Sting and then there reinzuformatieren the
commas and zeros.
(fusing. ....... We'll see ....)

is now the first time the isolation turn!

supplement 30.04.2010: The galvanic separation is constructed, at least in the transmit direction and seems to work. It could not test them. I've decided for now to realize the isolation of the measuring modules via optocouplers. Certainly if there were more subtle solutions I am thinking of the "ADUM ...." Series, which are signal transmitter based on inductive, as even a DC-DC converter in it that allows you to easily provide measurement units
könnte.Der price is anywhere from 3 € per unit. This is me at the moment too much!
I mean measurement modules will feed directly from the respective cells. As long as the input voltage divider consumes more than the microcontroller, the voltage is measured before everything else meaningless. .... And a controller per cell would require less power but because you could connect the right, but then also would need their own separate supply of each controller.
order again to put everything clear, it is about current consumption in the range of 2mA, which is practically nothing to cells 50-200 Ah so it makes little sense, since what to improve.

I have the "send page" built a little unconventional, but it works just fine. The "maximum configuration with 192 cells I would need 48 Optocoupler drive at the same time. rich (unlikely but it is just provided) should normally 12 optocoupler (48Zellen).
The serial signal is 5V TTL level from the blocks. An implementation on a MAX232 RS232 level brings anything here, the measurement modules I need
Anyhow a 5V TTL signal.
to control as many optocouplers but I need at least a 12V output. Then you could run then 24 x 4 optocoupler in series. I have therefore taken an IC, which is normally a MOSFET driver. A TC4451 The part can drive to about 12V to 2A of continuous current. That's enough for 24 x 5-10 mA pulses (short) all this and more!

The incoming Signal is much easier to handle. As more and sends only a single transmitter and only a single optocoupler is activated. A single optocoupler can drive directly to the Atmega and the output of the optocoupler can expect it even 12V. I will probably transfer the signals to 12V (??????) and driving down share limit computer again / / have to be suppressed by slightly more noise immunity.

Again Addendum (07/05/2010):
I have added a signal. Before any data transmission to the master sent a zero and read to the receive buffer of the serial interface is set to zero. Otherwise I would not notice any problems, because still the old value in the buffer would be ..... The solution found is not optimal. There must be another way around the receive buffer to 0 setzen.Ich the command had not yet found. As a "workaround" I have the master missed a software interface, with which he sends the 0 completely by myself. But this will certainly be much more elegant! But it works.
I have for these tests the old setup with the ATtiny reactivated again in 2313. For these experiments, ranging the old program, and the transducer in the current version are already there with it.
a short video, see:





Because I had it in your hand .....
The display size in comparison
I will probably use the EA DIP204-4. This display is also available in blue with white lettering or white with black lettering. The ribbon cable must have certainly be up to about 30cm. (Not yet tested)
The external display measures 68 x 27 mm and is equipped with cable etc 15mm high.
The amount could be necessary reduzirt to about 11 mm by removing the pins and
anlötet the ribbon cable directly to the board.




(which would have to accommodate somewhere safe)



to the normal operation of my BMS
no switches or buttons need (Three buttons for configuration)
so they can be hidden
"an inconspicuous area" or they are infected only when necessary to .............


To
housing etc. I have not had any thoughts!
The display was supposed to when it can somehow find the inner
existing fittings unit a place.
























The display itself is not much additional electronics
nötig.Hinten is still a pot revolves around the contrast setting,
a support capacitor and resistor for
the lighting. The pot should be later on
motherboard or if there is a PWM output remains
is replaced by an adjustment over the menu.
capacitor and resistor for the lighting
later have not necessarily sit on display.
It is currently compatible with the STK500 board
but uses only 8 wires. Two are free,
's enough even for contrast and lighting
(which should be better supplied with 12V on Ignition). From then
ago so no problem

This is necessary even without the board!

A few more tests with long lines, then I'll even take care of the units of measurement that can last four to measure voltages in series.
The balancer function I will get up and running without optocouplers.
I will probably take P-channel MOSFET, pull-up resistors to hold off and open collector drivers (ICs or transistors, or if necessary, but optocoupler?) Turn on the balancer to ground. (Mass in this case is the lowest point of any
Vierergruppe.Je possibly four, even three times to supply cells to the Atmega
see obs is the way I imagine me.

Addendum 05/18/2010
side just now running The first transducer with readout of four
cells connected in series.

reprogram order not to have to build everything and I did it with a
ATtiny up 24 and the previous program adapted

The whole thing works right away as I had imagined.
had the program I treat the first value different because the
is measured against "mass" of the four packs.
for the other three cells I must have the value of the next lower cell
subtract from value.

to accuracy:
voltage divider is 4:1
Voltage 1 (Zelle13) 0.683 V at the ADC => 2.73 V, the display: 2.77 V)
Spg2 (Zelle14) -0.683 V 1.400 V = 0.717 V => 2.86 V, the display: 2.91 V)
Spg3 (Zelle15) 2.170 V - 1.400 V = 0.77 V = 3.08 V, the display: 3.14 V)
SPG4 (zelle16) 3.034 V - 2.170 V = 0.86 V = 3.46 V, the display: 3.50 V)

Where does the problem occur?
The fact is none at all, or about 2% and
come in from the correction of the other values display.
There is also is the resolution of 0.02 V
which in such case can also double time.
The voltage dividers are still here ........ I have to fit
each transducer just a little more match
, namely the transducer and the display
as I do now for simplicity, then perfectly again.
Because I know where the error is coming from, I'm
for today with the result of very satisfied!!

19/05/2010
The correction is corrected ......... Since the recent
abeiteten converter with 5.05 V instead of 5V as reference
and therefore a little (about 1%) to low values, delivered
I had the corrected in the calculation.
The new converter has but 4.99 V reference, thus
whose output value is in more detail.
Current measurements thus:
Voltage 1 (Zelle13) = 2.74 V, shown in the display: 2.74 V)
Spg2 (Zelle14) = 2.86 V, shown in the display: 2.88 V)
Spg3 (Zelle15) = 3, 10V, the display shows: 3.11 V)
SPG4 (zelle16) = 3.46 V, shown in the display: 3.46 V)
surpasses all the expectations, the better the result
can not be!
As it happens I'll double check with a
very accurate measuring device.

08.06.2010
long .......... nothing new ..........
I just had bit of what else to do ......
There was between a real setback, but I was not really surprised
.
I tried to even the balance function with pure
pack. The ATiny 24 containing just smaller.
emergency 3 packages but nothing is steuernDas 24th with the ATtiny
Except that in any case the pins for four cells rich
are in communication with the software UART
simply too many timing Probleme.Offenbar there are interrupts in the game
and since then the interface gets mixed up when at the same
also still analog values to be read


When I then brought the Atmega 48 PWM function initially only with
Timer 1 to run. However, I need four independently controllable
PWM outputs (two for Timer 0 and 1;.! A go at Timer 2
of today but also with the Timer 0

Config Timer0 = PWM, PWM = On, Compare A = Clear , Prescale = 1
'Config Timer1 = PWM, PWM = A Clear Compare Up, Prescale = 1
'Config Timer2 = PWM, PWM = On, Compare A = Clear, Prescale = 1

For whatever reasons, Timer 0 and 2, just different
be configured. what it was but now I have really failed
not found until now. (but also not really looking) Just because
are 8 bits instead of 10 bit timer?
Timer 1 run in 8 bit mode. We will see ........

Jezter I would even 5 PWM outputs
and 6 AD converter inputs.

emergency or five groups would also be possible, but that seems too much then
me to be.
I have but the program still not on the Atmega 48
adapted and transferred. First I need another one up to several
ATmega48 run independently can.
then continue the experiments.
But it looks good as far as I can already say now.

The serial connection works fine which is tested for some time.
ADC values was read no problem
and the PWM outputs to drive now runs without problems.

That must just have everything in one (1) Program and with the hardware I have
me up a bit as I think the drive balancer-Mosfet
best.

Maybe even P-channel and N-channel mixed ?????
2.5 to 3 Volt is very little as the gate voltage
The heating idea has not given up! For
Balan wallpapering at about 4V, the voltage ranges.

mfG

Franz

0 comments:

Post a Comment