Resonant Control for Subspace#

General#

This module packages two Resonant controller together, so that it can be used easier for controlling a complete subspace. The idea is similar as for the CurrentControl, as it is easier to just call one function instead of two seperate PI-Controllers or two seperate Resonant-Controllers in this case. However this module adds no new math to the control and to understand the control scheme of the Resonant-Controller, please visit Resonant controller.

Functions#

typedef struct uz_subspace_resonant_control uz_subspace_resonant_control#

Object definition for uz_subspace_resonant_control.

struct uz_subspace_resonant_control_config#

Configuration struct for uz_subspace_resonant_control. Accessible by the user.

Public Members

float sampling_time#

SamplingTime of the resonant controller in seconds. Must be greater than 0.0f

float gain_1#

Gain of the resonant Controller for d/alpha

float gain_2#

Gain of the resonant Controller for q/beta

float harmonic_order#

Order of harmonic to be controlled

float lower_limit#

Lower limit for the output limitation

float upper_limit#

Upper limit for the output limitation. Must be greater than lower limit

float antiwindup_gain#

Gain of anti-windup feedback

uz_subspace_resonant_control *uz_subspace_resonant_control_init(struct uz_subspace_resonant_control_config config)#

Initialization of the uz_CurrentControl object.

Parameters:
  • config – configuration struct for CurrentControl

Returns:

uz_CurrentControl_t* Pointer to uz_CurrentControl_t instance

uz_3ph_dq_t uz_subspace_resonant_control_step_dq(uz_subspace_resonant_control *self, uz_3ph_dq_t i_reference_Ampere, uz_3ph_dq_t i_actual_Ampere, float omega_el_fundamental)#

step the controllers with dq values

Parameters:
  • self – pointer to instance

  • i_reference_Ampere – reference dq currents

  • i_actual_Ampere – actual dq currents of subspace

  • omega_el_fundamental – fundamental omega_el in rad_s (NOT order of harmonic’s omega)

Returns:

dq reference voltages

uz_3ph_alphabeta_t uz_subspace_resonant_control_step_alphabeta(uz_subspace_resonant_control *self, uz_3ph_alphabeta_t i_reference_Ampere, uz_3ph_alphabeta_t i_actual_Ampere, float omega_el_fundamental)#

step the controllers with alpha beta values

Parameters:
  • self – pointer to instance

  • i_reference_Ampere – reference alpha beta currents

  • i_actual_Ampere – actual alpha beta currents of subspace

  • omega_el_fundamental – fundamental omega_el in rad_s (NOT order of harmonic’s omega)

Returns:

alpha beta reference voltages

void uz_subspace_resonant_control_reset(uz_subspace_resonant_control *self)#

resets both resonant instances

Parameters:
  • self – pointer to instance

void uz_subspace_resonant_control_set_gains(uz_subspace_resonant_control *self, float gain1, float gain2)#

changes gain of both instances and writes new gains to config

Parameters:
  • self – pointer to instance

  • gain1 – new gain for resonant instance 1

  • gain1 – new gain for resonant instance 2

struct uz_subspace_resonant_control_config uz_subspace_resonant_control_get_config(uz_subspace_resonant_control *self)#

returns actual config of instance

Parameters:
  • self – pointer to instance

Returns:

config

Usage#

During initialization, many of the parameters, such as the limits, the harmonic order, sampling time and anti-windup gain are shared for both controllers. However, the user can set different gains for both controllers. The control is executed with the step function, which is available for either dq- or \(\alpha\beta\)-setpoints.

Note

Be advised that not only the UZ_SUBSYSTEM_RESONANT_CONTROL_MAX_INSTANCES of this module must be high enough, but there also have to be enough UZ_RESONANT_CONTROLLER_MAX_INSTANCES, as two resonant controllers are initalized for each subsystem control object.

Example#

Listing 156 Example to create and initialize the instance in main.c#
 1#include "uz/uz_subspace_resonant_control/uz_subspace_resonant_control.h"
 2struct uz_subspace_resonant_control_config config = {
 3      .antiwindup_gain = 10.0f,
 4      .gain_1 = 10.0f,
 5      .gain_2 = 15.0f,
 6      .harmonic_order = 5.0f,
 7      .lower_limit = -10.f,
 8      .upper_limit = 10.0f,
 9      .sampling_time = 0.0001f};
10uz_subspace_resonant_control* instance;
11..
12instance = uz_subspace_resonant_control_init(config);
Listing 157 Example to step the controller instance in isr.c#
1#include "../uz/uz_subspace_resonant_control/uz_subspace_resonant_control.h"
2extern uz_subspace_resonant_control* instance;
3..
4uz_3ph_dq_t xy_rotating = uz_subspace_resonant_control_step_dq(instance, setpoint, actual, omega_el);