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 341 of file boost_control.cpp.

341 {
342#if EFI_PROD_CODE
343 if (engine->module<BoostController>().unmock().hasInitBoost) {
344 // already initialized - nothing to do here
345 return;
346 }
347 // todo: why do we have 'isBoostControlEnabled' setting exactly?
348 // 'initVvtActuators' is an example of a subsystem without explicit enable
350 return;
351 }
352
353 bool hasAnyEtbWastegate = false;
354
355 for (size_t i = 0; i < efi::size(engineConfiguration->etbFunctions); i++) {
356 hasAnyEtbWastegate |= engineConfiguration->etbFunctions[i] == DC_Wastegate;
357 }
358
359 // If we have neither a boost PWM pin nor ETB wastegate, nothing more to do
360 if (!isBrainPinValid(engineConfiguration->boostControlPin) && !hasAnyEtbWastegate) {
361 return;
362 }
363#endif
364
365 // Set up open & closed loop tables
368 boostCltCorr.initTable(config->cltBoostCorr, config->cltBoostCorrBins);
369 boostIatCorr.initTable(config->iatBoostCorr, config->iatBoostCorrBins);
370 boostCltAdder.initTable(config->cltBoostAdder, config->cltBoostAdderBins);
371 boostIatAdder.initTable(config->iatBoostAdder, config->iatBoostAdderBins);
372
373 // Set up boost controller instance
374 engine->module<BoostController>().unmock().init(
375 &boostPwmControl,
376 &boostMapOpen,
377 &boostMapClosed,
378 boostCltCorr,
379 boostIatCorr,
380 boostCltAdder,
381 boostIatAdder,
383 );
384
385#if !EFI_UNIT_TEST
387#endif
388}
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 298 of file boost_control.cpp.

298 {
306
310
311 for (int loadIndex = 0; loadIndex < BOOST_LOAD_COUNT; loadIndex++) {
312 for (int rpmIndex = 0; rpmIndex < BOOST_RPM_COUNT; rpmIndex++) {
313 config->boostTableClosedLoop[loadIndex][rpmIndex] = (float)config->boostClosedLoopLoadBins[loadIndex];
314 }
315 }
316
317 // Defaults for ETB-style wastegate actuator
321}
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 323 of file boost_control.cpp.

323 {
324#if !EFI_UNIT_TEST
325 // Only init if a pin is set, no need to start PWM without a pin
327 return;
328 }
329
331 &boostPwmControl,
332 "Boost",
336 /*dutyCycle*/0
337 );
338#endif /* EFI_UNIT_TEST */
339}
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.