HPM SDK
HPMicro Software Development Kit
DSP Controller Functions

Functions

static void hpm_dsp_clarke_f32 (float32_t a, float32_t b, float32_t *alpha, float32_t *beta)
 Clarke transform of floating-point input. More...
 
static void hpm_dsp_clarke_q31 (q31_t a, q31_t b, q31_t *alpha, q31_t *beta)
 Clarke transform of q31 input. More...
 
static void hpm_dsp_inv_clarke_f32 (float32_t alpha, float32_t beta, float32_t *a, float32_t *b)
 Inverse Clarke transform of floating-point input. More...
 
static void hpm_dsp_inv_clarke_q31 (q31_t alpha, q31_t beta, q31_t *a, q31_t *b)
 Inverse Clarke transform of q31 input. More...
 
static void hpm_dsp_park_f32 (float32_t alpha, float32_t beta, float32_t *a, float32_t *b, float32_t sin, float32_t cos)
 Park transform of floating-point input. More...
 
static void hpm_dsp_park_q31 (q31_t alpha, q31_t beta, q31_t *a, q31_t *b, q31_t sin, q31_t cos)
 Park transform of q31 input. More...
 
static void hpm_dsp_inv_park_f32 (float32_t a, float32_t b, float32_t *alpha, float32_t *beta, float32_t sin, float32_t cos)
 Inverse Park transform of floating-point input. More...
 
static void hpm_dsp_inv_park_q31 (q31_t a, q31_t b, q31_t *alpha, q31_t *beta, q31_t sin, q31_t cos)
 Inverse Park transform of q31 input. More...
 
static float32_t hpm_dsp_pid_f32 (riscv_dsp_pid_f32_t *instance, float32_t src)
 PID control of floating-point input. More...
 
static void hpm_dsp_init_pid_f32 (riscv_dsp_pid_f32_t *instance, int32_t set)
 PID initializatopn control function of floating-point formats. More...
 
static q31_t hpm_dsp_pid_q31 (riscv_dsp_pid_q31_t *instance, q31_t src)
 PID control of Q31 input. More...
 
static void hpm_dsp_init_pid_q31 (riscv_dsp_pid_q31_t *instance, int32_t set)
 PID initializatopn control function of Q31 formats. More...
 
static q15_t hpm_dsp_pid_q15 (riscv_dsp_pid_q15_t *instance, q15_t src)
 
static void hpm_dsp_init_pid_q15 (riscv_dsp_pid_q15_t *instance, int32_t set)
 PID initializatopn control function of Q15 formats. More...
 

Detailed Description

Function Documentation

◆ hpm_dsp_clarke_f32()

static void hpm_dsp_clarke_f32 ( float32_t  a,
float32_t  b,
float32_t *  alpha,
float32_t *  beta 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Clarke transform of floating-point input.

Parameters
[in]ainput three-phase coordinate a.
[in]binput three-phase coordinate b.
[out]*alphaoutput two-phase orthogonal vector axis alpha.
[out]*betaoutput two-phase orthogonal vector axis beta.

◆ hpm_dsp_clarke_q31()

static void hpm_dsp_clarke_q31 ( q31_t  a,
q31_t  b,
q31_t *  alpha,
q31_t *  beta 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Clarke transform of q31 input.

Parameters
[in]ainput three-phase coordinate a.
[in]binput three-phase coordinate b.
[out]*alphaoutput two-phase orthogonal vector axis alpha.
[out]*betaoutput two-phase orthogonal vector axis beta.

The internal 32-bit accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.

◆ hpm_dsp_init_pid_f32()

static void hpm_dsp_init_pid_f32 ( riscv_dsp_pid_f32_t *  instance,
int32_t  set 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

PID initializatopn control function of floating-point formats.

Parameters
[in,out]*instancepoints to an instance of the PID controliler.
[in]setfor 1 will clear the state to all zeros 0 will not.

This function will calculate the PID control structure gain gain1, gain2 and gain3 by seting the variable Kp, Ki and Kd. The state variable will set to all zeros.

◆ hpm_dsp_init_pid_q15()

static void hpm_dsp_init_pid_q15 ( riscv_dsp_pid_q15_t *  instance,
int32_t  set 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

PID initializatopn control function of Q15 formats.

Parameters
[in,out]*instancepoints to an instance of the PID controliler.
[in]setfor 1 will clear the state to all zeros 0 will not.

This function will calculate the PID control structure gain gain1, gain2 and gain3 by seting the variable Kp, Ki and Kd. The state variable will set to all zeros.

◆ hpm_dsp_init_pid_q31()

static void hpm_dsp_init_pid_q31 ( riscv_dsp_pid_q31_t *  instance,
int32_t  set 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

PID initializatopn control function of Q31 formats.

Parameters
[in,out]*instancepoints to an instance of the PID controliler.
[in]setfor 1 will clear the state to all zeros 0 will not.

This function will calculate the PID control structure gain gain1, gain2 and gain3 by seting the variable Kp, Ki and Kd. The state variable will set to all zeros.

◆ hpm_dsp_inv_clarke_f32()

static void hpm_dsp_inv_clarke_f32 ( float32_t  alpha,
float32_t  beta,
float32_t *  a,
float32_t *  b 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Inverse Clarke transform of floating-point input.

Parameters
[in]alphainput two-phase orthogonal vector axis alpha.
[in]betainput two-phase orthogonal vector axis beta.
[out]*aoutput three-phase coordinate a.
[in]*boutput three-phase coordinate b.

◆ hpm_dsp_inv_clarke_q31()

static void hpm_dsp_inv_clarke_q31 ( q31_t  alpha,
q31_t  beta,
q31_t *  a,
q31_t *  b 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Inverse Clarke transform of q31 input.

Parameters
[in]alphainput two-phase orthogonal vector axis alpha.
[in]betainput two-phase orthogonal vector axis beta.
[out]*aoutput three-phase coordinate a.
[in]*boutput three-phase coordinate b.

The internal 32-bit accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.

◆ hpm_dsp_inv_park_f32()

static void hpm_dsp_inv_park_f32 ( float32_t  a,
float32_t  b,
float32_t *  alpha,
float32_t *  beta,
float32_t  sin,
float32_t  cos 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Inverse Park transform of floating-point input.

Parameters
[in]ainput coordinate of rotor frame a.
[in]binput coordinate of rotor frame b.
[out]*alphaoutput two-phase orthogonal vec axis alpha.
[out]*betaoutput two-phase orthogonal vec axis beta.
[in]sinsine value of rotation angle .
[in]coscosine value of rotation angle .

◆ hpm_dsp_inv_park_q31()

static void hpm_dsp_inv_park_q31 ( q31_t  a,
q31_t  b,
q31_t *  alpha,
q31_t *  beta,
q31_t  sin,
q31_t  cos 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Inverse Park transform of q31 input.

Parameters
[in]ainput coordinate of rotor frame a.
[in]binput coordinate of rotor frame b.
[out]*alphaoutput two-phase orthogonal vec axis alpha.
[out]*betaoutput two-phase orthogonal vec axis beta.
[in]sinsine value of rotation angle .
[in]coscosine value of rotation angle .

The internal 32-bit accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.

◆ hpm_dsp_park_f32()

static void hpm_dsp_park_f32 ( float32_t  alpha,
float32_t  beta,
float32_t *  a,
float32_t *  b,
float32_t  sin,
float32_t  cos 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Park transform of floating-point input.

Parameters
[in]alphainput two-phase coordinate alpha.
[in]betainput two-phase coordinate beta.
[out]*aoutput rotor frame a.
[out]*boutput rotor frame b.
[in]sinsine value of rotation angle .
[in]coscosine value of rotation angle .

◆ hpm_dsp_park_q31()

static void hpm_dsp_park_q31 ( q31_t  alpha,
q31_t  beta,
q31_t *  a,
q31_t *  b,
q31_t  sin,
q31_t  cos 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Park transform of q31 input.

Parameters
[in]alphainput two-phase coordinate alpha.
[in]betainput two-phase coordinate beta.
[out]*aoutput rotor frame a.
[out]*boutput rotor frame b.
[in]sinsine value of rotation angle .
[in]coscosine value of rotation angle .

The internal 32-bit accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format.

◆ hpm_dsp_pid_f32()

static float32_t hpm_dsp_pid_f32 ( riscv_dsp_pid_f32_t *  instance,
float32_t  src 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

PID control of floating-point input.

Parameters
[in,out]*instancepoints to an instance of the PID controliler.
[in]srcinput data.
Returns
output data.

◆ hpm_dsp_pid_q15()

static q15_t hpm_dsp_pid_q15 ( riscv_dsp_pid_q15_t *  instance,
q15_t  src 
)
inlinestatic

◆ hpm_dsp_pid_q31()

static q31_t hpm_dsp_pid_q31 ( riscv_dsp_pid_q31_t *  instance,
q31_t  src 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

PID control of Q31 input.

Parameters
[in,out]*instancepoints to an instance of the PID controliler.
[in]srcinput data.
Returns
output data.