Skip to content
/ FOC Public

sensorless fixed point foc use smo and pll in stm32

License

Notifications You must be signed in to change notification settings

super1207/FOC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

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

Releases

No releases published

Packages

No packages published

Languages