Trail Tracer

The Trail Tracer adds self-driving to any normal R/C vehicle, opening up an entirely new way to build, race, and play. Create your own courses, watch your car navigate on its own, and push your builds in ways never thought possible. It’s not just a new feature for R/C cars, it’s a whole new hobby.

The Trail Tracer guides the vehicle along a loop of wire that can be buried in the ground or laid across the surface. The basic set is easy to install and gives the vehicle the ability to follow the wire autonomously, or in a semi-manual “cruise control” mode.

Automatic battery charging can be added with the Charge Port (CP) board and a DIY charging station. Build plans and instructions are in the Advanced Setup tutorial video (in progress). This lets the vehicle drive autonomously 24/7.

Additional capabilities such as multi-vehicle collision avoidance and automatic speed changes can be triggered with the addition of Beacon Transmitter (BTx) boards.

Watch the video on YouTube

How It Works

How does a car see a wire? Here is the hunch this whole guide runs on. A wire carrying a known signal ought to be visible, somehow, to the right kind of receiver. It is. The receiver never sees the wire itself. It sees two numbers, one from each coil on the front bumper, and from the driver’s seat those two numbers are enough to tell you where to drive.

A car following the wire, seen from above with the car held still.  Notice the front wheels turn as the wire slides sideways, and the plot on the right follows the wire the way the receiver sees it.
A car following the wire, seen from above with the car held still. Notice the front wheels turn as the wire slides sideways, and the plot on the right follows the wire the way the receiver sees it.

By the end of this guide you will be able to look at those two numbers and see the wire the way the receiver does: which side it is on, how far away it is, and why the car steers the way it does. Getting there takes some physics about currents and magnetic fields, and some geometry about two coils set at right angles. None of it needs a formula. Where the guide skips something, it says so.

Hardware Summary

The full kit.  Every board in this section, labeled with the name it is sold under.
The full kit. Every board in this section, labeled with the name it is sold under.

Wire

The wire is a closed loop of ordinary insulated wire. It carries a current from the transmitter, and that current creates a magnetic field along the whole wire. The magnetic field is what guides the vehicle. The route the loop takes is the track, and the track can be any shape with a couple restrictions. A vehicle can follow the wire, stay inside it as a boundary, or use it as a landmark. The receiver software decides how the vehicle uses the wire.

Transmitter

The transmitter drives a current onto the wire. It holds the current at a steady strength by adjusting its output voltage, so the field is the same for any track up to about 100 m (300 ft) long. The current is a sine wave with a precise frequency. The transmitter can use any of five frequencies, called channels, so that several tracks can run near or even on top of each other.

The transmitter.  The two wire terminals are on the left, and the five channel lights are on the right.
The transmitter. The two wire terminals are on the left, and the five channel lights are on the right.

Sensor

A sensor is a pair of coils. Each coil is a flat winding of wire that turns a changing magnetic field into a small voltage, the coil signal. The coils are tuned to a band of frequencies that covers all five transmitter channels. A coil only responds to the part of the field that passes through its face, so the two coils are interlocked in an “X”, 90° apart. When one coil sees little of the field, the other sees most of it.

The sensor.  The two coils are inside the black housing, crossed at 90° in an X shape.
The sensor. The two coils are inside the black housing, crossed at 90° in an X shape.

Receiver

The receiver measures the coil signals from each sensor and turns them into a position: where the wire is relative to the vehicle. It also reads up to four servo inputs from a normal R/C receiver and drives up to four servo outputs, all under software control, to steer the vehicle.

The receiver.  Sensor plugs S1 and S2 on the left, servo pins on the right, charge port plug at the front.
The receiver. Sensor plugs S1 and S2 on the left, servo pins on the right, charge port plug at the front.

Charge Port

The charge port is only used in systems with a charging station. It lets the receiver sense and control charging.

The charge port.  It sits between the charge contacts and the battery.
The charge port. It sits between the charge contacts and the battery.

Beacon Transmitter

The beacon transmitter is a small transmitter with its own coil on the same board. It creates a short-range magnetic field at its own frequency. The receiver can sense it and use it to trigger features such as speed changes. In this case, the coil is used to create a field, not measure one, kindof like a tiny track that loops over itself a lot.

The beacon transmitter.  The coil is the board itself.
The beacon transmitter. The coil is the board itself.

System Summary

The receiver reads the wire out to 1.2 m (4 ft). Beyond that it declares the wire lost. It reports the position in millimeters, and near the wire the reading is within ±10 mm of the truth. Noise in the reading grows with distance, so the reading gets rougher the farther the sensor is from the wire. The position updates up to 100 times a second (100 Hz).

A single sensor only gives a correct position when the vehicle is upright and pointed along the wire. The receiver assumes both at startup and whenever the wire comes back into range. If the vehicle rolls, the position reading changes a little even though the vehicle has not moved sideways, because a sensor cannot tell rolling from moving. The physics section explains why.

Physics Explanation

Two facts about electricity and magnetism make the Trail Tracer work:

  1. A current in a wire creates a magnetic field around the wire.
  2. A magnetic field that changes creates a voltage in any coil it passes through.

Creating a Magnetic Field

The transmitter drives current through the wire, and the current creates a magnetic field along the whole track. The track can be any shape. Zoom in anywhere along it, to the scale of the vehicle, and the stretch of wire under the vehicle is close enough to a straight line. The sensor only ever sees that short stretch, so from here on the wire is drawn straight.

A track of any shape, with two close-ups.  Notice that at the vehicle's scale, the wire under the vehicle is nearly straight in both.
A track of any shape, with two close-ups. Notice that at the vehicle's scale, the wire under the vehicle is nearly straight in both.

A long straight wire carrying current creates a magnetic field that wraps around the wire in circles. The field is strongest right at the wire and gets weaker with distance: twice as far away, half as strong. The field also has a direction.

The field wraps around the wire in rings.  Notice the rings fade with distance.
The field wraps around the wire in rings. Notice the rings fade with distance.

Look along the wire with the current flowing away from you, and the field circles clockwise around the wire. The direction matters later, when the sensor uses it to tell which side of the wire it is on.

Looking along the wire, with the current going away from you.  Notice the field circles clockwise and fades with distance.
Looking along the wire, with the current going away from you. Notice the field circles clockwise and fades with distance.

If the current changes, the field strength changes in step with it. If the current reverses, the field reverses. This animation shows what the field does along the whole track as the current swings back and forth.

Notice the field follows the current: strong when the current is strong, reversed when the current reverses.
Notice the field follows the current: strong when the current is strong, reversed when the current reverses.

Measuring a Magnetic Field

When the magnetic field passing through a coil changes, a voltage appears in the coil. Direction matters: the voltage is largest when the field points straight through the coil’s face. One way to picture it is with light and shadows. Say the field points straight down, like light from directly overhead, and picture the coil as a flat disk. Held flat, the disk casts a full round shadow. Tilted, the shadow shrinks to an oval. Turned edge-on, the shadow shrinks to a thin line. The light the disk catches is exactly the shadow it casts: a smaller shadow means more light went past the disk. What matters is how much of the disk’s area faces the light, and it is the same for a coil. What matters is how much of the coil’s area faces the field.

Notice the shadow shrinking as the disk tilts.  A coil "sees" the field the same way.
Notice the shadow shrinking as the disk tilts. A coil "sees" the field the same way.

A coil facing the field squarely gets the full coil signal. A coil edge-on gets none. In between, the coil signal fades smoothly: full strength at no tilt, about 70% at 45°, and zero at 90°. A stronger field gives a stronger coil signal, the same way a brighter light puts more light on the disk.

A steady field creates no voltage at all, as long as nothing moves. Only a changing field does. Say we ramp the current up at a steady rate. The field grows at a steady rate, and the coil gives a steady voltage for as long as the ramp lasts. But a ramp cannot last forever, the current would have to grow without limit, so at some point the ramp has to stop. The moment it stops, the coil signal drops to zero. Ramp the current back down and the coil signal reappears, reversed. The coil signal only responds to change: it follows the rate of change of the current, not the current itself.

Notice the coil signal only appears while the current is ramping, and vanishes the moment the current holds steady.
Notice the coil signal only appears while the current is ramping, and vanishes the moment the current holds steady.

The Trail Tracer uses a sine wave current. A sine wave never stops changing, so the coil signal never stops either. It turns out to be a sine wave too, at the same frequency, shifted a quarter of a cycle in time. That is the reason for choosing a sine wave: one fixed frequency in, the same fixed frequency out. The next section shows why that makes everything downstream simpler.

Notice the coil signal is a sine wave at the same frequency as the current, shifted a quarter of a cycle.
Notice the coil signal is a sine wave at the same frequency as the current, shifted a quarter of a cycle.

Now watch the coil signal as the coil tilts and as it moves. Tilt the coil and the coil signal fades, reaching zero when the coil is edge-on to the field.

Notice the coil signal shrinking to nothing as the coil tilts to 90°.
Notice the coil signal shrinking to nothing as the coil tilts to 90°.

Move the coil closer or farther and the coil signal grows or fades.

Notice the coil signal fading as the coil moves away from the wire.
Notice the coil signal fading as the coil moves away from the wire.

Moving the coil along the wire, without tilting it or changing its distance, changes nothing.

Picking Out the Transmitter’s Frequency

A coil picks up every changing magnetic field around it, not only the one from the wire. An R/C car is full of them: servos, ESCs and motors all make strong, changing magnetic fields, and the coils pick up some of every one. The receiver has to pull the wire’s field out of that mix. It can, because the transmitter’s frequency is fixed and known. Think of tuning a radio to one station and ignoring the rest. The receiver synchronizes to the transmitter’s frequency and ignores everything else. From here on, that is what “synchronize” means.

The tool that does this is the Fourier transform. What happens inside it is a subject of its own, and this guide skips it on purpose. The one thing to take from it is this: once the receiver is synchronized, a sine wave that never stops wiggling turns into one steady number, its strength. Instead of watching the coil signal swing up and down, we ask “how strong is the sine wave right now?” and get a single value that only changes when something real changes.

Notice the wiggling coil signal on the left becomes one steady strength on the right.  The strength only moves when the wiggle grows or shrinks.
Notice the wiggling coil signal on the left becomes one steady strength on the right. The strength only moves when the wiggle grows or shrinks.

Here are the tilt and distance animations again, this time showing the synchronized strengths. The field looks constant now, because the transmitter’s sine wave current has a constant strength. The coil signal strength only changes when the coil tilts or moves.

Notice the strength holds steady until the coil tilts, and reaches zero edge-on.
Notice the strength holds steady until the coil tilts, and reaches zero edge-on.
Notice the strength holds steady until the coil moves, and fades with distance.
Notice the strength holds steady until the coil moves, and fades with distance.

Combining Two Coils

Now we want to use the strength to find where the vehicle is relative to the wire. One coil is not enough. Its strength depends on two things, tilt and distance, and we only get one number from it. There is no way to tell a change in tilt from a change in distance. Worse, at some tilts the coil gets nothing at all. We need more information, and the only way to get it is a second coil.

A second coil at the same tilt as the first tells us nothing new. But a second coil at 90° to the first changes everything. That 90° pair is the sensor. Roll the sensor so that one coil gets zero, and the other coil gets full strength. Three things fall out of the pair:

This plot shows the two coils, A and B. As the sensor rolls, the two strengths change. Plot coil A’s strength across and coil B’s strength up, and plot the point that the two values define. There are a few key things to pay attention to in this plot:

Notice the point tracing a circle as the sensor rolls, and the direction to the point matching the roll angle.
Notice the point tracing a circle as the sensor rolls, and the direction to the point matching the roll angle.

The point’s angle follows the sensor’s roll angle because the two coils split one field between them. At the sensor, the field points one way: straight across the wire. We know if coil A faces the field directly, coil B completely misses. When coil B faces the field directly, coil A misses. Between those angles the coils will share the total signal. The signal strength split works exactly the same way as our plot shows the blue line. That is the whole trick: the plot blue line is the field from the sensor’s point of view, and that makes the roll angle clear.

The point traced a circle because the sensor stayed at one distance from the wire and the current had a constant strength. The distance from the plot center to the plotted point is the field strength, and it does not care about roll. Move the sensor away from the wire and the plotted point moves in toward the center. Move the sensor closer to the wire and the plotted point moves out.

Notice the point moving in and out with distance, whatever the roll angle.
Notice the point moving in and out with distance, whatever the roll angle.

The pair can now tell a change in angle from a change in distance, and that is enough to drive a car!

What the Sensor Cannot Know

What about yaw? Every animation so far kept the yaw fixed. Keep the sensor directly above the wire and yaw it, and both coils change their angle to the field, so both strengths change. We are back to the first problem: three unknowns, two measurements, and no way to tell which one moved.

What about pitch? Every animation so far kept the pitch fixed too. Pitch the sensor while it sits directly above the wire, and the strengths do not change at all. Pitch is invisible there.

Put the sensor directly beside the wire instead, and yaw and pitch swap roles. Between that things are messy.

Count them up and there are five unknowns. Position is two: distance to the side of the wire, and distance above it. The wire is treated as endlessly long, or as a huge loop, so moving along it changes nothing. Sensor angle is three: roll, pitch and yaw. Five unknowns cannot be pinned down with fewer than five coils, and those coils must be spread over two or more places on the vehicle.

So how does the Trail Tracer manage with two coils? Three assumptions:

  1. Pitch is zero, relative to the wire. A ground vehicle and the wire both follow the same ground.
  2. Roll is zero, relative to the wire. Most vehicles do not roll much.
  3. Yaw is zero because the software keeps it there. When the system is working, the vehicle is always pointed along the wire.

That leaves two unknowns, distance to the side of the wire and distance above it, and two coils can find two unknowns. The Trail Tracer supports a second sensor, four coils in all, so advanced applications can pin down up to two more unknowns. Which two depends on where the second sensor is mounted. Skipped on purpose: how a second sensor is used. It needs custom software.

The Driver’s View

Now look at the wire from inside the vehicle, like a tiny driver. From there, the assumptions and the position calculation make more sense. The sensor’s two coils sit in an “X”, each at 45° from vertical, and the sensor is mounted on the front of the vehicle on its centerline. Looking forward like the driver, the question is where the wire is, left or right, and how far. From the driver’s seat the sensor never moves, it is part of the vehicle. The wire moves!

Notice the wire sliding under a sensor that never moves, and the readout following the wire.
Notice the wire sliding under a sensor that never moves, and the readout following the wire.

The relative strengths of the two coils give the angle to the wire, and the combined strength grows as the wire gets closer. The receiver turns those two facts into one number: how far the wire is to the left or right of the vehicle. That is the number under the plot, and it is what the receiver steers on.

The receiver also calculates the height above the wire, but for most vehicles that is not a factor for steering.

Electrical Details

How the boards do all of this, the transmitter’s tuned output, the sensor’s coils and filter, and the receiver’s signal chain, is in a separate page: Trail Tracer Electrical Details.

Vocabulary

Each thing in this guide has exactly one name. Other words may describe a thing, but only one word names it.

Name What it is
wire The closed loop of wire that the transmitter drives current through.
track The route and length of the wire loop.
current What flows in the wire. A sine wave at the transmitter’s frequency.
magnetic field, field What the current creates around the wire.
coil One flat winding on the sensor.
sensor A pair of coils in the 90° “X” arrangement. Sold as the Sensor Coil.
coil signal The voltage a coil produces.
strength How big a sine wave is. After synchronizing, the one steady number per coil.
synchronize The receiver locking on to the transmitter’s frequency and ignoring everything else.
channel One of the five transmitter frequencies.
band The spread of frequencies the coils are tuned to.
distance How far a coil or sensor is from the wire.
range The largest distance at which the receiver still reads the wire, 1.2 m.
tilt Turning a single coil, in the analogies.
roll, pitch, yaw The vehicle’s three rotations.
orientation Which way the sensor faces, all three rotations together.
angle A measured number of degrees.
direction Which way the field or the current points.
position Where the wire is relative to the sensor.
transmitter, receiver, charge port, beacon transmitter The boards, named without “board”.
R/C receiver The radio receiver in the car, not the Trail Tracer receiver.
servo input, servo output The servo lines into and out of the receiver.