打印
[STM32F1]

有关基于stm32的PMSM的FOC控制中u8 SVPWMEOCEvent(void)的一个问题

[复制链接]
1765|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
干嘛呢|  楼主 | 2014-6-8 15:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
最近在做基于stm32的PMSM的FOC控制,2.0的库,单电阻采样的,感觉库函数中的u8 SVPWMEOCEvent(void)函数少了判断ADC何时第一次采样,何时第二次采样的语句,还有函数说明中说“Return false after first EOC, return true after second EOC ”的这条句话,好像没有实现这个功能的语句,什么时候也不能返回逻辑“false”啊?还是在别的函数中判断我没看到啊?
沙发
干嘛呢|  楼主 | 2014-6-8 15:36 | 只看该作者
补充一下,原函数代码如下:
/*******************************************************************************
* Function Name  : SVPWMEOCEvent
* Description    :  Routine to be performed inside the end of conversion ISR
                        store the first sampled value and compute the bus voltage and temperature
                        sensor sampling  and disable the ext. adc triggering.
* Input           : None
* Output         : Return false after first EOC, return true after second EOC
* Return         : None
*******************************************************************************/
u8 SVPWMEOCEvent(void)
{
  if (bDistEnab == 1)
  {
    // Diabling the Injectec conversion for ADC1
    ADC_ExternalTrigInjectedConvCmd(ADC1,DISABLE);
  }
  
  // Store the Bus Voltage and temperature sampled values
  h_ADCTemp = ADC_GetInjectedConversionValue(ADC2,ADC_InjectedChannel_1);
  h_ADCBusvolt = ADC_GetInjectedConversionValue(ADC2,ADC_InjectedChannel_2);
  
  return ((u8)(1));
}

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

8

主题

46

帖子

2

粉丝