Thursday, February 4, 2010

Illustrated Of Ship Parts

A particularly simple PWM control with ATtiny13

..... something completely different in between ........

Because the motor controller was an e-mopeds broken
I have taken up a very old project back
and the most simple Control handicrafts.

controlled time did I "with the TL494.
principle is also very good, but if you then want
have extras such as current limit
or even soft-start, then
is a simple OP amp circuit
very complicated very quickly ..... And because I did not
MOSFET driver chip was in there,
has been requested but warmer than the whole holding.

But it is indeed capable of learning .........

I have again taken an ATtiny13.
(Although I'd pay not to actually before the ATtiny
this blog, but I do like is the halt.
And because Franzis-learning package is based on all
particularly easy to understand)

Since everything is on it. Two AD converters for inputs
two pulse-to-space modulators for PWM outputs.
I need one anyway just ever, but because I find some time
also what a help zBStrombegrenzung
and because the part can also expect there is no
problem because even a few security reinzuzaubern
circuits.
A free pin would be still left

A "BASCOM basic program"
for two! PWM channels in one! ATtiny13:

$ regfile = "attiny13.dat"
$ crystal = 1.2 million
Portb.0 Config = Output 'Config Pin5 PWM0a
Portb.1 = Output' pin 6 PWM0b

Config Timer0 = PWM Prescale = 1, Compare A PWM = Clear Down, B Compare PWM = Clear Down
Config Adc = Single, Prescaler = Auto, Reference = AVCC
Start Adc Dim M As Byte


Dim N As Byte Dim
AD_2 As Integer Dim
AD_3 Integer

Thurs

AD_2 = GetADC (2) 'Pin3 ADC2
AD_2 = AD_2 / 4 to 8 bits '10Bit
M = AD_2' variable for manipulation

AD_3 GetADC = ( 3) 'Pin2 ADC3
AD_3 = AD_3 / 4 to 8 bits '10Bit
N = AD_3' variable for manipulation

Pwm0a = M = N
Pwm0b

Loop End




the ........ enough already continue even as the basis for
!
This program occupies about 34% of the memory

I have it programmed again with BASCOM.
is the fastest and easiest.
ideal for such small projects
be quickly done just once ......

Although the HEX file is significantly larger than
with assembler, but whatever ...
And even if some turn up "professionals" are the nose-
This blog is written by a
ATtiny beginner for beginners.
on processing power is not on,
and the whole program has only about 20 lines. In order to reduce

the angle of rotation of the potentiometer
I began with the Reference to 1.1 V set.
but I have changed and the program
converted accordingly, or simply
limits the value to 255.
So I get the opportunity to adjust the angle of rotation
and especially
install a cable break monitoring
.

The AD converter is by default in BASCOM
set to 10 bits (0-1023) of the PWM output
works with 8 bit (0-255) Convert

Consequently, we ....

Divide by 4 for the full range of rotation or
limit on 255 (if x> 255 then x = 255) or both
combine
fit to the sensitivity.
Since you can play nice ............
For "larger" Atmel can change the
resolution of the PWM outputs.
Perhaps this is also the ATtiny13.
I have not tried yet.
I will occasionally test times.

See also:
http://www.rn-wissen.de/index.php/Bascom_und_PWM

Since the frequencies are also calculated

A small problem is the fact that the
ATtiny during the reset
to "high" on. (Regardless of
as the outputs are configured)

Since at least a jolt goes through the engine,
controls when N-channel MOSFETs directly.
The activation of N-channel Mosfet
must be so inverted.
So must also the starting
either be inverted output (y = 255-x)
or you can not or configure the PWM outputs
also inverting.
Namely: clear clear up instead of down
used to control N-channel MOSFET should be used in any case anyway
an inverting
driver module.
eg TC or MIC4451
for high performance or the TC4431 when operated on directly 24V.
The TC 4431 will cost about 2 €, that must be it. Every other circuit
trick is more likely to be more expensive
everything works.
As mentioned several times to deal with MOSFET
mostly with problems of
timing or too little connected steep flanks.
Especially with high-frequency switching
need good, strong driver stages.

In an emergency, or in special applications where it counts
to minimal size can sometimes
but also make everything a lot easier.

However, no "fine" but rather the very rough
solution!
one or two P-channel MOSFET, the ATtiny
Not even to be directly controlled !!!!!!!!!
For very simple drives (and only there!
eg toys, etc. or model) should satisfy the
well. The
ATtiny then has a negative 5V voltage regulator

at the positive voltage depend.

disadvantages of the circuit: the
Attiny is not grounded.
If only a potentiometer as a donor has the
is not a problem.
for analog measurement inputs is completely inappropriate.
Until you because what fits ..... Here it is reasonable to assume equal
a driver, not for P-channel inverting
P-channel MOSFETs have a much higher internal resistance than
N-channel types.
can ensure that motors run but the
firmly grounded as strong wiper motors, etc. are
Dynastart starter

the times I've built up quite tentative:

1x ATtiny13
1x 7905 voltage regulator
2x IRF4905 P-channel MOSFET (if necessary also at 5V ok)
1x IRF1404 N-channel MOSFET (here only as a diode)
1x pot 5k (value is absolutely critical ca.1k-50k)
a few back-up capacitors
nothing else!

(The LEDs are used only for control)

The mosfet I have connected directly without series
! (Components save! 100R-ev500R would be better)
And the IRF is only passively as a strong 1404 led inside.
should, of course, since a proper fast diode in!
...... lo and behold! it works anyway! Better than expected!

The thing is as it is loose! 30A at 24V control!
(even up to about 10A without a heat sink!)

The tiny "heat sink" is sufficient for about 1 min 30A at 24V.
had not much I expected!





















For a proper circuit
it is much better to use a mosfet driver
. The ATtiny is then
GND and can be controlled better
but as I said, a pinch goes so well.
In some cases (model), there is simply no place
and a soft start of a model locomotive would
such a typical example
or the common, yet manipulable
control of two electric motors, a boat
or a tracked vehicle
(one input on the gas, the other draws)
A regular driver for Mosfets often costs
more than the power transistors it controls,
but only as a really good working
control.
.... But now a very courageous
is contemporary, then it would even be possible to omit the 7905
negative regulator also ........ The works of well
Attiny 2V to 6V ..
the power consumption is minimal.
the load by the MOSFET is low. (Impulse!)
if the resistance of the potentiometer as the load resistance
and would be used (set with diodes in series to about 5 V) the status LED as a voltage limiter

it should go with a matching resistor to ground!
Since the potentiometer is directly related to the reference voltage
small variations in voltage do not care!
I have not tested it yet though!

a more detailed description of the program
coming soon.

basic functions of the "moped" program:

0-position monitoring
(If when you turn the pot not
to 0 starts the engine does not)

circuit monitoring:
If (to break the ground wire of the potentiometer,
the motor would " full throttle "
is therefore disabled in this case.
Full power is already at about 60 °
angle, well ahead at 1.25 V
the AD converter.

switch output at full load at full
the PWM stage is switched
an output.
currently with the Signal for
Potistellung, but it could also
a contactor to bridge the
transistors are operated.

The value of going on the PWM output is not directly included but

tracked the output of the AD converter.
(by greater-less-than comparison is
added in each run one or subtracted)
remain in the program
many opportunities to intervene in the scheme.
tracing the change can be dampened
.
on the second AD converter could be
current limit.
a limit is exceeded, then one could
as 2 or 3 and you subtract the current is limited.
This is not yet installed.

It is once again amazing, with very simple
means we now can build a PWM control


The control by the ATtiny
works great! The clock to 9.6 MHz, then whistles
anything. I have not measured the frequency,
but since the circuit at 4.8 MHz whistles clear
is probably somewhere around 20khz.

and if one chooses the appropriate MOSFET driver and MOSFET
, then
really great benefits be taxable.
I have used for the control moped
a TC4431 as a driver and four IRF1404
as a MOSFET.
(40V 202A TO220 go but 800APeak.
there, the inner life more than the pins!) This would be
loose at 24V 100-150A
create. For a moped reichts
all!
This looks like this:
is not there much on it!


















this I recommend, now there nachzuschauen:

http://www.paulandsabrinasevstuff.com/index.html

The
build an "open source" 144V 500A controller for cars!
There's much more luxurious inside, but the
basic circuit is almost the same.

the clock (PWM) provides here a ATMEGA,
that's around it "luxury", such as temperature and current monitoring etc.

back comes out a PWM cycle.
TTL level as in ATtiny too.
As MOSFET driver is a much stronger set up the
to 12V (best) is operated and the MOSFET are
course "something" but the larger principle
Circuit is still almost identical. The whole logic is
drumrum it by me.
(which in this application is not necessary)
So there are still some reserves and
to find optimization possibilities!

Just a note at the end:
If one uses a MOSFET driver module, then
could build Mandie diode as a controlled
MOSFET (bridged)
or even build a real H-bridge. (2 drivers)
Why the ATtiny finally has two PWM outputs!
A "permanent-field" engine braking then
now and can run back and forth.

I'll build some point, perhaps can
to the pair with a pendant
!?????!
Has anyone even a "Segway" as a model
built??
.... only as a spontaneous idea ..........
but will probably not be as easy ... ;-) --- No matter ....!

mfG Franz

0 comments:

Post a Comment