Skip to content

Commit

Permalink
Add EGT to CAN format, add enable switches for frames #398
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Mar 21, 2024
1 parent e20bd4d commit 7ae1a6c
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 9 deletions.
2 changes: 2 additions & 0 deletions firmware/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ or
- Added Lua function `getAuxDigital` for parity with rusEFI #351
- Optional table to change after start idle taper time #369 (thank you, Krakert!)
- Increased precision available for Lua tables
- Add EGT values to CAN broadcast format #398
- Add options to enable/disable optional CAN frames (cams, EGT so far)

### Fixed
- Improve performance with Lua CAN reception of a high volume of frames
Expand Down
13 changes: 12 additions & 1 deletion firmware/controllers/can/FOME_CAN_verbose.dbc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION ""


NS_ :
NS_ :
NS_DESC_
CM_
BA_DEF_
Expand Down Expand Up @@ -117,6 +117,16 @@ BO_ 520 BASE8: 8 Vector__XXX
SG_ Cam2E : 48|8@1- (1,0) [-100|100] "deg" Vector__XXX
SG_ Cam2Etar : 56|8@1- (1,0) [-100|100] "deg" Vector__XXX

BO_ 521 BASE9: 8 Vector__XXX
SG_ Egt1 : 0|8@1+ (5,0) [0|1250] "deg C" Vector__XXX
SG_ Egt2 : 8|8@1+ (5,0) [0|1250] "deg C" Vector__XXX
SG_ Egt3 : 16|8@1+ (5,0) [0|1250] "deg C" Vector__XXX
SG_ Egt4 : 24|8@1+ (5,0) [0|1250] "deg C" Vector__XXX
SG_ Egt5 : 32|8@1+ (5,0) [0|1250] "deg C" Vector__XXX
SG_ Egt6 : 40|8@1+ (5,0) [0|1250] "deg C" Vector__XXX
SG_ Egt7 : 48|8@1+ (5,0) [0|1250] "deg C" Vector__XXX
SG_ Egt8 : 56|8@1+ (5,0) [0|1250] "deg C" Vector__XXX



CM_ SG_ 3221225472 AFR "Current AFR Reading
Expand Down Expand Up @@ -177,4 +187,5 @@ CM_ SG_ 520 Cam2I "Cam bank 2 intake actual";
CM_ SG_ 520 Cam2Itar "Cam bank 2 intake target";
CM_ SG_ 520 Cam2E "Cam bank 2 exhaust actual";
CM_ SG_ 520 Cam2Etar "Cam bank 2 exhaust target";
CM_ BO_ 521 "EGT";

17 changes: 16 additions & 1 deletion firmware/controllers/can/can_verbose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,14 @@ static void populateFrame(Cams& msg) {
msg.Bank2ExhaustTarget = engine->outputChannels.vvtTargets[3];
}

struct Egts {
uint8_t egt[8];
};

static void populateFrame(Egts&) {
// TODO: https://github.com/FOME-Tech/fome-fw/issues/398
}

void sendCanVerbose() {
auto base = engineConfiguration->verboseCanBaseAddress;
auto isExt = engineConfiguration->rusefiVerbose29b;
Expand All @@ -222,7 +230,14 @@ void sendCanVerbose() {
transmitStruct<Fueling> (base + 5, isExt, canChannel);
transmitStruct<Fueling2> (base + 6, isExt, canChannel);
transmitStruct<Fueling3> (base + 7, isExt, canChannel);
transmitStruct<Cams> (base + 8, isExt, canChannel);

if (engineConfiguration->canBroadcastCams) {
transmitStruct<Cams> (base + 8, isExt, canChannel);
}

if (engineConfiguration->canBroadcastEgt) {
transmitStruct<Egts> (base + 9, isExt, canChannel);
}
}

#endif // EFI_CAN_SUPPORT
4 changes: 2 additions & 2 deletions firmware/integration/rusefi_config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -977,8 +977,8 @@ bit skippedWheelOnCam,"On camshaft","On crankshaft";Where is your primary skippe
bit useSeparateVeForIdle;This activates a separate fuel table for Idle, this allows fine tuning of the idle fuelling.
bit verboseTriggerSynchDetails;Verbose info in console below engineSnifferRpmThreshold\nenable trigger_details
bit isManualSpinningMode;Usually if we have no trigger events that means engine is stopped\nUnless we are troubleshooting and spinning the engine by hand - this case a longer\ndelay is needed
bit unused1200b12
bit unused1200b13
bit canBroadcastEgt;Disable to skip cam data frame (base + 9) if you have no EGT sensing.
bit canBroadcastCams;Disable to skip cam data frame (base + 8) if you have no VVT.
bit unused1200b14
bit useFixedBaroCorrFromMap
bit useSeparateAdvanceForCranking,"Table","Fixed (auto taper)";In Constant mode, timing is automatically tapered to running as RPM increases.\nIn Table mode, the "Cranking ignition advance" table is used directly.
Expand Down
13 changes: 8 additions & 5 deletions firmware/tunerstudio/rusefi.input
Original file line number Diff line number Diff line change
Expand Up @@ -3733,13 +3733,16 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
field = "inertia measurement unit", imuType
field = "Enable FOME CAN broadcast", enableVerboseCanTx

dialog = canBroadcast, "CAN Data Broadcast"
dialog = canBroadcast, "FOME CAN Data Broadcast"
field = "Broadcast format details at"
field = "https://wiki.fome.tech/Advanced-Features/CAN/"
field = "FOME CAN data bus", canBroadcastUseChannelTwo
field = "FOME CAN data base address", verboseCanBaseAddress
field = "FOME CAN data address type", rusefiVerbose29b
field = "FOME CAN data period", canSleepPeriodMs
field = "FOME CAN data bus", canBroadcastUseChannelTwo
field = "Base address", verboseCanBaseAddress
field = "Address type", rusefiVerbose29b
field = "Data transmit period", canSleepPeriodMs
field =
field = "Enable cams frame", canBroadcastCams
field = "Enable EGT frame", canBroadcastEgt

dialog = canBus2, "Secondary CAN Bus"

Expand Down

0 comments on commit 7ae1a6c

Please sign in to comment.