Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cranking taper duration multiplier based on CLT #370

Merged
merged 9 commits into from
Feb 26, 2024

Conversation

Krakert
Copy link
Contributor

@Krakert Krakert commented Feb 22, 2024

Fixes #369

@@ -981,6 +981,7 @@ bit skippedWheelOnCam,"On camshaft","On crankshaft";Where is your primary skippe
bit complexWallModel,"Advanced (tables)","Basic (constants)";Should we use tables to vary tau/beta based on CLT/MAP, or just with fixed values?
bit alwaysInstantRpm
bit isMapAveragingEnabled
bit overrideCrankingTaperDurationSetting; If enabled, use separate temperature multiplier table for cranking taper duration.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure override is the right language here - maybe useCrankingIdleTaperTable or something would be clearer?

Copy link
Contributor Author

@Krakert Krakert Feb 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will change, just looked add overrideCrankingIacSetting, maybe change that one too

@mck1117
Copy link
Collaborator

mck1117 commented Feb 22, 2024

I'd love to see a unit test for the new behavior :)

(engineConfiguration->afterCrankingIACtaperDuration *
interpolate2d(clt, config->cltCrankingTaperCorrBins, config->cltCrankingTaperCorr));
}
return (float)engine->rpmCalculator.getRevolutionCounterSinceStart() / engineConfiguration->afterCrankingIACtaperDuration;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would avoid duplicating this code if you can - it's not obvious to the reader why these two cases are different when they look so similar on first glance.

prefer something like

float x = config.taperDuration;

if (new_behavior) {
    x *= table_lookup();
}

return getRevCounter() / x;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that style of writing it makes it very clear which parts are the same, and which parts are different when the setting is enabled

@@ -1556,6 +1557,9 @@ uint8_t[PEDAL_TO_TPS_SIZE] autoscale pedalToTpsRpmBins;;"RPM", 100, 0, 0, 25000,
float[CLT_CRANKING_CURVE_SIZE] cltCrankingCorrBins;CLT-based cranking position multiplier for simple manual idle controller;"C", 1, 0, -100, 250, 2
float[CLT_CRANKING_CURVE_SIZE] cltCrankingCorr ;CLT-based cranking position multiplier for simple manual idle controller;"%", 1, 0, 0, 500, 2

float[CLT_CRANKING_CURVE_SIZE] cltCrankingTaperCorrBins;CLT-based taper duration multiplier for simple manual idle controller;"C", 1, 0, -100, 250, 2
float[CLT_CRANKING_CURVE_SIZE] cltCrankingTaperCorr ;CLT-based taper duration multiplier for simple manual idle controller;"%", 1, 0, 0, 500, 2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. is 500 a reasonable maximum value for this parameter? maybe 5 is safer?
  2. using float here is a waste of storage, maybe int8_t for temp, and uint8_t with scale 0.02 for multiplier would be better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a good idea to also make these change this for the cltCrankingCorr

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, finding other tables we can compact would be a great follow-on task #371

@Krakert
Copy link
Contributor Author

Krakert commented Feb 22, 2024

I'd love to see a unit test for the new behavior :)

Added a unit test

@Krakert Krakert changed the title Add Cranking taper duration multiplier based on CLT Add cranking taper duration multiplier based on CLT Feb 23, 2024
@mck1117 mck1117 merged commit 4c65992 into FOME-Tech:master Feb 26, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add cranking IAC taper duration multiplier
2 participants