U S E R M A N U A L
Jan 26, 2015, AN709-00011-1v0-E
11
pid_regulation.c
The PID module for current and speed PI
svpwm.c
The SVPWM module
s04_app
adc_sample.c
The ADC process module based on the ADC ISR
brake.c
The brake module including motor stop by brake
limitation.c
The FOC current and voltage limitation module
Dead-time compensation.c
Dead-time compensation module()
motor_ctrl.c
The main file of the motor control including the main
function of FOC process of motor and the start/stop
function of motor
motor_startup_encoder.c
The
motor
start-up
module
with
encoder
after
zero-checking
observer_encoder.c
The Position Calculate module by encoder
protect.c
The Protect module
speed_calculate.c
The Speed Calculate module
qprc_zero_seach
Search encoder zero signal module
s05_user
customer_interface.c
The motor parameter setting
main.c
Main function
isr.c
MCU interrupt vector list
init_mcu.c
Initialize MCU peripheral functions
Startup_mb9xfxxx.s
MCU startup file
4.4
FW Control Flow
The control flow for the motor is shown as Figure 4-4. There are 4 interrupts that are red highlighted for the
motor FOC control, hall capture, AD converter. The timer events are executed in the end-less loop and the
timers are generated in the zero detect
ion interrupt ‘ISR_MFT_FRT’ of the free run timer 0.
Figure 4-4: Diagram of the Control Flow
Feed watchdog
Start
Current U\V\W sample
FOC control
Speed &Position Generate
Protection
(High Priority)
PID
SVPWM
Other Algorithm
DC bus sample and calculate
Current restoration
ISR_ADC_unit0
ISR_MFT_FRT
End-less loop in Main.c
Initialize peripheral
Motor Start/Stop