This commit is contained in:
rusefillc 2022-01-14 21:18:51 -05:00
parent 598ce79b05
commit 71b2dc762a
6 changed files with 6 additions and 6 deletions

View File

@ -394,7 +394,7 @@ expected<percent_t> EtbController::getClosedLoopAutotune(percent_t target, perce
float b = 2 * autotuneAmplitude;
// 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"
// and "some overshoot" flavors of the Ziegler-Nichols method

View File

@ -35,6 +35,8 @@ typedef unsigned int time_t;
// gasoline E0
#define STOICH_RATIO 14.7f
#define CONST_PI 3.14159265358979323846
// time in seconds
typedef time_t efitimesec_t;

View File

@ -20,7 +20,6 @@ typedef unsigned char byte;
#endif
// irrational constants
#define CONST_PI 3.14159265358979323846
#define CONST_SQRT2_DIV_2 0.70710678118654752440

View File

@ -110,7 +110,7 @@ float HIP9011::getRpmByAngleWindowAndTimeUs(int timeUs, float angleWindowWidth)
/**
* 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
* '60000000' because revolutions per MINUTE in uS conversion

View File

@ -15,8 +15,7 @@
#define EFI_HIP_9011_DEBUG EFI_HIP_9011
#endif
#define PIF 3.14159f
#define HIP9011_BAND(bore) (900 / (PIF * (bore) / 2))
#define HIP9011_BAND(bore) (900 / (CONST_PI * (bore) / 2))
#define HIP9011_DESIRED_OUTPUT_VALUE 5.0f
#define HIP9011_DIGITAL_OUTPUT_MAX 0x03ff /* 10 bit max value */
#define HIP_INPUT_CHANNELS 2

View File

@ -22,7 +22,7 @@ void Biquad::reset() {
}
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) {