This commit is contained in:
parent
598ce79b05
commit
71b2dc762a
|
@ -394,7 +394,7 @@ expected<percent_t> EtbController::getClosedLoopAutotune(percent_t target, perce
|
||||||
float b = 2 * autotuneAmplitude;
|
float b = 2 * autotuneAmplitude;
|
||||||
|
|
||||||
// Ultimate gain per A-H relay tuning rule
|
// Ultimate gain per A-H relay tuning rule
|
||||||
float ku = 4 * b / (3.14159f * m_a);
|
float ku = 4 * b / (CONST_PI * m_a);
|
||||||
|
|
||||||
// The multipliers below are somewhere near the "no overshoot"
|
// The multipliers below are somewhere near the "no overshoot"
|
||||||
// and "some overshoot" flavors of the Ziegler-Nichols method
|
// and "some overshoot" flavors of the Ziegler-Nichols method
|
||||||
|
|
|
@ -35,6 +35,8 @@ typedef unsigned int time_t;
|
||||||
|
|
||||||
// gasoline E0
|
// gasoline E0
|
||||||
#define STOICH_RATIO 14.7f
|
#define STOICH_RATIO 14.7f
|
||||||
|
#define CONST_PI 3.14159265358979323846
|
||||||
|
|
||||||
|
|
||||||
// time in seconds
|
// time in seconds
|
||||||
typedef time_t efitimesec_t;
|
typedef time_t efitimesec_t;
|
||||||
|
|
|
@ -20,7 +20,6 @@ typedef unsigned char byte;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// irrational constants
|
// irrational constants
|
||||||
#define CONST_PI 3.14159265358979323846
|
|
||||||
#define CONST_SQRT2_DIV_2 0.70710678118654752440
|
#define CONST_SQRT2_DIV_2 0.70710678118654752440
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ float HIP9011::getRpmByAngleWindowAndTimeUs(int timeUs, float angleWindowWidth)
|
||||||
/**
|
/**
|
||||||
* TINT = TC * 2 * PI * VOUT
|
* TINT = TC * 2 * PI * VOUT
|
||||||
*/
|
*/
|
||||||
float integrationTimeUs = timeUs * 2 * PIF * HIP9011_DESIRED_OUTPUT_VALUE;
|
float integrationTimeUs = timeUs * 2 * CONST_PI * HIP9011_DESIRED_OUTPUT_VALUE;
|
||||||
/**
|
/**
|
||||||
* rpm = 60 seconds / time
|
* rpm = 60 seconds / time
|
||||||
* '60000000' because revolutions per MINUTE in uS conversion
|
* '60000000' because revolutions per MINUTE in uS conversion
|
||||||
|
|
|
@ -15,8 +15,7 @@
|
||||||
#define EFI_HIP_9011_DEBUG EFI_HIP_9011
|
#define EFI_HIP_9011_DEBUG EFI_HIP_9011
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PIF 3.14159f
|
#define HIP9011_BAND(bore) (900 / (CONST_PI * (bore) / 2))
|
||||||
#define HIP9011_BAND(bore) (900 / (PIF * (bore) / 2))
|
|
||||||
#define HIP9011_DESIRED_OUTPUT_VALUE 5.0f
|
#define HIP9011_DESIRED_OUTPUT_VALUE 5.0f
|
||||||
#define HIP9011_DIGITAL_OUTPUT_MAX 0x03ff /* 10 bit max value */
|
#define HIP9011_DIGITAL_OUTPUT_MAX 0x03ff /* 10 bit max value */
|
||||||
#define HIP_INPUT_CHANNELS 2
|
#define HIP_INPUT_CHANNELS 2
|
||||||
|
|
|
@ -22,7 +22,7 @@ void Biquad::reset() {
|
||||||
}
|
}
|
||||||
|
|
||||||
static float getK(float samplingFrequency, float cutoff) {
|
static float getK(float samplingFrequency, float cutoff) {
|
||||||
return tanf_taylor(3.14159f * cutoff / samplingFrequency);
|
return tanf_taylor(CONST_PI * cutoff / samplingFrequency);
|
||||||
}
|
}
|
||||||
|
|
||||||
static float getNorm(float K, float Q) {
|
static float getNorm(float K, float Q) {
|
||||||
|
|
Loading…
Reference in New Issue