rusefi/firmware/controllers/actuators/electronic_throttle.h

77 lines
1.9 KiB
C
Raw Normal View History

2015-07-10 06:01:56 -07:00
/**
* @file electronic_throttle.h
*
* @date Dec 7, 2013
2020-01-07 21:02:40 -08:00
* @author Andrey Belomutskiy, (c) 2012-2020
2015-07-10 06:01:56 -07:00
*/
2019-10-18 16:39:06 -07:00
#pragma once
2015-07-10 06:01:56 -07:00
#include "closed_loop_controller.h"
#include "rusefi_types.h"
#include "engine_configuration.h"
void initElectronicThrottle();
2022-10-26 14:33:10 -07:00
void doInitElectronicThrottle();
void setEtbIdlePosition(percent_t pos);
void setEtbWastegatePosition(percent_t pos);
void setEtbLuaAdjustment(percent_t adjustment);
void setHitachiEtbCalibration();
void blinkEtbErrorCodes(bool blinkPhase);
2024-07-03 00:54:50 -07:00
// same plug as 18919 AM810 but have different calibrations
void setToyota89281_33010_pedal_position_sensor();
2021-10-10 14:10:04 -07:00
void setBoschVAGETB();
2021-10-10 14:10:04 -07:00
void setDefaultEtbBiasCurve();
void setDefaultEtbParameters();
void setBoschVNH2SP30Curve();
2024-11-08 15:04:12 -08:00
2017-05-27 20:01:41 -07:00
void onConfigurationChangeElectronicThrottleCallback(engine_configuration_s *previousConfiguration);
void unregisterEtbPins();
void setProteusHitachiEtbDefaults();
void etbAutocal(size_t throttleIndex);
2024-05-08 05:23:14 -07:00
float getSanitizedPedal();
enum class EtbState : uint8_t {
Uninitialized, // 0
Autotune, // 1
NoMotor, // 2
NotEbt, // 3
LimpProhibited, // 4
Paused, // 5
NoOutput, // 6
Active, // 7
NoPedal, // 8
FailFast, // 9
InInit, // 10
SuccessfulInit, // 11
};
class DcMotor;
struct pid_s;
class ValueProvider3D;
struct pid_state_s;
class IEtbController : public ClosedLoopController<percent_t, percent_t> {
public:
// Initialize the throttle.
// returns true if the throttle was initialized, false otherwise.
2024-11-11 17:44:11 -08:00
virtual bool init(dc_function_e function, DcMotor *motor, pid_s *pidParameters, const ValueProvider3D* pedalMap) = 0;
virtual void reset() = 0;
virtual void setIdlePosition(percent_t pos) = 0;
virtual void setWastegatePosition(percent_t pos) = 0;
virtual void update() = 0;
virtual void autoCalibrateTps() = 0;
2024-05-04 09:08:16 -07:00
virtual bool isEtbMode() const = 0;
virtual const pid_state_s& getPidState() const = 0;
virtual float getCurrentTarget() const = 0;
virtual void setLuaAdjustment(percent_t adjustment) = 0;
};