Call me back | My basket | Checkout | Add to email list

     You are here: Website » Knowledge base

« back to website


Processing the SPEEDBOX CAN data

Sometimes it is preferable to take the CAN data from the SPEEBOX and use it to calculate a brake distance completely independently of the SPEEDBOXs internal calculations. This approach is sometimes useful if the SPEEDBOX is to be integrated into systems with other CAN based sensors.

This is certainly possible, but to achieve the full accuracy of the SPEEDBOX considerable care has to be taken. It's highly recommended that a few tests are done and the results generated from the SPEEDBOX directly are compared with the results generated externally from the CAN data. Using the information below it should be possible to get agreement within a few mm between the SPEEDBOXs internally calculated results and those independently calculated from the CAN data.

Timing of the CAN data

For a typical brake test starting at 100kph, the vehicle is moving about 28m every second, or 3cm every ms. Hence it is essential that the fixed CAN latency mode is used on the SPEEDBOX, this sets the latency of the speed message the incoming CAN data to a known value of either 30mS or 150mS. The CAN data must then be logged on a system that time stamps data certain to within 100uS to ensure this doesn't degrade results.

For tests that are triggered on speed (for example 100kph to 2kph) its slightly more accurate to assume that speed samples are spaced by the target update rate rather than use the time stamp from the CAN message. For example if we set the output rate for the speed message to be 200Hz, then it is more accurate to simply assume that there is exactly 5mS between each sample.

Incorrect start trigger time (latency on the trigger)

If the test is started from a external trigger, typically an optical trigger or brake pressure sensor, then alignment of this trigger with the CAN data is very important. As above for a typical braking test starting at 100kph, each 1mS of error in the starting trigger will result in several cm of error. Given this level of sensitivity, it's important to check the accuracy of the time stamping of the input, and completely account for any delays on the sensor output - for example while most optical sensors only have a delay on their output of a fraction of a ms, some are several ms. Typically being certain of the time alignment between the CAN messages and the trigger is the most difficult to arrange.

Triggering at the wrong level, or on the wrong edge

If triggering from an external source, then it's also very important to check that you are triggering at the correct level in the case of an analogue sensor, and in the case of an optical trigger make sure that you are triggering on the correct edge. Note due to the de-bounce logic built into the SPEEDBOX trigger this needs to be triggered on the leading edge (the first edge).

Interpolation of results

If the speed box is set up to output speed on CAN at 200Hz, then at 100kph the distance between samples is about 14cm. So when doing calculations its essential to interpolate between samples, this is equally true when triggering from an external trigger, or triggering from speed. Interpolating linearly between samples is adequate, interpolating with a higher order fit only gives improvements of the order of 0.1mm, which is considered insignificant.

Integration method

The SPEEDBOX outputs a speed measurement, which then has to be integrated to give a distance measurement. The suggested method of integration is trapezoidal.

Distance(k) = ( Speed(k) + Speed(k-1) ) /2 * Sample_Time

Using a rectangle method introduces errors of a significant number of centimetres into a braking distance test, using a high order algorithm only gives a theoretical benefit of fractions of a millimetre.

Page last modified on January 20, 2016, at 10:16 AM