![]() |
Kinetis SDK v.1.2 Demo Applications User's Guide
Rev. 0
Freescale Semiconductor, Inc.
|
Motor 1 state machine. More...
#include "BLDC_appconfig.h"
#include "peripherals_init.h"
#include "M1_StateMachine.h"
#include "motor_structure.h"
#include "arm_cm0.h"
Macros | |
#define | MAX_CMT_ERRORS |
#define | CALIB_ONE_MEASURE_PERIOD_US |
period between measurements (multiples of 1 / PWM modulo frequency) More... | |
#define | CALIB_MEASURES_CNT |
40 ms More... | |
#define | CALIB_ONE_MEASURE_PERIOD_TICKS |
#define | CURRENT_CONTROLLER_ALIGN_LIM_LOW |
#define | CURRENT_CONTROLLER_ALIGN_LIM_HIGH |
Typedefs | |
typedef void(* | PFCN_VOID_MCSTRUCT )(MCSTRUC_BLDC_SNLS_INT_T *) |
Enumerations | |
enum | SM_RUN_SUBSTATE_T { CALIB, READY, ALIGN, STARTUP, SPIN, FREEWHEEL } |
Run sub-states. More... | |
Functions | |
static void | M1_StateFault (void) |
User state machine functions. More... | |
static void | M1_StateInit (void) |
INIT state. More... | |
static void | M1_StateStop (void) |
STOP state. More... | |
static void | M1_StateRun (void) |
RUN state. More... | |
static void | M1_TransFaultInit (void) |
User state-transition functions. More... | |
static void | M1_TransInitFault (void) |
INIT to FAULT transition. More... | |
static void | M1_TransInitStop (void) |
INIT to STOP transition. More... | |
static void | M1_TransStopFault (void) |
STOP to FAULT transition. More... | |
static void | M1_TransStopInit (void) |
STOP to INIT transition. More... | |
static void | M1_TransStopRun (void) |
STOP to RUN transition. More... | |
static void | M1_TransRunFault (void) |
RUN to FAULT transition. More... | |
static void | M1_TransRunStop (void) |
RUN to STOP transition. More... | |
static void | M1_StateRunCalib (MCSTRUC_BLDC_SNLS_INT_T *) |
User sub-state machine functions. More... | |
static void | M1_StateRunReady (MCSTRUC_BLDC_SNLS_INT_T *sM_Drive) |
RUN READY sub-state. More... | |
static void | M1_StateRunAlign (MCSTRUC_BLDC_SNLS_INT_T *sM_Drive) |
RUN ALIGN sub-state. More... | |
static void | M1_StateRunStartup (MCSTRUC_BLDC_SNLS_INT_T *sM_Drive) |
RUN STARTUP sub-state. More... | |
static void | M1_StateRunSpin (MCSTRUC_BLDC_SNLS_INT_T *sM_Drive) |
RUN SPIN sub-state. More... | |
static void | M1_StateRunFreewheel (MCSTRUC_BLDC_SNLS_INT_T *sM_Drive) |
RUN FREEWHEEL sub-state. More... | |
void | TimeEvent (MCSTRUC_BLDC_SNLS_INT_T *sM_Drive) |
Time event function. More... | |
void | FastControlLoop (MCSTRUC_BLDC_SNLS_INT_T *sM_Drive) |
Fast control loop function. More... | |
void | SlowControlLoop (MCSTRUC_BLDC_SNLS_INT_T *sM_Drive) |
Slow control loop function. More... | |
void | BldcCommutation (MCSTRUC_BLDC_SNLS_INT_T *sM_Drive) |
BLDC commutation function. More... | |
void | ReadSwFaults (MCSTRUC_BLDC_SNLS_INT_T *sM_Drive) |
Read faults by S/W. More... | |
void | M1_Fault (int intValue) |
Fault function. More... | |
void | M1_SetAppSwitch (int intValue) |
Set the app switch function. More... | |
int | M1_GetAppSwitch (void) |
Read the app switch function. More... | |
Variables | |
volatile UInt16 | uw16TriggerErrorCnt |
static int | mintM1_SwitchAppOnOff |
static int | mintM1_Fault |
static SM_RUN_SUBSTATE_T | meM1_StateRun |
Run sub-state identifier. More... | |
MCSTRUC_BLDC_SNLS_INT_T | gsM1_Drive |
static const SM_APP_STATE_FCN_T | msSTATE |
State machine functions field (in pmem) More... | |
static const SM_APP_TRANS_FCN_T | msTRANS |
State-transition functions field (in pmem) More... | |
static const PFCN_VOID_MCSTRUCT | mM1_STATE_RUN_TABLE [6] |
Sub-state machine functions field (in pmem) More... | |
SM_APP_CTRL_T | gsM1_Ctrl |
State machine structure declaration and initialization */. More... | |
Motor 1 state machine.
#define CALIB_MEASURES_CNT |
#define CALIB_ONE_MEASURE_PERIOD_TICKS |
#define CALIB_ONE_MEASURE_PERIOD_US |
#define CURRENT_CONTROLLER_ALIGN_LIM_HIGH |
#define CURRENT_CONTROLLER_ALIGN_LIM_LOW |
#define MAX_CMT_ERRORS |
typedef void(* PFCN_VOID_MCSTRUCT)(MCSTRUC_BLDC_SNLS_INT_T *) |
enum SM_RUN_SUBSTATE_T |
void BldcCommutation | ( | MCSTRUC_BLDC_SNLS_INT_T * | sM_Drive | ) |
sM_Drive | BLDC motor variables structure pointer |
void FastControlLoop | ( | MCSTRUC_BLDC_SNLS_INT_T * | sM_Drive | ) |
sM_Drive | BLDC motor variables structure pointer |
void M1_Fault | ( | int | intValue | ) |
int M1_GetAppSwitch | ( | void | ) |
void M1_SetAppSwitch | ( | int | intValue | ) |
|
static |
FAULT state.
|
static |
|
static |
|
static |
sM_Drive | BLDC motor variables structure pointer |
|
static |
RUN CALIB sub-state.
sM_Drive | BLDC motor variables structure pointer |
|
static |
sM_Drive | BLDC motor variables structure pointer |
|
static |
sM_Drive | BLDC motor variables structure pointer |
|
static |
sM_Drive | BLDC motor variables structure pointer |
|
static |
sM_Drive | BLDC motor variables structure pointer |
|
static |
|
static |
FAULT to INIT transition.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
void ReadSwFaults | ( | MCSTRUC_BLDC_SNLS_INT_T * | sM_Drive | ) |
sM_Drive | BLDC motor variables structure pointer |
void SlowControlLoop | ( | MCSTRUC_BLDC_SNLS_INT_T * | sM_Drive | ) |
sM_Drive | BLDC motor variables structure pointer |
void TimeEvent | ( | MCSTRUC_BLDC_SNLS_INT_T * | sM_Drive | ) |
sM_Drive | BLDC motor variables structure pointer |
SM_APP_CTRL_T gsM1_Ctrl |
The state machine structure declaration.
MCSTRUC_BLDC_SNLS_INT_T gsM1_Drive |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
volatile UInt16 uw16TriggerErrorCnt |