HPM SDK
HPMicro Software Development Kit
hpm_mcl_hw_loop.c File Reference
#include "hpm_mcl_hw_loop.h"

Functions

hpm_mcl_stat_t hpm_mcl_hw_loop_init (mcl_hw_loop_t *loop, mcl_hw_loop_cfg_t *cfg)
 Initialize hardware loop components. More...
 
hpm_mcl_stat_t hpm_mcl_vsc_run (mcl_hw_loop_t *loop)
 Run VSC (Vector Signal Controller) hardware acceleration. More...
 
hpm_mcl_stat_t hpm_mcl_clc_run (mcl_hw_loop_t *loop, float d_expect, float q_expect)
 Run CLC (Current Loop Controller) hardware acceleration. More...
 
hpm_mcl_stat_t hpm_mcl_qeo_run (mcl_hw_loop_t *loop)
 Run QEO (Quadrature Encoder Output) hardware acceleration. More...
 

Function Documentation

◆ hpm_mcl_clc_run()

hpm_mcl_stat_t hpm_mcl_clc_run ( mcl_hw_loop_t loop,
float  d_expect,
float  q_expect 
)

Run CLC (Current Loop Controller) hardware acceleration.

This function performs current loop control using hardware CLC module. It calculates d-q axis voltage outputs based on expected and actual current values.

Parameters
loopPointer to hardware loop structure
d_expectExpected d-axis current reference
q_expectExpected q-axis current reference
Returns
mcl_success if operation successful, error code otherwise

◆ hpm_mcl_hw_loop_init()

hpm_mcl_stat_t hpm_mcl_hw_loop_init ( mcl_hw_loop_t loop,
mcl_hw_loop_cfg_t cfg 
)

Initialize hardware loop components.

This function initializes the hardware loop components including VSC, CLC, and QEO modules. Each component is initialized through callback functions if they are configured.

Parameters
loopPointer to hardware loop structure
cfgPointer to hardware loop configuration
Returns
mcl_success if initialization successful, error code otherwise

◆ hpm_mcl_qeo_run()

hpm_mcl_stat_t hpm_mcl_qeo_run ( mcl_hw_loop_t loop)

Run QEO (Quadrature Encoder Output) hardware acceleration.

This function performs inverse Park and inverse Clarke transformations using hardware QEO module. It converts d-q voltages to three-phase PWM duty cycles.

Parameters
loopPointer to hardware loop structure
Returns
mcl_success if operation successful, error code otherwise

◆ hpm_mcl_vsc_run()

hpm_mcl_stat_t hpm_mcl_vsc_run ( mcl_hw_loop_t loop)

Run VSC (Vector Signal Controller) hardware acceleration.

This function performs Clarke and Park transformations using hardware VSC module. It converts three-phase currents (ia, ib, ic) to alpha-beta and d-q coordinates.

Parameters
loopPointer to hardware loop structure
Returns
mcl_success if operation successful, error code otherwise