Set Point

Toolbox for a standard set-point module. The input is a reference torque. This will then be converted, depending on the machine type selection, into d- and q-reference currents. It currently supports surface-mounted (SMPMSM) and interior (IPMSM) permanent magnet synchronous machines. IPMSM with a positive and negative saliency ratio are both supported. The output currents will, depending on the operating condition of the machine, either be calculated via MTPA or field-weakening. It can not control a machine on its own.

Figure made with TikZ

Fig. 78 Schematic overview of the SetPoint module

Setup

typedef struct uz_SetPoint_t uz_SetPoint_t

Object definition for uz_SetPoint_t.

Configuration

enum uz_Setpoint_motor_type

enum for selection of machine type

Values:

enumerator SMPMSM
enumerator IPMSM
enum uz_Setpoint_control_type

enum for selection of control type

Values:

enumerator FOC
struct uz_SetPoint_config

Configuration struct for Setpoint module. Accessible by the user.

Public Members

uz_PMSM_t config_PMSM

PMSM struct which carries necessary motor related parameters for field weakening and MTPA

float id_ref_Ampere

manual i_d reference current. Will be added on top of the MTPA d-current. Unused, if FW is active.

float relative_torque_tolerance

sets the relative torque tolerance for the newton raphson solver in percent. I.e. with 0.01 tolerance and a M_ref = 8 Nm, the absolute tolerance will be max 0.08 Nm. An assertion triggers, if the approximated iq-current leads to a estimated M_ref which is outside of this tolerance band.

bool is_field_weakening_enabled

flag to enable field_weaking. True = enabled

enum uz_Setpoint_motor_type motor_type

Selection for which motor type is used

SMPMSM -> surface-mounted PMSM (Ld=Lq)

IPMSM -> interior PMSM (Ld=/=Lq)

enum uz_Setpoint_control_type control_type

Selection for which control type is used

FOC -> field oriented control

Example

Listing 112 Example function call for configuration
 1#include "uz/uz_setpoint/uz_setpoint.h"
 2int main(void) {
 3   struct uz_SetPoint_config SP_config = {
 4      .config_PMSM.I_max_Ampere = 15.0f,
 5      .config_PMSM.Ld_Henry = 0.0003f,
 6      .config_PMSM.Lq_Henry = 0.0003f,
 7      .config_PMSM.R_ph_Ohm = 0.1f,
 8      .config_PMSM.polePairs = 4.0f,
 9      .config_PMSM.Psi_PM_Vs = 0.0075f,
10      .control_type = FOC,
11      .motor_type = SMPMSM,
12      .is_field_weakening_enabled = false,
13      .id_ref_Ampere = 0.0f
14      .relative_torque_tolerance = 0.001f;
15   };
16}

Init function

uz_SetPoint_t *uz_SetPoint_init(struct uz_SetPoint_config config)

Initialization of the Setpoint object.

Parameters:
  • config – uz_SetPoint_config configuration struct

Returns:

Pointer to uz_SetPoint_t object

Example

Listing 113 Example function call to init the SpeedController for the SpeedControl. config according to configuration section
1int main(void) {
2   uz_SetPoint_t* SP_instance = uz_SetPoint_init(SP_config);
3}

Description

Allocates the memory for the SetPoint instance. Furthermore the input values of the configuration struct are asserted.

Functions