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.
How It Works
How does a car see a wire? A wire carrying a known signal should be detectable, somehow, to the right kind of receiver. It just feels possible. It is, but building the right kind of receiver is a little tricky!
By the end of this guide you will be able to look at the trail tracer hardware and understand how it works. Getting there takes some physics about currents and magnetic fields, and some geometry about two coils set at right angles. But we don’t actually need any tough math, just the right intuition.
Hardware Summary
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, which 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.
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.
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.
Charge Port
The charge port is only used in systems with a charging station. It lets the receiver sense and control charging.
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.
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:
- A current in a wire creates a magnetic field around the wire.
- 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 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.
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.
If the current changes, the field strength changes 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.
Measuring a Magnetic Field
When the field through a coil changes, a voltage appears across the coil’s two ends. How big that voltage is depends on which way the coil faces. I want you to think of a coil as a flat disk, focusing on how you see it’s surface area. Only the field that passes through the coil counts. Field that slips by the edge of the loop does nothing at all.
Light and shadow is a simple way to visualize the same effect. Put a lamp straight overhead and watch how much light the coil area catches. If the coil is trying to get a tan, then lying flat catches the most light. You know that because it casts the biggest shadow. Tilt it and it will catch less light, and its shadow will shrink to an oval. Stand it edge-on and all the light goes right by it, it has no shadow, maybe just a line.
So the coil signal follows how much light it catches through every angle in between: full strength facing the field, about 70% at 45°, and nothing at all edge-on. This is worth stopping on, because it really explains how these coils work.
- What if the light get stronger? The coil catches more light, so its signal gets larger!
- What if the light stays the same, but the coil gets bigger? The coil still catches more light from more area, so the its signal gets larger!
- No matter how bright the light, or how big the coil, the signal will be biggest when the coil perfectly faces the light.
- No matter how bright the light, or how big the coil, if the light hits the coil perfectly edge-on, nothing happens.
If those four points make sense, then you undersand half of how a coil “sees” a magnetic field!
It’s all About Change
Then there’s the other half…
A steady field creates no voltage at all, only a changing field does. You can put the universes’s strongest magnetic field right next to a coil, but if its not changing, the coil sees nothing!
But lets start at zero current, zero field. Say we ramp the current up at a steady rate. The field grows at a steady rate, and the coil instantly jumps to a 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 changes: it follows the rate of change of the current, not the current itself.
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.
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.
Move the coil closer or farther and the coil signal grows or fades.
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, or having a way to listen to only one key of an entire piano while someone bashes on it. 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. There’s a lot going on in a Fourier Transform, but the Trail Tracer only needs a couple small pieces of it, so we’ll skip the complicated stuff. 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.
There is a little bit more we need to take from the fourier transform: Strength can be negative! For us it simply means that the wiggling is upside-down. If you understand a signals strength and sign, then you are just as smart as the Trail Tracer.
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 since that is regulated by the transmitter. The coil signal strength only changes when the coil tilts or moves.
Combining Two Coils
Now we want to use the measured signal 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 strength 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:
- The relative strengths of the two coils give the angle between the sensor and the wire.
- The combined strength of the two coils gives the distance to the wire.
- The two answers come out separately. Angle does not disturb distance, and distance does not disturb angle.
This plot shows the two coils, A and B. As the sensor rolls, the two strengths change. Plot coil A’s strength across as the green arrow, and coil B’s strength up as the purple arrow. The black point is the combination of both signal strengths. There are a few key things to pay attention to in this plot:
- The angle to the plotted point follows the sensor’s roll angle perfectly
- The plotted point traces out a perfect circle
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 to the right. 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’s blue line is the field from the sensor’s point of view, and that makes the roll angle clear.
This plot is exactly the same as the previous one, but we let the coil A and B axis rotate with the sensor. The blue line that represents field strength and direction doesn’t move! That is true because the center of the sensor stays in the same spot relative to the wire, and the magnetic field has perfectly steady strength and direction.
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.
That was a lot of spinning, but the coil 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 only if they are set up just right.
So how does the Trail Tracer manage with two coils? Three assumptions:
- Pitch is zero, relative to the wire. A ground vehicle and the wire both follow the same ground.
- Roll is zero, relative to the wire. Most vehicles do not roll much.
- 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, and customizing the 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!
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. |