SV-PWM

Introduction

The SV-PWM driver is the responsible to control the power stage, that is, the circuit that powers the motor. The power stage is formed by three half-bridge circuits, one for each motor phase. Each half-bridge is composed by two switches: \(\mathrm{q_i}\) and \(\mathrm{\bar{q_i}}\), where \(\mathrm{i} \in \mathrm{(a, b, c)}\) (Fig. 16). These switches are implemented using transistors (e.g. MOSFET, GaN…).

../../_images/ps-schematic.svg

Fig. 16 Schematic of the power stage switches

As the notation suggests, the switches are by complementary PWM signals, sometimes with the insertion of dead-time. The modulation scheme implemented by the driver is known as Space Vector PWM, hence its name. The theoretical details of this modulation can be found at the SV-PWM page. When using shunt resistors, current sampling needs to be synchronized with the PWM generation. Because of this reason, the SV-PWM driver also takes care of current sampling synchronization. The theoretical details can be found at the Current sampling page.

API

group spinner_drivers_svpwm

Functions

static inline void svpwm_start(const struct device *dev)

Start the SV-PWM controller.

Note

Current sampling device must be started prior to SV-PWM, since SV-PWM is the responsible to trigger current sampling measurements.

Parameters:
  • dev[in] SV-PWM device.

static inline void svpwm_stop(const struct device *dev)

Stop the SV-PWM controller.

Parameters:
  • dev[in] SV-PWM device.

static inline void svpwm_set_phase_voltages(const struct device *dev, float v_alpha, float v_beta)

Set phase voltages.

Parameters:
  • dev[in] SV-PWM device.

  • v_alpha[in] Alpha voltage.

  • v_beta[in] Beta voltage.

Implementations