Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FOC

sensorless and fixed point foc use smo and pll

doc

define in gobal:

MotorParams motor;

in main function:

// you may modify this function for different motor
InitMotorParams1(&motor);
SetMotorDir(&motor,0);// 1 or 0,default 0

in pwm timer interrupt function(freq:12K)

int32_t adc_u,adc_v;
...
// read adc,format to Q12(-4096~4096)
...
motor.Iu = adc_u;
motor.Iv = adc_v;
SetMotorVq(&motor,8800);// 0~32768,default 8800
MotorStep(&motor);
// ARR = 3500
TIM1->CCR1 = motor.PWMOut[0];
TIM1->CCR2 = motor.PWMOut[1];
TIM1->CCR3 = motor.PWMOut[2];

..

image image

About

sensorless fixed point foc use smo and pll in stm32

Topics

Resources

Stars

42 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages