HPM SDK
HPMicro Software Development Kit
hpm_over_zero.h File Reference
#include "hpm_common.h"

Go to the source code of this file.

Data Structures

struct  hpm_mcl_over_zero_cfg
 Over-zero method configuration data. More...
 
struct  hpm_mcl_over_zero_spd_par
 Filtering and phase-locked loop parameters. More...
 
struct  hpm_mcl_over_zero_pi_par
 Speed PID control. More...
 

Typedefs

typedef struct hpm_mcl_over_zero_cfg hpm_mcl_over_zero_cfg_t
 Over-zero method configuration data. More...
 
typedef struct hpm_mcl_over_zero_spd_par hpm_mcl_over_zero_spd_para_t
 Filtering and phase-locked loop parameters. More...
 
typedef struct hpm_mcl_over_zero_pi_par hpm_mcl_over_zero_pi_para_t
 Speed PID control. More...
 

Enumerations

enum  hpm_mcl_over_zero_fsm_t { hpm_mcl_over_zero_fsm_init = 0 , hpm_mcl_over_zero_fsm_location = 1 , hpm_mcl_over_zero_fsm_running = 2 }
 Over-zero method fsm. More...
 
enum  hpm_mcl_dir_t { hpm_motor_dir_forward = 0 , hpm_motor_dir_reverse = 3 }
 Motor Direction. More...
 
enum  hpm_mcl_over_zero_interval_t {
  hpm_mcl_interval_init = 0 , hpm_mcl_interval_w_down = 1 , hpm_mcl_interval_v_up = 2 , hpm_mcl_interval_u_down = 3 ,
  hpm_mcl_interval_w_up = 4 , hpm_mcl_interval_v_down = 5 , hpm_mcl_interval_u_up = 6
}
 

Functions

int8_t hpm_mcl_over_zero_step_get (hpm_mcl_over_zero_cfg_t *cfg)
 Get commutation position. More...
 
float hpm_mcl_over_zero_speed_filter (hpm_mcl_over_zero_spd_para_t *par)
 Speed filter. More...
 
void hpm_mcl_over_zero_pwm_ctrl (uint8_t motorindex, uint8_t step)
 pwm output for different angle intervals More...
 
float hpm_mcl_over_zero_cal_speed (hpm_mcl_over_zero_cfg_t *cfg)
 alculating speed by clock cycles More...
 
float hpm_mcl_over_zero_pi_contrl (hpm_mcl_over_zero_pi_para_t *par)
 Speed pi control. More...
 

Typedef Documentation

◆ hpm_mcl_over_zero_cfg_t

Over-zero method configuration data.

◆ hpm_mcl_over_zero_pi_para_t

Speed PID control.

◆ hpm_mcl_over_zero_spd_para_t

Filtering and phase-locked loop parameters.

Enumeration Type Documentation

◆ hpm_mcl_dir_t

Motor Direction.

Enumerator
hpm_motor_dir_forward 

forward

hpm_motor_dir_reverse 

reverse

◆ hpm_mcl_over_zero_fsm_t

Over-zero method fsm.

Enumerator
hpm_mcl_over_zero_fsm_init 

Initialization data

hpm_mcl_over_zero_fsm_location 

Initial phase positioning

hpm_mcl_over_zero_fsm_running 

Normal run

◆ hpm_mcl_over_zero_interval_t

Enumerator
hpm_mcl_interval_init 

Initialization

hpm_mcl_interval_w_down 

w down

hpm_mcl_interval_v_up 

v up

hpm_mcl_interval_u_down 

u down

hpm_mcl_interval_w_up 

w up

hpm_mcl_interval_v_down 

v down

hpm_mcl_interval_u_up 

u up

Function Documentation

◆ hpm_mcl_over_zero_cal_speed()

float hpm_mcl_over_zero_cal_speed ( hpm_mcl_over_zero_cfg_t cfg)

alculating speed by clock cycles

Parameters
[in,out]cfghpm_mcl_over_zero_cfg_t
Returns
speed raw value

◆ hpm_mcl_over_zero_pi_contrl()

float hpm_mcl_over_zero_pi_contrl ( hpm_mcl_over_zero_pi_para_t par)

Speed pi control.

Parameters
[in]parhpm_mcl_over_zero_pi_para_t
Returns
pwm duty cycle

◆ hpm_mcl_over_zero_pwm_ctrl()

void hpm_mcl_over_zero_pwm_ctrl ( uint8_t  motorindex,
uint8_t  step 
)

pwm output for different angle intervals

Parameters
[in]motorindexmotor index
[in]stepangle intervals

◆ hpm_mcl_over_zero_speed_filter()

float hpm_mcl_over_zero_speed_filter ( hpm_mcl_over_zero_spd_para_t par)

Speed filter.

Parameters
[in,out]parhpm_mcl_over_zero_spd_para_t
Returns
speed value

Low pass

PI

◆ hpm_mcl_over_zero_step_get()

int8_t hpm_mcl_over_zero_step_get ( hpm_mcl_over_zero_cfg_t cfg)

Get commutation position.

Parameters
[in,out]cfghpm_mcl_over_zero_cfg_t
Returns
Current commutation interval

Determine the current state machine and perform different operations

< Continue waiting for positioning to complete

< Continue waiting for positioning to complete

< Number of cumulative cycles