HPM SDK
HPMicro Software Development Kit
HPMicro MCL BLOCK APIs

Functions

void hpm_mcl_bldc_block_ctrl (uint8_t motorindex, uint8_t dir, uint8_t step)
 Output pwm according to the number of motor steps. More...
 
uint8_t hpm_mcl_bldc_block_step_get (bldc_hall_phase_t phase, uint8_t hall_u, uint8_t hall_v, uint8_t hall_w)
 Get step count based on Hall sensor status. More...
 
float hpm_mcl_al_pi_ctrl_func (float *memory, float targetspeed, float speed, float kp, float ki, float max)
 pi loop function More...
 
void hpm_mcl_bldc_pwm_enable (uint8_t motor_index, uint8_t pin_name)
 Enables the pwm output of the given pin. More...
 
void hpm_mcl_bldc_pwm_disable (uint8_t motor_index, uint8_t pin_name)
 Disable the pwm output of the given pin. More...
 

Detailed Description

Function Documentation

◆ hpm_mcl_al_pi_ctrl_func()

float hpm_mcl_al_pi_ctrl_func ( float *  memory,
float  targetspeed,
float  speed,
float  kp,
float  ki,
float  max 
)

#include <middleware/hpm_mcl/inc/hpm_block.h>

pi loop function

Parameters
[in]memoryStore points data
[in]targetspeedTarget speed
[in]speedReal speed
[in]kpScale factor
[in]kiIntegral factor
[in]maxOutput maximum and integration maximum
Returns
float Data after pi adjustment

◆ hpm_mcl_bldc_block_ctrl()

void hpm_mcl_bldc_block_ctrl ( uint8_t  motorindex,
uint8_t  dir,
uint8_t  step 
)

#include <middleware/hpm_mcl/inc/hpm_block.h>

Output pwm according to the number of motor steps.

Parameters
[in]motorindexnumber of motor BLDC_MOTOR0_INDEX ... BLDC_MOTOR3_INDEX
[in]dirMotor operation direction BLDC_MOTOR_DIR_FORWARD or BLDC_MOTOR_DIR_REVERSE
[in]stepMotor steps, 60 degrees per step

◆ hpm_mcl_bldc_block_step_get()

uint8_t hpm_mcl_bldc_block_step_get ( bldc_hall_phase_t  phase,
uint8_t  hall_u,
uint8_t  hall_v,
uint8_t  hall_w 
)

#include <middleware/hpm_mcl/inc/hpm_block.h>

Get step count based on Hall sensor status.

Parameters
[in]phaseHall Displacement bldc_hall_phase_t
[in]hall_uu-phase Hall level state, 0-low 1-high
[in]hall_vv-phase Hall level state, 0-low 1-high
[in]hall_ww-phase Hall level state, 0-low 1-high
Returns
uint8_t step

◆ hpm_mcl_bldc_pwm_disable()

void hpm_mcl_bldc_pwm_disable ( uint8_t  motor_index,
uint8_t  pin_name 
)

#include <middleware/hpm_mcl/inc/hpm_block.h>

Disable the pwm output of the given pin.

Parameters
[in]motor_indexnumber of motor BLDC_MOTOR0_INDEX ... BLDC_MOTOR3_INDEX
[in]pin_namepin names BLDC_PWM_PIN_UH ... BLDC_PWM_PIN_WL

◆ hpm_mcl_bldc_pwm_enable()

void hpm_mcl_bldc_pwm_enable ( uint8_t  motor_index,
uint8_t  pin_name 
)

#include <middleware/hpm_mcl/inc/hpm_block.h>

Enables the pwm output of the given pin.

Parameters
[in]motor_indexnumber of motor BLDC_MOTOR0_INDEX ... BLDC_MOTOR3_INDEX
[in]pin_namepin names BLDC_PWM_PIN_UH ... BLDC_PWM_PIN_WL