Table 10: Six-Step Firmware Library Not Exported Functions; Table 11: Six-Step Firmware Library Exported Functions (Apis); Figure 23: Six-Step Main Firmware Routines: Medium Priority Task - ST STM32 User Manual

Hide thumbs Also See for STM32:
Table of Contents

Advertisement

Getting started with the STM32 six-step firmware
library
Closed loop control
DEMO_STOP_TIME
Notes:
(1)
This parameter is available for firmware v.1.1.0 only or higher
(2)
This time is available if the DEMO mode is selected during the compiling phase
6Step_Lib.c contains the six-step library and the main functions are listed in the following
tables.
MC_SixStep_TABLE()
MC_SixStep_ARR_step()
MC_SixStep_Ramp_Motor_calc()
MC_SixStep_NEXT_step()
MC_Task_Speed()
MC_Bemf_Delay()
Function
MC_SixStep_INIT()
MC_SixStep_RESET()
MC_StartMotor()
MC_StopMotor()
MC_Set_Speed()
MC_EXT_button_SixStep()
The exported APIs functions are inside the header file 6Step_Lib.h. It contains also all the
variables and structures for the six-step algorithm. At the base of the MC driver, three main
tasks run at different frequencies and with different priority levels, according to the specific
function to cover, in particular (see
task",
Figure 23: "six-step main firmware routines: medium priority task"
"six-step main firmware routines: high priority
1.
High priority task: it is dedicated to the high frequency function (advanced TIMx PWM
generation, ADC reading) and it is managed at the highest priority. This frequency can
be modified through the STM32CubeMX software, i.e. TIM1_ARR.
2.
Medium priority task: it is dedicated to the medium frequency function (general TIMx
for step timing) and it is managed at medium priority. This frequency can be modified
through the STM32CubeMX software, i.e. TIM6_ARR (for STM32F302-Nucleo).
28/39

Table 10: Six-step firmware library not exported functions

Function

Table 11: Six-step firmware library exported functions (APIs)

Initializes the main variables for motor driving from
MC_SixStep_param.h
Resets all variables used for 6Step control algorithm
Starts the motor
Stops the motor
Sets the new motor speed value
Handles the push button event
DocID029868 Rev 1
Voltage mode
Time (msec) to keep the motor in stop
mode
Sets the peripherals (TIMx, GPIO etc.) for each step
Generates the ARR value for low frequency TIM during start-up
Calculates the acceleration profile step by step for motor during
start-up
Generates the next step number according to the direction (CW
or CCW)
Speeds loop with PI regulator
Calculates the demagnetization delay time
Figure 22: "six-step main firmware routines: low priority
task"):
Result
Result
and
Figure 24:
UM2124
Unit
msec, 16 bit
unsigned

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents