miniFOC 1.0.3
This open-source project aims to accomplish a FOC(Field Oriented Control) scheme that is operatable with minimum costs in China.
Macros
config.h File Reference

used to place important parameter configurations for users More...

Go to the source code of this file.

Macros

#define VBUS   8.0f
 bus voltage is 8.0V More...
 
#define POLAR_PAIRS   7
 set BLDC polar pairs to 7 More...
 
#define ENCODER_RESO   4096
 SC60228 resolution is 2^8 = 4096. More...
 
#define CALI_TORQUE   0.5f
 set calibrate torque to 0.5 More...
 
#define USE_SVPWM   1
 Not using space vector pulse width modulator. More...
 
#define UART_BAUDRATE   512000
 set UART baud rate to 512000 More...
 
#define PWM_FREQUENCY   20
 set PWM frequency to 20kHz More...
 
#define TIM2_FREQUENCY   8
 set FOC loop frequency to 8kHz More...
 
#define TIM13_FREQUENCY   100
 set speed/angle PID loop frequency to 100Hz More...
 
#define SPEED_UP_FREQ   200
 set speed update frequency to 200Hz More...
 
#define SPI_PRESCALE   SPI_PSC_16
 set SPI frequency to 72 / 16 = 4.5MHz More...
 
#define UART_PRIORITY   1
 UART preemption priority set to 1. More...
 
#define TIM2_PRIORITY   2
 TIMER2 preemption priority set to 2. More...
 
#define TIM13_PRIORITY   3
 TIMER13 preemption priority set to 3. More...
 
#define FMC_WRITE_START_ADDR   0x08007C00UL
 User flash space start address, 1KB user flash. More...
 

Detailed Description

used to place important parameter configurations for users

Author
Lao·Zhu
Version
V1.0.3
Date
1. August 2023

Definition in file config.h.

Macro Definition Documentation

◆ CALI_TORQUE

#define CALI_TORQUE   0.5f

set calibrate torque to 0.5

Definition at line 19 of file config.h.

◆ ENCODER_RESO

#define ENCODER_RESO   4096

SC60228 resolution is 2^8 = 4096.

Definition at line 17 of file config.h.

◆ FMC_WRITE_START_ADDR

#define FMC_WRITE_START_ADDR   0x08007C00UL

User flash space start address, 1KB user flash.

Definition at line 44 of file config.h.

◆ POLAR_PAIRS

#define POLAR_PAIRS   7

set BLDC polar pairs to 7

Definition at line 15 of file config.h.

◆ PWM_FREQUENCY

#define PWM_FREQUENCY   20

set PWM frequency to 20kHz

Definition at line 26 of file config.h.

◆ SPEED_UP_FREQ

#define SPEED_UP_FREQ   200

set speed update frequency to 200Hz

Definition at line 32 of file config.h.

◆ SPI_PRESCALE

#define SPI_PRESCALE   SPI_PSC_16

set SPI frequency to 72 / 16 = 4.5MHz

Definition at line 34 of file config.h.

◆ TIM13_FREQUENCY

#define TIM13_FREQUENCY   100

set speed/angle PID loop frequency to 100Hz

Definition at line 30 of file config.h.

◆ TIM13_PRIORITY

#define TIM13_PRIORITY   3

TIMER13 preemption priority set to 3.

Definition at line 41 of file config.h.

◆ TIM2_FREQUENCY

#define TIM2_FREQUENCY   8

set FOC loop frequency to 8kHz

Definition at line 28 of file config.h.

◆ TIM2_PRIORITY

#define TIM2_PRIORITY   2

TIMER2 preemption priority set to 2.

Definition at line 39 of file config.h.

◆ UART_BAUDRATE

#define UART_BAUDRATE   512000

set UART baud rate to 512000

Definition at line 24 of file config.h.

◆ UART_PRIORITY

#define UART_PRIORITY   1

UART preemption priority set to 1.

Definition at line 37 of file config.h.

◆ USE_SVPWM

#define USE_SVPWM   1

Not using space vector pulse width modulator.

Definition at line 21 of file config.h.

◆ VBUS

#define VBUS   8.0f

bus voltage is 8.0V

Definition at line 13 of file config.h.