你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

st-img
chrome
st-img
firefox
st-img
safari
st-img
ie8及以上
shequ.stmicroelectronics.cn
  • ST意法半导体官网
  • STM32中文官网
  • ST全球论坛
登录/注册
  • 首页
  • 技术问答
  • 话题
  • 资源
  • 创客秀
  • 视频
  • 标签
  • 每日签到
  • STM32团队2
  • 论坛吐槽优化专区
  • 升级测试
在路上…

在路上…

 

回答数 0 关注数 0
关注 私信
  • 动态99
  • 提问
  • 回答0
  • 创客秀 0
  • 分享 0
  • 关注0
3 回答

[STM32G0]Keil仿真一下再退出仿真程序才运行正常

STM32 STM32G0
butterflyspring butterflyspring 回答时间: 2019-6-25 17:12

搞定了就好

赞0
21 回答

STM32L151C8T6A的板子 自己画的 串口乱码

STM32 STM32L1
toofree toofree 回答时间: 2019-3-29 13:48

你得用异步串口

赞0
14 回答

ST FOC5.x电机库 电流值如何转换为真实电流呢?

未设置标签
stm32gxx stm32gxx 回答时间: 2020-9-23 09:05

给一个稍微具体的实现方式,仅供参考: (1)库函数,__weak void R3_1_GetPhaseCurrents( PWMC_Handle_t * pHdl, ab_t * pStator_Currents )是用于采集相电流,每一次只采a,b,c中2相,组合并不是固定的,根据sectorX来,修改这个函数,要知道波形是一个周期,可以根据sectorX的变化判断是否满足一个周期,在数据未达到一个周期前,根据需要把这些电流存起来   pHandle->_Super.Ia = pStator_Currents->a;   pHandle->_Super.Ib = pStator_Currents->b;   pHandle->_Super.Ic = -pStator_Currents->a - pStator_Currents->b; (2)如果采满一个周期,就开始计算RMS,这个可能需要一段时间,这期间就不用再存电流,等算好后,就可以显示;接着开始下一次取电流。 这样的方法不是实时的,有些电流周期数据没有计算进去,不过对于数码管这种低速的显示,应该是可以了。 另外也可以用纯硬件实现,比如,每次abc相电流采样结束,把电流值用dac输出,然后再接到专用有效值芯片,那么芯片就一直输出有效值,供mcu的adc采集就可以,这样不需要mcu参加有效值的计算。

赞0
12 回答

求HAL库例程

未设置标签
wls151 wls151 回答时间: 2020-8-3 10:57

可以,我也这个路径

赞0
12 回答

STM32 FOC5.2电机库中中的电流采样如何改为反向放大

STM32
在路上… 在路上… 最优答案 回答时间: 2019-1-24 15:40

结帖了,我的思路是正确的,先是硬件调坏了一块 后是电机烧了一个,调到怀疑人生。现在把改后的代码贴出来,方便大家查阅 void R3HD2_GetPhaseCurrents( PWMC_Handle_t * pHdl, Curr_Components* pStator_Currents ) {   uint8_t bSector;   int32_t wAux;   WMC_R3_HD2_Handle_t * pHandle = (PWMC_R3_HD2_Handle_t *) pHdl;   /* Deactivate TIMx CH4 to disable next triggers using bit-banding access */   *(uint32_t*) (pHandle->wTIMxCH4_BB_Addr) = 0u;   /* Reset the SOFOC flag to indicate the start of FOC algorithm*/   pHandle->bSoFOC = 0u;   bSector = (uint8_t) pHdl->hSector;   switch ( bSector )   {   case SECTOR_4:   case SECTOR_5:     /* Current on Phase C is not accessible     */     /* Ia = PhaseAOffset - ADC converted value) */     wAux = (int32_t)( ADC1->JDR1 );     wAux *= 2;     wAux = wAux - (int32_t)( pHandle->wPhaseAOffset ) ;     /* Saturation of Ia */     if ( wAux < -INT16_MAX )     {       pStator_Currents->qI_Component1 = -INT16_MAX;     }     else if ( wAux > INT16_MAX )     {       pStator_Currents->qI_Component1 = INT16_MAX;     }     else     {       pStator_Currents->qI_Component1 = (int16_t) wAux;     }         /* Ib = PhaseBOffset - ADC converted value) */     wAux = (int32_t)( pHandle->pParams_str->ADCx2->JDR1 );     wAux *= 2;     wAux = wAux - (int32_t)( pHandle->wPhaseBOffset ) ;     /* Saturation of Ib */     if ( wAux < -INT16_MAX )     {       pStator_Currents->qI_Component2 = -INT16_MAX;     }     else if ( wAux > INT16_MAX )     {       pStator_Currents->qI_Component2 = INT16_MAX;     }     else     {       pStator_Currents->qI_Component2 = (int16_t) wAux;     }     break;       case SECTOR_6:   case SECTOR_1:     /* Current on Phase A is not accessible     */     /* Ib = PhaseBOffset - ADC converted value) */     wAux = (int32_t)( ADC1->JDR1 );     wAux *= 2;     wAux =  wAux - (int32_t)( pHandle->wPhaseBOffset ) ; //Ib     /* Saturation of Ib */     if ( wAux < -INT16_MAX )     {       pStator_Currents->qI_Component2 = -INT16_MAX;     }     else if ( wAux > INT16_MAX )     {       pStator_Currents->qI_Component2 = INT16_MAX;     }     else     {       pStator_Currents->qI_Component2 = (int16_t) wAux;     }     /* Ia = -Ic -Ib */     wAux = (int32_t)( pHandle->pParams_str->ADCx2->JDR1 );     wAux *= 2;     wAux = (int32_t) pHandle->wPhaseCOffset - wAux;  //Ic     wAux -= (int32_t) pStator_Currents->qI_Component2; //-Ic-Ib wAux = -wAux-pStator_Currents->qI_Component2     /* Saturation of Ia */     if ( wAux > INT16_MAX )     {       pStator_Currents->qI_Component1 = INT16_MAX;     }     else if ( wAux < -INT16_MAX )     {       pStator_Currents->qI_Component1 = -INT16_MAX;     }     else     {       pStator_Currents->qI_Component1 = (int16_t) wAux;     }     break;       case SECTOR_2:   case SECTOR_3:     /* Current on Phase B is not accessible     */     /* Ia = PhaseAOffset - ADC converted value) */     wAux = (int32_t)( ADC1->JDR1 );     wAux *= 2;     wAux =  wAux - (int32_t)( pHandle->wPhaseAOffset ) ;     /* Saturation of Ia */     if ( wAux < -INT16_MAX )     {       pStator_Currents->qI_Component1 = -INT16_MAX;     }     else if ( wAux > INT16_MAX )     {       pStator_Currents->qI_Component1 = INT16_MAX;     }     else     {       pStator_Currents->qI_Component1 = (int16_t) wAux;     }     /* Ib = -Ic -Ia */     wAux = (int32_t)( pHandle->pParams_str->ADCx2->JDR1 );     wAux *= 2;     wAux = (int32_t) pHandle->wPhaseCOffset - wAux;     wAux -= (int32_t) pStator_Currents->qI_Component1;     /* Saturation of Ib */     if ( wAux > INT16_MAX )     {       pStator_Currents->qI_Component2 = INT16_MAX;     }     else if ( wAux < -INT16_MAX )     {       pStator_Currents->qI_Component2 = -INT16_MAX;     }     else     {       pStator_Currents->qI_Component2 = (int16_t) wAux;     }                          break;   default:     break;   }   pHandle->_Super.hIa = pStator_Currents->qI_Component1;   pHandle->_Super.hIb = pStator_Currents->qI_Component2;   pHandle->_Super.hIc = -pStator_Currents->qI_Component1 - pStator_Currents->qI_Component2; }复制代码

赞0
在路上… 在路上…


阅读作者更多的帖子

所在话题

参与活动

  • 滴滴押注社区团购,明确“投入不设上限,要做市场第一”

    线下 2020-10-16
  • 滴滴押注社区团购,明确“投入不设上限,要做市场第一”

    网络 2020-10-16
  • 滴滴押注社区团购,明确“投入不设上限,要做市场第一”

    网络 2020-10-16
  • 滴滴押注社区团购,明确“投入不设上限,要做市场第一”

    网络 2020-10-16
  • 滴滴押注社区团购,明确“投入不设上限,要做市场第一”

    线下 2020-10-16
  • 滴滴押注社区团购,明确“投入不设上限,要做市场第一”

    线下 2020-10-16