wheelspeed defaulting to 8mph
Posted: Sat Jul 01, 2017 1:03 am
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))
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))