diff --git a/README.md b/README.md index aa42ebc9..e0e20f86 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,7 @@ Projects devoted to the use of sensors, audio, or image data specific to the pre * [Fluid Leak Detection With a Flowmeter and AI - Seeed Wio Terminal](predictive-maintenance-and-fault-classification/fluid-leak-detection-with-flowmeter-seeed-wio-terminal.md) * [Pipeline Clog Detection with a Flowmeter and AI - Seeed Wio Terminal](predictive-maintenance-and-fault-classification/pipeline-clog-detection-with-flowmeter-seeed-wio-terminal.md) * [Refrigerator Predictive Maintenance - Arduino Nano 33 BLE Sense](predictive-maintenance-and-fault-classification/refrigerator-predictive-maintenance-arduino-nano-33.md) +* [Motor Pump Predictive Maintenance - Infineon PSoC 6 WiFi-BT Pioneer Kit + CN0549](predictive-maintenance-and-fault-classification/motor-pump-cypress-cn0549.md) ### Accelerometer & Activity Projects diff --git a/SUMMARY-v2.md b/SUMMARY-v2.md deleted file mode 100644 index aaf3329f..00000000 --- a/SUMMARY-v2.md +++ /dev/null @@ -1,158 +0,0 @@ -# Table of contents - -* [Welcome](README.md) - -## Image Projects - -* [Recyclable Materials Sorter - Nvidia Jetson Nano](recyclable-materials-sorter.md) -* [Analog Meter Reading - Arduino Nicla Vision](analog-meter-reading-with-nicla-vision.md) -* [Creating Synthetic Data with Nvidia Omniverse Replicator](nvidia-omniverse-replicator.md) -* [Traffic Monitoring using the Brainchip Akida Neuromorphic Processor](brainchip-akida-traffic-monitoring.md) -* [Workplace Organizer - Nvidia Jetson Nano](workplace-organizer.md) -* [Container Counting with a Nicla Vision & FOMO](container-counting-nicla-vision.md) -* [Smart Smoke Alarm Using Thermal Imaging](smart-smoke-alarm.md) -* [Shield Bot Autonomous Security Robot](shieldbot.md) -* [Cyclist Blind Spot Detection](cyclist-blind-spot-detection.md) -* [IV Drip Fluid-Level Monitoring](iv-drip-fluid-level-monitoring.md) -* [Worker Safety Monitoring with Nvidia Jetson Nano](worker-safety-monitoring.md) -* [Delivered Package Detection with Computer Vision](parcel-detection.md) -* [Bean Leaf Classification with Sony Spresense](bean-leaf-classification.md) -* [Oil Tank Measurement and Delivery Improvement Using Computer Vision](oil-tank-gauge-monitoring.md) -* [Adaptable Vision Counters for Smart Industries](adaptable-vision-counters.md) -* [Smart Cashier with FOMO on a Raspberry Pi](smart-cashier.md) -* [Identifying PCB Defects with Machine Learning](identifying-pcb-defects.md) -* [Counting Eggs with Computer Vision](egg-counting-openmv.md) -* [Elevator Passenger Counting Using Computer Vision](elevator-passenger-counting.md) -* [Bicycle Counting with a Sony Spresense](spresense-bicycle-counter.md) -* [ESD Protection using Computer Vision](esd-protection-using-computer-vision.md) -* [Solar Panel Defect Detection with FOMO on an Arduino Portenta](solar-panel-defect-detection.md) -* [Automated Label Inspection With FOMO](label-inspection.md) -* [Knob Eye: Monitor Analog Dials and Knobs with Computer Vision](ml-knob-eye.md) -* [Posture Detection for Worker Safety](worker-safety-posture-detection.md) -* [TinyML Digital Counter for Electric Metering System](tinyml-digital-counter-openmv.md) -* [Corrosion Detection with Seeed reTerminal](corrosion-detection-reterminal.md) -* [Automated Inventory Management with Computer Vision](automated-inventory-management.md) -* [Monitoring Retail Checkout Lines with Computer Vision on the RZ/V2L](monitoring-checkout-lines-rzv2l.md) -* [Smart Grocery Cart Using Computer Vision](smart-grocery-cart-with-computer-vision.md) -* [Driver Drowsiness Detection With FOMO](driver-drowsiness-detection-with-computer-vision.md) -* [TinyML for Gastroscopic Image Processing](tinyml-gastroscopic-image-processing.md) -* [Pharmaceutical Pill Quality Control and Defect Detection](pharmaceutical-pill-defect-detection.md) -* [Counting Retail Inventory with Computer Vision on the RZ/V2L](counting-retail-inventory-rzv2l.md) -* [Use Computer Vision on a TI TDA4VM to Deter Shoplifting](deter-shoplifting-with-computer-vision.md) -* [Retail Image Classification with a Jetson Nano](retail-image-classification-jetson-nano.md) -* [Smart Factory Prototype with Texas Instruments TDA4VM](smart-factory-with-tda4vm.md) -* [Fall Detection using Computer Vision for Industrial Workers](worker-fall-detection-computer-vision.md) -* [Surface Crack Detection and Localization with Texas Instruments TDA4VM](surface-crack-detection-ti-tda4vm.md) -* [Surface Crack Detection with Seeed reTerminal](surface-crack-detection.md) -* [The SiLabs xG24 Plus Arducam - Sorting Objects with Computer Vision and Robotics - Part 1](silabs-xg24-card-sorting-and-robotics-1.md) -* [The SiLabs xG24 Plus Arducam - Sorting Objects with Computer Vision and Robotics - Part 2](silabs-xg24-card-sorting-and-robotics-2.md) -* [Object Detection and Visualization with the Seeed Studio Grove Vision AI Module](object-detection-ubidots-seeed-grove-ai.md) -* [Renesas RZ/V2L DRP-AI Pose Detection](renesas-rzv2l-pose-detection.md) -* [Computer Vision for Product Quality Inspection with Renesas RZ/V2L](renesas-rzv2l-product-quality-inspection.md) -* [Build a Path-Following, Self-Driving Vehicle Using an Arduino Portenta H7 and Computer Vision](arduino-portenta-h7-self-driving-rc-car.md) -* [TI TDA4VM - Correct Posture Detection and Enforcement](ti-tda4vm-posture-enforcer.md) -* [Using a "Bring Your Own Model" Image Classifier for Wound Identification](arduino-portenta-h7-byom-wound-classification.md) -* [Acute Lymphoblastic Leukemia Classifier](ai-leukemia-classifier.md) - -## Audio Projects - -* [Glass Window Break Detection - Nordic Thingy:53](glass-break-detection-thingy53.md) -* [Occupancy Sensing - SiLabs EFR32MG24](occupancy-sensing-with-silabs.md) -* [Smart Appliance Control Using Voice Commands - Nordic Thingy:53](smart-appliance-voice-commands.md) -* [Illegal Logging Detection - Syntiant TinyML](illegal-logging-detection-syntiant.md) -* [Illegal Logging Detection - Nordic Thingy:53](illegal-logging-detection-nordic-thingy53.md) -* [Wearable Cough Sensor and Monitoring](wearable-cough-sensor.md) -* [Shield Bot Autonomous Security Robot](shieldbot.md) -* [Collect Data for Keyword Spotting with Raspberry Pi Pico and Edge Impulse](collect-data-raspberrypi-pico.md) -* [Voice-Activated LED Strip for $10: Raspberry Pi Pico and Edge Impulse](voice-activated-led-controller.md) -* [Snoring Detection on a Smart Phone](snoring-detection-on-smartphone.md) -* [Gunshot Audio Classification](gunshot-audio-classification.md) -* [AI-Powered Patient Assistance](ai-patient-assistance.md) -* [Acoustic Pipe Leak Detection](acoustic-pipe-leak-detection.md) -* [Location Identification using Sound](location-sound.md) -* [Environmental Noise Classification with a Nordic Thingy:53](environmental-noise-classification.md) -* [Running Faucet Detection with a Seeed XIAO Sense + Blues Cellular](running-faucet-detection.md) -* [Vandalism Detection via Audio Classification](vandalism-detection-audio-classification.md) -* [Predictive Maintenance Using Audio Classification](predictive-maintenance-with-sound.md) -* [Porting an Audio Project from the SiLabs Thunderboard Sense 2 to xG24](audio-recognition-on-silabs-xg24.md) -* [Environmental Audio Monitoring Wearable with Syntiant TinyML Board](environmental-audio-monitoring-syntiant-tinyml.md) -* [Environmental Audio Monitoring Wearable with Syntiant TinyML Board - Part 2](environmental-audio-monitoring-syntiant-tinyml-part-2.md) -* [Keyword Spotting on the Nordic Thingy:53](keyword-spotting-on-nordic-thingy53.md) -* [Detecting Worker Accidents with Audio Classification](detecting-worker-accidents-with-ai.md) -* [Snoring Detection with Syntiant NDP120 Neural Decision Processor on Nicla Voice](arduino-nicla-voice-syntiant-snoring-detection.md) -* [SonicSight AR - Sound Classification with Feedback on an Augmented Reality Display](particle-photon-2-sonicsight-ar.md) - -## Predictive Maintenance & Fault Classification - -* [Predictive Maintenance - Nordic Thingy:91](predictive-maintenance-with-nordic-thingy-91.md) -* [Brushless DC Motor Anomaly Detection](brushless-dc-motor-anomaly-detection.md) -* [Industrial Compressor Predictive Maintenance - Nordic Thingy:53](compressor-predictive-maintenance-thingy53.md) -* [EdenOff: Anticipate Power Outages with Machine Learning](edenoff-anticipate-power-outages.md) -* [Faulty Lithium-Ion Cell Identification in Battery Packs](faulty-lithium-ion-cell-identification.md) -* [Acoustic Pipe Leak Detection](acoustic-pipe-leak-detection.md) -* [Upgrade a Stretch-film Machine: Weight Scale and Predictive Maintenance](stretch-film-machine.md) -* [Fluid Leak Detection With a Flowmeter and AI](fluid-leak-detection-with-flowmeter-and-ai.md) -* [Pipeline Clog Detection with a Flowmeter and TinyML](clog-detection-with-ai.md) -* [Refrigerator Predictive Maintenance](refrigerator-predictive-maintenance.md) -* [Motor Pump Predictive Maintenance: CY8CKIT-062-WIFI-BT + cn0549](motor-pump-cypress-cn0549.md) - -## Accelerometer & Activity Projects - -* [Arduino x K-Way - Outdoor Activity Tracker](arduino-kway-outdoor-activity-tracker.md) -* [Arduino x K-Way - Gesture Recognition for Hiking](arduino-kway-gesture-recognition-weather.md) -* [Arduino x K-Way - TinyML Fall Detection](arduino-kway-fall-detection.md) -* [Hand Gesture Recognition using TinyML on OpenMV](hand-gesture-recgnition-using-tinyml-on-openmv.md) -* [Arduin-Row, a TinyML Rowing Machine Coach](arduin-row-tinyml-rowing-machine-coach.md) -* [Gesture Recognition with a Bangle.js Smartwatch](gesture-recognition-with-banglejs-smartwatch.md) -* [Bluetooth Fall Detection](bt-fall-detection.md) -* [Safeguarding Packages During Transit with AI](secure-packages-with-ai.md) -* [Smart Baby Swing](smart-baby-swing.md) -* [Warehouse Shipment Monitoring using a Thunderboard Sense 2](warehouse-shipment-monitoring.md) -* [Patient Communication with Gesture Recognition](patient-gesture-recognition.md) -* [Hospital Bed Occupancy Detection with TinyML](hospital-bed-occupancy-detection.md) -* [Fall Detection using a Transformer Model with Arduino Giga R1 WiFi](fall-detection-with-transformers-arduino-giga-r1.md) -* [Porting a Posture Detection Project from the SiLabs Thunderboard Sense 2 to xG24](silabs-xg24-posture-detection.md) -* [Porting a Gesture Recognition Project from the SiLabs Thunderboard Sense 2 to xG24](gesture-recognition-on-silabs-xg24.md) - -## Air Quality & Environmental Projects - -* [Arduino x K-Way - Environmental Asthma Risk Assessment](arduino-kway-environmental-risk-assessment.md) -* [Gas Detection in the Oil and Gas Industry - Nordic Thingy:91](gas-detection-thingy-91.md) -* [Smart HVAC System with an Arduino Nicla Vision](arduino-nicla-vision-smart-hvac.md) -* [Smart HVAC System with a Sony Spresense](sony-spresense-smart-hvac-system.md) -* [Indoor CO2 Level Estimation Using TinyML](indoor-co2-level-estimation-using-tinyml.md) -* [Bhopal 84, Detect Harmful Gases](detect-harmful-gases.md) -* [AI-Assisted Monitoring of Dairy Manufacturing Conditions](dairy-manufacturing-with-ai.md) -* [Fire Detection Using Sensor Fusion and TinyML](fire-detection-with-arduino-and-tinyml.md) -* [AI-Assisted Air Quality Monitoring with a DFRobot Firebeetle ESP32](air-quality-monitoring-firebeetle-esp32.md) -* [Air Quality Monitoring with Sipeed Longan Nano - RISC-V Gigadevice](air-quality-monitoring-sipeed-longan-nano-riscv.md) -* [Methane Monitoring in Mines - Silabs xG24 Dev Kit](methane-monitoring-silabs-xg24.md) - -## Novel Sensor Projects -* [8x8 ToF Gesture Classification](tof-gesture-classification.md) -* [Food Irradiation Dose Detection](food-irradiation-detection.md) -* [Bike Rearview Radar](bike-rearview-radar.md) -* [Applying EEG Data to Machine Learning, Part 1](eeg-data-machine-learning-part-1.md) -* [Applying EEG Data to Machine Learning, Part 2](eeg-data-machine-learning-part-2.md) -* [Applying EEG Data to Machine Learning, Part 3](eeg-data-machine-learning-part-3.md) -* [Fluid Leak Detection With a Flowmeter and AI](fluid-leak-detection-with-flowmeter-and-ai.md) -* [Pipeline Clog Detection with a Flowmeter and TinyML](clog-detection-with-ai.md) -* [Liquid Classification with TinyML](liquid-classification-tinyml.md) -* [AI-Assisted Pipeline Diagnostics and Inspection with mmWave Radar](ai-pipeline-inspection-mmwave.md) -* [Sensecap A1101 - Soil Quality Detection Using AI and LoRaWAN](sensecap-a1101-lorawan-soil-quality.md) -* [Smart Diaper Prototype with an Arduino Nicla Sense ME](arduino-nicla-sense-smart-diaper.md) - -## Software Integration Demos - -* [Azure Machine Learning with Kubernetes Compute and Edge Impulse](azure-machine-learning-EI.md) -* [Community Guide – Using Edge Impulse with Nvidia DeepStream](nvidia-deepstream-community-guide.md) -* [Creating Synthetic Data with Nvidia Omniverse Replicator](nvidia-omniverse-replicator.md) -* [NVIDIA Omniverse - Synthetic Data Generation For Edge Impulse Projects](nvidia-omniverse-synthetic-data.md) -* [ROS2 + Edge Impulse, Part 1: Pub/Sub Node in Python](ros2-part1-pubsub-node.md) -* [ROS2 + Edge Impulse, Part 2: MicroROS](ros2-part2-microros.md) -* [Using Hugging Face Datasets in Edge Impulse](using-huggingface-dataset-with-edge-impulse.md) -* [How to Use a Hugging Face Image Classification Dataset with Edge Impulse](hugging-face-image-classification.md) -* [Edge Impulse API Usage Sample Application - Jetson Nano Trainer](api-sample-application-jetson-nano.md) -* [Renesas CK-RA6M5 Cloud Kit - Getting Started with Machine Learning](renesas-ra6m5-getting-started.md) -* [TI CC1352P Launchpad - Getting Started with Machine Learning](ti-cc1352p-getting-started.md) -* [MLOps with Edge Impulse and Azure IoT Edge](mlops-azure-iot-edge.md) diff --git a/SUMMARY.md b/SUMMARY.md index c3bb4ec3..85a3ef73 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -101,6 +101,7 @@ * [Fluid Leak Detection With a Flowmeter and AI - Seeed Wio Terminal](predictive-maintenance-and-fault-classification/fluid-leak-detection-with-flowmeter-seeed-wio-terminal.md) * [Pipeline Clog Detection with a Flowmeter and AI - Seeed Wio Terminal](predictive-maintenance-and-fault-classification/pipeline-clog-detection-with-flowmeter-seeed-wio-terminal.md) * [Refrigerator Predictive Maintenance - Arduino Nano 33 BLE Sense](predictive-maintenance-and-fault-classification/refrigerator-predictive-maintenance-arduino-nano-33.md) +* [Motor Pump Predictive Maintenance - Infineon PSoC 6 WiFi-BT Pioneer Kit + CN0549](predictive-maintenance-and-fault-classification/motor-pump-cypress-cn0549.md) ## Accelerometer & Activity Projects diff --git a/predictive-maintenance-and-fault-classification/motor-pump-cypress-cn0549.md b/predictive-maintenance-and-fault-classification/motor-pump-cypress-cn0549.md index 7eb29f7e..ab60b844 100644 --- a/predictive-maintenance-and-fault-classification/motor-pump-cypress-cn0549.md +++ b/predictive-maintenance-and-fault-classification/motor-pump-cypress-cn0549.md @@ -1,9 +1,9 @@ --- description: >- - Predictive Maintenance of a motor pump using cy8ckit-062-wifi-bt pioneer kit and CN0549 condition-based monitoring platform. + Predictive Maintenance of a motor pump using the Infineon PSoC 6 Pioneer Kit and CN0549 condition-based monitoring platform. --- -# Motor Pump Predictive Maintenance - CY8CKIT-062-WIFI-BI pioneer kit - CN0549 Monitoring Platform +# Motor Pump Predictive Maintenance - Infineon PSoC 6 WiFi-BT Pioneer Kit + CN0549 Created By: Pratyush Mallick @@ -15,28 +15,30 @@ GitHub Repository: [https://github.com/Pratyush-Mallick/ei_cypress_cn549](https://github.com/Pratyush-Mallick/ei_cypress_cn549/) -![image](../.gitbook/assets/motor-pump-cypress-cn0549/1.jpg) +![](../.gitbook/assets/motor-pump-cypress-cn0549/1.jpg) ## Introduction -Pumps are critical equipment in every industrial operation. Pumps move liquids like beverages, dyes, and chemicals around production lines. They're also part of ancillary systems like hydraulics, lubrication, machine cooling, HVAC, and wastewater—all necessary to keep machines working, plant environments safe, and temperatures steady. Whatever pumps are doing, we want to keep them healthy! -For years, manufacturers have been practicing a preventive maintenance approach for industrial Pumps. However, this method of monitoring pump health has previously been a potentially time-intensive and costly task due to manual inspections of each equipment. When equipment is large in number and placed in accessible areas, the probability of failed equipment going unnoticed for an extended period is relatively high. +Pumps are critical equipment in every industrial operation. Pumps move liquids like beverages, dyes, and chemicals around production lines. They're also part of ancillary systems like hydraulics, lubrication, machine cooling, HVAC, and wastewater; all necessary to keep machines working, plant environments safe, and temperatures steady. Whatever pumps are doing, we want to keep them healthy! -### The Challenge +For years, manufacturers have been practicing a preventive maintenance approach for industrial pumps. However, this method of monitoring pump health has previously been a potentially time-intensive and costly task due to manual inspections of each piece of equipment. When equipment is large in number and placed in less-accessible areas, the probability of failed equipment going unnoticed for an extended period of time is relatively high. + +## The Challenge In industrial settings, pumps provide air to power tools, transfer steam for aluminum, paint sprayers, abrasive blast equipment, phase shift refrigerants for air conditioning and refrigeration, and propel gas through pipelines. -For some applications like steam making, the industrial pump must provide an optimal laminar liquid flow through the pipelines. Despite their harmless appearance, the bubbles in pumping systems are fundamentally distinct from those children typically blow with a wand. When pressure fluctuations inside the pumps give rise to minuscule bubbles, the ensuing collapse of these bubbles generates shock waves that are both powerful and constant. Over time, these recurring shocks wear down the components of the system through erosion or even may lead to ruining the production output. Regarding processing systems, bubbling or bubble cavitation should be avoided at all costs. +For some applications like steam making, the industrial pump must provide an optimal laminar liquid flow through the pipelines. Despite their harmless appearance, the bubbles in pumping systems are fundamentally distinct from those children typically blow with a wand. When pressure fluctuations inside the pumps give rise to minuscule bubbles, the ensuing collapse of these bubbles generates shock waves that are both powerful and constant. Over time, these recurring shocks wear down the components of the system through erosion or may lead to ruining the production output. Regarding processing systems, bubbling or bubble cavitation should be avoided at all costs. -### Our Solution +## Our Solution To address this, we will develop a predictive maintenance solution that gathers vibration data from a motor pump and uses machine learning algorithms to detect any bubble cavitation being formed in the pumping systems, which is considered abnormal behavior. -The whole principle of operation of a motor pump is based on moving parts. The process of formation and collapse in cavitation is characterized by its rapid and violent nature, which results in a different vibration signal than a normally operating pump. When such machinery manifests anomalous vibration patterns, a possible malfunction may occur, and critical equipment failure may be inbound. Such modifications may occur for hours or days, and human operators seldom pick them up. Such phenomena can be detected by harnessing IoT devices and machine learning algorithms, and maintenance teams may be alerted before machinery failure occurs. + +The whole principle of operation of a motor pump is based on moving parts. The process of formation and collapse in cavitation is characterized by its rapid and violent nature, which results in a different vibration signal than a normally operating pump. When such machinery manifests anomalous vibration patterns, a possible malfunction may occur, and critical equipment failure may be coming. Such modifications may occur for hours or days, and human operators seldom pick them up. Such phenomena can be detected by harnessing IoT devices and machine learning algorithms, and maintenance teams may be alerted before machinery failure occurs. ### Hardware Requirements * [Infineon PSoC™ 6 WiFi-BT Pioneer Kit](https://www.infineon.com/cms/en/product/evaluation-boards/cy8ckit-062-wifi-bt/) -* [CN0549 Condition monitoring Platform](https://www.analog.com/en/design-center/reference-designs/circuits-from-the-lab/cn0549.html) +* [CN0549 Condition Monitoring Platform](https://www.analog.com/en/design-center/reference-designs/circuits-from-the-lab/cn0549.html) * Industrial Motor Pump * 2 * USB-C cable @@ -49,22 +51,25 @@ The whole principle of operation of a motor pump is based on moving parts. The p * [Precision Converters Firmware for CN0549](https://github.com/analogdevicesinc/precision-converters-firmware/tree/main/projects/ad77681_iio) * [pyadi-iio 0.14](https://pypi.org/project/pyadi-iio/0.0.14/) * [libiio 0.24](https://github.com/analogdevicesinc/libiio/releases/tag/v0.24) -* python 3.10 +* Python 3.10 ## Hardware Setup -For this application, we would use a condition-based prototyping platform developed by Analog Devices CN0549 and PSOC 6 Wifi-BT pioneer kit by Infineon. +For this application, we will use a condition-based prototyping platform developed by Analog Devices (CN0549) and PSOC 6 Wifi-BT Pioneer Kit by Infineon. + +The CN0549 is a condition-based monitoring platform based around the integrated electronic piezoelectric (IEPE) standard, a popular signaling interface standard for high-end microelectronic mechanical systems (MEMS) and piezo sensors that are prevalent in industry today. The kit comes with a mechanical mount optmized for vibration fidelity. For setting up the board with the sensor and to learn more about the hardware, please refer to the links below: -The CN0549 is a condition-based monitoring platform based around the integrated electronic piezoelectric (IEPE) standard, a popular signaling interface standard for high-end microelectronic mechanical systems (MEMS) and piezo sensors that are prevalent in the industry today. The kit comes with a mechanical mount optmized for vibration fidelity. For setting up the board with the sensor and learn more about the hardware, please refer to the links below: * [Putting together CN0549](https://wiki.analog.com/resources/eval/user-guides/circuits-from-the-lab/cn0549#:~:text=Card%20using%20Linux-,Putting%20together%20the%20CN0549,-Take%20out%20the) * [Understanding the circuit](https://www.analog.com/en/design-center/reference-designs/circuits-from-the-lab/cn0549.html#rd-functionbenefits) -The anchor of this solution is Infineon's PSOC 6 Wifi-BT pioneer kit. The application processor is performance-optimized and runs at 150 MHz, and the co-processor is M0, which can run at 100 MHz. Both cores are power-efficient. It has a floating-point unit (FPU), an 8 KB 2-way associative cache, 1 MB Flash, and 288 KB RAM. The board also has a capacitive sensing block and the capability of programable digital and analog blocks known as PSOC. It is an excellent pick for developing edge ML applications requiring a direct sensor interface. Moreover, board Wi-Fi support and a USB host device would be helpful for high-speed data logging. +The anchor of this solution is Infineon's PSOC 6 Wifi-BT Pioneer Kit. The application processor is performance-optimized and runs at 150 MHz, and the co-processor is an Arm M0 core, which can run at 100 MHz. Both cores are power-efficient. It has a floating-point unit (FPU), an 8 KB 2-way associative cache, 1 MB Flash, and 288 KB RAM. The board also has a capacitive sensing block and the capability of programable digital and analog blocks known as PSOC. It is an excellent pick for developing edge ML applications requiring a direct sensor interface. Moreover, board Wi-Fi support and a USB host device can be helpful for high-speed data logging. -Here are some pictures of the hardware before and after the assembly. Refer to the CN0549 reference guide for sensor-specific modifications, such as selecting coaxial wire and jumper settings. Switch the SW7 to position one on the MCU board side, ensuring that the sensor board is powered from kitprog2 stable VDD supply. Also, ensure the board is in daplink mode for easy debugging in the software section. -![image](../.gitbook/assets/motor-pump-cypress-cn0549/2.jpg) +Here are some pictures of the hardware before and after the assembly. Refer to the CN0549 reference guide for sensor-specific modifications, such as selecting coaxial wire and jumper settings. Switch the `SW7` to position **one** on the MCU board side, ensuring that the sensor board is powered from kitprog2 stable VDD supply. Also, ensure the board is in **daplink** mode for easy debugging in the software section. + +![](../.gitbook/assets/motor-pump-cypress-cn0549/2.jpg) + +![](../.gitbook/assets/motor-pump-cypress-cn0549/3.jpg) -![image](../.gitbook/assets/motor-pump-cypress-cn0549/3.jpg) ## Software Setup ### Creating an Edge Impulse Project @@ -73,152 +78,175 @@ Let's start by developing an Edge Impulse project. Log into your Edge Impulse account, pick **Create new project** from the menu, give it a recognizable name, choose **Developer** as the project type, and then click **Create new project**. -![image](../.gitbook/assets/motor-pump-cypress-cn0549/3_1.jpg) +![](../.gitbook/assets/motor-pump-cypress-cn0549/3_1.jpg) Afterward, select **Accelerometer** data as the type of data you will be dealing with. -### IIO Background -The Industrial I/O subsystem is intended to support devices analog to digital or digital to analog converters (ADCs, DACs) or even beyond. It provides a standard interface to talk to converters across different hardware and software platforms. Using libiio and other application-specific wrapper libraries, the hardware can talk to any client-side number-crunching applications such as Python or Matlab. Since the firmware for CN0549 is based on the iio stack, we would use the pyadi-iio package to collect data in Python from the firmware. +### IIO Background + +The Industrial I/O subsystem is intended to support a device's analog to digital or digital to analog converters (ADCs, DACs) or even beyond. It provides a standard interface to talk to converters across different hardware and software platforms. Using `libiio` and other application-specific wrapper libraries, the hardware can talk to any client-side number-crunching applications such as Python or Matlab. Since the firmware for CN0549 is based on the iio stack, we will use the `pyadi-iio` package to collect data in Python from the firmware. Before starting to build the dataset, you should install these first, or else the Python code might fail to run: * [pyadi-iio 0.14](https://pypi.org/project/pyadi-iio/0.0.14/) * [libiio 0.24](https://github.com/analogdevicesinc/libiio/releases/tag/v0.24) * python 3.10 -### Building the firmware: -The default firmware available for CN0549 is based on mbed-OS and iiod stack. Since our cy8ckit-062-wifi-bt is also mbed-enabled, we can port the existing code to our board with little modifications. I have already done that for you; you can directly import the firmware into the Keil studio cloud from the link below, which lets you build and debug the firmware inside the browser. +### Building the Firmware + +The default firmware available for CN0549 is based on mbed-OS and the iiod stack. Since our CY8CKIT-062-WIFI-BT is also mbed-enabled, we can port the existing code to our board with little modifications. I have already done that for you; you can directly import the firmware into the Keil studio cloud from the link below, which lets you build and debug the firmware inside the browser. + * [EI_Cypress_CN0549](https://github.com/Pratyush-Mallick/ei_cypress_cn549) * [Guide for clone Github project into Keil Studio Cloud](https://developer.arm.com/documentation/102497/1-7/Work-with-Mbed-projects/Create--import-or-clone-an-Mbed-project-or-a-standalone-library/Clone-an-Mbed-project-or-a-standalone-library) Some of the modifications done so far to make this compatible are listed below: -* Changed the SPI mode in the user_config.c and pin mappings in app_config_mbeb.c/.h files. You can want to use different pins or configurations; you can change them in these files. -* Disabled some of the wireless stacks on the mbed-OS to avoid conflicts. There can be found .mbedignore file in the root of the directory. -* Changed pin name in mbed-OS to avoid conflict with edge impulse library. This happens explicitly when using the ARM compiler. With GCC, it builds fine. The modified mbed-OS can be found [here](https://github.com/Pratyush-Mallick/mbed-os). The mbed-OS for our firmware would be cloned from this repository when we import the code into Keil studio. -![image](../.gitbook/assets/motor-pump-cypress-cn0549/4.jpg) +* Changed the SPI mode in the `user_config.c` and pin mappings in `app_config_mbeb.c/.h` files. If you want to use different pins or configurations; you can change them in these files. +* Disabled some of the wireless stacks in the mbed-OS to avoid conflicts. These can be found in the `.mbedignore` file in the root of the directory. +* Changed pin name in mbed-OS to avoid conflict with the Edge Impulse library. This happens explicitly when using the ARM compiler. With GCC, it builds fine. The modified mbed-OS can be [found here](https://github.com/Pratyush-Mallick/mbed-os). The mbed-OS for our firmware should be cloned from this repository when we import the code into Keil studio. + +![](../.gitbook/assets/motor-pump-cypress-cn0549/4.jpg) + * We're using the board as a USB host; you might need to connect another cable to another port. -![image](../.gitbook/assets/motor-pump-cypress-cn0549/5.jpg) -* Change the DAC code in the firmware to remove any DC bias. IEPE accelerometer has a specific DC bias voltage that must be removed because this voltage does not carry any useful information. This is a crucial step to ensure that you're receiving reliable data. Even changing the length of the cable connected to the sensor can also affect the DC bias. You can use the code and select option - 21 (Compensate Piezo sensor offset), which Automatically compensates for voltage offsets in the sensor, giving more accurate data. The user should run this after connecting a new sensor. - * [Offset Compensation Code](https://wiki.analog.com/resources/eval/user-guides/circuits-from-the-lab/cn0540/sdp-k1#:~:text=Compensate%20Piezo%20sensor,a%20new%20sensor.) - * [Learn more about CN0549 board circuit](https://www.analog.com/en/design-center/reference-designs/circuits-from-the-lab/cn0540.html#rd-description) +![](../.gitbook/assets/motor-pump-cypress-cn0549/5.jpg) + +* Change the DAC code in the firmware to remove any DC bias. The IEPE accelerometer has a specific DC bias voltage that must be removed because this voltage does not carry any useful information. This is a crucial step to ensure that you're receiving reliable data. Even changing the length of the cable connected to the sensor can affect the DC bias. You can use the code and select Option 21 (Compensate Piezo sensor offset), which automatically compensates for voltage offsets in the sensor, giving more accurate data. The user should run this after connecting a new sensor. + +* [Offset Compensation Code](https://wiki.analog.com/resources/eval/user-guides/circuits-from-the-lab/cn0540/sdp-k1#:~:text=Compensate%20Piezo%20sensor,a%20new%20sensor.) +* [Learn more about CN0549 board circuit](https://www.analog.com/en/design-center/reference-designs/circuits-from-the-lab/cn0540.html#rd-description) -![image](../.gitbook/assets/motor-pump-cypress-cn0549/6.jpg) -* Since most of the drivers and firmware for the CN0549 are C code and edge impulse is on C++, we need to use EI_C_LINKAGE=1 flags to build the code properly. Some other flags and configurations can be found in the mbed_app.json file. +![](../.gitbook/assets/motor-pump-cypress-cn0549/6.jpg) + +* Since most of the drivers and firmware for the CN0549 are C code and Edge Impulse is C++, we need to use `EI_C_LINKAGE=1` flags to build the code properly. Some other flags and configurations can be found in the `mbed_app.json` file. + +![](../.gitbook/assets/motor-pump-cypress-cn0549/7.jpg) -![image](../.gitbook/assets/motor-pump-cypress-cn0549/7.jpg) +Once the code has been imported into the Keil Studio, connect the board through the **kitprog2** USB port, and the Studio should automatically detect the device, or else you can manually select the board and build the code. -Once the code has been imported into the Keil studio, connect the board through the kitprog2 USB port, and the studio should automatically detect the device, or else you can manually select the board and build the code. -Ensure that all libraries have been appropriately cloned. All the modified mbed-OS and edge impulse model libraries are linked through .lib files with specific commit ids. Click the exclamation mark in the picture below, and that should check out the libraries properly. +Ensure that all libraries have been appropriately cloned. All the modified mbed-OS and Edge Impulse model libraries are linked through `.lib` files with specific Commit IDs. Click the "Exclamation mark" shown in the picture below, and that should check out the libraries properly. -![image](../.gitbook/assets/motor-pump-cypress-cn0549/8.jpg) +![](../.gitbook/assets/motor-pump-cypress-cn0549/8.jpg) -Please change the macro in the app_config.h file depending upon the intended use. You can either use it for data logging or inferencing. In inference mode, the firmware returns the client two extra bytes of classification results and the accelerometer data. +Please change the macro in the `app_config.h` file depending upon the intended use. You can either use it for data logging or inferencing. In inference mode, the firmware returns the client two extra bytes of classification results and the accelerometer data. -![image](../.gitbook/assets/motor-pump-cypress-cn0549/9.jpg) +![](../.gitbook/assets/motor-pump-cypress-cn0549/9.jpg) -Once all the modifications are done, build and load the code onto the hardware directly from the Keil Studio using the run button or download the hex file and drag-n-drop into the daplink drive. +Once all the modifications are done, build and load the code onto the hardware directly from the Keil Studio using the **Run** button or download the .hex file and drag-and-drop into the daplink drive. -If everything loads up correctly, you can connect the cable to the USB device port on board, which should be detected. +If everything loads up correctly, you can connect the cable to the USB device port on the board, which should be detected. -### Building the Dataset +## Building the Dataset -To build the data set, we would collect the data from the device using pyadi-iio drivers into Python and then push it to edge impulse using its ingestion APIs. You can find the Python drivers in the py_supplement folder of the firmware repository or visit the following [link](https://github.com/Pratyush-Mallick/ei_cypress_cn549/blob/main/py_supplement/pcg_cn549_python.ipynb). -This jupyter notebook has all the initialization and data logging code. Run all the cells in the notebook one by one except the last two cells. One is used for inference, and the other is for pushing data into the edge impulse. -Here is the snapshot of the code. Add your HMAC and API_KEY into the code, and you can also set the sampling frequency (which needs to be in sync with the sampling frequency specified in the firmware) and then run the code. -Changing the block_size will determine the sample lengthsample length, which also depends on the sampling frequency. Here is a snapshot: +To build the data set, we should collect the data from the device using _pyadi-iio_ drivers in Python and then push it to Edge Impulse using the Ingestion API. You can find the Python drivers in the `py_supplement` folder of the firmware repository or visit the [following link](https://github.com/Pratyush-Mallick/ei_cypress_cn549/blob/main/py_supplement/pcg_cn549_python.ipynb). -![image](../.gitbook/assets/motor-pump-cypress-cn0549/10.jpg) +This Jupyter notebook has all the initialization and data logging code. Run all the cells in the notebook one by one, except the last two cells. One is used for inference, and the other is for pushing data into Edge Impulse. -Your device will show up in the device section. Also, before running the code, set the label in the script, and data would arranged accordingly in the edge impulse studio. You should be able to see your incoming data in the data acquisition tab. +Here is a snapshot of the code. Add your `HMAC` and `API_KEY` into the code, and you can also set the sampling frequency (which needs to be in sync with the sampling frequency specified in the firmware) and then run the code. -![image](../.gitbook/assets/motor-pump-cypress-cn0549/11.jpg) +Changing the `block_size` will determine the sample length, which also depends on the sampling frequency. Here is a snapshot: + +![](../.gitbook/assets/motor-pump-cypress-cn0549/10.jpg) + +Your device will show up in the **Device** section in the Studio. Also, before running the code, set the `label` in the script, and data will be arranged accordingly in the Edge Impulse Studio. You should be able to see your incoming data in the **Data acquisition** tab. + +![](../.gitbook/assets/motor-pump-cypress-cn0549/11.jpg) We have built a motor pump system with an inlet and outlet container to demonstrate the solution. For this application, the accelerometer is directly mounted on the wooden sheet near the motor pump unit for demonstration purposes in the hardware setup. The mounting block has a cross-section for inserting a screw into any hardware. You can also mount the accelerometer and mounting block directly on the pump. Once mounted, we record data for "Normal" and "Bubbling." For bubbling, we deliberately half-fill the container so air bubbles can form at the motor inlet. -Ensure to take data on various motor power to avoid overfitting the model. Here are some snaps: -![image](../.gitbook/assets/motor-pump-cypress-cn0549/12.jpeg) +Be sure to collect data with various motor power selections to avoid overfitting the model. + +![](../.gitbook/assets/motor-pump-cypress-cn0549/12.jpeg) During regular operation, the motor pump manifests a vibration with a low amplitude, with rhythmic increases in amplitude once every cycle. However, when bubbling, there are multiple rhythmic spikes appearing in the signal. -![image](../.gitbook/assets/motor-pump-cypress-cn0549/13.jpg) +![](../.gitbook/assets/motor-pump-cypress-cn0549/13.jpg) -Here are videos demonstrating the data collection process: +Here are some videos demonstrating the data collection process: {% embed url="https://www.youtube.com/watch?v=4lPJPVO5ESk" %} + {% embed url="https://www.youtube.com/watch?v=R7yAq5SBI2s" %} -### Designing the Impulse +## Designing the Impulse + +After building the data set, it's time to create the Impulse. An Impulse is a symbolic pipeline of gathering data, passing it through a preprocessor, feeding it into a neural network, and outputting it, with each step of the process being customizable. -After building the data set, it's time to create the Impulse. An Impulse is a symbolic pipeline of gathering data, passing it through a preprocessor, feeding it into a neural network, and outputting it, each step of the process being customizable. +![](../.gitbook/assets/motor-pump-cypress-cn0549/14.jpg) -![image](../.gitbook/assets/motor-pump-cypress-cn0549/14.jpg) +For this application, we will be using an input block with a 160ms window size, with a window increase of 80ms at an acquisition frequency of 32000Hz. A **Spectrogram** block is used as our Processing block, and a **Classification** block for our Learning Block, which is good for audio and vibrational data. -For this application, we will be using an input block with a 160ms window size, with a window increase of 80ms at an acquisition frequency of 32000Hz, a **Spectrogram** block is used as our processing block, and a combination of learning blocks, a **Classification** which good for audio and vibrational data. -Suppose you need help determining which blocks to select. In that case, you can always try out [Edge Impulse EON tuner](https://docs.edgeimpulse.com/docs/edge-impulse-studio/eon-tuner), which can validate different impulse architectures and give insights on the suitable ones for your specific application. +If you need help determining which blocks to select, you can always try out the [Edge Impulse EON Tuner](https://docs.edgeimpulse.com/docs/edge-impulse-studio/eon-tuner), which can validate different Impulse architectures and give insights on the suitable ones for your specific application. For the sake of simplicity, there are only two conditions to detect; however, you can collect data for as many classes as you want and infer them. -### Configure the Spectrogram Block +## Configure the Spectrogram Block The Spectrogram processing block extracts time and frequency features from a signal. It performs well on audio data for non-voice recognition use cases or any sensor data with continuous frequencies. Low-pass and high-pass filters can be used in this block to eliminate undesirable frequencies. As with our use case, this block typically performs well when decoding recurrent patterns in a signal, such as those caused by the vibrations or motions picked up by an accelerometer unit. -Under the parameters tab, you can configure your spectrogram features or let the edge edge do it by clicking on the "Autotune Parameters" button. -![image](../.gitbook/assets/motor-pump-cypress-cn0549/15.jpg) +Under the **Parameters** tab, you can configure your spectrogram features or let the Studio do it by clicking on the "Autotune Parameters" button. + +![](../.gitbook/assets/motor-pump-cypress-cn0549/15.jpg) + +After being redirected to the **Feature generation** tab, check "Calculate feature importance" and press **Generate features**. Calculating the importance of each signal feature is a great asset of the Edge Impulse platform, as it allows the block to prioritize those values as they are the most meaningful for the observed phenomenon. -After being redirected to the feature generation tab, check "Calculate feature importance" and press **Generate features**. Calculating the importance of each signal feature is a great asset of the Edge Impulse platform, as it allows the block to prioritize those values as they are the most meaningful for the observed phenomenon. -The **Feature Explorer** allows you to quickly check if the data separates nicely, as it visually represents all the data from the Training dataset. Any point in the feature explorer can be hovered over to reveal the source for that point. If you work with time series data, clicking on a data item will show you the raw waveform, the utilized signal window, and a quick link to the signal processing page. This makes identifying the outlier data points in your dataset very simple. +The **Feature Explorer** allows you to quickly check if the data separates nicely, as it visually represents all the data from the Training dataset. Any point in the Feature explorer can be hovered over to reveal the source for that point. If you work with time series data, clicking on a data item will show you the raw waveform, the utilized signal window, and a quick link to the signal processing page. This makes identifying the outlier data points in your dataset very simple. -![image](../.gitbook/assets/motor-pump-cypress-cn0549/16.jpg) +![](../.gitbook/assets/motor-pump-cypress-cn0549/16.jpg) -### Configure the NN Classifier +## Configure the NN Classifier -The NN Classifier block's configuration is the next phase in developing the machine learning algorithm. The number of training cycles, learning rate, size of the validation set, and whether or not the Auto-balance dataset function is enabled are just a few of the factors that can be modified. -They provide users control over the number of epochs the NN is trained on, how quickly the weight of the links between neurons is modified each epoch, and the proportion of samples from the training dataset that are used for validation. The architecture of the NN is detailed underneath. +The NN Classifier block's configuration is the next phase in developing the machine learning algorithm. The number of training cycles, learning rate, size of the validation set, and whether or not the Auto-balance dataset function is enabled are just a few of the factors that can be modified. -Edge impulse also provides options to augment the preprocessed data, which can help avoid overfitting the model, making it robust against a wide range of input data. +They provide users control over the number of epochs the neural network is trained on, how quickly the weight of the links between neurons is modified each epoch, and the proportion of samples from the training dataset that are used for validation. The architecture of the neural network is detailed, and can be changed as well. -Leave everything on default settings for the time being and click **Start training**. +Edge Impulse also provides options to augment the preprocessed data, which can help avoid overfitting the model, making it robust against a wide range of input data. -![image](../.gitbook/assets/motor-pump-cypress-cn0549/17.jpg) +Leave everything on default settings for the time being, and click **Start training**. + +![](../.gitbook/assets/motor-pump-cypress-cn0549/17.jpg) After the training has been assigned to a cluster, the training performance tab will be displayed. Here, you can view in tabulated form the correct and incorrect predictions made by the model after being presented with the Validation data set. When training a neural network, we aim for a high **Accuracy** (the percentage of predictions where the expected value matches the actual value of the data input) and a low **Loss** (the total sum of errors produced for all the samples in the validation data set). Underneath those performance indices, you can visually explore the data to find the outliers and the mislabeled data. You can see that on the right side of the graphic, there is a small cluster of "Normal" data points that were mislabeled, represented with red dots. + You can also explore different data type options for the model and their impact on model output parameters, such as RAM usage and accuracy. -![image](../.gitbook/assets/motor-pump-cypress-cn0549/18.jpg) +![](../.gitbook/assets/motor-pump-cypress-cn0549/18.jpg) -### Model Testing +## Model Testing -The **Model Testing** tab allows users to quickly evaluate how the machine learning model fares when presented with new data. The platform uses the data available in the Test data pool, defined during the data acquisition phase, and evaluates the performance of the model. -Since we're using our custom firmware, live testing is not supported directly. However, if you want to use the live testing option in the Edge Impulse studio, you can go through the following link: -[Live Testing](https://docs.edgeimpulse.com/docs/edge-impulse-studio/live-classification) +The **Model Testing** tab allows users to quickly evaluate how the machine learning model fares when presented with new data. The platform uses the data available in the Test data pool, defined during the Data acquisition phase, and evaluates the performance of the model. + +Since we're using our custom firmware, live testing is not supported directly. However, if you want to use the live testing option in the Edge Impulse Studio, you can go through the steps in the following link: [https://docs.edgeimpulse.com/docs/edge-impulse-studio/live-classification](https://docs.edgeimpulse.com/docs/edge-impulse-studio/live-classification) ## Deploying the Model on the Edge -Edge impulse allows users to export the machine learning model they have just created as a pre-compiled binary for the supported platforms without going through the effort of building custom firmware. +Edge Impulse allows users to export the machine learning model they have just created as a pre-compiled binary for the supported platforms without going through the effort of building custom firmware. + However, since our platform uses different sensors supported by the original board, we must download the model as a C++ library and then integrate the SDK into our firmware. -![image](../.gitbook/assets/motor-pump-cypress-cn0549/19.jpg) +![](../.gitbook/assets/motor-pump-cypress-cn0549/19.jpg) -You can build the firmware with the SDK offline using the GCC compiler or Keil Studio Cloud online, as I did. You can drag and drop the edge impulse C++ library into the folder structure or create a git repository and import it into Keil studio as we did initially. +You can build the firmware with the SDK offline using the GCC compiler or Keil Studio Cloud online, as I did. You can drag and drop the Edge Impulse C++ library into the folder structure, or create a git repository and import it into Keil Studio as we did initially. -![image](../.gitbook/assets/motor-pump-cypress-cn0549/20.jpg) +![](../.gitbook/assets/motor-pump-cypress-cn0549/20.jpg) -To view the inference results, you must rebuild the code with the inference macro enabled in app_config.h file. This shall build the code to transport inference results as part of the data stream on the host; on the client side, it should be able to separate it. +To view the inference results, you must rebuild the code with the inference macro enabled in `app_config.h` file. This will build the code to transport inference results as part of the data stream on the host; on the client side, it should be able to separate it. -![image](../.gitbook/assets/motor-pump-cypress-cn0549/9.jpg) +![](../.gitbook/assets/motor-pump-cypress-cn0549/9.jpg) -Run the jupyter notebook with all instructions as we did during data logging, except just one step: running the last cell, modified explicitly for data inferencing. -If everything goes well, Hurray!, you should see the streaming data along with classification in your jupyter notebook. +Run the Jupyter notebook with all the instructions as we did during data logging, except just one step: running the last cell, modified explicitly for data inferencing. -![image](../.gitbook/assets/motor-pump-cypress-cn0549/21.png) +If everything goes well, Hurray!, you should see the streaming data along with classification in your Jupyter notebook. + +![](../.gitbook/assets/motor-pump-cypress-cn0549/21.png) ## Conclusion -![image](../.gitbook/assets/motor-pump-cypress-cn0549/22.jpg) +![](../.gitbook/assets/motor-pump-cypress-cn0549/22.jpg) + +Employing machine learning-based models for predictive maintenance can help us efficiently operate equipment, plan for downtimes, and increase longevity. + +Baking intelligence into the edge and moving computing closer to where data is a paradigm shift from traditional computing, and Edge Impulse is at the forefront. -Employing machine learning-based models for predictive Maintenance can help us efficiently operate the equipment, plan the downtimes, and increase longevity. -Baking intelligence into the edge and moving computing closer to where data is a paradigm shift from traditional computing, and edge impulse is at the forefront. -Imparting intelligence is just one aspect, and selecting a proper data collection platform is equally important as it can make or break a system. Platforms like CN0549, with their software and hardware scalability, provide the least past of resistance for such data acquisition heavy tinyML models. +Imparting intelligence is just one aspect, and selecting a proper data collection platform is equally important as it can make or break a system. Platforms like CN0549, with their software and hardware scalability, provide a great path for data acquisition needs to build better tinyML models.