SC_12V_24V_Speed_Controller_Pt1.pdf

(7257 KB) Pobierz
Want to control a really big DC motor? This circuit can
handle 12V or 24V DC motors at currents up to 40A.
This 12V or 24V high-current DC Motor Speed Controller is rated
at up to 40A (continuous) and is suitable for heavy-duty motor
applications. All control tasks are monitored by a microcontroller
and as a result, the list of features is extensive.
.I.
controller is based on a PIC16F88
microcontroller. This micro provides
all the fancy features such as bat­
tery monitoring, soft-start and speed
regulation.
It
also monitors the speed
setting potentiometer and drives a
4-digit display board which includes
two pushbuttons.
The 4-digit display board is optional
but we strongly recommend that you
build it, even if you only use it for
the initial set-up.
It
unlocks the full
features of the speed controller and
allows all settings to be adjusted. The
microcontroller will detect whether
30
SILICON CHIP
THIS
COMPLETELY NEW speed
the display board is connected and if
not, the speed controller will support
only the basic functions. In this sim­
ple mode, it will function as a simple
speed regulated controller with auto­
matic soft-start and with the speed be­
ing directly controlled by a pot (VR1).
All the other settings will be the initial
defaults or as last set (with the display
board connected).
When connected, the 4-digit display
allows you to monitor the speed and
the input voltage (useful when running
from a battery).
It
also enables you to
navigate through the various menus
to adjust the settings.
The circuit can run from 12V or 24V
batteries and can drive motors (or re­
sistive loads) up to 40A. Furthermore,
this is our first DC speed controller
(except for out train controllers) incor­
porating speed regulation under load.
In other words, a given motor speed is
maintained, regardless of whether the
motor is driving a heavy load or not.
Monitoring the back-EMF
In speed controllers which do not
have good speed regulation (ie, the vast
majority of designs), the more a motor
is loaded, the more it slows down. In
order to provide speed regulation, the
siliconchip. com.au
:-'';:~~4
.
!7~<?f
circuit must monitor the back-EMF
of the motor, since this parameter is
directly proportional to its speed.
As a result, our new speed controller
monitors the back-EMF of the motor.
"Back-EMF" is the voltage generated
by any motor to oppose the current
through the windings. EMF stands for
"electromotive force" and is an obso­
lete term for voltage. Back-EMF is di­
rectI y proportional to the motor speed
and so by monitoring this parameter,
we have a means of controlling and
maintaining the motor speed.
In practice, the main control loop
of the microcontroller tries to match
the speed of the motor (back-EMF) to
the speed set by the pot or recalled
from a preset memory.
If
the measured
speed is lower than the set speed, the
duty cycle of the pulse width modu­
lation (PWM) signal used to drive the
power Mosfets that control the motor
is gradually increased. In other words,
siliconchip.com.au
if the speed tends to drop, more power
is fed to the motor and vice versa.
The frequency of the pulse width
modulation can be set from 488Hz to
7812Hz. This is a useful feature since
different motors will have differ­
ent frequency responses, as well
as different resonant frequencies.
This is important to reduce the
audible buzzing from the pulse
width modulation, as these fre­
quencies are well within the
range of hearing.
By now you're probably won­
dering how the microcontroller
monitors the back-EMF of the mo­
tor, considering that the motor is
continuously driven with pulse-width
modulated DC. The answer is that the
micro periodically turns off the PWM
signal to the motor for just enough time
for the back-EMF to stabilise. This
"window" needs to be wide enough
to ensure that we are measuring back­
EMF and not the spike generated by the
last PWM pulse. On the other hand, we
don't want the window so wide that
the maximum power to the motor is
significantly reduced or that the motor
noticeably slows.
The compromise value is that the
motor is monitored for 200llS every
7.4ms (ie, about 135 times a second),
as shown in the scope diagrams in
this article. As a result, the fact that
we do monitor the back-EMF around
135 times a second means that the
power applied to the motor is slightly
less than the theoretical maximum,
although this effect is negligible.
A low-battery alarm is also incorpo­
rated to warn when the battery level
drops below a preset value. This is
especially useful for applications like
electric wheelchairs.
There are also eight memory speed
settings. All settings are persistent,
meaning they are retained in non­
volatile memory.
• Good speed regulation under
load
• Automatic soft-start and fast
switch-off
• Eight memory settings
• 4-digit 7-segment display
• Variable frequency for pulse
width modulation (PWM)
• Battery level meter
• Low-battery alarm
• Persistent settings
&
defaults
• Rated up to 40A continuous
current
• 12-24V
DC
input voltage
dition and sets the duty cycle of the
PWM to 0%. This ensures that when
the motor is sWitc;hed in, its speed will
increase gradually from the stationary
state to the desired speed setting.
Turn-on currents for motors can be
very high and it is desirable to reduce
these surge currents as much as pos­
sible. That is why the automatic soft­
start feature has been incorporated into
the firmware.
It
will ensure that the
motor is brought up to the set speed
gradually.
Fast
switch-off feature
Another feature that has been in­
corporated into the firmware is the
so-called "Fast-off" feature. This
means that the duty cycle of the PW
modulation is set to 0% (turning off the
motor) whenever the selected speed
setting of the pot goes to 0%. Rather
than decreasing the speed gradually,
setting the pot to its lowest setting
turns the motor off immediately.
This design also incorporates our
extensive experience with previous
speed controllers featured in SILICON
CHIP. As a result, it uses four high­
current Mosfets to do the switching
(pulse width modulation), uses very
wide tracks on the PC board and heavy­
duty (40A) terminal blocks to carry the
heavy currents.
Soft start
When the motor is switched off,
perhaps by an external switch in series
with one of its terminals, the voltage
at the drain of the Mosfets will be
OV
(this is due to the voltage divider
used to scale the back-EMF voltage
to within the operating range of the
microcontroller). The microcontroller
converts this analog value to a digital
value using an on-board ADC (analog­
to-digital converter).
The firmware detects this
OV
con­
User interface
Two pushbuttons on the display
board are used to navigate through
the menus, while the pot is used both
to vary the speed and to vary certain
settings.
MARCH 2008
31
1 PC board, code 09103081,
1'24mm x 118mm
2 heavy-duty PC-mount terminal
blocks (3-way) (Altronics
P2053)
l'
8-pin DIP IC socket
1 18-pin DIP IC socket
1 SPOT toggle switch (S1)
1 50A 5AG fuse (F1) (Jaycar
SF1976)
1 60A 5AG fuse holder (Jaycar
SZ2065)
1 12-way pin header (Altronics
P-5502)
1 200mm length 16-way rainbow
cable
1 PC-mount mini piezo beeper
(Jaycar AB3459 or equivalent)
1 220J.lH inductor (L
1)
Jaycar
LF1276 or equivalent)
1 10kQ 16mm PC-mount linear
single-gang pot (VR1)
1 500Q horizontal trimpot (VR2)
Semiconductors
1 PIC16F88-I/P microcontroller
programmed with 091 0308A.
hex (IC1)
1 MC34063 switch mode DC-DC
converter (IC2)
1 BC327 PNP transistor (01)
3 BC337 NPN transistors (02-04)
4 IRF1405 N-channel Mosfets
(05-08) (Jaycar ZT2468)
1 1N4004 diode (01)
1 1N5819 Schottky diode (02)
2 MBR201 OOCT 20A diodes
(Jaycar ZR1 039) OR
1 40EPF06PBF 40A ultra-fast
diode (Farnell 910-1560) (03)
5 1N4745 16V 1W zener diodes
(ZD1-ZD5)
2 1N5364BG 33V 5W zener
diodes (ZD6-ZD7) (Farnell
955-8217)
1 3mm red LED (LED1)
Capacitors
1 2200J.lF 50V low-ESR
electrolytic (Altronics R-6207)
1 470J.lF 16V electrolytic
1 100J.lF 63V electrolytic
1 1OOJ.lF 25V electrolytic
1 10J.lF 25V electrolytic
3 4.7J.lF 16V electrolytic
1 220nF 100V MKT polyester
1 1OOn F 100V MKT polyester
3 1OOnF monolithic
1 470pF ceramic
Resistors (O.25W,
1
%)
233kQ
1 100Q
24.7kQ
156Q
1 3.6kQ
1 22Q 1W
61kQ
415Q
2470Q
31Q
Display Board
1 PC board, code 09103082,
73mm
x
58mm
1 SPST PC-mount momentary­
contact switch, yellow (Jaycar
SP0722; Altronics S-1 097) (S2)
1 SPST PC-mount momentary­
contact switch, red (Jaycar
SP0720; Altronics S-1095) (S3)
1 16-pin DIP IC socket (optional)
1 100nF monolithic capacitor
Semiconductors
1 74HC595 shift register (IC3)
4 BC337 NPN transistors
(09-012)
4 7-segment common cathode
red LED displays (Jaycar
ZD1855; Altronics Z-0190 )
Resistors (O.25W, 1%)
4470Q
839Q
The two pushbuttons are sensitive
to two types of presses, short and long.
A short press is of the order of half a
second or less while a long press is
one around one second.
To change a setting, a long press
is usually needed. This prevents
unwanted changes to the settings,
which are stored in EEPROM and thus
recalled at the next switch on.
Because of the capabilities offer­
ed by the PIC microcontroller, we
32
SILICON CHIP
have been able to incorporate a large
number of features into the firmware,
as described in the separate panel later
in this article.
Circuit description
The circuit for the speed controller
is shown in Fig.l. As noted previously,
it can work with 12V or 24V batteries
but has been optimised for operation
at 24
V.
Within the circuit itself, there
are two separate voltage rails: +sV for
the microcontroller and +16V for driv­
ing the gates of the Mosfets. Both are
derived from the +24V input supply.
The main input supply is filtered by
a 2200J.lF low ESR capacitor, to mini­
mise high-voltage transients which
can be produced by the inductance
of the battery connecting leads. This
capacitor is absolutely vital to the
proper operation of the speed control­
ler at high currents.
Sl is the power switch and diode
Dl protects the low-power part of
the circuit (TCl
&
IC2) from reverse
polarity. A 22Q 1W resistor, a 33V SW
zener diode (ZD7) and a 100J.lF capaci­
tor also protect the MC34063 IC from
transients on the supply rail.
The filtered supply is then fed to
the MC34063 (TC2) which operates
in a standard step-down converter
configuration to provide the +sV rail.
Three lQ resistors between pins 6
&
7
are used to set the maximum switch­
ing current. The output voltage is set
by the voltage divider associated with
trimpot VR2.
Only about 200mA is ever drawn
from this supply and most of this is
used to drive the display.
ICl is the heart of the circuit and is
the popular PIC16F88 microcontrol­
leI' which incorporates a number of
peripheral functions. Of these, the
timers, hardware PWM (pulse width
modulation) and three ADC inputs
are used.
The three ADC inputs used are at
pins 1, 2
&
18. As these need to be
within the O-SV range, voltage dividers
consisting of 33kQ and 4. 7kQ resistors
are used to scale both the input voltage
rail (which could be as high as 29V)
and the back-EMF from the motor, to
be fed to the ADC inputs at pins 1
&
18. The ADCs convert the monitored
voltages to lO-bit values.
The +16V rail is used as the gate
drive supply for the Mosfets and is
derived from the 24V supply via a
lkQ resistor and a 16V 1W zener
diode (ZD1). Bypassing of this rail
is particularly important and is ac­
complished using 100J.lF and 100nF
capacitors near ZDl and adjacent to
the transistors Ql
&
Q2.
If
the battery supply is to be 12V,
the lkQ resistor feeding ZDl should
be reduced to 100Q. In this case, the
supply will actually be between 12V
and 14V (depending on the actual bat­
tery voltage); still enough to provide
adequate gate drive for the Mosfets and
siliconchip. com. au
en
g
~
lk
PlElO
Ll 220/iH
3x
10
~
g.
ill
c:::
ii'
8
3
9
_
l00nF
:1
"
OO~
+ 8UllER
VRI
10k
UN
SPEED
4
14
Vdd
r
470/iF.1.i
16V
2
MCLR
AN3
4.7/iF....
t
I
-
k
3.6
2
>--
I1
1
8
SC
...
1
7
Ips
6
Vee
100... +
63V
,..:J:
~
K
~
SE
ORe
I
~K ~Z07
r:
~
220
lW
A
33V
5W
~
I
k
VR2
500
UN
02
lN5819\:/
A
t:;'\
5
COMP
IC2
MC34063
3
Ct'1
+51/
ri
SET
Q4
C 8C337
~
16V:r
~
L
G~
-
(
.AI
E~
~B
4700
~~?.n
I
it\
LEOI
3
ANI 18
RM
4.7k
I
+
.
J.
~
~
33k
.r
Rl
I
~~~~~
~~1W
A
470pF
CD,
K
A
. •
<.
'
..
'
01
lN4004
K
A
...:.
I
)
''0--
+
_A
4.7/iF
16V
}iooo
IFVbot< 16V
\]k IFVbot> 16V
- ­ --
. ""­
~
~
5
6
:
9
10
11
K'-.:;/
A
+5V
lk
1~~F1I+
-
"'"
16V
.----..._-_---1
lr100nF
112200/iF
-
50V
~
220nF:
C
)+
CON1 1 k
,.. 1
:::
P1C16F88~/P
IC 1
AN2 1
15 RA6
Uk
~
a..
~
g
\.:;..
o
<I)
12
1~ :~
RB6
9
RB3
6
7
RBI
4i~~I
1
~
(MOTORBACKEMFI
~
33k
~
I
=
03
\2
.1.
tJ
t:\
A
K
1
r;
­
1
-T
I
....L
MOTOR
8ATTERY
(12-24V)
I
I
10/iFJ:"
251/1
I>-
100nF
••
L
:
4
~
~{Q2
lk
100nFJ.
11
RB5
10 RB4
1",-
2
12
~
LED
R80
v
r-«
B
560
BI7)C Q3
)8C337
E
I
.
. - - - - - - -.......
---_>----~
••
E
Ql
)8C327
150
~D
150
~
A
C
V..
\.!!
E8C337
~Kl:\;:
S
~tV:
S
~I:\;:
S
~I:\~
s
It/
~
G(I:+;
Q5
16V
1W
G(I~
~D
Q6
150
G(I~
~D
Q7
150
GCI~
~D
Q8
K
fr;I:\ZD6
~EJ33V
A
5W
1
5
~~16V
A
lW
~~16V
A
1W
\!.:~16V
A
1W
2
!'v
a
a
co
w
w
:J:l
~
~
~
8C327,8C337
Z01-Z07
A---K
D1-{)3
§!
DC MOTOR SPEED CONTROLLER
~~8~,.~
G .
­
=
o
S
A
K
E
Fig.I: the circuit uses PIC16F88 microcontroller ICI to provide PWM drive to power-Mosfets Q5-Q8 which in turn control the motor. The microcontroller also
monitors the back-EMF from the motor, to provide speed regulation. IC2 is a DC-DC switchmode converter and this provides a +5V rail to power ICI.
DISP 1
DISP 2
DISP 3
D1SP 4
Bx 39n
15
Qo
1
--v.Mr--'-i
Qb
SRCfr·J)I,;.;;O_~
_
-+
_
---Yl/{lr-~5
Qf
'---v.Mr-......=.t
Qg
6
IC3 Sck 11
1
2
---Yl/{lr--4':iQe74HC595Rckt-:
7
---<>-----------'-:-tO
5Inl-'l...;.4
---Yl/{lr-~2
Qc
---Yl/{lr-~3
Qd
~t:>1""3------_-~-~o
-'-+0
I
7
_--Ylr-tv--'-I
Qh
v..
8
470n
470n
Q9-Q12: BC337
470n
470n
B
E
C
(02008
SC
S2
DC MOTOR SPEED CONTROLLER
t
DISPLAY BOARD
Fig.2: the display circuit interfaces to the microcontroller
&
uses a 74HC595 shift register (IC3)
&
transistors Q9­
.Q12 to drive four 7-segment LED displays. Switches S2
&
S3 are used to control the display
&
for software set-up.
+
ensure minimum heat dissipation (low
on-resistance).
The PWM output of the PIC16F88
(adjusted by firmware) appears at pin
6 and drives transistor Q3 which then
drives complementary transistors Ql
&
Q2. Ql, Q2
&
Q3 thus provide buff­
ering and voltage level translation for
ICl 's PWM output to drive the gates of
Mosfets Q5-Q8 via 15n resistors.
Note that these resistors need to be
relatively low in value (ie, 15n) in
order to ensure quick charging and
discharging of the gate capacitances.
That's because the gate capacitance
of these Mosfets can be quite high, of
the order of5000-10,000pF each.
If
the
gate charging time is too long, the Mos­
fets will spend too much time between
the on and off states and this will lead
to much higher heat dissipation.
In fact, the gate voltage transitions
need to be very fast, of the order of 1
~s
or less. This has been accomplished,
as shown by the oscilloscope screen
grab of Fig.4.
The specified Mosfets are from
International Rectifier, type IRF1405.
This is a 55V 169A N-channel Hexfet
with an exceptionally low on-resist­
ance (Rds) of 5.3 milliohms (5.3mn)
typical. Their pulse current rating is
a stupendous 680A.
The IRF1405is specifically intended
for automotive use, in applications
such as electric power steering, anti­
34
SILICON CHIP
lock braking systems (ABS), power
windows and so on and is therefore
ideal for this speed control applica­
tion.
Why
four Mosfets?
In fact, since the ratings of this Mos­
fet are so high, you might think that
just one device on its own would be
enough to handle the 40A rating of this
speed controller project. So why are
we using four Mosfets in parallel?
As always, real world use brings us
down to earth. For a start, we are using
these Mosfets without heatsinks, apart
from the vestigial heatsink effect of
their being bolted to and connected to
the copper side of the PC board - not
much heatsink benefit there. Their
thermal characteristic is 62°C per watt
(junction to ambient), assuming that
are mounted in free air (which they
are not).
Assuming an ambient temperature
of 25°C and an on-resistance of 10mn
(conservative), we can approximate
the temperature of the Mosfets at
their highest operating current (lOA
per Mosfet for a total of 40A). At lOA
and 10mn on-resistance, the power
dissipated is: 10
2
x .01
=
1W
This means that the temperature of
the case will be approximately: 25
+
62 x 1
=
87°C
This means that at full current, the
Mosfets will be very hot to the touch.
Careful: they will burn you. Our meas­
urements produced a top temperature
of around
noc
after a test period of
half an hour.
In practice, even with much higher
ambient temperatures, the Mosfets
should not get quite this hot because
in "real world" operation, the speed
control is not likely to be providing
full power to the motor on a continu­
ous basis. At 24V and 40A, the motor
would have 960W applied (ie, more
than IHP) and this equates to relatively
high power operation.
Protection
Zener diodes ZD2-ZD5 are included
to protect the Mosfets from excessive
gate voltages. In normal circuit opera­
tion, these zener diodes do nothing.
Additional protection for the drains
of the paralleled Mosfets is provided
by 33V 5W zener diode ZD6, in paral­
lel with a 100nF capacitor. The zener
is there to clip any residual voltage
transients which get past the
2200~F
low-ESR input filter capacitor.
The Mosfets are further protected by
fast-recovery diode D3 and its parallel
220nF capacitor. These parts are wired
across the motor terminals and are
used to suppress the high back-EMF
spikes caused by the armature induct­
ance when the motor is switched off
by the Mosfets.
These components are crucial to
siliconchip. com. au
Zgłoś jeśli naruszono regulamin