Three phase sine function#

type uz_wavegen_three_phase#
uz_3ph_abc_t uz_wavegen_three_phase_sample(uz_wavegen_three_phase *self, float amplitude, float frequency_Hz, float offset)#

Returns one sample of a three-phase sine wave using phase accumulation. Correctly handles ramped frequency and preserves precision at long uptimes.

Parameters:
  • self – Pointer to uz_wavegen_three_phase instance

  • amplitude – Amplitude of all three signals

  • frequency_Hz – Frequency in Hertz. Only positive values permitted.

  • offset – DC offset added to all three phases

Returns:

uz_3ph_abc_t

Example#

The current value of the three phases at the current system time is calculated by calling uz_wavegen_three_phase_sample(). The module uses the uz_3ph_abc_t data type from Coordinate Transformation to return all three phase values as a struct.

float amplitude = 2.0f;
float frequency = 5.0f;
float offset = 1.0f;
uz_wavegen_three_phase* three_phase = uz_wavegen_three_phase_init();
uz_3ph_abc_t three_phase_sine = uz_wavegen_three_phase_sample(three_phase, amplitude, frequency, offset);

Description#

Outputs one sample of a sine wave with three phases for each function call.

Figure made with TikZ

Fig. 342 three phase sine wave