Flux approximation#
This module implements a method to approximate flux-linkages using the approach described in [[1]].
Setup#
Configuration#
In order to configure the flux approximation, the fitting parameter struct has to be initialized.
-
struct uz_PMSM_flux_fitting_parameter_config_t#
1#include "uz_approximate_flux.h"
2int main(void) {
3 struct uz_PMSM_flux_fitting_parameter_config_t fitting_config = {
4 .ad1_parameter = 0.030483840951002f,
5 .ad2_parameter = 0.040244227373267f,
6 .ad3_parameter = -16.481195185733903f,
7 .ad4_parameter = 1.296438633344970f,
8 .ad5_parameter = 6.183163374457993e-04f,
9 .ad6_parameter = -12.275586044862504f,
10 .aq1_parameter = 0.004816670542863f,
11 .aq2_parameter = 0.171595254784258f,
12 .aq3_parameter = 9.262938633610718e-04f,
13 .aq4_parameter = 0.005001870975338f,
14 .aq5_parameter = 0.170521235710151f,
15 .aq6_parameter = 9.186084507499523e-04f,
16 .F1G1_parameter = -0.001356794026337f,
17 .F2G2_parameter = 0.078813850391713f
18 };
19}
Description#
With this fitting config struct one can approximate the flux-linkages for a specific machine. The fitting parameter can be found solving the nonlinear-square problems discribed in [[1]]. For more information of how to get the fitting parameter see Flux approximation script.
Init function#
-
typedef struct uz_approximate_flux_t uz_approximate_flux_t#
Struct definition for uz_appropriate_flux.
-
uz_approximate_flux_t *uz_approximate_flux_init(uz_PMSM_flux_fitting_parameter_config_t fitting_config)#
init function for the flux approximation
- Returns:
uz_approximate_flux*, pointer to the flux approximation
Example#
1 int main(void) {
2 uz_approximate_flux_t* approximate_flux_instance = uz_approximate_flux_init(fitting_config);;
3}
Description#
Allocates the memory for the flux approximation instance. Furthermore the input values of the fitting parameter struct are asserted.
Step function#
-
uz_3ph_dq_t uz_approximate_flux_step(uz_approximate_flux_t *self, uz_3ph_dq_t i_actual_Ampere)#
approximate flux-linkages
- Returns:
uz_dq_t approximated flux-linkages for d- and q-axis
1 #include "uz_approximate_flux.h"
2 #include "../../../src/uz/uz_approximate_flux/approximate_flux_ert_rtw/approximate_flux.h"
3 int main(void) {
4 uz_PMSM_flux_fitting_parameter_config_t fitting_config = {
5 .ad1_parameter = 0.030483840951002f;
6 .ad2_parameter = 0.040244227373267f;
7 .ad3_parameter = -16.481195185733903f;
8 .ad4_parameter = 1.296438633344970f;
9 .ad5_parameter = 6.183163374457993e-04f;
10 .ad6_parameter = -12.275586044862504f;
11 .aq1_parameter = 0.004816670542863f;
12 .aq2_parameter = 0.171595254784258f;
13 .aq3_parameter = 9.262938633610718e-04f;
14 .aq4_parameter = 0.005001870975338f;
15 .aq5_parameter = 0.170521235710151f;
16 .aq6_parameter = 9.186084507499523e-04f;
17 .F1G1_parameter = -0.001356794026337f;
18 .F2G2_parameter = 0.078813850391713f;
19 };
20 uz_approximate_flux_t* test_instance = uz_approximate_flux_init(fitting_config);
21 struct uz_3ph_dq_t i_actual_Ampere = {.d = 1.0f, .q = 2.0f, .zero = 0.0f};
22 struct uz_3ph_dq_t flux_approx_real = uz_approximate_flux_step(test_instance, i_actual_Ampere);
23 }
Description#
Approximates the flux linkages for the measured currents in both axis using analytic prototype functions from [[1]]
Reference step function#
-
uz_3ph_dq_t uz_approximate_flux_reference_step(uz_approximate_flux_t *self, uz_3ph_dq_t i_reference_Ampere, uz_3ph_dq_t i_actual_Ampere)#
approximate reference flux-linkages.
- Returns:
uz_dq_t approximated reference flux-linkages for a specified reference ampere.
1 #include "uz_approximate_flux.h"
2 #include "../../../src/uz/uz_approximate_flux/approximate_flux_ert_rtw/approximate_flux.h"
3 int main(void) {
4 uz_PMSM_flux_fitting_parameter_config_t fitting_config = {
5 .ad1_parameter = 0.030483840951002f;
6 .ad2_parameter = 0.040244227373267f;
7 .ad3_parameter = -16.481195185733903f;
8 .ad4_parameter = 1.296438633344970f;
9 .ad5_parameter = 6.183163374457993e-04f;
10 .ad6_parameter = -12.275586044862504f;
11 .aq1_parameter = 0.004816670542863f;
12 .aq2_parameter = 0.171595254784258f;
13 .aq3_parameter = 9.262938633610718e-04f;
14 .aq4_parameter = 0.005001870975338f;
15 .aq5_parameter = 0.170521235710151f;
16 .aq6_parameter = 9.186084507499523e-04f;
17 .F1G1_parameter = -0.001356794026337f;
18 .F2G2_parameter = 0.078813850391713f;
19 };
20 uz_approximate_flux_t* test_instance = uz_approximate_flux_init(fitting_config);
21 struct uz_3ph_dq_t i_actual_Ampere = {.d = 1.0f, .q = 2.0f, .zero = 0.0f};
22 struct uz_3ph_dq_t i_reference_Ampere = {.d = 2.0f, .q = 4.0f, .zero = 0.0f};
23 struct uz_3ph_dq_t flux_approx_reference = uz_approximate_flux_reference_step(test_instance,i_reference_Ampere,i_actual_Ampere);
24 }
Description#
Approximates the flux linkages in both axis using analytic prototype functions from [[1]]. This follows the approach described in [[2], p. 913] or [[3], p. 102].