Kp adjustment#
-
void uz_CurrentControl_adjust_Kp(uz_CurrentControl_t *self, uz_3ph_dq_t i_reference_Ampere, uz_3ph_dq_t i_actual_Ampere, float BO_factor)#
Function to adjust the Kp parameter of the PI-Controllers during runtime based on nonlinear flux-maps.
- Parameters:
self – uz_CurrentControl_t instance
i_reference_Ampere – uz_dq_t struct for reference dq-currents in Ampere
i_actual_Ampere – uz_dq_t struct for measured dq-currents in Ampere
BO_factor – factor for magnitude optimum
Example#
1int main(void) {
2 struct uz_CurrentControl_config config = {
3 config_iq.samplingTime_sec = 0.00001f
4 }; //only this parameter is needed
5 uz_CurrentControl_t* instance = uz_CurrentControl_init(config);
6 struct uz_3ph_dq_t i_actual_Ampere = {.d = 0.8f, .q = 0.8f, .zero = 0.0f};
7 struct uz_3ph_dq_t i_reference_Ampere = {.d = 1.0f, .q = 1.0f, .zero = 0.0f};
8 struct uz_3ph_dq_t flux_approx_real = {.d = 0.00040f, .q = 0.0019f, .zero = 0.0f};
9 struct uz_3ph_dq_t flux_approx_reference = {.d = 0.00045f, .q = 0.002f, .zero = 0.0f};
10 float factor = 2.0f //Magnitude optimum factor
11 uz_CurrentControl_set_flux_approx(instance,flux_approx_real,flux_approx_reference);
12 uz_CurrentControl_adjust_Kp(i_actual_Ampere, i_reference_Ampere, factor);
13 }
Description#
Calculates the new adjusted values of the kp parameters following the functions described in [[1], p. 913] or [[2], p. 102]. It has to be used in conjunction with Set flux approximation.
Then the new Kp parameters can be calculated:
If the flag Kp_adjustment_flag
is set to true in the uz_CurrentControl_config
, the calculated \(K_{p,d}\) and \(K_{p,q}\) are automatically written to the pi controllers.
If false, no adjustment of \(K_{p,d}\) and \(K_{p,q}\) is done.