完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,我现在正在尝试用DSPIC33 EP256MC506在船上编程一个马达控制单元。我对当前的感应有困难。要跟踪引起的问题,我想知道,相对于PWM信号,当ADC被触发来转换采样电压时,用示波器,我想要感应PWM信号朝向门单元以及ADC的触发器。是否可以将ADC触发器输出到引脚上?谢谢你的帮助
以上来自于百度翻译 以下为原文 Hello everyone, I am currently trying to program a Motor Control Unit with the dsPIC33EP256MC506 onboard. I have trouble with the current sensing. To track down what is causing the problem I want to know, relative to the PWM signal, when the ADC is triggered to convert the sampled voltage. With an oscilloscope I want to sense the PWM signals towards the gate units as well as the trigger of the ADC. Is it possible to output the ADC trigger onto a pin? Thanks in advance Moritz |
|
相关推荐
3个回答
|
|
嗨,莫里兹,这不是我们在DSPICE256MC506的块中的一个特性。我们将把它用于较新的芯片,把这个特性扩展到EP MC族可能是有意义的。如果你没有马达测试,那么在模拟信号(具有足够高阻抗)的锡上应该是可行的。由于采样引起的毛刺。这是不实际的一个真正的电机运行信号。最好的解决办法是添加一个数字输出端口到您的模型,生成代码,在MPLAB X中打开,并在ADC中断中添加两条线来切换和关闭这个引脚。中断方案高度依赖于您的PWM产生。ADC块配置。没有模型的设置,我无法提供更多的细节。鲁宾
以上来自于百度翻译 以下为原文 Hi Moritz, This is not a feature we have yet within the blockset for the dsPICEP256MC506. We will have it for newer chip and it might make sense to extend this feature to the EP MC family. If you test without motor, it should be feasible to see on the analog signal (with high enough impedance) the tiny glitch due to the sampling. This is not practical with a real motor running signal. The best workaround is to to add one digital output port to your model, generate the code, open within MPLAB X and within the ADC interrupt add two lines to toggle on & off this pin. The interrupt scheme generated highly depends on your PWM and ADC blocks configuration. I could not provide further details without the model's block settings. Lubin |
|
|
|
你好,鲁宾,谢谢你的快速回复!很高兴听到这可能成为未来的一个特点。我现在正在尝试实现您建议的解决方案,需要一点帮助。在我的Simulink模型中,我有一个高速PWM块和一个ADC块,它的设置如所附文件所示。当生成代码时,其中一个文件被创建为MCHPYADC1Y.Cuff.C,它看起来是这样的:我认为这是在中断被抛出时执行的代码,因此在关闭支架之前添加了一行代码:D6引脚在ADCGrutGeUpPuts.Me.c文件中由T初始化。他是……命令,因为我在模型中添加了一个数字输出块。然而,这并不输出任何针。可能是什么问题?编辑:它确实有用,请参阅下一篇文章。我还想指出的是,我已经注释了D6引脚的默认值,因为没有连接到数字输出块。
以上来自于百度翻译 以下为原文 Hello Lubin, thanks for the fast reply! Glad to hear this might become a feature in the future. I am now trying to implement the workaround you suggested and need a little assistance. In my Simulink model I have a Highspeed PWM block and an ADC block with the settings as shown in the attached files. When generating the code among others one file is created called MCHP_ADC1_Interrupt.c which looks like this: #include "ADCTriggerOutput.h" #include "ADCTriggerOutput_private.h" /* ADC - Interrupt: volatile uint16_T ADC1BuffChannelA[4]; void __attribute__((__interrupt__,__auto_psv__)) _AD1Interrupt(void) { _AD1IF = 0; ADC1BuffChannelA[0] = ADC1BUF0; /* Copy value from ADC buffer */ ADC1BuffChannelA[1] = ADC1BUF1; /* Copy value from ADC buffer */ ADC1BuffChannelA[2] = ADC1BUF2; /* Copy value from ADC buffer */ ADC1BuffChannelA[3] = ADC1BUF3; /* Copy value from ADC buffer */ } I thought this would be the code executed when the interrupt is thrown so I added a line of code before the closing bracket: LATDbits.LATD6 = !LATDbits.LATD6; The D6 Pin is initialized in the ADCTriggerOutput_main.c file by the TRISD = ... command as I added a digital output block in the model. Also I want to point out that I have commented out the line that assigns the default value of false to the D6 Pin as there is nothing connected to the Digital Output block. Moritz Attached Image(s) |
|
|
|
再次问候,只是一个简短的更新。我在前一篇文章中实现的方法实际上是有效的。我只是把我必须用示波器测量的针脚混为一谈。OOPS LOL:我可能会打开另一个线程,显示ADC没有完全在PWM的中间触发,尽管我设置了PWM。
以上来自于百度翻译 以下为原文 Hello again, just a short update. The way I implemented it in my previous post does actually work. I just mixed up at which Pin I have to measure with the oscilloscope. oops LoL: I might open another thread showing that the ADC is not triggered exactly in the middle of the PWM though I set the PWm up to do so. Moritz |
|
|
|
只有小组成员才能发言,加入小组>>
5238 浏览 9 评论
2028 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3204 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
777浏览 1评论
666浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
595浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
676浏览 0评论
576浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 04:39 , Processed in 1.291319 second(s), Total 50, Slave 44 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号