Friday, June 11, 2010

Is Milena Velbas Director Black

Go on with the BMS !!!!!!

quite fresh:

(sometimes just typed in the lunch break .................)



The hottest Bascom-Listing for my balance / measurement / heating

transducer with Atmega 48

The program is not finished yet!

(The balancer is so natural yet, but

Measure of four cells in series

work ever and the PWM story is also enabled.

the AD converter in between already been read,

songwriter ok so far! It still lacks a limit to the balancer
derHeizfunktion and activate the program must be in the master

changed so that it sends the 255 to be heated when

..............)



Unlike ATiny Atmega 24 of a "right" has

serial interface and which operates independently

The software solution Attiny24 problems entailed, because

was blocked during the transmission of the program.




$ regfile = "m48def.dat" $ crystal = 4000000



$ baud = 1200


Config Adc = Single , Prescaler = Auto , Reference = AvccStart Adc

Dim A As Byte

Dim A1 As Integer

Dim B As Byte

Dim B1 As Integer

Dim D As Byte

Dim E As Byte

Dim F As Byte

Dim Bal1 As Word

Dim Bal2 As Word

Dim Bal3 As Word

Dim Bal4 As Word

Dim Pwm1 As Byte

Dim Pwm2 As Byte

Dim Pwm3 As Byte

Dim Pwm4 As Byte

Dim Pwmx As Byte

'Open "coma.7:1200,8,n,1" For Output As #1'Open "comb.2:1200,8,n,1" For Input As #2
'Config Timer2 = Pwm , Pwm = On, Compare A = Clear, Prescale = 1'Config = Timer0 PWM, PWM = On, Compare A = Clear, Prescale = 1

Config Timer0 = PWM, PWM = On, Compare A PWM = Clear Down, Compare B Pwm = Clear Down, Prescale = 1

Config Timer1 = PWM, PWM = Clear Down Compare A, B Compare PWM = Clear Down, Prescale = 1

Portd.5 Config = Output 'Config OC0B

Portd.6 = Output' OC0A

Portb.1 Config = Output 'Config OC1A

Portb.2 = Output' OC1B

Thurs

D = 0 'not really necessary
If F> 0 Then F = F - 1
Inkey A = () Read the read command

E = A

If E = 255 F = 255 Then 'value is stored for heating Balancer
A = A - 12' -12 at 13-16
If A = 1 Then 'AD converter 1 measures against "mass" A1 = GetADC (1) If A1> 255 Then A1 = 255

D = A1

Printbin D


End If If A> 1 And A < a=" 2">
B = A - 1 'here is the next input taken as reference

GetADC A1 = (a)

GetADC B1 = (b) 'reading of ADC2, 3, 4

A1 = A1 - B1

If A1 < a1 =" 0">
If A1> 255 Then A1 = 255

D = A1 'transformation into a byte

Printbin D ' senden des ByteEnd If

Bal1 = Getadc(1)

If Bal1 > Pwmx And Pwm1 < pwm1 =" Pwm1">
If Bal1 <> 0 Then Pwm1 = Pwm1 - 1

If F > Pwm1 Then Pwm1 = F

Ocr0a = Pwm1
Bal2 = Getadc(2)

If Bal2 > Pwmx And Pwm2 < pwm2 =" Pwm2">
If Bal2 <> 0 Then Pwm2 = Pwm2 - 1

If F > Pwm2 Then Pwm2 = F

Ocr0b = Pwm2
Bal3 = Getadc(3)

If Bal3 > Pwmx And Pwm3 < pwm3 =" Pwm3">
If Bal3 <> 0 Then Pwm3 = Pwm3 - 1

If F > Pwm3 Then Pwm3 = F

Ocr1a = PWM3
Bal4 = GetADC (4)

If Bal4> PWMX And Pwm4 < pwm4 =" Pwm4">
If Bal4 <> Pwm4 = 0 Then Pwm4 - 1

If F> = F Pwm4 Then Pwm4

Ocr1b = Pwm4

Loop End




that moves the text formatting

is annoying .... sorry!
.......... and yet another update:
I've worked a little turn.
The PWM Augänge now working properly!
So who actually has the balancer!
The threshold is now just temporarily on
128 (about 2.5 V) is set and the output is an LED.
the short-circuiting of an input is the particular
LED slowly (in about 1 second), and afterwards again
slowly. So be it!
go from here?
The big question is: should the set Balancerschwelle
be set, or through the master
can be configured?
.... The heating ......
I imagine the way: If
on heating is switched, the Balancerschwelle
by command to around 2.5 - which obviously made 3V
switch through the balancer full and strong heat.
(about 20-25W per cell so the 10A should then be it!!
is not without seeing ................... times ... .......)
The command is of course only one time per
run and therefore needs a function of time.
The threshold must therefore switch back to the correct value when the command longer
not coming back.
here if you would have several values to choose from, then you could in fact
sometimes "below for balancing
burn without having any residual power to have.
must also of course the temperature of the heat sink
be monitored.
I must have a little play ...................
The number of available commands depends on how many cells should be
ultimately managed.
As long as I only send one byte sinds 254 commands altogether.
that is ultimately not sooooviel.
each cell occupies an ever that's for
Then all depends on what you want to know everything
and how it evaluates.
A global status query the metering unit therefore a Atmega,
monitors four cells should be enough. The back has indeed
254 (one byte) answers!
Since it is also in the eight individual bit as much
into code or a table from one erstelllt
prepared answers.
There should be sufficient under normal circumstances 40Zellen (ca.144V)
but in extreme cases, 192Zellen at least as
options are provided when normal AC motors
should be operated with frequency
I'm going to the numbers 1-50 reserved for cells
and the numbers 51-192 as long as it avoided use is not.
The status query a reading should be 201-210
or in case of full serve to 248. (10 to 48 measurement units)
Stay So even 193-200 and 211-254
(when 255 turns on the heating and values such as aircraft battery,
engine temperature, total voltage and current, etc. from the master
be measured directly .... . .. there are still many ways .......
and if you just only a maximum 40 cells proceeds, then
the range of 41 - 200 and 211-254 to use, that's enough)
The master computer is known to me the place in the ATmega48
running low, but since there's still the Atmega 88 or 168, then I can
again "feast".
But since I really want to do with the top 48,
I will first simplify the menu again.
Less text, only variables and only all
save on exit, which might work.
The remaining energy I want to display as an independent module design
...... again demonstrated a command
if the master's is the
The measuring unit is still "space without end" is still there
much! they were also two
analog inputs and a PWM output free.
For temperature measurement per four-pack extends this
Addendum 15/06/2010
first tests with the latest state of the measurement and Balazi-
program Atmega have been very encouraging.
works adorn fairs balanced and generally been very good as far as my
unfinished circuit allows it.
As mentioned earlier, the driving of the MOSFET
the biggest problem.
When a group of four on their own
considered then is the Atmega with one of the cells
to ground. The cells are linked and the tensions
somewhere at 3.6 V, 7.2 V, 10.8 V and 14.4 V.
The Atmega is a 5V regulator of the highest cell
of supplies (2-3mA) The PWM outputs turn out so
between GND and 5V and her.Damit I can only
MOSFET is the drive directly to GND if there is a N-channel MOSFET
ist.Für the other three is not possible.
come here P-channel types are used and there is still a
each driver transistor is required that leads as "open collector" to the gates
Gnd. Again a rather unusual circuit,
but how it works! Thus, a four-group does not need further
Electrical isolation and the fact it came to me.
Only two optocouplers (one for RXD, one for TXD four cells)
and the supply of the Atmega carried out in group of four
The balancer is functional even without a control computer,
each cell is balanced for separately
and the control computer can always consult each cell
and then it is the voltage sent
The accuracy is about + - 0.04V + / -2% that is in range.
that should be enough.
the greatest power used by the way, the input voltage divider
!
missing is a message loop for charge termination
when the first cell is full ..........

mfG

Franz

supplement 25.07.2010:

The silly season is everywhere ........
In recent weeks, gabs do enough other things
so I was certainly never boring!
at BMS is not a lot happening except for some tests,
which are all very positive
The balancer work fine, smooth switching via PWM works fine to solve

Only:
Reliable switch the balancer-voltage limits from the master from
(or should that ever be controlled from there ???????)
message output independently from the master.

What is this?
I want my "master", etc. Thus, the display shows me the values.
(Max Min average temperature error etc)

I think it is dangerous but for the whole Balancersystem
from the master and let the serial connection to be dependent. The
must work independently!
with any loops that signal is interrupted error.
at least the charging process must be controlled Sun

these days I had a completely different idea, which I really want to
into practice.
There are therefore at this point a little break,
and again something completely different in between!
Up soon!
Franz







Thursday, June 10, 2010

How To Fold Decorative Towels

for a change: Lambda control

In between times something else ............

while at the battery management temporarily
slightly hooked (4 x PWM in a block
....) and because I wanted to do for some time
, I finally built my
lambda control. As a pleasant side effect

I was able to solve even my
PWM problem!
So it is with the battery management
forward again soon.
(Measure already works fine, now comes
the balancing function in the units of measure and possibly
the heating of the
Balancerwiderstände ........ has apparently not yet made
or dared .............)
The whole is more of a programming exercise,
obs works in practice is still to come
.

If anyone wants any source code,
Please Sign!
unfortunately I can publish here bad, because the formatting is not compatible
...........
Video / photos is a another time!

mfG
Franz

heart of it all is an ATmega48.
Programmed with Bascom. ('s Always more fun!)
as display the now proven DIP204 EA-4.
The voltage of the lambda probe is to
And the internal 5V reference gemessen.Ich
could take 1.1 V, but also how it works.
Just enough is all!
If I was a potentiometer on the throttle it was so
need better

The probe delivers at 450 mV
mixture is too lean and too rich to 550mV.
The area between is a way to skip
.
(my probe is very old .......
more than 800mV come out of there no longer)

You can not simply amplify the signal but readjust
has another value
slowly in that direction.

over a menu you can adjust the upper and lower
switching point.
as the delay / loss in
opening and closing the auxiliary air valve.
A contact at idle, the valve closes immediately.
(the idle would otherwise "cut")
is on active menu as "to"

The display indicates:
sensor voltage in mV,
the ADC value (5V = 1023)
an arrow indicates whether too lean, ok, or too fat
The state of the PWM output
in%, by value 0-255, and as a bar graph

The course setup values stored in ERAM
and in menu there is a time-
out too long if nothing enters.

As I said, a programming exercise.
could the values have to send out serial
and possibly I need to monitor
or consideration of the throttle position
an engine temperature gauge, maybe?


soon!
Franz