OnlineID#

Description#

This Stateflow is used to detect special transient states and to gather measuring data in these states. It is based on [[1] , [2] ] and has been modified to fit into the ParameterID library of the UltraZohm. It functions as an indefinite loop and continuously identifies its parameters. This is done to identify the parameters of the linear PMSM model. This includes the stator resistance \(R_s\), direct inductance \(L_d\), quadrature inductance \(L_q\) and permanent magnet flux \(\psi_{PM}\). The flux maps \(\psi_d\) and \(\psi_q\) can be identified as well. The relevant signals are measured with each new operating point, and the flux in the specific operating point is calculated. Up to 100 unique values will be stored in an array, which will later be cleaned up with external functions. In contrast to the FluxMapID state, this state does not actively control the machine via reference currents (except by adding an injection signal with low amplitude/frequency on top of the reference d-axis current). Thus it measures and calculates the flux in the operating points.

To assist in the identification of the flux maps, an Automatic reference current generator does exist. It is an external Stateflow purposefully designed for the OnlineID state. It returns reference currents of a circular determined current map to quickly cycle through different operating points and identify flux map values over a wide operating point.

Figure made with TikZ

Fig. 284 Schematic overview of the FrictionID

Necessary measurement values#

  • i_dq

  • v_dq

  • omega_m

  • omega_el

OnlineID object#

typedef struct uz_ParaID_OnlineID_t uz_ParaID_OnlineID_t#

Object definition for uz_ParaID_OnlineID_t.

OnlineID config#

struct uz_ParaID_OnlineIDConfig_t#

configuration struct for TwoMassID specific settings

Public Members

boolean_T OnlineID_Reset#

flag to reset the OnlineID state

real32_T Temp_ref#

reference temperature for identification of the winding temperature of the motor

real32_T dev_omega#

scale factor to determine the tolerance band for the speed during steady-state detection. Default value is 0.05.

real32_T dev_curr#

scale factor to determine the tolerance band for the dq-currents during steady-state detection. Default value is 0.05.

real32_T identRAmp#

amplitude for d-current injection signal for identification of linear parameters

boolean_T AverageTransParams#

flag to enable the averaging of identified linear parameters

real32_T nom_factor#

eactor for rated current,to determine in which interval the linear Parameters will be identified. i.e. 0.5*I_n

real32_T Rs_time#

enter value in seconds. Determines, after which time the linear Parameters have to be identified again, even if the currents are outside the interval determined by nom_factor.

boolean_T allowPsiCalcOutside#

false: Flux maps will only be calculated, if linear parameters have been identified inside the valid range. Flux maps will only be calculated again, if the machine is in the valid range.

true:Flux maps will always be calculated, even if the linear parameters were identified outside of range.

real32_T min_n_ratio#

factor for rated speed to determine the lower end in which interval the linear Parameters will be identified. i.e. 0.1*n_n.

real32_T max_n_ratio#

factor for rated speed to determine the upper end in which interval the linear Parameters will be identified. i.e. 0.9*n_n.

boolean_T array_cleaned#

flag to signal, that the flux map array has been cleaned

OnlineID output#

struct uz_ParaID_OnlineID_output_t#

output struct for OnlineID

Public Members

real32_T id_out#

output for the d-current injection signal

real32_T Rph_out#

identified online resistance

real32_T Wtemp#

identified online winding temperature

real32_T psi_array[600]#

array storing all the measured flux map for each unique operating point of the motor

boolean_T IdControlFlag#

flag to signal, if the injection d-current is active

real32_T delta_psi[200]#

array storing the temperature dependent psi_pm values for all the operating points

uint16_T activeState#

activeState output of the OnlineID state

real32_T psi_pm_out#

identified Psi_PM

real32_T Ld_out#

identified Lq

real32_T Lq_out#

identified Ld

boolean_T clean_array#

flag to signal, that a new flux measurement point got saved in the array and it needs to be cleaned

OnlineID functions#

uz_ParaID_OnlineID_t *uz_OnlineID_init(void)#

Initializes the uz_ParaID_OnlineID_t object.

Returns:

uz_ParaID_OnlineID_t* pointer to object

void uz_OnlineID_step(uz_ParaID_OnlineID_t *self)#

steps the OnlineID state once

Parameters:
  • self – pointer to uz_ParaID_OnlineID_t object

void uz_OnlineID_CleanPsiArray(uz_ParaID_OnlineID_t *self, uz_ParameterID_Data_t *Data)#

This function is cleaning the array storing the measurement values, which always consists of a d-q-current combination a winding temperature and a speed value such as a d-q-flux combination The function is searching for measuring pairs which are closer than “eta_c” to their neighbors. In this case it is averaging these similar pairs to avoid measuring values containing the same information.

Parameters:
  • self – pointer to uz_ParaID_OnlineID_t object

void uz_OnlineID_CalcFluxMaps(uz_ParaID_OnlineID_t *self, uz_ParameterID_Data_t *Data)#

This function is calculating the regular flux maps out of the irregular scatter data array. The outputs is written onto the member FluxMap_Data of the uz_ParameterID_Data_t struct.

Parameters:
  • self – pointer to uz_ParaID_OnlineID_t object

void uz_OnlineID_AutoRefCurrents_step(uz_ParaID_OnlineID_t *self, uz_ParameterID_Data_t *Data)#

Calls an stateflow which automatically generates reference currents to speed up the measurement of the OnlineID flux maps. This is more like an extra and not needed for the OnlineID to work.

Parameters:
  • self – pointer to uz_ParaID_OnlineID_t object

void uz_OnlineID_set_Config(uz_ParaID_OnlineID_t *self, uz_ParaID_OnlineIDConfig_t Config)#

Sets the config struct for the OnlineID.

Parameters:
  • self – pointer to uz_ParaID_OnlineID_t object

  • Config – configuration struct for OnlineID

void uz_OnlineID_set_ActualValues(uz_ParaID_OnlineID_t *self, uz_ParaID_ActualValues_t ActualValues)#

Sets the ActualValues struct for the OnlineID.

Parameters:
  • self – pointer to uz_ParaID_OnlineID_t object

  • ActualValues – struct for the measurement values

void uz_OnlineID_set_GlobalConfig(uz_ParaID_OnlineID_t *self, uz_ParaID_GlobalConfig_t GlobalConfig)#

Sets the GlobalConfig struct for the OnlineID.

Parameters:
  • self – pointer to uz_ParaID_OnlineID_t object

  • GlobalConfig – struct for the general settings of the ParameterID

void uz_OnlineID_set_ControlFlags(uz_ParaID_OnlineID_t *self, uz_ParaID_ControlFlags_t *ControlFlags)#

Sets the ControlFlags struct for the OnlineID.

Parameters:
  • self – pointer to uz_ParaID_OnlineID_t object

  • ControlFlags – pointer to the struct with the enable signals of the ParameterID

void uz_OnlineID_set_cleaned_psi_array(uz_ParaID_OnlineID_t *self, float *array_pointer)#

Sets the cleaned_psi_array from the CleanPsiArray state.

Parameters:
  • self – pointer to uz_ParaID_OnlineID_t object

  • array_pointer – pointer to the cleaned array

void uz_OnlineID_set_AutoRefCurrents_Config(uz_ParaID_OnlineID_t *self, uz_ParaID_AutoRefCurrentsConfig_t Config)#

Sets config struct of the AutoRefCurrents state embedded in the OnlineID state.

Parameters:
  • self – pointer to uz_ParaID_OnlineID_t object

  • Config – configuration struct for the AutoRefCurrents state

void uz_OnlineID_set_AutoRefCurrents_GlobalConfig(uz_ParaID_OnlineID_t *self, uz_ParaID_GlobalConfig_t GlobalConfig)#

Sets the GlobalConfig struct for the AutoRefCurrents state embedded in the OnlineID state.

Parameters:
  • self – pointer to uz_ParaID_OnlineID_t object

  • GlobalConfig – struct for the general settings of the ParameterID

void uz_OnlineID_set_AutoRefCurrents_ControlFlags(uz_ParaID_OnlineID_t *self, uz_ParaID_ControlFlags_t *ControlFlags)#

Sets the ControlFlags struct for the AutoRefCurrents state embedded in the OnlineID state.

Parameters:
  • self – pointer to uz_ParaID_OnlineID_t object

  • ControlFlags – pointer to the struct with the enable signals of the ParameterID

uz_ParaID_FluxMapsData_t *uz_OnlineID_get_InterpMeshGrid_FluxMapData(uz_ParaID_OnlineID_t *self)#

Gets the interpolated flux maps from the InterMeshGrid state embedded in the OnlineID state.

Parameters:
  • self – pointer to uz_ParaID_OnlineID_t object

Returns:

uz_ParaID_FluxMapsData_t* interpolated flux maps

bool uz_OnlineID_get_enteredOnlineID(uz_ParaID_OnlineID_t *self)#

Gets the status of the enteredOnlineID flag.

Parameters:
  • self – pointer to uz_ParaID_OnlineID_t object

Returns:

true state has been entered

Returns:

false state hasn’t been entered

uz_ParaID_OnlineID_output_t *uz_OnlineID_get_output(uz_ParaID_OnlineID_t *self)#

Gets the pointer to the output struct of the OnlineID.

Parameters:
  • self – pointer to uz_ParaID_OnlineID_t object

Returns:

uz_ParaID_OnlineID_output_t* pointer to the output struct

Sources#