e011046.PDF

(2953 KB) Pobierz
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
GENERAL INTEREST
Modular speed controller for R/C models
Speed Controller Duet
part 1: overview and SpeedControl
Design by B. Stuurman
The interest in speed controllers for R/C models is still just as great as
ever, and we can confidently state that the Speed Controller Duet sets a
new standard in this area. It is a universal system that
can be used in all branches of R/C model building,
including electrically powered aeroplanes, boats and
cars. An equally important feature is that almost every-
thing is programmable, thanks to an RS232 interface
that allows the controller to be linked to a PC.
46
Elektor Electronics
1/2001
 
855738308.062.png 855738308.073.png 855738308.084.png 855738308.001.png
GENERAL INTEREST
The Speed Controller Duet is a mod-
ular system. Its intelligent heart is
formed by the SpeedControl unit.
This microcontroller-based circuit
does not contain any power output
stages. These are instead built as
separate units that are controlled by
the SpeedControl. This division of
functions is actually quite logical.
After all, processing the received
pulses has little in common with dri-
ving electric motors with currents of
several tens of ampères.
There are two types of power stages
for the Speed Controller Duet. Speed-
Power 1 is equipped with two relays
for reversing the polarity of the out-
put voltage, for driving or sailing in
reverse. This unit is thus a perfect fit
for applications in model ships and
cars. SpeedPower 2 is fitted with a
‘brake FET’. This can be used to col-
lapse the folding propeller of an elec-
tric glider. The principle is simple:
the motor is short-circuited by the
brake FET, which causes it
to quickly
slow
down.
Once the
rpm’s have
dropped to a
low enough
value, the
force of the air
stream against
the propeller
blades causes
them to fold
back. This con-
siderably
reduces the wind
resistance of the
aircraft.
In principle, both
types of power
stage are usable
with supply volt-
ages between 7.2
and 12 V, with a
maximum current of 50 A. However,
the relays in the SpeedPower 1 are
rated at 25 A, so it is a good idea not
to go too far beyond this limit. The
SpeedPower 1 and SpeedPower 2 are
both fitted with a Battery Eliminator
Circuit (BEC) rated at 5 V and 1.5 A,
which allows the supply battery for
the receiver to be eliminated.
A particularly interesting aspect of
this modular approach is that several
power units can be connected to the
Figure 1. A bird’s eye view of the Speed Control Duet. The SpeedControl is in the fore-
ground, with the SpeedPower 1 at the left rear and the SpeedPower 2 at the right rear.
SpeedControl. For instance, each
motor of a multi-motor aeroplane
could be fitted with its own power
unit in the motor nacelle. The avail-
able power can thus be doubled in
this manner.
The power units are fitted with fast digital
optocouplers, which allows the inputs and
outputs of all power units of the same type to
be connected in parallel, and the distance to
the SpeedControl can in theory amount to
several metres.
SpeedControl specifications
Maximum voltage:
6.5 V
Minimum voltage:
3.75 V
Current consumption:
10 mA (1 LED on, U=4.5 V)
Input:
polarity:
positive
minimum pulse duration:
0.5 ms
maximum pulse duration:
2.7 ms
minimum repetition interval:
16.6 ms (60 Hz)
maximum repetition interval:
28.6 ms (35 Hz)
Outputs:
1: PWM:
positive duty cycle 0-100%
2: for/back:
1 = reverse
Transmitter adaptation:
intelligent three-point timing
User programming:
using a PC, via RS232
Protocol:
19200, 7, n, 2
Options:
practically everything is programmable
BEC:
yes, via power unit; 5 V / 1.5 A
Cut-off:
yes, adjustable
Digital watchdog:
yes
Gliding motor control:
yes, approx. 0.7 s for 100%
Stand-alone option:
yes, using trimpot
1/2001
Elektor Electronics
47
855738308.003.png 855738308.004.png
GENERAL INTEREST
a little while, since many measure-
ments are taken and then averaged,
so be sure to hold the control stick
steady. After the beep, the control
stick can be moved to the ‘neutral’
position. Pressing the pushbutton
again causes the timing of the ‘neu-
tral’ position to be measured (the
‘med[ium]’ LED is illuminated).
Finally, the full throttle timing can be
measured.
The three timing measurements
must always be made in the
sequence revere, neutral and full
throttle.
If the control stick is at the bottom
when the first measurement is
made, that is the ‘reverse’ position.
On the other hand, if it is at the top
for the first measurement, then
‘reverse’ is at the top.
If the control stick is not moved
between making the reverse and
neutral timing measurements, there
is no reverse (a small amount of hys-
teresis is programmed in for the tran-
sition to reverse).
On completion of the three-point tim-
ing measurements, the controller
resets itself and enters the ‘normal
operation’ mode. This mode begins –
following an initialisation – with
checking the relationship among the
three stick positions. If this is invalid,
the SpeedControl cannot go any fur-
ther, and it lets this be known by
loud beeping.
to the top and measure the ‘full
throttle’ timing. All done!
100%
100%
Example 3
Stick in the middle is stop, stick up
is full throttle and stick down is
reverse (or to switch on the brake
FET).
First set the trim down, since it will
not be used.
Select ‘timing mode’. Move the
stick to the bottom and measure
the ‘reverse’ timing. Then move the
stick to the middle and measure
the ‘neutral’ timing. Finally, move
the stick to the top and measure
the ‘full throttle’ timing. All done!
25%
25%
0%
0%
0%
reversing
20%
neutral
100%
full throttle
Stick position
000070 - 12
Figure 2. Three-point timing illustrated. The
maximum forward and reverse power levels
depend on the choice of the neutral position.
The control characteristics are mirrored about a
vertical line through the neutral point.
Note:
Maximum power is always obtained
in the greater part of the range of
stick motion (see Figure 2 ).
– If the relationship between reverse,
neutral and full throttle is invalid
(which will be the case when the
SpeedControl is switched on), all
three timing LEDs (‘min’, ‘med’ and
‘max’) will be illuminated and the
unit will beep furiously.
– If there are no pulses when the
SpeedControl is switched on, the
‘max’ LED will be illuminated and
there will be a fast beeping signal.
– If the control stick is not in the
‘neutral’ position when the Speed-
Control is switched on, the ‘med’
LED will be illuminated and there
will be a slow beeping signal.
Three-point timing
‘Three-point timing’ forms an essential part
of the SpeedControl concept. This has to do
with how the SpeedControl is linked to the
transmitter, and in particular, to three specific
positions of the control stick.
Three-point timing is based on the following
three positions of the control stick: reverse,
neutral and full throttle. Neutral must lie
between reverse and full throttle, but it may
also be the same as reverse.
In neutral, the motor is always stopped. At
full throttle, the motor is supplied with maxi-
mum power. If neutral is located beyond
reverse, then when the stick is moved
towards reverse, the ‘for/back’ output is first
activated, and after that the power is again
increased from 0%.
In the SpeedPower 1 unit, the ‘for/back’ sig-
nal is used to actuate the relay, while in the
SpeedPower 2 unit it is used to control the
brake FET and block power to the motor.
We can illustrate the versatility of this con-
cept using a few examples. The SpeedControl
unit is assumed to be connected to the
receiver, with the transmitter switched on.
The timing of reverse, neutral and full throt-
tle takes place as follows. If the pushbutton
of the SpeedControl is held down while
power is switched on, the microcontroller will
enter the ‘timing’ mode (under the condition
that the trimmer potentiometer is set to
‘time’), and the three LEDs ‘max’. ‘med’ and
‘min’ will all be illuminated. The control stick
can now be set to the ‘reverse’ position. If the
pushbutton is pressed, the timing of the
‘reverse’ position is measured (as shown by
the ‘min’ LED being illuminated). This takes
Example 1
Stick down is stop, stick up is full
throttle.
First set the trim down, since it will
not be used.
Select ‘timing mode’. Move the
stick to the bottom and measure
the ‘reverse’ timing. Leave the stick
at the bottom and measure the
‘neutral’ timing. Now move the
stick to the top and measure the
‘full throttle’ timing. All done!
During the three-point timing
process, the pause intervals are
measured in addition to the posi-
tions of the control stick. The pulse
repetition intervals are computed
from the measured times, and the
minimum and maximum repetition
intervals (which will normally be the
same) are extracted from the mea-
sured times using a bubble sort.
Small margins are applied to these
times, which are subsequently used
as limit values for judging the valid-
ity of the received signal. If the rep-
etition interval (or rate) deviates
from the measured and calculated
value by more than
Example 2
Stick down is stop, stick up is full
throttle. The trim is used to select
forward/reverse, or to switch on the
brake FET.
Select ‘timing mode’. Set the trim
down and move the stick to the
bottom, and then measure the
‘reverse’ timing. Then set the trim
to the top and measure the ‘neu-
tral’ timing. Finally, move the stick
3 %, the pulse is
not allowed to pass, or during oper-
ation it is regarded as erroneous
(this check can be disabled if
desired). It is thus necessary to carry
out the three-point timing process for
each individual R/C installation.
±
48
Elektor Electronics
1/2001
855738308.005.png 855738308.006.png 855738308.007.png 855738308.008.png 855738308.009.png
GENERAL INTEREST
4...6V
R5
R12
R11
R10
R9
R3
D7
C2
C3
T2
BAT85
D 5
D 4
D 3
D 2
100n
100µ
16V
R6
BC557
BZ1
9
17
1
2
4
5
NMI
PB0
PB1
PB2
PB3
IC1
P1
8
T4
PA0
5k
R14
560
R4
11
PA1
12
PA2
6
7
T3
BC557
PB6
PB7
13
R15
560
PA3
ST6260
F/B
R8
10k
16
20
BC557
RESET
PC2
PC3
PC4
PWM
19
18
T1
T5
R1
10k
3
R13
10k
IN
TEST
RxD
OSC1
OSC2
10
2x
14
15
X1
TxD
BC547
S1
R2
R7
D1
C1
D6
C4
C5
220p
2V3
BAT85
4MHz
18p
18p
RESET
000070 - 11
Figure 3. Schematic diagram of the SpeedControl unit.
The circuit
The schematic diagram of the
SpeedControl is shown in Figure 3 .
The heart of the circuit is the
ST62T60BB6, which is a powerful
microcontroller with a large number
of on-board peripheral circuits, such
as a standard timer, a PWM timer, a
digital watchdog, an A/D converter
and a serial interface (SPI). There are
128 bytes of RAM present, as well as
the same amount of EEPROM, along
with 3384 bytes of program memory
(user ROM/EEPROM). Although the
maximum clock frequency is 8 MHz,
we have here intentionally chosen
4 MHz, since the controller still
works at this clock rate with a sup-
ply voltage of 3.5 V (instead of 4.5 V
at 8 MHz).
The reset circuit, which consists of
D1, T2 and R5–R8, deserves special
attention. D1 is a 2.3-V voltage refer-
ence. The base of T2 is driven via the
voltage divider R5/R6. The threshold
voltage of T2 is around 0.6 V, so
when the supply voltage reaches
4.2 V, T2 starts to conduct and the
reset signal is disabled. This voltage
lies well above the minimum operat-
ing voltage of the microcontroller, so
we can be sure that it will never end
up in an unstable region. The refer-
ence voltage is also connected to
PA0. This port is configured as an
input, and it can be switched over
by the software to act as an ana-
logue input. This allows the value of
the supply voltage to be measured,
in the interest of the cut-off function.
The RS232 interface is truly
extremely simple: just two diodes
(D6 and D7) and one resistor (R13).
The input signal enters via port PC2,
and the output signal exits via port
PC3. PC2 is configured as the input
to the serial interface (SPI) of the
microcontroller, which handles
incoming data on its own, without
any intervention by the ‘core’ hard-
ware. After reception is complete,
the SPI interrupt sets a flag, and the
core can fetch the data. The SPI is
not used for transmitting RS232
data. A software routine for this pur-
pose is present, and it drives PC3.
As it happens, the durations of the
incoming servo pulses are measured
using their rising and falling edges,
each of which generates an inter-
rupt. The NMI and the PA ports can
detect falling edges, while the PC
ports can detect rising edges. It
would thus be really very nice if one
edge could be captured with the
NMI and the other edge with one of
the PC ports. Unfortunately, this can-
not be done, since the SPI occupies
PC4 (as a clock line), so we have no
choice but to use one of the PA ports.
This means that the incoming signal
must be inverted twice, first by T1
for buffering and level conversion
(since the amplitude of the servo
pulse is only 2.5 V with some receivers), and
then again by T5 in order to generate an edge
interrupt via PA2. The rising edge of the
incoming pulse thus generates an NMI inter-
rupt (which takes precedence over all other
interrupts), while the falling edge generates
a PA2 interrupt. The durations of the pulses
and the pauses between pulses are measured
by the built-in timer, which works pretty
much on its own, under control of the inter-
rupt routines.
The other inputs that are present are the trim-
pot P1, whose voltage can be read by the
software, and pushbutton S1. If S1 is held
down while the power is switched on, then
one of three options is chosen, depending on
the previously selected setting of the trimpot.
These are ‘time’, ‘program’ and ‘speed’.
‘Time’ puts us in the three-point timing mode,
which means that after you have released the
pushbutton you will have to press it three
more times in succession (and wait for the
beep) for the reverse, neutral and full throttle
positions. In the ‘program’ mode, the con-
troller can be programmed by the user
entirely according to his or her own prefer-
ences, using a PC. In the ‘speed’ mode, no
servo signal is necessary; the trimpot takes
over the control function, as though it were a
control stick.
All port B lines are configured as outputs.
Each of them can sink or source up to 20 mA.
The buzzer, the LEDs and the outputs to the
power units (‘PWM’ and ‘for/back’) are con-
nected to these lines (the latter two via open-
collector drivers).
In addition to providing status information in
1/2001
Elektor Electronics
49
855738308.010.png 855738308.011.png 855738308.012.png 855738308.013.png 855738308.014.png 855738308.015.png 855738308.016.png 855738308.017.png 855738308.018.png 855738308.019.png 855738308.020.png 855738308.021.png 855738308.022.png 855738308.023.png 855738308.024.png 855738308.025.png 855738308.026.png 855738308.027.png 855738308.028.png 855738308.029.png 855738308.030.png 855738308.031.png 855738308.032.png 855738308.033.png 855738308.034.png 855738308.035.png 855738308.036.png 855738308.037.png 855738308.038.png 855738308.039.png 855738308.040.png 855738308.041.png 855738308.042.png 855738308.043.png 855738308.044.png 855738308.045.png 855738308.046.png 855738308.047.png 855738308.048.png 855738308.049.png 855738308.050.png 855738308.051.png 855738308.052.png 855738308.053.png 855738308.054.png 855738308.055.png 855738308.056.png 855738308.057.png 855738308.058.png 855738308.059.png 855738308.060.png 855738308.061.png 855738308.063.png 855738308.064.png 855738308.065.png 855738308.066.png 855738308.067.png 855738308.068.png 855738308.069.png 855738308.070.png 855738308.071.png 855738308.072.png 855738308.074.png 855738308.075.png 855738308.076.png 855738308.077.png 855738308.078.png 855738308.079.png 855738308.080.png 855738308.081.png 855738308.082.png 855738308.083.png 855738308.085.png 855738308.086.png 855738308.087.png 855738308.088.png 855738308.089.png 855738308.090.png
 
GENERAL INTEREST
Pulse durations and cables
There is little in the way of standardisation to be seen in the area of radio control, but fortunately the differences are not that large, and
nowadays a positive servo pulse is used nearly universally. The following table lists the pulse durations used by the best-known manufac-
turers, along with the repetition rates. The order numbers and colour codes for the servo cables are shown to the right.
Make
Pulse duration (ms)
Servo cable
min
neutral
max
Hz
order no.
+ batt
– batt
pulse
Futaba
0.9
1.5
2.1
50
F1439
red
black
white
Graupner/Jr
0.8
1.5
2.2
50
3941/6
red
brown
orange
Multiplex
1.05
1.6
2.15
40
890412
red
black
yellow
Robbe
0.65
1.3
1.95
50
8182
red
black
white
Simprop
1.2
1.7
2.2
50
0101745
red
blue
black
We used servo cables with Futaba plug/socket sets for the various connections, but you are naturally free to use whatever you wish. If you
want to make up your own cables, bear in mind that genuine servo cables contain very fine stranded wire leads inside a silicone rubber
mantle. The contacts are pressed into the leads, which yields more reliable connections than does soldering. If you solder your own con-
nections, therefore, always finish them with sleeves of heat-shrink tubing.
the core of the software while the
motor is stopped. If this pulse were
to correspond to ‘full throttle’, the
motor would give a tremendous jolt.
Gliding motor control prevents this!
The PWM timer cannot generate out-
puts with 0% or 100% duty cycle,
since spikes are always present in
the output. The software thus
switches PB7 over to operate as a
normal output in such cases, and
sets it to the appropriate state – with
no spikes. The power MOSFETs in
the power units appreciate the
favour.
(000070-1)
special cases, the LEDs have the following
significance in normal operation: the green
LED is illuminated in the ‘no power’ state, the
red LED D3 at ‘full throttle’ and the yellow
LED for intermediate settings. The red LED
D2 is connected to the ‘for/back’ output and
is illuminated when this output is active.
In addition, the three ’power’ LEDs have an
additional meaning if the user option ‘fail’ is
enabled. In this case, these LEDs are illumi-
nated if errors are detected in the incoming
pulse stream (as long as the user has not dis-
abled the ‘reptest’ check).
The final item to be noted in the schematic
diagram is the PWM signal. The PWM timer
(auto-reload timer) is not fed directly from the
main program loop, but instead indirectly via
a ‘sliding’ delay. This means that the outputs
signal can never abruptly change from
stopped to full throttle – this transition is
always ‘sliding’. This reduces the strain on
the motor(s), but what we find even
more important is that this function
enormously increases safety. Sup-
pose that against all odds, a false
pulse should manage to penetrate to
Next month, we will continue with
construction, programming and the
power units.
50
Elektor Electronics
1/2001
855738308.091.png 855738308.092.png 855738308.093.png 855738308.002.png
Zgłoś jeśli naruszono regulamin