10#ifndef MINIFOC_ALGORITHM_FOC_H_
11#define MINIFOC_ALGORITHM_FOC_H_
24#define MECHANGLE_COEFFICIENT (6.2831854f / ENCODER_RESO)
26#define ELECANGLE_COEFFICIENT ((6.2831854f * POLAR_PAIRS) / ENCODER_RESO)
28#define SPEED_COEFFICIENT ((6.2831852f * TIM13_FREQUENCY) / ENCODER_RESO)
void foc_calculate_dutycycle(float elect_angle, float d, float q, float *u, float *v, float *w)
calculate the corresponding three-phase PWM duty cycle under the current electrical angle
unsigned char foc_parameter_available_flag
flag variable for FOC parameter availability
volatile FOC_Structure_t FOC_Struct
FOC handler.
void foc_calibrate_phase(void)
automatic phase sequence detection and correction
volatile unsigned char phase_sequence
motor phase sequence flag variable
structure of FOC algorithm
float user_expect
user expect value of miniFOC
float rotate_speed
motor rotate speed calculate from timer
float mechanical_angle
mechanical angle read form encoder