rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Data Structures | Functions
boost_control.h File Reference

Data Structures

class  BoostController
 

Functions

void startBoostPin ()
 
void initBoostCtrl ()
 
void setDefaultBoostParameters ()
 

Function Documentation

◆ initBoostCtrl()

void initBoostCtrl ( )

Definition at line 342 of file boost_control.cpp.

342 {
343#if EFI_PROD_CODE
344 if (engine->module<BoostController>().unmock().hasInitBoost) {
345 // already initialized - nothing to do here
346 return;
347 }
348 // todo: why do we have 'isBoostControlEnabled' setting exactly?
349 // 'initVvtActuators' is an example of a subsystem without explicit enable
351 return;
352 }
353
354 bool hasAnyEtbWastegate = false;
355
356 for (size_t i = 0; i < efi::size(engineConfiguration->etbFunctions); i++) {
357 hasAnyEtbWastegate |= engineConfiguration->etbFunctions[i] == DC_Wastegate;
358 }
359
360 // If we have neither a boost PWM pin nor ETB wastegate, nothing more to do
361 if (!isBrainPinValid(engineConfiguration->boostControlPin) && !hasAnyEtbWastegate) {
362 return;
363 }
364#endif
365
366 // Set up open & closed loop tables
369 boostCltCorr.initTable(config->cltBoostCorr, config->cltBoostCorrBins);
370 boostIatCorr.initTable(config->iatBoostCorr, config->iatBoostCorrBins);
371 boostCltAdder.initTable(config->cltBoostAdder, config->cltBoostAdderBins);
372 boostIatAdder.initTable(config->iatBoostAdder, config->iatBoostAdderBins);
373
374 // Set up boost controller instance
375 engine->module<BoostController>().unmock().init(
376 &boostPwmControl,
377 &boostMapOpen,
378 &boostMapClosed,
379 boostCltCorr,
380 boostIatCorr,
381 boostCltAdder,
382 boostIatAdder,
384 );
385
386#if !EFI_UNIT_TEST
388#endif
389}
void startBoostPin()
void init(IPwm *const pmw, const ValueProvider3D *const openLoopMap, const ValueProvider3D *const closedLoopTargetMap, const ValueProvider2D &cltMultiplierProvider, const ValueProvider2D &iatMultiplierProvider, const ValueProvider2D &cltAdderProvider, const ValueProvider2D &iatAdderProvider, pid_s *const pidParams)
constexpr auto & module()
Definition engine.h:200
static EngineAccessor engine
Definition engine.h:413
static constexpr persistent_config_s * config
static constexpr engine_configuration_s * engineConfiguration
bool isBrainPinValid(brain_pin_e brainPin)
scaled_channel< uint8_t, 1, 100 > boostRpmBins[BOOST_RPM_COUNT]
scaled_channel< uint8_t, 1, 2 > boostTableClosedLoop[BOOST_LOAD_COUNT][BOOST_RPM_COUNT]
scaled_channel< uint8_t, 2, 1 > boostTableOpenLoop[BOOST_LOAD_COUNT][BOOST_RPM_COUNT]

Referenced by commonInitEngineController(), and BoostController::onConfigurationChange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDefaultBoostParameters()

void setDefaultBoostParameters ( )

Definition at line 299 of file boost_control.cpp.

299 {
307
311
312 for (int loadIndex = 0; loadIndex < BOOST_LOAD_COUNT; loadIndex++) {
313 for (int rpmIndex = 0; rpmIndex < BOOST_RPM_COUNT; rpmIndex++) {
314 config->boostTableClosedLoop[loadIndex][rpmIndex] = (float)config->boostClosedLoopLoadBins[loadIndex];
315 }
316 }
317
318 // Defaults for ETB-style wastegate actuator
322}
void setRpmTableBin(TValue(&array)[TSize])
void setLinearCurve(TValue(&array)[TSize], float from, float to, float precision=0.01f)

Referenced by setDefaultEngineConfiguration().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ startBoostPin()

void startBoostPin ( )

Definition at line 324 of file boost_control.cpp.

324 {
325#if !EFI_UNIT_TEST
326 // Only init if a pin is set, no need to start PWM without a pin
328 return;
329 }
330
332 &boostPwmControl,
333 "Boost",
337 /*dutyCycle*/0
338 );
339#endif /* EFI_UNIT_TEST */
340}
SingleTimerExecutor scheduler
Definition engine.h:271
RegisteredOutputPin boostPin
Definition efi_gpio.h:111
EnginePins enginePins
Definition efi_gpio.cpp:24
void startSimplePwm(SimplePwm *state, const char *msg, Scheduler *executor, OutputPin *output, float frequency, float dutyCycle, pwm_gen_callback *callback)

Referenced by applyNewHardwareSettings(), and initBoostCtrl().

Here is the call graph for this function:
Here is the caller graph for this function:

Go to the source code of this file.