I’m trying to create a traction loss indicator gauge.
I have individual wheel speeds from a CAN frame. I am trying to calculate traction loss (rear wheel slip) from the ratio of individual wheel speed and vehicle speed.
The problem is the values for “Wheel Slip RR” and “Wheel Slip RL” are always zero.
I also tried this in gauge math. As soon as I put a reference like ‘Wheel Speed RL’ in the math, the result is always zero.
<frame id="416">
<!-- Vehicle Speed -->
<value targetId="64" name="Vehicle Speed" offset="0" bitcount="12" signed="true" units="km/h"
conversion="V*0.1"></value>
</frame>
<frame id="206">
<!-- Individual Wheel Speeds -->
<value name="Wheel Speed RR" offset="6" length="2" signed="true" units="km/h"
conversion="V*0.0625"></value>
<value name="Wheel Speed RL" offset="4" length="2" signed="true" units="km/h"
conversion="V*0.0625"></value>
<!-- slip is the ratio of driven wheel speed to vehicle speed (ID64) -->
<!-- we add 1 to prevent dividing by zero. abs prevents a problem if speed is -1 -->
<value name="Wheel Slip RR" conversion="'Wheel Speed RR' / (abs(ID64) + 1.0)"></value>
<value name="Wheel Slip RL" conversion="'Wheel Speed RL' / (abs(ID64) + 1.0)"></value>
</frame>