完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我下载了PMSM电机示例。我想修复自己的程序,但不知道。
我只想询问ia,ib的外部输入,通过FOC算法,三相电压的输出值到示波器的测量, FOC算法只要我调用以下程序范例即可? PWMC_GetPhaseCurrents(oCurrSensor [bMotor],& Iab); Ialphabeta = MCM_Clarke(Iab); Iqd = MCM_Park(Ialphabeta,hElAngledpp); hElAngledpp = SPD_GetElAngle(oSPD [MC_NUM]); Vqd.qV_Component1 = PI_Controller(oPIDIq [MC_NUM], (int32_t)(FOCVars [MC_NUM] .Iqdref.qI_Component1) - Iqd.qI_Component1); Vqd.qV_Component2 = PI_Controller(oPIDId [MC_NUM], (int32_t)(FOCVars [MC_NUM] .Iqdref.qI_Component2) - Iqd.qI_Component2); Valphabeta = MCM_Rev_Park(Vqd,hElAngledpp); hCodeError = PWMC_SetPhaseVoltage(oCurrSensor [MC_NUM],Valphabeta); 该功能是三相电压值的最终输出? 谢谢! 以上来自于谷歌翻译 以下为原文 I downloaded the PMSM Motor Example. I want to fix my own programs, but has no idea . I just wanted to ask if the external input from ia, ib, via FOC algorithm, the output value of the three-phase voltage to the oscilloscope measurement, The FOC algorithm as long as I call following below program paradigm can be ? PWMC_GetPhaseCurrents(oCurrSensor[bMotor], &Iab); Ialphabeta = MCM_Clarke(Iab); Iqd = MCM_Park(Ialphabeta, hElAngledpp); hElAngledpp = SPD_GetElAngle(oSPD[MC_NUM]); Vqd.qV_Component1 = PI_Controller(oPIDIq[MC_NUM], (int32_t)(FOCVars[MC_NUM].Iqdref.qI_Component1) - Iqd.qI_Component1); Vqd.qV_Component2 = PI_Controller(oPIDId[MC_NUM], (int32_t)(FOCVars[MC_NUM].Iqdref.qI_Component2) - Iqd.qI_Component2); Valphabeta = MCM_Rev_Park(Vqd, hElAngledpp); hCodeError = PWMC_SetPhaseVoltage(oCurrSensor[MC_NUM], Valphabeta); This function is the final output of the three-phase voltage values ? Thanks! |
|
相关推荐
3个回答
|
|
Ciao Sapphira
是的,这些是高频任务中存在的步骤,执行当前规则以实现FOC。 最后的功能 PWMC_SetPhaseVoltage(oCurrSensor [MC_NUM],Valphabeta); 将Valpha和Vbeta转换为三个占空比值(施加到电机的电压)并将其设置为PWM定时器以生成输出。中间值Va,Vb和Vc不是经过精确计算和存储的,因此Va,Vb和Vc变量不能以这种方式直接发送到DAC输出。您可以进入代码并查找为三个任务计算的变量并将其发送到DAC(但您需要lib的机密或受保护版本。) 返回值hCodeError它只是一个错误代码,如果在定时器的更新事件(计算出的三个占空比变为实际的那一刻)之前更新了三个占空比,则返回null。 再见 梁咏琪 以上来自于谷歌翻译 以下为原文 Ciao Sapphira Yes, these are the steps present inside the High Frequency Task that performs the current regulation to achieve the FOC. The final function PWMC_SetPhaseVoltage(oCurrSensor[MC_NUM], Valphabeta); Transform the Valpha and Vbeta into the three duty cycle values (voltage applied to the motor) and set it into the PWM timer to generate the output. Intermediate value Va, Vb and Vc is not reaqlly computed and stored and for this reason the Va, Vb and Vc variables can't directly sent to the DAC output in this way. You can go inside the code and find the variables computed for the three duty and send it to the DAC (but you require confidential or protected version of the lib.) The return value hCodeError it is only a error code or null if the three duty cycle has been updated before the update event of the timer (the moment in which the three duty cycle computed become actual). Ciao Gigi |
|
|
|
亲爱的吉吉,
感谢你的信息。 但我在功能方面遇到了一些问题 PWMC_GetPhaseCurrents(oCurrSensor [bMotor],& Iab); 当我调用这个函数时,这段代码变成了无限循环。 void HardFault_Handler(void) { / *发生硬故障异常时进入无限循环* / 而(1) { } } 我从函数发生器发送3.3v到Ia和Ib,但我不能 从这个函数得到Ia,Ib。 所以我的代码可能有问题。 我怎么能正确使用这个功能? 谢谢! 以上来自于谷歌翻译 以下为原文 Dear Gigi, Thanks for your information. But I had some problems about function PWMC_GetPhaseCurrents(oCurrSensor[bMotor], &Iab); When I call this function, this code into an infinite loop. void HardFault_Handler(void) { /* Go to infinite loop when Hard Fault exception occurs */ while (1) { } } I send 3.3v to Ia and Ib from function generator, but I couldn't get Ia, Ib from this function. So maybe something wrong with my code. How could I use this function correctly? Thanks! |
|
|
|
Ciao Sapphira
如果使用MCTaks.c中的MC Boot功能未正确实例化所有对象,则会发生这种情况 这是因为某些指向数据或函数的指针可能为NULL,这会在无效的内存范围内产生跳转。 然后调用PWMC_GetPhaseCurrents 在正常操作中(我的意思是正确配置FW并执行MC Boot)并且在Hghfrequency taks内每个PWM周期执行一次,通常不会发生硬故障。 再见 梁咏琪 以上来自于谷歌翻译 以下为原文 Ciao Sapphira This can occur if all the object are not correctly instantiated using the MC Boot function in MCTaks.c This due to the fact that some pointer to data or functions can be NULL and this generate a jump in a not valid range of the memory. Calling then PWMC_GetPhaseCurrents in normal operation (I mean with FW correctly configured and MC Boot executed) and done one time each PWM period inside the Hghfrequency taks, the hard fault normally doesn't occur. Ciao Gigi |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2240 浏览 1 评论
3028 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1605 浏览 1 评论
3416 浏览 6 评论
5753 浏览 21 评论
765浏览 4评论
1131浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
400浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1112浏览 3评论
1164浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-8-13 05:07 , Processed in 1.085613 second(s), Total 80, Slave 63 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号