2 byte table axis #3045

This commit is contained in:
rusefillc 2021-12-19 22:42:46 -05:00
parent 2f414559f5
commit 66f82a0cdb
5 changed files with 6 additions and 6 deletions

View File

@ -129,7 +129,7 @@ static void setDefaultStftSettings() {
cfg.deadband = 5;
// Sensible region defaults
cfg.maxIdleRegionRpm = 1000 / RPM_1_BYTE_PACKING_MULT;
cfg.maxIdleRegionRpm = 1000;
cfg.maxOverrunLoad = 35;
cfg.minPowerLoad = 85;

View File

@ -24,7 +24,7 @@ static SensorType getSensorForBankIndex(size_t index) {
size_t computeStftBin(int rpm, float load, stft_s& cfg) {
// Low RPM -> idle
if (idleDeadband.lt(rpm, cfg.maxIdleRegionRpm * RPM_1_BYTE_PACKING_MULT))
if (idleDeadband.lt(rpm, cfg.maxIdleRegionRpm))
{
return 0;
}

View File

@ -114,7 +114,7 @@ void startTriggerInputPins(void) {
dacHysteresisDelta = dacHysteresisMin;
// 20 rpm (60_2) = 1000*60/((2*60)*20) = 25 ms for 1 tooth event
float satRpm = engineConfiguration->triggerCompSensorSatRpm * RPM_1_BYTE_PACKING_MULT;
float satRpm = engineConfiguration->triggerCompSensorSatRpm;
hystUpdatePeriodNumEvents = engine->triggerCentral.triggerShape.getSize(); // = 116 for "60-2" trigger wheel
float saturatedToothDurationUs = 60.0f * US_PER_SECOND_F / satRpm / hystUpdatePeriodNumEvents;
saturatedVrFreqNt = 1.0f / US2NT(saturatedToothDurationUs);

View File

@ -260,7 +260,7 @@ struct stft_cell_cfg_s
end_struct
struct stft_s
uint8_t maxIdleRegionRpm;+Below this RPM, the idle region is active;"RPM", @@RPM_1_BYTE_PACKING_MULT@@, 0, 0, 12000, 0
uint8_t autoscale maxIdleRegionRpm;+Below this RPM, the idle region is active;"RPM", @@RPM_1_BYTE_PACKING_MULT@@, 0, 0, 12000, 0
uint8_t maxOverrunLoad;+Below this engine load, the overrun region is active;"load", 1, 0, 0, 250, 0
uint8_t minPowerLoad;+Above this engine load, the power region is active;"load", 1, 0, 0, 250, 0
uint8_t deadband;+When close to correct AFR, pause correction. This can improve stability by not changing the adjustment if the error is extremely small, but is not required.;"%", 0.1, 0, 0, 3, 1
@ -1443,7 +1443,7 @@ tChargeMode_e tChargeMode;
uint8_t triggerCompCenterVolt;+Trigger comparator center point voltage;"V", @@VOLTAGE_1_BYTE_PACKING_DIV@@, 0, 0, 5.1, 2
uint8_t triggerCompHystMin;+Trigger comparator hysteresis voltage (Min);"V", @@VOLTAGE_1_BYTE_PACKING_DIV@@, 0, 0, 5.1, 2
uint8_t triggerCompHystMax;+Trigger comparator hysteresis voltage (Max);"V", @@VOLTAGE_1_BYTE_PACKING_DIV@@, 0, 0, 5.1, 2
uint8_t triggerCompSensorSatRpm;+VR-sensor saturation RPM;"RPM", @@RPM_1_BYTE_PACKING_MULT@@, 0, 0, 12000, 0
uint8_t autoscale triggerCompSensorSatRpm;+VR-sensor saturation RPM;"RPM", @@RPM_1_BYTE_PACKING_MULT@@, 0, 0, 12000, 0
pid_s idleRpmPid2

View File

@ -51,7 +51,7 @@ TEST(ClosedLoopFuel, CellSelection) {
stft_s cfg;
// Sensible region config
cfg.maxIdleRegionRpm = 1500 / RPM_1_BYTE_PACKING_MULT;
cfg.maxIdleRegionRpm = 1500;
cfg.minPowerLoad = 80;
cfg.maxOverrunLoad = 30;