wheelspeed defaulting to 8mph

Discussion on the Lua Scripting capabilities for RaceCapture/Pro. Also see the <a href="http://autosportlabs.net/RaceCapturePro_Lua_Scripting">Lua Scripting Guide</a>

Moderators: JeffC, stieg

Post Reply
MrBlahh
Posts: 45
Joined: Tue Sep 27, 2016 11:13 pm

wheelspeed defaulting to 8mph

Post by MrBlahh »

Not sure what I'm doing wrong, e46/mini code with an average on it, I get a lot of wheelspin and I lift the rear wheels when I autocross and they tend to stop in the air, so I'm averaging the front two tires for the log and harry's laptimer.

This is the wheelspeed code, I'm correcting for my smaller 15" track/autocross tires

function processWheel(id, data, offset)
--wheel speed is 13 bits long, little endian
--low byte high byte
--76543210 76543210
--11111111 11111XXX
local highByte = bit.band(data[offset + 2], 0x1F)
local lowByte = data[offset + 1]
local value = highByte * 256 + lowByte
value = value * 0.0625
--convert to MPH. comment to keep KPH
value = value * 0.621371
--15" wheel correction
value = value * .9468
setChannel(id, value)
end


this is the wheelspeed data that I'm using, it's defaulting to 8mph when I'm at a standstill and the car is shut off

setChannel(AvgWheelId, ((lfWheelId + rfWheelId) /2))

Post Reply