How to perform condition monitoring on STM32 using FP-AI-NANOEDG1

Revision as of 14:46, 5 January 2021 by Registered User (→‎Hardware set up)
Under construction.png Delivery for this distribution is being prepared

The aim of this article is to provide a step-by-step guide for the readers to set up a vibration-based condition monitoring solution using STM32 sensor board. The anomaly detection AI libraries used in this tutorial will be generated using Cartesiam NanoEdge AI studio and the software used to program the sensor board can be downloaded from the ST website.

In this article you will learn:

  • setting up a motor control project,
  • programming the STWIN with FP-AI-NANOEDG1,
  • setting-up the sensor node and performing the data logging,
  • generating the AI libraries for condition monitoring, and
  • condition monitoring of the motor setup using vibration data.

1. Requirements

1.1. Hardware

The hardware required to reproduce this tutorial includes:

  • STEVAL-STWINKT1B
    The STWIN SensorTile wireless industrial node (STEVAL-STWINKT1B) is a development kit and reference design that simplifies prototyping and testing of advanced industrial IoT applications such as condition monitoring and predictive maintenance. For details visit the link.
stwinkt1b.jpg
  • STM32 P-NUCLEO-IHM03 Motor Control Nucleo Pack
    The P-NUCLEO-IHM03 STM32 motor-control pack is a kit composed of the X-NUCLEO-IHM16M1 board, the NUCLEO-G431RB board, a brushless Gimbal motor (GBM2804H-100T), and the DC power supply. For details visit the link.
ihm03Set.jpg
  • Misceleneous
stlink-v3mini.jpg
  • MicroSDTM card for the data logging operation,
microSDcard.jpg
  • 3 x Micro USB cables to connect the motor control board, STLINK-V3Mini and STWIN
microUSBCable.png
  • Plexiglass: to fix the motor, the X-NUCLEO-IHM16M1, and the NUCLEO-G431RB boards.
  • 20 cm x 15 cm
  • 9 cm x 15 cm
  • Clamps: to fix the whole set up to the table.
  • Screws: to fix the boards and the motor to the plexiglass base,
screws and nuts.png
  • Magnets and Metallic tape: to attach the STWIN on the motor setup.

1.2. Software

  • STM32 Motor Control Software Development Kit
    STM32 MC SDK (motor control software development kit) firmware (X-CUBE-MCSDK and X-CUBE-MCSDK-FUL) includes the Permanent-magnet synchronous motor (PMSM) firmware library (FOC control) and the STM32 Motor Control Workbench (to configure the FOC firmware library parameters), with its graphical user interface (GUI). For details visit link.
  • FP-AI-NANOEDG1
    An Artificial Intelligence (AI) condition monitoring function pack for STM32Cube provides a complete firmware to program an STM32L4+ sensor node for condition monitoring and predictive maintenance applications on the STEVALSTWINKT1B SensorTile wireless industrial node. The function pack can be downloaded from
  • One of the following IDEs
Info white.png Information
In this document all the steps presented are carried out with STM32CubeIDE but the same can also be done with the other two IDEs.
  • STM32 ST-LINK Utility
    A software interface for programming STM32 microcontrollers. This software is only required to install the prepared binaries provided in the function pack folder at the start. Note that this software will be used by not just users to install the already provided binaries but by STM32CubeIDE also to program the boards with the generated binaries.
    NOTE: This software can be downloaded from STSW-LINK004.
  • Tera Term
    Tera Term is an open-source and freely available software terminal emulator, which is used to host the CLI of the FP-AI-NANOEDG1 through a serial connection. Users can download and install the latest version available from Tera Term.
  • NanoEdge AI Studio
    The function pack is to be powered by Cartesiam. For this, the user needs to generate the libraries from the NanoEdge AI Studio and then embed these libraries in the FP-AI-NANOEDG1. The Studio can be downloaded from this https://cartesiam.ai/st-developpement-board-2/. Cartesiam provides a free evaluation version for the STMicroelectronics boards.

2. Motor set up

2.1. Hardware set up

The readers can fix the motor and boards the way they want, but in our demo set up the motor and boards are set up as the figure below.

2.2. Project creation

2.3. Controlling the motor

3. Sensor Node Setup

4. Library generation

4.1. Contextual Datalogging

4.2. Data Preparation for NanoEdge AI Studio

4.3. Library generation with NanoEdge AI Studio

4.4. Linking the library with FP-AI-NANOEDG1

5. Condition Monitoring

5.1. Learning the normal behavior

5.2. Condition Monitoring

5.3. Fine Tuning of Library