mirror of
https://github.com/apache/nuttx.git
synced 2026-09-22 14:41:29 +08:00
libdsp: add one_by_p to motor_phy_params
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user