Izze Racing Temperature Sensors

Revision as of 16:39, 8 November 2016 by Brentp (talk | contribs) (Created page with "=Izze Racing= image:izze_racing_tire_temperature_seinsor.jpg The [http://www.izzeracing.com Izze Racing] tire temperature sensor provides up to 8 channels of temperature...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Izze Racing

Izze racing tire temperature seinsor.jpg

The Izze Racing tire temperature sensor provides up to 8 channels of temperature per sensor and transmits via CAN bus.

See the Izze Racing documentation for wiring recommendations.

  • CAN baud rate: 1MB
  • Data format: Big Endian
  • Update rate: Up to 32Hz

Lua Script

To enable telemetry channels, import this script into the RaceCapture/Pro Lua scripting window.


--This example is configured for IzzeRacing CAN-bus TireTemp-Sensors
--by www.race-electronic.com

tickRate = 30
CAN_baud = 1000000
CAN_chan = 0 --CAN channel to listen to 0=first CAN channel, 1=second
be_mode = 1 --1 for Big Endian (MSB) mode; 0 for Little Endian mode (LSB)

--add your virtual channels here - format is:
--addChannel( name, sampleRate, [precision], [min], [max], [units])

TiTmpLF1Id = addChannel("TireTmp_LF1", 10, 0, -20, 300, 'degC')
TiTmpLF2Id = addChannel("TireTmp_LF2", 10, 0, -20, 300, 'degC')
TiTmpLF3Id = addChannel("TireTmp_LF3", 10, 0, -20, 300, 'degC')
TiTmpLF4Id = addChannel("TireTmp_LF4", 10, 0, -20, 300, 'degC')
--TiTmpLF5Id = addChannel("TireTmp_LF5", 10, 0, -20, 300, 'degC')
--TiTmpLF6Id = addChannel("TireTmp_LF6", 10, 0, -20, 300, 'degC')
--TiTmpLF7Id = addChannel("TireTmp_LF7", 10, 0, -20, 300, 'degC')
--TiTmpLF8Id = addChannel("TireTmp_LF8", 10, 0, -20, 300, 'degC')

TiTmpRF1Id = addChannel("TireTmp_RF1", 10, 0, -20, 300, 'degC')
TiTmpRF2Id = addChannel("TireTmp_RF2", 10, 0, -20, 300, 'degC')
TiTmpRF3Id = addChannel("TireTmp_RF3", 10, 0, -20, 300, 'degC')
TiTmpRF4Id = addChannel("TireTmp_RF4", 10, 0, -20, 300, 'degC')
--TiTmpRF5Id = addChannel("TireTmp_RF5", 10, 0, -20, 300, 'degC')
--TiTmpRF6Id = addChannel("TireTmp_RF6", 10, 0, -20, 300, 'degC')
--TiTmpRF7Id = addChannel("TireTmp_RF7", 10, 0, -20, 300, 'degC')
--TiTmpRF8Id = addChannel("TireTmp_RF8", 10, 0, -20, 300, 'degC')

TiTmpLR1Id = addChannel("TireTmp_LR1", 10, 0, -20, 300, 'degC')
TiTmpLR2Id = addChannel("TireTmp_LR2", 10, 0, -20, 300, 'degC')
TiTmpLR3Id = addChannel("TireTmp_LR3", 10, 0, -20, 300, 'degC')
TiTmpLR4Id = addChannel("TireTmp_LR4", 10, 0, -20, 300, 'degC')
--TiTmpLR5Id = addChannel("TireTmp_LR5", 10, 0, -20, 300, 'degC')
--TiTmpLR6Id = addChannel("TireTmp_LR6", 10, 0, -20, 300, 'degC')
--TiTmpLR7Id = addChannel("TireTmp_LR7", 10, 0, -20, 300, 'degC')
--TiTmpLR8Id = addChannel("TireTmp_LR8", 10, 0, -20, 300, 'degC')

TiTmpRR1Id = addChannel("TireTmp_RR1", 10, 0, -20, 300, 'degC')
TiTmpRR2Id = addChannel("TireTmp_RR2", 10, 0, -20, 300, 'degC')
TiTmpRR3Id = addChannel("TireTmp_RR3", 10, 0, -20, 300, 'degC')
TiTmpRR4Id = addChannel("TireTmp_RR4", 10, 0, -20, 300, 'degC')
--TiTmpRR5Id = addChannel("TireTmp_RR5", 10, 0, -20, 300, 'degC')
--TiTmpRR6Id = addChannel("TireTmp_RR6", 10, 0, -20, 300, 'degC')
--TiTmpRR7Id = addChannel("TireTmp_RR7", 10, 0, -20, 300, 'degC')
--TiTmpRR8Id = addChannel("TireTmp_RR8", 10, 0, -20, 300, 'degC')


----------------------------------------
--CAN channel mapping format is: 
--[CAN Id] = function(data) map_chan(<chan_id>, data, <CAN offset>, 
--<CAN length>, <multiplier>,<adder>, [filter])
----------------------------------------

CAN_map = {
[1200] = function(data) map_chan(TiTmpLF1Id, data, 0, 2, 0.1, -100)
                        map_chan(TiTmpLF2Id, data, 2, 2, 0.1, -100)
                        map_chan(TiTmpLF3Id, data, 4, 2, 0.1, -100)
                        map_chan(TiTmpLF4Id, data, 6, 2, 0.1, -100) end,
--[1201] = function(data) map_chan(TiTmpLF5Id, data, 0, 2, 0.1, -100)
--                        map_chan(TiTmpLF6Id, data, 2, 2, 0.1, -100)
--                        map_chan(TiTmpLF7Id, data, 4, 2, 0.1, -100)
--                        map_chan(TiTmpLF8Id, data, 6, 2, 0.1, -100) end,
[1204] = function(data) map_chan(TiTmpRF1Id, data, 0, 2, 0.1, -100)
                        map_chan(TiTmpRF2Id, data, 2, 2, 0.1, -100)
                        map_chan(TiTmpRF3Id, data, 4, 2, 0.1, -100)
                        map_chan(TiTmpRF4Id, data, 6, 2, 0.1, -100) end,
--[1205] = function(data) map_chan(TiTmpRF5Id, data, 0, 2, 0.1, -100)
--                        map_chan(TiTmpRF6Id, data, 2, 2, 0.1, -100)
--                        map_chan(TiTmpRF7Id, data, 4, 2, 0.1, -100)
--                        map_chan(TiTmpRF8Id, data, 6, 2, 0.1, -100) end,
[1208] = function(data) map_chan(TiTmpLR1Id, data, 0, 2, 0.1, -100)
                        map_chan(TiTmpLR2Id, data, 2, 2, 0.1, -100)
                        map_chan(TiTmpLR3Id, data, 4, 2, 0.1, -100)
                        map_chan(TiTmpLR4Id, data, 6, 2, 0.1, -100) end,
--[1209] = function(data) map_chan(TiTmpLR5Id, data, 0, 2, 0.1, -100)
--                        map_chan(TiTmpLR6Id, data, 2, 2, 0.1, -100)
--                        map_chan(TiTmpLR7Id, data, 4, 2, 0.1, -100)
--                        map_chan(TiTmpLR8Id, data, 6, 2, 0.1, -100) end,
[1212] = function(data) map_chan(TiTmpRR1Id, data, 0, 2, 0.1, -100)
                        map_chan(TiTmpRR2Id, data, 2, 2, 0.1, -100)
                        map_chan(TiTmpRR3Id, data, 4, 2, 0.1, -100)
                        map_chan(TiTmpRR4Id, data, 6, 2, 0.1, -100) end
--[1213] = function(data) map_chan(TiTmpRR5Id, data, 0, 2, 0.1, -100)
--                        map_chan(TiTmpRR6Id, data, 2, 2, 0.1, -100)
--                        map_chan(TiTmpRR7Id, data, 4, 2, 0.1, -100)
--                        map_chan(TiTmpRR8Id, data, 6, 2, 0.1, -100) end

}


function onTick()
    processCAN(CAN_chan)
end

function processCAN(chan)
    repeat
        local id, e, data = rxCAN(chan)
        if id ~= nil then
            local map = CAN_map[id]
            if map ~= nil then
                map(data)         
            end
        end
    until id == nil
end

--Map CAN channel, little endian format
function map_chan_le(cid, data, offset, len, mult, add, filter)
    offset = offset + 1
    local value = 0
    local shift = 1
    while len > 0 do
        value = value + (data[offset] * shift)
        shift = shift * 256
        offset = offset + 1
        len = len - 1
    end
 local cv = (value * mult) + add
 if filter ~= nil then cv = filter(cv) end
    setChannel(cid, cv)
end

--Map CAN channel, big endian format
function map_chan_be(cid, data, offset, len, mult, add, filter)
    offset = offset + 1
    local value = 0
    while len > 0 do
        value = (value * 256) + data[offset]
        offset = offset + 1
        len = len - 1
    end
 local cv = (value * mult) + add
 if filter ~= nil then cv = filter(cv) end
    setChannel(cid, cv)
end


map_chan = (be_mode == 1) and map_chan_be or map_chan_le
initCAN(CAN_chan, CAN_baud)