Microchip
直播中

陈涛

7年用户 217经验值
私信 关注
[问答]

Simulink+Microchip代码模块:为什么dsWIC33FJ32MC变体不能使用MCPWM?

亲爱的,我是新的DSPIC SIMULINK接口。然而,我已经安装了DSPIC块集库,并试图建立一个简单的模型生成PWM 20kHz。我与DSPIC33 FJ32 MC202一起工作,也熟悉MPLAB X IDE项目控制BLDC电机。我想在Simulink环境中对同一个模型进行建模,并运行仿真,并通过将代码从工作模型的嵌入式编码器和Flash生成到同一应用程序的控制器进行交叉验证。这是否可能与当前可用的块集?我在MPLAB X IDE中使用C实现了SimeWWM,但是如何从模型生成代码并在基于模型的环境和VeeVeSa中测试它?如何在C代码中手动设置所有寄存器?因为我看到MSPWM是不活动的,而数据表提供了实现的信息。请引导我通过这一点。我正在写我的论文,我也很想在Simulink做这篇论文。任何有经验的成员的宝贵输入都会对我有很大帮助,谢谢。

以上来自于百度翻译


      以下为原文

    Dear All,

I am new to dsPIC Simulink interface. However I have installed dspic block set library and tried to set up a simple model of generating PWM of 20kHZ. I am working with dsPIC33FJ32MC202 and also familiar with MPLAB X IDE project for controlling BLDC motor. I would like to model the same in Simulink environment and run the simulation, also cross verify by generating the code from Embedded coder of working model and flash to controller for the same application. Would this be possible with the currently available blockset?
I have implemented sinePWM using C in MPLAB x IDE, but how do I generate code from model and test it in Model based environment and viceversa? How do I set all registers which I do it manually in my C code? Because I see that MSPWM is inactive while the datasheet provide the information for implementation.
Please guide me through this. I am working on my thesis which is I am interested to do it in Simulink as well. ANy valuable inputs from already experienced members shall be highly helpful to me.
Thank You in advance.

回帖(2)

康大争

2019-1-23 13:46:50
使用PWM块为DSPIC33 FJ32系列(30F和3F系列)。PWM高速是针对最近的DSPIC(3E系列),MCPWM模块为PIC32。

以上来自于百度翻译


      以下为原文

    Use the PWM block for dsPIC33FJ32 family (30F and 33F family).
PWM High Speed is for more recent dsPIC (33E family)
The MCPWM block is for PIC32.
举报

李青妍

2019-1-23 13:56:09
谢谢你,鲁宾。我可以根据您的输入开发一个简单的模型。我已经开发了一个简单的模型,首先以wiki HTTP//www. Kuuelel.Eu/WiKi/PWMyChansTeNeXeNo.TooOpDSPIC中的示例为例。KuHuelFurMUMWiKiji可以从所附模型生成代码。然而,我不能建立或闪存到我的控制器。当我在MPLAB X IDE中打开项目时,我看不到任何响应。另外,我想知道FE的输入从您的论坛wiki。PWM值是40000是什么意思?为什么增益块是“10000”的一个分支。请帮我通过这个。我的控制器用来驱动无刷直流电动机。直流大约在1367伏,我用ICD 3来闪动代码。怎样才能在示波器上看到PWM?在我的情况下,我必须启用OVDCON吗?

以上来自于百度翻译


      以下为原文

    Thank You Lubin. I could deelop a simple model based on your inputs.
 
I have developed a simple model for to start with, based on your example in wiki http://www.kerhuel.eu/wiki/PWM_communication_between_two_dsPIC?kerhuelforum_mwiki__
 
I could generate the code from the model attached. However I could not build or flash to my controller. I do not see any response when I open the project in MPLAB X IDE. Also I would like to know fe of inputs from your forum wiki. What do you mean by PWM value is 40000? And why is in the Gain block a division of '10000'. Please help me through this.
My controller is used to drive a BLDC motor. DC is around 13.67V, I use ICD 3 to flash the code.
How can I view the PWM in oscilloscope? DO I have to enable OVDCON in my case?
 
 
 
 
   Attachment(s)

dsPIC33FJ32M202.slx (29.46 KB) - downloaded 49 times
举报

更多回帖

发帖
×
20
完善资料,
赚取积分