7static constexpr struct {
float k; }
SOIL_EC[] = {
15static constexpr float k_t_N[5] = {0.0041f, 0.0038f, 0.0028f, 0.0032f, 0.0040f};
16static constexpr float k_t_P[5] = {0.0053f, 0.0049f, 0.0035f, 0.0042f, 0.0051f};
17static constexpr float k_t_K[5] = {0.0032f, 0.0029f, 0.0018f, 0.0024f, 0.0031f};
20static inline float k_h_N(
float th){
return 1.8f - 0.024f*th; }
21static inline float k_h_P(
float th){
return 1.6f - 0.018f*th; }
22static inline float k_h_K(
float th){
return 1.9f - 0.021f*th; }
29 float ec25 = ecRaw / (1.0f + 0.021f * (T - 25.0f));
32 constexpr float THETA_SAT = 45.0f;
34 return ec25 * powf(THETA_SAT / theta, 1.0f +
k);
41 return phRaw - 0.003f * (T - 25.0f);
46 float& N,
float& P,
float& K,
SoilType soil)
48 if (theta < 25.0f || theta > 60.0f)
54 N *= (1.0f -
k_t_N[idx]*(T - 25.0f));
55 P *= (1.0f -
k_t_P[idx]*(T - 25.0f));
56 K *= (1.0f -
k_t_K[idx]*(T - 25.0f));
static float k_h_K(float th)
void correctNPK(float T, float theta, float &N, float &P, float &K, SoilType soil)
static constexpr float k_t_P[5]
static constexpr struct @016332004146266166342013117042232226317123312235 SOIL_EC[]
static constexpr float k_t_N[5]
static float k_h_N(float th)
static float k_h_P(float th)
static constexpr float k_t_K[5]
float correctPH(float phRaw, float T)
float correctEC(float ecRaw, float T, float theta, SoilType soil)
Алгоритмы коррекции показаний датчиков