完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我不知道这是正确的论坛,这样的问题,但我会提出它无论如何。我有一个PIC16F1517 MCU(它并不真正的问题,虽然确切的模型),我已经实现了一个应用程序,其中,MCU监控板的二次电源(3.3V,2.5V)。,1.8V,1.0V等)。我实际上想要做的只是比较测量值和我在代码中硬连接的某些阈值。所以我不感兴趣显示真正的价值或类似的东西。直到现在,我只是从ADC进行测量,然后与阈值进行比较。如果它在上面,我触发一个外部中断。我现在要做的是,不仅比较一个值,而是更多,以便更健壮,也许拒绝一些噪音。一个想法是实现某种类型的IIR或FIR滤波器或者仅仅是平均化。但是为了简化实现,我想出了另一个方法:我将检查n个连续的测量(在阈值之上找到第一个之后),并且如果多数在阈值之上(多少多数尚未被定义),只有中断才会被触发。你认为这比IIR滤波器(我正在考虑指数移动平均滤波器)还是平均值?我认为这样的应用应该足够了,对吧?背后有什么理论吗?我想这有一个名字:-!谢谢!
以上来自于百度翻译 以下为原文 Hi, I don't know if this is the correct forum for such a question, but I will pose it anyway. I have a PIC16F1517 MCU (it doesn't really matter though the exact model) and I have implemented an application where, among others, the MCU monitors several secondary power supplies of the board (3.3V, 2.5V, 1.8V, 1.0V etc.). What I actually want to do is to just compare the measured values with certain thresholds I have hardwired in the code. So I am not interested in displaying the real value or sth like this. Until now, I just took a measurement from the ADC and then compare it with the threshold. If it is above, I trigger an external interrupt. What I want to do now, is to not only compare just one value, but more, so as to be more robust and perhaps reject some noise. One idea was to implement some kind of IIR or FIR filter or just averaging. But in order to simplify the implementation a bit, I came up with sth else: I will check N consecutive measurements (after the first that is found above the threshold) and if the majority is above the threshold (how much majority is yet to be defined), only then the interrupt will be triggered. What do you think of this in comparison to an IIR filter (I was thinking of an exponential moving average filter) or averaging? I think it should be enough for this kind of application, right? Is there any theory behind? I suppose there is some kind of name for it :-) ! Thanks! |
|
相关推荐
6个回答
|
|
这取决于你试图过滤的噪声类型。为了消除交流线路噪声,简单的平均值是有效的。为了去除电机、电瞬变等的突发噪声,使用中值滤波器。要检测过电压或欠压条件,需要在n以上的n次连续测量。除了上述过滤技术中的一个之外。
以上来自于百度翻译 以下为原文 It depends on the type of noise you are trying to filter. To remove AC line noise, simple averaging will work. To remove burst noise from motors, electrical transients, etc., use a median filter. To detect an overvoltage or undervoltage condition, require N consecutive measurements above/below your threshold in addition to one of the above filtering techniques. |
|
|
|
IIR滤波器不给出一个良好的平均结果。你需要一个FIR或移动平均滤波器。设置一个循环缓冲区,您需要的样本数(2个倍数,如4或8个将是方便的)。保持连续运转。当一个新的样本进来时,从总和中减去最旧的值。添加新的值。将新的值放入缓冲区中代替最旧的值。将缓冲指针移到现在最老的样本。如果你真的想要平均值,而你的缓冲区是2的倍数,那么从总和中得到的平均值是一个简单的右移。一个警告——如果你正在尝试检测过电压条件,那么响应通常需要是公平的。Y快速(亚微秒)来保护动力装置。
以上来自于百度翻译 以下为原文 An IIR filter does *not* give a good average result. You need an FIR or moving average filter. Set up a circular buffer with the number of samples that you want (a multiple of 2, such as 4 or 8 will be handy). Keep a running sum. When a new sample comes in, subtract the oldest value from the sum. Add the new value. Put the new value into the buffer in place of the oldest value. Move the buffer pointer to what is now the oldest sample. If you really want the average, and your buffer is a multiple of 2, then getting the average from the sum is a simple right shift. One caution - if you are trying to detect an overvoltage condition then the response generally needs to be fairly fast (sub-microsecond) to protect the powered devices. |
|
|
|
中值滤波有利于噪声的滤除。超过阈值的连续样本,也就是三,也很好。但是为什么电源线上的噪声是可能的?你有没有正确的噪声参考点(嘈杂的地面)监控控制器?或者负载可以用噪音?
以上来自于百度翻译 以下为原文 Median filter is good for noise filtering. Consecutive samples, say three, over the threshold are good too. But why a noise on power supply lines is possible? Have you incorrect noisy reference point (noisy ground) for monitoring controller? Or the loads are OK with noise? |
|
|
|
一定要对输入信号至少进行一些模拟滤波。
以上来自于百度翻译 以下为原文 and do make sure you have at least some analog filtering on the input signal. |
|
|
|
许多电源将有“电源良好”引脚,您可以用来监视它们。否则,只是一个合适大小的RC过滤器(你无论如何需要)将做所有的工作-不需要做更多的过滤在代码中。
以上来自于百度翻译 以下为原文 Many power supplies will have "power good" pins which you can use to monitor them. Otherwise, just a suitable size RC filter (which you need anyway) will do all the job - no need to do more filtering in the code. |
|
|
|
谢谢大家的帮助!我想我要做的是实现指数移动平均或移动平均滤波器,然后要求n个连续的滤波输出高于或低于阈值。这里有一些评论:我不想在我原来的帖子中进一步分析,但是你基本上是正确的。在PIC FW改进的同时,我还分析了为什么电源上的噪声。为了将来的参考,我发现,从12V输入产生1.0V电源的DC /DC降压开关转换器的电路是不理想的。因此,当负载侧(处理器的核心)有跳跃时,转换器不能正确地响应,这就是为什么电源上有小而明显的过电压的原因。是的,我同意您的观点,但我基本上希望避免一个真正的移动平均滤波器,以便减少运算量。所需的负载和内存。因为有6个或7个电源板,我需要监控。但这当然是我要考虑的问题。关于你最后的评论,你所说的是正确的:对过电压的响应一般应该是快的。但我想过滤掉短的过电压和欠压脉冲,这可能不会对电力设备造成任何真正的威胁。好的,模拟RC滤波器是/实际上是我的首选解决方案,但不幸的是,在这一点上,我不允许在PCB中做任何修改。这就是为什么我想用数字滤波器代替模拟的原因。但我想,即使使用模拟滤波器,我确实需要某种数字滤波来保持健壮性,比如要求n个连续值高于阈值/低于阈值。对于转换器的“电源好”引脚,它们确实存在一些时间,但我的理解是它们(或至少T)。我已经看过了,不要给出任何关于过电压情况的信息,而仅仅是关于欠电压的信息。
以上来自于百度翻译 以下为原文 Thank you all for your helpful answers! I think what I will do is to implement an exponential moving average or a moving average filter and then require that N consecutive filtered outputs are above/below the threshold. Something like this. Here are some comments: I didn't want to analyze that further in my original post, but you are basically correct. In parallel to the PIC FW improvements, I also analyze why the noise on the supplies. Just for future reference, I found out that the circuit of the DC/DC buck switching converter that generates the 1.0V supply from the 12V input is not ideal. Due to this, when there are jumps on the load side (the core of a processor) the converter cannot "respond" correctly and that is why there are small but obvious over-voltages on the supply. Yes, I agree with you, but I basically wanted to avoid a true moving average filter so as to reduce the computational load and memory required. Because there are boards with 6 or 7 power supplies which I need to monitor. But it is certainly something that I will consider. As to your last comment, this is true what you are saying.: The response to over-voltages should generally be fast. But I'd like to filter out short over and under-voltage pulses, which probably don't pose any real threat to the powered devices. Well, an analog RC filter is/was indeed my preferred solution, but unfortunately I am not allowed to do any modifications in the PCB at this point. That's why I want to replace the analog with the digital filter. But I guess, even with an analog filter, I do need some sort of digital filtering for robustness, like requiring N consecutive values to be above/below the threshold. As for the "Power Good" pins of the converter, they do exist some times, but my understanding there is that they (or at least those that I have seen) don't give any information about over-voltage conditions but only about under-voltage. |
|
|
|
只有小组成员才能发言,加入小组>>
5171 浏览 9 评论
2001 浏览 8 评论
1931 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3176 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2228 浏览 5 评论
737浏览 1评论
622浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
509浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
635浏览 0评论
533浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-26 02:30 , Processed in 1.452213 second(s), Total 84, Slave 71 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号