Display Road Speed from ABS using a Maths Channel on PicoScope
Use an ABS Sensor to calculate Road Speed from ABS using Maths Channel. You can create a speed waveform in km or miles per hour. Most ABS Sensors use a toothed wheel to detect wheel rotation, every time a tooth passes the sensor a pulse is generated. In this example calculation, there are 48 pulses per rotation of the wheel.
Simplify your Calculations
The Maths Channel can perform many calculations on each sample. Considering that there are often more than a million samples, it is prudent to minimise the number of calculations that need to be performed to avoid slowing down the waveform display. Many maths formulae can be simplified to reduce the number of calculations especially where the value of some of the variables is known in advance. In this example, we will see how you can reduce the complexity of the Maths Channel calculation substantially by doing a few up-front calculations.
Pre-calculate the Tyre Circumference
You are trying to determine the vehicle’s speed so we need to know how far it travels each time the wheel turns. You can get this information from the tyre specifications, or you could measure the tyre’s circumference using a tape measure. We will use an example tyre size: 215/45R17. The tyre size specification really seems to have been designed by a committee!
- The first figure 215 is the tyre width in mm
- The second figure 45 is the tyre height expressed as a percentage of the width
- The R means Radial
- The third figure 17 is the Rim Diameter in inches
The tyre height in mm is calculated by multiplying the width by the height percentage:
- Tyre Height (mm) = 215mm * 45% = 96.75mm
The Rim Diameter in mm is calculated by multiplying by 25.4mm per inch:
- Rim Diameter (mm) = 17” * 25.4 = 431.8mm
The Total Wheel Diameter is calculated by adding two tyre heights to the rim diameter:
- Wheel Height = (96.75mm * 2) + 431.8 = 625.3mm
Simply multiply the diameter by π (3.14159) and divide by 1000 to find the circumference in metres:
- Wheel Circumference (m) = (625.3mm * π) / 1000 = 1.9644m
Every time the wheel completes one revolution, the vehicle travels 1.9644m.
Pre-calculate the Wheel Rotation Speed from the ABS Sensor Frequency Factor
A factor is a constant number which can be used to scale or convert a value into different units. An example is 25,4mm per inch. You can multiply a length in inches by the factor 25.4 to express the length in mm.
We want a factor that converts the pulse frequency from the ABS Sensor into road speed in km per hour. We will also calculate another factor that converts to miles per hour. If we have pre-calculated a single factor, we have simplified the Maths Channel Calculation to simply, the ABS frequency multiplied by the factor.
The Frequency of the ABS Sensor is the number of teeth passing the sensor every second in Hz. We will use the arbitrary value 144Hz as an example to test our calculations. We know (see the first paragraph) that there are 48 teeth and therefore the wheel rotates at the ABS frequency divided by the number of teeth:
- Wheel Rotation (revs per second) = ABS Frequency (Hz) / Teeth = 144 / 48 = 3 rps
As we are going to measure the speed in km or miles per hour, we need to convert to revs per hour:
- Wheel Rotation (revs / hour) = Wheel Rotation (revs / sec) * 3600 (seconds / hour) = 10,800 rph
Pre-Calculate the Road Speed from Wheel Rotation Speed
You simply multiply the wheel revolutions per hour by the tyre circumference (m) and divide by 1000 to convert to km to get the road speed.
- Road Speed (km/h) = Tyre Speed (revs / hour) * Tyre Circumference (m) / 1000 (m/km)
- 21.21552 km/h = 10,800 revs / hour * 1.9644 m / 1000 m/km
Calculate the km/h factor
We now know that 144Hz from the ABS Sensor yields a road speed of 21.21552 km/hr so we can calculate the factor by dividing the road speed by the frequency:
- Factor = Road Speed (km/h) / ABS Sensor Frequency (Hz)
- 0.14733 = 21.21552 km/h / 144 Hz
If you are monitoring the ABS sensor using Channel A of your PicoScope, the formula for the Maths Channel is simply: 0.14733 * freq(A)
Calculate the miles / hour factor
You can change the km/h factor into a miles / hour factor. Simply multiplying the factor by the number of miles in a km (0.6213712).
- Miles / hour factor = km / hour factor * 0.6213712 (mile / km)
- 0.0915466 = 0.14733 * 0.6213712 miles / km
The maths channel formula for miles per hour is therefore: 0.0915466 * freq(A)
Summary and Conclusions
- Maths Channel calculations are performed on-the fly for every sample
- Every calculation adds at least a million operations – often more
- Although PicoScope software can do large calculations
- Your computer will slow down
- Waveform refresh times will degrade
- Therefore, always try to simplify your maths calculations to increase performance
Derived from Steve Smith's excellent series on the Maths Channel Maths is Cool on the Pico Auto website.