Skip to content

Instantly share code, notes, and snippets.

@kosenko-max
kosenko-max / racecaptureFuel.lua
Last active May 8, 2016 07:10
Fuel controllers management (Easy Performance + Fuellab Prodigy)
initCAN(0, 500000)
setTickRate(1000)
setPwmClockFreq(1250) -- Fuelab recommends 500-1500
local surgePumpVoltage = 2.5
local mainPumpDuty = (90-20)/2 -- Fuelab uses 20%-90% range
local pumpSurgeVoltChannel = addChannel( "pumpSurgeV", 1000, 2, 0, 5, "V" )
local pumpMainDutyChannel = addChannel( "pumpMainD", 1000, 1, 0, 100, "%" )
@kosenko-max
kosenko-max / canmap.cfg
Last active April 10, 2016 11:36
Config file for racecapture3.lua script
-- Copyright 2016 Mash at boostedforums.net
-- TODO: Make converter to single line string with , ; @ delimeters.
-- Address,PID,Priority (1)
-- ,Bits,Name,Min,Max,Unit,Mult(1),Add(0),Signed(0/1 - default 0)
-- ,Bits - skip number of bits forward
-- Length of request calculated automatically
-- Number of digits calculated from multiplicator
@kosenko-max
kosenko-max / racecapture3.lua
Last active June 1, 2024 00:46
Improved version with CAN mapping in the config string
-- Copyright 2016 Mash at boostedforums.net
-- Minify before use by https://mothereff.in/lua-minifier
-- Editor https://ace.c9.io/build/kitchen-sink.html
-- don't remove excessive commas or comments - minify will deal with it
-- ========================= CAN CONFIG =======================================
local canCon ="0x7E1,0x33,10;8,SstTemp,-50,205,C@0x7E1,0x34,10;8,SstMode,1,3@0x7E1,0x36,3;8,Gear,0,11@0x7E1,0xA6;16,SstSlip1,-8500,8500,RPM,1/2,0,1;16,SstSlip2,-8500,8500,RPM,1/2,0,1@0x7E1,0xAA;16,SstPress1,0,30,Bar,1/500,0,1;16,SstPress2,0,30,Bar,1/500,0,1@0x7E1,0xA5;16,SstTemp1,-40,215,C,1/4,0,1;16,SstTemp2,-40,215,C,1/4,0,1@0x7E1,0x38;8,GearTarget,0,11@0x7E1,0xAB;16,SstPosF1,-128,128,mm,1/256,0,1;16,SstPosF2,-128,128,mm,1/256,0,1@0x7E1,0xAC;16,SstPosF3,-128,128,mm,1/256,0,1;16,SstPosF4,-128,128,mm,1/256,0,1@0x7E1,0xAD;16,SstCurF1,0,2048,mA,1/16,0,1;16,SstCurF2,0,2048,mA,1/16,0,1@0x7E1,0xAE;16,SstCurCool,0,2048,mA,1/16,0,1@0x7E1,0xAF;16,SstCurLPS,0,2048,mA,1/16,0,1@0x7E1,0xB0;16,SstShaft1,0,8500,RPM,1/2,0,
@kosenko-max
kosenko-max / racecapture2.lua
Last active June 1, 2024 00:44
Improved version of Evo X RaceCapture Pro script (WORKING)
-- Copyright 2016 Mash at boostedforums.net
-- Minify before use by https://mothereff.in/lua-minifier
-- Editor https://ace.c9.io/build/kitchen-sink.html
-- don't remove excessive commas or comments - minify will deal with it
local afrM = 0.046872 -- AFR Multiplicator - Set own calibration
local afrA = 7.3125 -- AFR Additive - Set own calibration
local mapM = 4/3 -- Set it to 1.0 if stock MAP
local frontO2PID = 0x808661 -- Specific by ROM (this one 5305012
local bToPsi = 14.5037738 -- Set to 1 to get pressures in Bar
@kosenko-max
kosenko-max / racecapture.lua
Last active April 7, 2016 03:28
Evo X RaceCapture Pro logging (requires rewrite to consume less memory and be configurable for different demands)
-- Copyright 2016 Mash at boostedforums.net
-- Minify before use by https://mothereff.in/lua-minifier
-- Next version: https://gist.github.com/kosenko-max/c5cb086292c287e45004
--TODO: ======================== TEPHRA X MOD V3 LOGGING ====================================
--requestCAN(2016,0x805100,0x1E)
--3.2x Higher Precision, larger scale: logs[number_of_logs].load = ((uint)Data[0] * 256 + Data[1]) * 10.0f / 32.0f;
--2 times higher precision: logs[number_of_logs].rpm = ((uint)Data[2] * 256 + Data[3]) * 1000.0f / 256.0f;
--2.5 times higher precision: if (Omni4BAR) {
-- logs[number_of_logs].boost = (((uint)Data[4] * 256 + Data[5]) / 4.0f) * 0.2343f - 14.196f;