diff --git a/firmware/console/binary/tunerstudio_outputs.h b/firmware/console/binary/tunerstudio_outputs.h index 471923363b..723f297df0 100644 --- a/firmware/console/binary/tunerstudio_outputs.h +++ b/firmware/console/binary/tunerstudio_outputs.h @@ -281,9 +281,12 @@ struct TunerStudioOutputChannels { scaled_voltage rawTps2Primary; // 302 scaled_voltage rawTps2Secondary; // 304 - scaled_channel knockCount; + scaled_channel knockCount;// 306 - uint8_t unusedAtTheEnd[30]; // we have some unused bytes to allow compatible TS changes + scaled_channel accelerationZ; // 308 + scaled_channel accelerationRoll; // 310 + scaled_channel accelerationYaw; // 312 + uint8_t unusedAtTheEnd[24]; // we have some unused bytes to allow compatible TS changes // Temporary - will remove soon TsDebugChannels* getDebugChannels() { diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index daae431118..50908c62ca 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -731,6 +731,9 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->accelerationX = engine->sensors.accelerometer.x; // 278 tsOutputChannels->accelerationY = engine->sensors.accelerometer.y; + tsOutputChannels->accelerationY = engine->sensors.accelerometer.z; + tsOutputChannels->accelerationRoll = engine->sensors.accelerometer.roll; + tsOutputChannels->accelerationYaw = engine->sensors.accelerometer.yaw; #if EFI_DYNO_VIEW tsOutputChannels->VssAcceleration = getDynoviewAcceleration(PASS_ENGINE_PARAMETER_SIGNATURE); diff --git a/firmware/controllers/algo/engine_parts.h b/firmware/controllers/algo/engine_parts.h index 60ee24c560..d120860e4c 100644 --- a/firmware/controllers/algo/engine_parts.h +++ b/firmware/controllers/algo/engine_parts.h @@ -27,6 +27,8 @@ public: float x = 0; // G value float y = 0; float z = 0; + float yaw = 0; + float roll = 0; }; class SensorsState { diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index b697997ab2..6cb60a3d34 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -754,7 +754,10 @@ typedef enum { Force_4_bytes_size_can_vss_nbc_e = ENUM_32_BITS, } can_vss_nbc_e; -// inertia measurement unit, yawn accelerometer +/** + * inertia measurement unit, yawn accelerometer + * By the way both kinds of BOSCH use Housing : TE 1-967640-1, pins 144969-1 seal 967056-1 plug 967067-2 + */ typedef enum __attribute__ ((__packed__)) { IMU_NONE = 0, IMU_VAG = 1, diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 2a4ecba7ff..d19e9a629f 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -1806,6 +1806,8 @@ end_struct #define GAUGE_NAME_ACCEL_X "Acceleration: X" #define GAUGE_NAME_ACCEL_Y "Acceleration: Y" #define GAUGE_NAME_ACCEL_Z "Acceleration: Z" +#define GAUGE_NAME_ACCEL_ROLL "Acceleration: Roll" +#define GAUGE_NAME_ACCEL_YAW "Acceleration: Yaw" #define GAUGE_NAME_BARO_PRESSURE "Barometric pressure" diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 8b36d8d1e9..bfc3fba86f 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -342,6 +342,9 @@ enable2ndByteCanID = false ; Accel accelerationX = scalar, S16, 212, "G", {1/@@PACK_MULT_PERCENT@@}, 0 accelerationY = scalar, S16, 214, "G", {1/@@PACK_MULT_PERCENT@@}, 0 + accelerationZ = scalar, S16, 308, "G", {1/@@PACK_MULT_PERCENT@@}, 0 + accelerationRoll= scalar, S16, 310, "G", {1/@@PACK_MULT_PERCENT@@}, 0 + accelerationYaw = scalar, S16, 312, "G", {1/@@PACK_MULT_PERCENT@@}, 0 ; egt egt1 = scalar, S16, 216, "deg C", 1, 0 @@ -1039,6 +1042,9 @@ gaugeCategory = Sensors - Extra 1 VSSGauge = vehicleSpeedKph, "Vehicle speed", "kmh", 0, 200, 0, 1, 3, 4, 1, 1 accelerationXGauge = accelerationX, @@GAUGE_NAME_ACCEL_X@@, "acc", -11, 11, 1.0, 1.2, 100, 100, 3, 1 accelerationYGauge = accelerationY, @@GAUGE_NAME_ACCEL_Y@@, "acc", -11, 11, 1.0, 1.2, 100, 100, 3, 1 + accelerationZGauge = accelerationZ, @@GAUGE_NAME_ACCEL_Z@@, "acc", -11, 11, 1.0, 1.2, 100, 100, 3, 1 + accelerationRollGauge=accelerationRoll, @@GAUGE_NAME_ACCEL_ROLL@@, "acc", -11, 11, 1.0, 1.2, 100, 100, 3, 1 + accelerationYawGauge=accelerationYaw, @@GAUGE_NAME_ACCEL_YAW@@, "acc", -11, 11, 1.0, 1.2, 100, 100, 3, 1 atmPresCGauge = baroPressure, @@GAUGE_NAME_BARO_PRESSURE@@, "kPa", 0, 1024, 0, 0, 0, 0, 0, 0 vvtPositionB1IGauge = vvtPositionB1I, @@GAUGE_NAME_VVT_B1I@@, "deg", -60, 60, -60, -60, 60, 60, 1, 1 vvtPositionB1EGauge = vvtPositionB1E, @@GAUGE_NAME_VVT_B1E@@, "deg", -60, 60, -60, -60, 60, 60, 1, 1 @@ -1290,8 +1296,11 @@ gaugeCategory = DynoView entry = totalFuelConsumption, @@GAUGE_NAME_FUEL_CONSUMPTION@@, int, "%d" entry = fuelFlowRate, @@GAUGE_NAME_FUEL_FLOW@@, float, "%.2f" - entry = accelerationX, @@GAUGE_NAME_ACCEL_X@@, float,"%.2f", { LIS302DLCsPin != 0 || imuType != 0 } - entry = accelerationY, @@GAUGE_NAME_ACCEL_Y@@, float,"%.2f", { LIS302DLCsPin != 0 || imuType != 0 } + entry = accelerationX, @@GAUGE_NAME_ACCEL_X@@, float,"%.2f", { LIS302DLCsPin != 0 || imuType != 0 } + entry = accelerationY, @@GAUGE_NAME_ACCEL_Y@@, float,"%.2f", { LIS302DLCsPin != 0 || imuType != 0 } + entry = accelerationZ, @@GAUGE_NAME_ACCEL_Z@@, float,"%.2f", { LIS302DLCsPin != 0 || imuType != 0 } + entry = accelerationRoll,@@GAUGE_NAME_ACCEL_ROLL@@,float,"%.2f", { LIS302DLCsPin != 0 || imuType != 0 } + entry = accelerationYaw, @@GAUGE_NAME_ACCEL_YAW@@, float,"%.2f", { LIS302DLCsPin != 0 || imuType != 0 } entry = egt1, "EGT1", float,"%.1f", { max31855_cs1 != 0} entry = egt2, "EGT2", float,"%.1f", { max31855_cs2 != 0} entry = egt3, "EGT3", float,"%.1f", { max31855_cs3 != 0}