Files
graduation-project/main.adoc

303 lines
13 KiB
Plaintext
Raw Normal View History

2024-03-07 09:46:26 +08:00
= 基于 CNN 和 MEMS 的边缘计算振动检测设备
2024-03-07 09:20:27 +08:00
曹王仁博 <cao.wangrenbo@yandex.com>
2024.03.11
2024-03-07 09:20:27 +08:00
:toc: auto
:stem: latexmath
2024-03-07 09:20:27 +08:00
2024-03-07 09:46:26 +08:00
== 摘要
随着物联网 (IoT) 和工业 4.0 的快速发展,对实时监测和分析振动数据的需求不断增长。传统的振动监测系统通常依赖于中心服务器进行数据处理,这会带来延迟和数据传输成本高昂的问题。为了解决这些问题,本文提出了一种基于卷积神经网络 (CNN) 和微机电系统 (MEMS) 的边缘计算振动检测设备。该设备能够在本地进行实时振动分析,并通过无线网络将结果传输到远程服务器。
=== 研究现状
传统的振动监测系统通常由传感器、数据采集器和中心服务器组成。传感器负责采集振动数据,数据采集器负责将数据传输到中心服务器,中心服务器负责进行数据分析和处理。这种模式存在以下问题:
- 调试过程复杂:传统方案主要依靠专家针对测得的信号进行时域和频域特征的分析,通过尝试合适的算法提取振动特征,对于不同的设备需要专门化处理,对于复杂场景的快速部署是不利的。
- 数据延迟:由于数据需要传输到中心服务器进行处理,因此会存在一定的延迟,这对于需要实时监测的应用来说是不可接受的。
数据传输成本高昂:对于大型监测系统,需要传输大量数据,这会带来高昂的数据传输成本。
- 安全性和可靠性问题:中心服务器容易受到攻击和故障的影响,这会影响系统的安全性和可靠性。
=== 边缘计算
边缘计算是一种将计算资源从中心服务器迁移到边缘设备的新兴技术。边缘设备可以是任何靠近数据源的设备,例如智能手机、智能传感器和网关。边缘计算可以有效解决传统模式存在的延迟、成本和安全问题。
=== CNN 和 MEMS
CNN 是一种深度学习算法在图像识别和自然语言处理等领域取得了巨大成功。CNN 也可用于振动信号分析。MEMS 是一种微型机电系统可以用于制造微型传感器。MEMS 传感器可以用于采集振动数据。
=== 本文提出的设备
本文提出的设备由以下部分组成:
- MEMS 传感器:用于采集振动数据。
- CNN 处理器:用于进行实时振动分析。
- 无线通信模块:用于将分析结果传输到远程服务器。
本文提出了一种基于 CNN 和 MEMS 的边缘计算振动检测设备。该设备能够在本地进行实时振动分析,并通过无线网络将结果传输到远程服务器。该设备可以有效解决传统振动监测系统存在的延迟、成本和安全问题。
关键词振动监测、边缘计算、CNN、MEMS
2024-03-07 09:20:27 +08:00
2024-03-07 09:58:09 +08:00
== Abstract
With the rapid development of the Internet of Things (IoT) and Industry 4.0, there is a growing need for real-time monitoring and analysis of vibration data. Traditional vibration monitoring systems typically rely on a central server for data processing, which introduces problems with latency and high data transmission costs. To address these issues, this paper proposes an edge computing vibration detection device based on convolutional neural networks (CNN) and micro-electromechanical systems (MEMS). The device is capable of performing real-time vibration analysis locally and transmitting the results to a remote server via wireless network.
=== Current status of research
Traditional vibration monitoring systems usually consist of sensors, data collectors and central servers. The sensor is responsible for collecting vibration data, the data collector is responsible for transmitting the data to the central server, and the central server is responsible for data analysis and processing. This model has the following problems:
- The debugging process is complex: Traditional solutions mainly rely on experts to analyze the time domain and frequency domain characteristics of the measured signals, and extract vibration characteristics by trying appropriate algorithms. Specialized processing is required for different equipment, and rapid deployment in complex scenarios is Adverse.
- Data delay: Since the data needs to be transmitted to the central server for processing, there will be a certain delay, which is unacceptable for applications that require real-time monitoring.
Data transmission costs are high: For large monitoring systems, a large amount of data needs to be transmitted, which will bring high data transmission costs.
- Security and reliability issues: Central servers are vulnerable to attacks and failures, which can affect the security and reliability of the system.
=== Edge Computing
Edge computing is an emerging technology that migrates computing resources from central servers to edge devices. An edge device can be any device that is close to the data source, such as smartphones, smart sensors, and gateways. Edge computing can effectively solve the latency, cost and security issues of traditional models.
=== CNN and MEMS
CNN is a deep learning algorithm that has achieved great success in areas such as image recognition and natural language processing. CNN can also be used for vibration signal analysis. MEMS are microelectromechanical systems that can be used to create tiny sensors. MEMS sensors can be used to collect vibration data.
=== Equipment proposed in this article
The device proposed in this article consists of the following parts:
- MEMS sensors: used to collect vibration data.
- CNN processor: for real-time vibration analysis.
- Wireless communication module: used to transmit analysis results to a remote server.
This paper proposes an edge computing vibration detection device based on CNN and MEMS. The device is capable of performing real-time vibration analysis locally and transmitting the results to a remote server via wireless network. This device can effectively solve the delay, cost and safety problems of traditional vibration monitoring systems.
Keywords: vibration monitoring, edge computing, CNN, MEMS
== 绪论
// 和摘要有点冲突,后面再改
2024-03-26 12:33:52 +08:00
=== 课题研究背景及其意义
=== 国内外研究现状
==== 振动传感器应用现状
==== 振动信号采集监测设备研究现状
==== 边缘计算技术研究现状
=== 当前存在的主要问题
=== 本论文主要研究内容
=== 论文结构
== 基于 MEMS 和 CNN 的边缘计算振动监测节点总体方案
=== 总体技术架构
=== 需求分析
=== 总体方案
== 基于 MEMS 和 CNN 的边缘计算振动监测节点的硬件设计
=== LIS3DH 型加速度传感器单元及其电路设计
=== AHT20 型温度传感器单元及其电路设计
=== GD32F405RGT6 微控制器及其电路设计
设计要求能够运行裁剪后的卷积神经网络 (CNN),对于处理器的存储和运算处理能力有一定要求。此外,还要求有一定的耐候性要求,以应对家用或者环境较为恶劣的工业场景。同时考虑作为消费级设备的成本问题,本文设计的振动检测设备的主控核心选用意法半导体的 STM32F405RGT6。另外考虑国产化要求同时选用可 Pin to Pin 替代的 GD32F405RGT6 进行替换测试,该芯片对于本设计所需性能参数要优于 STM32F405RGT6。对于 STM32F405RGT6其架构如图所示。
image:doc_attachments/2024-03-11T03-02-23-728Z.png[STM32F405RG 系统框图]
STM32F405RGT6 基于高性能 Arm® Cortex®-M4 32 位 RISC 内核,运行频率可达 168 MHz。Cortex-M4 内核具有浮点单元FPU单精度支持所有 Arm 单精度数据处理指令和数据类型。它还实现了完整的 DSP 指令和内存保护单元 (MPU),可增强应用程序安全性。
STM32F405RGT6 采用高速嵌入式存储器1 Mbyte 闪存和 192 KB SRAM、4 KB 备份 SRAM以及广泛的增强型 I/O 和外设,连接到两个 APB 总线、3 条 AHB 总线和 1 个 32 位多 AHB 总线矩阵。提供三个 12 位 ADC、两个 DAC、一个低功耗 RTC、多个定时器以及标准和高级功能通讯接口。
工作温度范围为 40 至 +105 °C
image:doc_attachments/2024-03-11T03-29-49-397Z.png[主控电路原理图]
主控部分的电路由电源、复位电路、启动选择电路、外部高速时钟、外部低速时钟组成。
其中电源部分结合本设计中不考虑器件低功耗运行的情况,使用一个 3.3V 为多个供电域直接供电,并外接退耦和滤波电容,降低开关噪声和电压跌落对主控造成的影响。
复位部分由于芯片内部有一个 40K 的上拉电阻,所以仅需外接一个 0.1uF 的陶瓷电容和一个按键,该电路在上电和按键按下时,可以将 NRST 引脚电平拉低到
[stem]
++++
V_{IL(NRST)}=0.3V_{DD}\approx0.99V
++++
以下,并持续超过
[stem]
++++
T_{NRST} = 20us
++++
2024-03-12 18:08:55 +08:00
的时间
2024-03-26 17:31:49 +08:00
=== CH582F 微控制器及其电路设计
=== RS-485 通信接口设计
image::doc_attachments、2024-03-26T09-20-09-142Z.png[RS-485 收发器原理图]
本设计考虑到设备在工业场景下工作的可能,并考虑到方便接入现有的现场控制总线,所以采用了工业上常用的 RS-485 总线接口。为了简化主控操作,在考虑到通常工业总线通信波特率较低的情况下,设计使用了自动换向电路,不需要主控在操作前对收发器进行读写状态转换。本设计中 RS-485 收发器选用 SP3485 芯片。该芯片内部框图如图所示、
image::doc_attachments/2024-03-26T09-23-22-414Z.png[SP3485 内部框图]
在主控工作在写状态时,当 TXD 电平下降NPN 管关闭,此时收发器 2、3 脚经 4.7K 电阻上拉到 3.3V达到失能接收使能发送的效果。而当主控工作在读状态时TXD 上无电平变化,其上拉到 3.3V。此时 NPN 管开启,将收发器 2、3 脚和 GND 导通,达到使能接收,失能发送的效果。
但是由于三极管截止和饱和状态切换速度较慢,输入信号的边沿变化也趋于平缓。所以使用自动换向电路时,设备要求工作在较低的通信速率上。考虑到兼容性,设计通信波特率为 115200 或 9600。
=== 电源设计
2024-03-12 18:08:55 +08:00
image:doc_attachments/2024-03-11T13-29-59-494Z.png[电源电路原理图]
本文设计的设备采用工业上常见的 12-24V 直流电源供电需要给主控、温度和加速度传感器、485 通信模块等供电。
由于主控和传感器供电电压较小,而输入电压较大,所以设计为两级降压方式。先使用开关电源芯片将电压降至 5V再使用 LDO 芯片将电压降至 3.3V。这样的设计提高了电源效率,同时降低了输入主控和传感器的开关噪声。
image:doc_attachments/2024-03-12T04-30-03-730Z.png[供电结构]
==== SGM6132 设计计算
SGM6132 为一款标称 3A28.5V1.4MHz 的异步开关电源转换芯片,典型应用电路如图所示。
image:doc_attachments/2024-03-12T08-54-01-296Z.png[SGM6132 典型应用电路]
根据本文应用需求,主要设计的计算有电感 L、反馈分压电阻 R1 R2、续流二极管 D1。
===== 反馈电阻 R1 R2 设计
对于反馈电阻 R1 R2
[stem]
++++
V_{FB} = V_{OUT}\frac{R2}{R1+R2}
++++
其中,根据数据手册得
[stem]
++++
V_{FB} = 0.8V
++++
又有要求
[stem]
++++
R2 < 100k\Omega
++++
故选择
[stem]
++++
R2 = 10k\Omega
R1 = 52.3k\Omega
++++
计算得
[stem]
++++
V_{OUT} = 0.8\times\frac{R1+R2}{R2} = 0.8\times\frac{10+52.3}{10} = 4.984V
++++
该输出电压满足后级 LDO 的最小压降。
===== 电感 L 设计
[stem]
++++
L = \frac{V_{OUT}}{f_{OSC}\times{\Delta}I_L}\times(1-\frac{V_{OUT}}{V_{IN}})
++++
其中
[stem]
++++
时钟频率 f_{OSC} = 1.4MHz
输入电压 V_{IN} = 24V
峰峰电流值 {\Delta}I_L = 30\% \times I_L
最大峰值电流 I_L = I_{LOAD} + \frac{V_{OUT}}{2 \times f_{OSC} \times L} \times (1 - \frac{V_{OUT}}{V_{IN}})
++++
设计负载电流 1.7A
所以有
[stem]
++++
I_L = 2.000A
++++
代入得
[stem]
++++
L = 4.712 \times 10^{-6} H = 4.712 uH
++++
就近取标准功率电感值
[stem]
++++
L = 4.7uH
++++
===== 续流二极管 D1 设计
为了减小二极管正向导通损失和恢复时间,续流二极管类型选择肖特基二极管。要求其最大反向电压大于最大输入电压,最大过流能力大于最大负载电流。
2024-03-26 17:31:49 +08:00
按照该需求选择 D1 型号为 SS34。
==== XC6206 设计
XC6206 为一款标称最大输出电流 200mA 最大输入电压 6.0V 的 CMOS 稳压器,典型应用电路如图所示。
image::doc_attachments/2024-03-26T08-58-51-017Z.png[XC6206 典型应用电路]
设计上选用 1uF 的低 ESR 陶瓷电容,尽可能的靠经放置在芯片的输入和输出引脚附近。
=== 基于 MEMS 和 CNN 的边缘计算振动监测节点 PCB 设计
== 基于 MEMS 和 CNN 的边缘计算振动监测节点的程序开发
=== 基于 MEMS 和 CNN 的边缘计算振动监测节点主控程序开发
==== 程序整体架构
==== 振动信号采集子程序
==== 基于 FFT 和小波变换的数据预处理
==== 基于 Keras 的 CNN 训练过程
==== 基于 Cube-AI 的推理模型转化和部署
==== 基于 Modbus 总序协议的程序设计
==== 设备间数据交换程序设计
=== 基于 MEMS 和 CNN 的边缘计算振动监测节点蓝牙设备程序开发
==== 设备间数据交换程序设计
==== BLE 广播模式程序设计
==== BLE MESH 模式程序设计 (optional)
== 基于 MEMS 和 CNN 的边缘计算振动监测节点有效性验证(及工程集成应用)
=== 验证场景
=== 基于 MEMS 和 CNN 的边缘计算振动监测节点工况识别准确性验证
== 总结与展望
=== 总结
=== 展望