Professional Documents
Culture Documents
Kischel
R/C Analyser
a digital tachograph for R/C model cars
The R/C analyser measures the speed obtained as a ‘by-product’. pinion, using a different motor, or
of a model vehicle. The speed is meas- The rate at which the main gear- using a different gearbox, in order to
ured directly in the R/C vehicle, rather wheel is spinning is continually optimise the configuration of the R/C
than being computed from the num- measured using a rotational speed model and allow the motor to run in
ber of laps and elapsed time. This sensor. This continual measurement its optimum speed range. This gives
means that the speed, and in particu- also allows a wide variety of other ambitious model car racers a real
lar the top speed, can be determined factors to be tested and analysed, advantage.
for individual curves and straight- such as the effect of varying the The speed is measured and
aways. The average lap speed is also sizes of the main gearwheel or motor stored once a second. The current
+5V
C5
1µ IC2
Hall-sensor LP2950CZ-5.0
R1 D1 +5V
16V
H1 2
10k
K1 K1
1 V+ 16 1N4148
C3 C1+ K5
1 C1 C2
6 3 IC3 4...8VDC
1µ C1–
16V 1µ 1µ
H601 2 14
T1OUT T1IN
11
16V 16V
7 7 10
T2OUT T2IN
3 13 12
R1IN R1OUT
8 8 9
R2IN R2OUT
Optical reflective sensor 4 4
C4 C2+
9
R1 R2 MAX232
5 1µ 5 15
C2–
10k
150... K1 16V V-
270Ω
6
SUB D9 C6
IC1
1 3 DISPLAY 2 x 16
1µ
+5V 16V
VDD
VSS
R/W
VO
RS
D7
D6
D5
D4
D3
D2
D1
D0
A
K
2 4 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
R1
CNY70 +5V
14
10k
K2 K3
Optical interrupt sensor K4 4 13
MCLR RB7
IC1 12
R1 R2 RB6
3 11
T0CK/RA4 RB5
270Ω
10k
K1 10
RB4
17 PIC16F627 9
RA0 RB3
18 8
1 IC1 3 RA1 RB2
JP1 JP2 1 7
RA2 RB1
2 6
R RS RA3 RB0
M D
OSC1 OSC2
2 4
16 15 5
S1 X1
CNY37
4MHz
JP1: R = READ OUT
M = MEASURE
JP2: RS = RS232 P1
D = DISPLAY
10k
030178 - 11
Figure 1. Circuit diagram of the R/C analyser, with three different types of sensors.
version of the software allows up to to the microcontroller to allow the optical sensor using reflected light,
120 values to be measured, stored various functions and settings to be or an optical gate sensor.
and then read out after all the laps configured. If an optical gate sensor is used,
have been run. This permits a total The microcontroller can communi- a small hole must be drilled in the
driving time of two minutes to be cate with a PC via an RS232 level main gearwheel of the R/C model to
analysed. In the future, an additional converter. Only the TxD and RxD allow the IR light beam of the sensor
EEPROM will be fitted to the circuit lines are used, so there is no hard- to pass through once per revolution.
board to achieve a measurement ware handshaking. RxD is included The optical gate sensor requires the
time that is limited only by the for future enhancements. A low-drop most space of the three options. The
capacity of the motor battery (which voltage regulator with a voltage drop distance between the arms of the
means approximately 8 to 10 min- of only 0.5 V ensures reliable circuit gate must be adjusted to match the
utes). The predefined measurement operation from a battery power thickness of the main gearwheel.
interval (gate time for counting source. If a reflected-light optical sensor
pulses) can be configured using a Reset pushbutton S1 is used to is used, the main gearwheel must
software parameter. start a measurement session. Trim- have a small reflective spot (consist-
pot P1 allows the contrast of the ing of a piece of glued-on aluminium
display to be continuously foil or white enamel). The distance
Analyser system adjusted. Pin 5 (R/W) of the display between the reflected-light sensor
The R/C analyser system consists of is connected directly to ground, and the reflecting surface can eas-
the analyser board, a rotational since the software does not read ily be as much as 15 mm without
speed sensor (selected from three any data from the display. All con- interfering with the operation of the
options), a display module for view- nections to the power source, rota- sensor.
ing the data at trackside and an tional speed sensor, display, exter- If a Hall sensor is used, a small
RS232 interface for connection to a nal pushbutton and RS232 link are magnet is glued to the main gear-
PC. made using connectors. wheel to induce a pulse for each rev-
The heart (or more precisely, the The system is rounded out by a olution of the gearwheel. The gap
brain) of the analyser system shown program written in Visual Basic, between the sensor and the magnet
in Figure 1 consists of a PIC16F627 which allows the data to be dis- should not exceed 5 mm.
microcontroller with 1 KB of Flash played and analysed in graphic form.
memory and an integrated 128-byte The R/C analyser system is an ‘open’
EEPROM for storing the measured system, so future modifications and Reading
values. The microcontroller, which new features can easily be inte- and displaying
comes in an 18-pin DIL package, grated into the hardware and soft-
measured values
should be fitted in a socket so its ware.
software can be updated in the Three different types of sensors The sensors operate using three dif-
future. It is clocked at 4 MHz by a can be connected to K4: a Hall sen- ferent principles, but they all yield
three-lead ceramic resonator. Two sor (which responds to a magnetic the same result. The IR light beam
jumpers (JP1 and JP2) are connected field, in this case a rotating field), an interrupted or reflected by the main
C5
+ D1
H1
S1 - K1
C3
ROTKELE )C(
1-871030
JP2 JP1 K4 K5 C1 C2
IC2 IC3
X1 IC1 C4
R1 C6
H3
K2
Figure 2. The printed circuit board is
H2
gearwheel, or the magnetic field in started using S1, there is ten-second number, measured value, and num-
the case of the Hall sensor, causes delay programmed into the software ber of revolutions per second (rps) of
the sensor to generate a rectangular (this value can be easily modified) to the main gearwheel are displayed.
pulse waveform that is applied to allow the driver to take his or her The speed can be obtained by a sim-
the microcontroller counter input position at the controls or concen- ple conversion. In a planned future
(RA4). trate on the start. During this delay, version of the software, the speed
This Schmitt-trigger input feeds the values previously stored in the will be shown directly in km/h. The
the pulses to counter TMR0, which internal EEPROM of the PIC are revised version of the software will
counts the falling edges of the pulses erased. allow the conversion factor (distance
and writes the number of pulses per Pushbutton S1 not only starts a travelled per revolution of the main
time unit to the appropriate register, measurement session, it also starts gearwheel) to be set using a config-
as well as to the internal EEPROM data readout and output via the LCD uration parameter.
for long-term storage. The time win- or RS232 interface if JP1 and JP2 are The program for reading the data
dow (1/20, 1/10, 1/2 or 1 s), and with suitably configured (see Table 1). via the serial interface and display-
it the number of possible measure- The measurement data are dis- ing it on a PC is written in Visual
ments, can be configured as desired played using a two-line LCD module Basic for Excel. A simple user inter-
using the software. with 16 characters per line. For each face allows suitable parameters to
When a measurement session is measurement, the measurement be selected and shows the car speed
and motor speed in separate charts.
This is ideal for tasks such as inves-
tigating how different combinations
of pinion size and main gearwheel
size affect the speed of the motor.
troller should be fitted in a socket. If the settings of the two jumpers, and values do not have to be first con-
space is tight, you can use a pin deletes the old measurement values verted, but can instead be entered
header instead of the sub-D socket, from the internal EEPROM. directly into a spreadsheet. The DLL
along with a suitable adapter. file must be copied to the Windows
system directory in the PC.
Driving
Software the serial interface The appropriate functions and
The entire intelligence of the R/C procedures (subroutines) of
analyser system is contained in an The RSAPI.DLL function library RSAPI.DLL are declared in a macro in
assembler program. The individual allows devices to be driven via the the Excel document rclogex3.xls. This
functions, which are programmed as serial interface of the PC. It is typi- informs Basic that it has to use new
separate modules for ease of under- cally used for measurement and con- external functions. These declara-
standing, are called from the main trol applications. Device control is tions are located at the beginning of
routine via jumps. Once each module implemented using macros written the VB module, followed by the rou-
has finished its job, it makes an in VB (Visual BASIC) for standard MS tine for reading the measured values.
orderly return to the main routine. Office programs, such as Word or The interface is initialised and
The main routine initialises the Excel. A particular advantage of this opened using the following configu-
inputs and outputs of the PIC, reads is that the transferred measurement ration parameters: 2400 baud, no
parity bit, 8 data bits and 1 stop bit.
The Excel worksheet rclogger is then
opened and column B, which con-
tains the values from the previous
session, is erased. The macro then
waits for new values. The program
remains in an endless loop (which
can be aborted by pressing the Esc
key) until the pushbutton is pressed
on the R/C analyser to start reading
out the measured values.
When the button is pressed, the
measured values are read line by line
using the function READBYTE. After
the data have been transferred, the
interface is closed using CLOSECOM
and a message dialogue is dis-
played. The data are then displayed
in an easily understood form, as
shown in Figure 3.
(030178-1)
Figure 3. The parameters and measured values are displayed using an Excel
worksheet.