STM32无刷电机程序源码,采用电动势检测无刷电机电压获取转子位

内容分享2小时前发布
0 0 0

STM32无刷电机程序源码,采用电动机检测无刷电机电压获取转子位置。非常实用,包括程序源码加原理图加pcb工程。

//ADC1

//ADC2

//

#else

static uint32_t adcRawData[ADC_CHANNELS*2];

#endif

float adcToAmps;

//ADC的电流采样值 转换为

static int16_t adcAdvance;

static int32_t adcBlankingMicros;

int32_t adcMaxPeriod;//ADC最大的周期

static int32_t adcMinPeriod;//ADC最小的采样时间

static int16_t histIndex;//数组的下标值

int16_t histSize;

static uint16_t histA[ADC_HIST_SIZE];//adc转换后

static uint16_t histB[ADC_HIST_SIZE];

static uint16_t histC[ADC_HIST_SIZE];

uint32_t avgA, avgB, avgC;//电机A B C相的电压

int32_t adcAmpsOffset;//当前ADC采集转换后

volatile int32_t adcAvgAmps;//当前ADC采集转换后

volatile int32_t adcMaxAmps;//运行中最大 传感器

volatile int32_t adcAvgVolts;//运行的电压

static uint8_t adcStateA, adcStateB, adcStateC;//电机

volatile uint32_t detectedCrossing;

volatile uint32_t crossingPeriod;

volatile int32_t adcCrossingPeriod;

static uint32_t nextCrossingDetect;//ADC检测时间(

//重新对ADC内部校准

static void adcCalibrateADC (ADC_TypeDef *ADCx)

{

// Enable ADC reset calibration register

ADC_ResetCalibration(ADCx);

// Check the end of ADC reset calibration register

while(ADC_GetResetCalibrationStatus(ADCx))

;

// Start ADC calibration

ADC_StartCalibration(ADCx);

}

STM32无刷电机程序源码,采用电动势检测无刷电机电压获取转子位STM32无刷电机程序源码,采用电动势检测无刷电机电压获取转子位STM32无刷电机程序源码,采用电动势检测无刷电机电压获取转子位STM32无刷电机程序源码,采用电动势检测无刷电机电压获取转子位STM32无刷电机程序源码,采用电动势检测无刷电机电压获取转子位

© 版权声明

相关文章

暂无评论

none
暂无评论...