📜 ⬆️ ⬇️

Timing for amateur racing, flexible and wireless

Hello.
For some time, I became interested in amateur motor racing - no, not night street racing, but quite legal competitions held in the daytime and agreed with the relevant structures. As many guess, the purpose of such competitions is to drive the distance faster than the opponent. What is necessary to measure the time of passage of a distance.

The easiest way is to hand out stopwatches to the judges and teach them to press the Start / Stop button in time. Obvious disadvantages of this method are unbearable low accuracy and suspicions of the participants about the involvement of judges. Another point - during the 3rd category amateur rally, the start and finish are often separated from each other, and the time is measured at the “synchronized” referee's clock. In practice, these are Chinese alarm clocks of 30 r each, which run away from each other for a few seconds in 10 minutes.

The modern way is to use telemetry. The most common option is one or two target, triggered at the intersection of the infrared beam, and on these intersections control the stopwatch. Seen by me versions of versions (amateur, do not take into account professional systems), left to wish and hope for the best.

Example 1. Rides on a quarter mile (402m), it is - Drag racing. At the start, the IR target is set with the 2nd or 3rd ray pairs. At the finish line there is also a target with a pair of rays, one beam for each track. The starting traffic light is connected to the starting line. At the command of the controller, the traffic light starts counting the starting sequence, after which the participants begin the race. The time is counted from the moment of ignition of the green signal, until the moment of crossing the finish section.
The logic and structure of such a system is obvious. A small minus is half a kilometer of wires connecting the starting and finishing target.
')
Example 2. Ring races on time, the so-called Time Attack. Rides on the ring, at the same time at a distance of 2 participants. The result of arrival is the lap time of the participant, equal to the interval between successive passes of the alignment.
All too obvious. Cons, I saw the implementation:
- the need for each participant to pass only “his” target, which is indicated to him at the start, otherwise the system incorrectly counts the lap time;
- in connection with the previous point - finding a part of the structure in the middle of the strip, which is fraught with consequences - quite often there were attacks on the central rack with the system being inoperative;
- instability of the system to false alarms, if a foreign object passed through the target, such as a downed cone, part of a fallen bumper, etc. This operation led to the termination of arrival, and re-start. And the participant was already driving on the “last money”, with a knocking motor, and tried to win. It's a shame, yes.

Example 3. Rally sprint, start and finish are separated by a decent distance - about a hundred or two hundred meters, participants start at intervals of 2-3 minutes, up to 7-10 cars can be at a distance simultaneously, depending on the length. The time of passing the distance is measured by the actions of two judges - the judge at the start gives the starting essay at a certain time by the clock, the judge at the finish - records the time of the finish by his watch, according to the difference of readings time goes to offset.
The disadvantages of this timekeeping method are the asynchronous hours at the start and at the finish (as I wrote, Chinese alarm clocks are often used from the stall in the transition), and the influence of the human factor (the judge at the start can release the car sooner or later, as well as the finish judge can fix the moment of passage is not accurate enough).

At the next event, having heard plenty of complaints from participants and organizers, I was asked to assemble the system under “their” requirements, for use in amateur motorsport competitions.
The requirements for this system were formed:
- Cheap. According to the organizers, the rental price of a semi-professional system comes to 15 thousand rubles. on the day of the competition - obviously not for enthusiasts this option;
- Ability to adapt to various types of events - drag, ring, rally sprint, etc .;
- Ease of deployment and transportation - a minimum of parts, wires and other accessories;
- Maximum automation of the competition process - counting time, placing results, and more.

In accordance with these requirements, it was decided to implement a modular system, with wireless transmission of information, with the ability to process information on a PC and output the results to a printer or screen.

The modularity of the system consists in creating independent IR gateways that can be placed at a distance in a virtually arbitrary configuration, at the start, at the finish, at an intermediate finish, and so on.
Each target is able to record the time of the beam crossing and transmit the moment of fixation to the central console (the console is implemented on a laptop). The moment of fixation is a complete time stamp, including year, month, day, time with an accuracy of 1 ms. Thus, having information about the moments of crossing the alignment, we can algorithmically implement practically any arrival scheme.
The only requirement in this embodiment is the exact synchronization of the cross sections between each other. This synchronization is carried out using a GPS receiver - they are quite cheap at the moment and easy to use. Synchronization accuracy without the use of special measures - up to 1 Îźs.
In the photo - an experimental card for the alignment capable of processing up to 6 IR rays simultaneously, plus control of the starting traffic light. Why 6 rays? I will explain a little later.

image
image

TSOP4038 receivers are used as infrared detectors, which allow you to receive a “continuous” modulated beam, unlike other series receivers, which simply “shut up” when a continuous beam is applied as a result of the built-in AGC and stop responding to any actions with the beam. For this receiver, the modulation frequency of the infrared beam at 38 kHz is necessary, but experience has shown that this value is rather arbitrary, and the modulation frequency from 32 to 45 kHz is quite suitable for the task.

The radiating device is a TSAL6100 LED, powered by a modulating frequency generator. And placed roughly in the focus of the collecting lens.
About the emitter dwell in more detail. As I wrote earlier, the board in the photo is capable of processing up to 6 rays simultaneously. This is used to set the car on the start line in races with a traffic light. The so-called Pre-Stage, Stage and Start. To accurately put the car on the start line, the Stage beam is located 10-15 cm from the start beam. And at the intersection of this beam, the Stage indicator at the traffic lights lights up, informing the participant about being on the start line and ready to enter.

At first glance, nothing complicated about it. But as practice has shown, it is impossible to arrange two LEDs just at a distance of 10-15 cm and not to light at the same time the “adjacent” sensor. That is, the task is the independent recognition of two rays that run in parallel at a distance of 10–15 cm. Ways of solution: “mechanical” - focus the beam so that it illuminates only its own sensor, “algorithmic” - think of something else.

Focusing the beam with a lens gives an excellent result, the spot size does not exceed 3-4 cm at a distance of 8 m, but there is one “but” - to get such a beam into the receiver is another task, especially when the beam is not visible, and on the street approximately - 25 ° C. And besides, this aiming requires the use of mechanisms that implement the rotation of the radiator in two planes, which complicates the design itself.

The second varinat is to focus the beam in one plane, for which a cylindrical lens would be needed, but I did not find one, and I had to discard this option.

The third option is to divide the rays in a different way. Namely - in time. Since we already have a source of accurate time signals (GPS) on the board, including every beam only at “its own” moment of time, we can independently assess the presence or absence of a signal from each radiator. For this, the GPS receiver module was also installed in the emitter control circuit, which provided the synchronization of signals between themselves.

This solution allowed the beam to “widen”, and the transmitter pointing to the receiver was simplified by an order of magnitude.
A half of the cheapest optical sight was used as the focusing system (the price of the sight is around 150-200 rubles), while the second half is used accordingly for the second radiator.

Another nuisance is the sun's illumination of the receiver; when the receiver was removed to a bright sun, random output pulses were observed at its output, which led to false readings. The solution is a plumbing pipe and food foil :)

Here is how it looks. In the middle - a block with receivers and a wireless module, along the edges - radiators.
image

Data transfer

As a wireless data network, it was decided to use something similar to Zig-Bee, namely, the Xbee-Pro modules (ZigBee itself is, with only some variations). Such modules allow you to deploy a network with minimal programming and configuration costs — in fact, they make the communication channel transparent from the serial interface of the transmitter to the receiver, and vice versa, respectively. Plus version Pro has an increased transmitter power, and, accordingly, the range. On tests, it was possible to achieve stable operation at 500m, using standard antennas of the “pin” type manufactured by D-Link for Wi-Fi routers.
To transfer data to the computer, an Xbee-Usb adapter was assembled on the Xbee-Pro module and the FTDI232 chip.

How it works

A continuous timer is implemented in the receiving unit. It is synchronized using GPS - the microcontroller hardware timer, which provides a count of fractions of a second, is restarted by the 1PPS receiver signal.
Signals from IR receivers are initiated by external microcontroller interrupts. When the beam is interrupted, the current time value is captured and this “tag” is queued for transmission to the console.

Transfer to the remote control is carried out 1 time per second of all counts accumulated at the current moment. The console confirms the reception of the countdown and the confirmed countdown is removed from the transmission queue.
Each sample has the identifier of the signal that has been triggered and the identifier of the target on which the signal has been triggered.

The work of the hardware is done on this. Her task is to detect the moment of beam crossing and transfer this mark to the console.

Further, depending on the type of competition and the configuration of arrival, software enters the business.
image

At the time of receiving the count, a line is displayed with the received timestamp, depending on the source, this mark can be placed in the Start or Finish section, after which time is calculated for tags that have the same number — time from start to finish, lap time and t .P.

In the event of a false positive (flying animal through the target, or pieces of equipment), the tag that is hit is simply removed from the table and does not affect the measurement results in any way.

To ensure the automation of the calculation of the results, each time stamp is assigned the number of the participant who has passed through the target. This option allows timekeeping, regardless of the number of cars on the track at the same time and their relative position.
The only option when the system does not work is a partial overlap of the hulls when passing through one target.
After assigning a number to the label, the results are recalculated and the final table is updated, which can be displayed on a separate large monitor for the audience.
Like this. This table is updated immediately after the participant passes the finish line, thus realizing the “online broadcast” of the results for the audience :)

image

Also in the software implemented the ability to enter the data of each participant: the starting number, name, model of the car, the class in which the athlete is declared. On the basis of the data of this table, the final list of the competitions is formed automatically.

Various modifications (in the process of evolution) of this system were used during the year at several events, such as ice races with a parallel start, a ground sprint with an interval start, and time races "TimeAttak". The system proved to be from the good side - compact design (set on one target is placed in the package from the supermarket) and easy operation.

At the last 2/07/2013 2nd stage “TimeAttak” in Omsk, a variant was tested with outputting results to a large monitor (or rather TV :)) in real time. Spectators and participants of the competition were satisfied).

Components from which the system was assembled:
- micro-controllers: ATMega8 (emitters), ATMega128 (receiving unit)
- GPS modules: Quectel L10
- wireless modules: Xbee Pro 2
- IR receivers: TSOP4038
- ABS plastic casing
- coasters of scrap metal

Results:
- the accuracy of measuring the time of passing the distance is not worse than 1 ms (in the program it is rounded up to 0.01 s for convenience of perception)
- deployment time - 5-10 minutes
- operating time from a set of batteries - not yet determined, for a day is enough for sure, batteries - used 7A / h from an office UPS.
- budget - approximately 5-6 thousand rubles. if you buy parts yourself, I used trash deposits in the workplace 

What else you would like: this configuration requires the participation of the operator to enter the numbers of participants. It is necessary to automate the identification of the participant who passed through the target.

Source: https://habr.com/ru/post/189898/


All Articles