libdsp: add one_by_p to motor_phy_params

This commit is contained in:
raiden00pl
2022-02-20 21:58:10 +08:00
committed by Xiang Xiao
parent 2ed4ab64a9
commit ca4790c429
4 changed files with 4 additions and 0 deletions
+1
View File
@@ -386,6 +386,7 @@ struct motor_phy_params_f32_s
float res; /* Phase-to-neutral resistance */
float ind; /* Average phase-to-neutral inductance */
float one_by_ind; /* Inverse phase-to-neutral inductance */
float one_by_p; /* Inverse number of motor pole pairs */
};
/* PMSM motor physcial parameters */
+1
View File
@@ -299,6 +299,7 @@ struct motor_phy_params_b16_s
*/
b16_t ind; /* Average phase-to-neutral inductance */
b16_t one_by_ind; /* Inverse phase-to-neutral inductance */
b16_t one_by_p; /* Inverse number of motor pole pairs */
};
/* PMSM motor physcial parameters */
+1
View File
@@ -372,6 +372,7 @@ void motor_phy_params_init(FAR struct motor_phy_params_f32_s *phy,
phy->res = res;
phy->ind = ind;
phy->one_by_ind = (1.0f / ind);
phy->one_by_p = (1.0f / poles);
}
/****************************************************************************
+1
View File
@@ -324,6 +324,7 @@ void motor_phy_params_init_b16(FAR struct motor_phy_params_b16_s *phy,
phy->res = res;
phy->ind = ind;
phy->one_by_ind = b16divb16(b16ONE, ind);
phy->one_by_p = b16divb16(b16ONE, poles);
}
/****************************************************************************