only:nissan TCU torque converter pressure good

This commit is contained in:
rusEFI LLC 2024-06-28 20:54:02 -04:00
parent 4dcf82dffa
commit 3859a4301c
1 changed files with 11 additions and 8 deletions

View File

@ -103,15 +103,15 @@ function getTwoBytesLSB(data, offset, factor)
return (data[offset + 2] * 256 + data[offset + 1]) * factor
end
--function getTwoBytesMSB(data, offset, factor)
-- return (data[offset + 1] * 256 + data[offset + 2]) * factor
--end
function getTwoBytesMSB(data, offset, factor)
return (data[offset + 1] * 256 + data[offset + 2]) * factor
end
local rpm = 0
payloadENGINE_1_505 = {0x20, 0x00, 0x1a, 0x5e, 0x00, 0x00, 0x00, 0x00}
function onENGINE_1_505(bus, id, dlc, data)
rpm = getTwoBytesLSB(data, 2, 0.125)
rpm = getTwoBytesMSB(data, 2, 0.125)
-- RPM
payloadENGINE_1_505[3] = data[3]
payloadENGINE_1_505[4] = data[4]
@ -128,17 +128,20 @@ end
payloadENGINE_7_563 = {0x79, 0xa2, 0x00, 0x18, 0x0e, 0x00, 0x00, 0x01}
function onENGINE_7_563(bus, id, dlc, data)
payloadENGINE_7_563[3] = data[3] -- huh?
-- payloadENGINE_7_563[3] = data[3] -- huh?
payloadENGINE_7_563[4] = data[4] -- RPMlow
payloadENGINE_7_563[7] = data[7] -- RPMhi
txCan(TCU_BUS, ENGINE_7_563, 0, payloadENGINE_7_563)
-- txCan(TCU_BUS, ENGINE_7_563, 0, data)
end
pps = 0
payloadENGINE_3_573 = {0x00, 0x0e, 0x0b, 0x0e, 0x01, 0x38, 0x00, 0x79}
function onENGINE_3_573(bus, id, dlc, data)
payloadENGINE_3_573[1] = data[1]
-- payloadENGINE_3_573[1] = data[1]
payloadENGINE_3_573[2] = data[2]
pps = payloadENGINE_3_573[2] * 0.392
payloadENGINE_3_573[3] = data[3]
payloadENGINE_3_573[7] = data[7]
txCan(TCU_BUS, ENGINE_3_573, 0, payloadENGINE_3_573)
@ -152,7 +155,7 @@ function onENGINE_4_574(bus, id, dlc, data)
-- payloadENGINE_4_574[1] = data[1]
-- payloadENGINE_4_574[2] = data[2]
payloadENGINE_4_574[3] = data[3] -- affects desired torque converter pressure Throttle_position_inverted
payloadENGINE_4_574[4] = data[4]
-- payloadENGINE_4_574[4] = data[4]
-- payloadENGINE_4_574[5] = data[5]
payloadENGINE_4_574[6] = data[6]
payloadENGINE_4_574[7] = data[7] -- affects desired torque converter pressure
@ -243,7 +246,7 @@ everySecondTimer = Timer.new()
function onTick()
if everySecondTimer : getElapsedSeconds() > 1 then
print("rpm " .. rpm)
print("rpm " .. rpm .. " pps " .. pps)
everySecondTimer : reset()
print("Total from ECU " ..totalEcuMessages .." from TCU " ..totalTcuMessages .." dropped=" ..totalDropped .." replaced " ..totalReplaced)
end