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.
- STEVAL-STWINKT1B
- 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.
- STM32 P-NUCLEO-IHM03 Motor Control Nucleo Pack
- Misceleneous
- STLINK-V3MINI to program the STWIN,
- MicroSDTM card for the data logging operation,
- 3 x Micro USB cables to connect the motor control board, STLINK-V3Mini and STWIN
- 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,
- 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
- STMicroelectronics - STM32CubeIDE version 1.4.2
- IAR Embedded Workbench for Arm (EWARM) toolchain V8.50.5 or later
- RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.31
- STM32 Motor Control Software Development Kit
- 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.
- STM32 ST-LINK Utility
2. Motor set up
2.1. Hardware set up
The setup process includes:
- A two-level plexiglass base, by fixing two plexiglass pieces with the help of the spacer screws.
- Fix the motor using double-sided tape from the left side of the smaller board.
- Fix the G431RB and the IHM16M1 board using the provided screws in the kit with the board.
- Put the metallic strip in the center of the small board in order to attach the STWIN to the setup.
2.2. Project creation
For creating the motor, the project has to be created using the STM32 Motor Control Software Development Kit or STM32-MCSDK for short. In this section, we show the steps to create the project and to program the motor control board with the FW in order to start, stop, or accelerate and decelerate the motor. Step 1
- The first step is to create a new project from the ST Motor Control Workbench. Here we are using version
5.4.4
. To start the project click on the new project icon.
2.3. Controlling the motor
3. Sensor Node Setup
3.1. Get the function pack
The first step is to get the function pack. The FP-AI-NANOEDG1 can be downloaded from ST website. Once the pack is downloaded, the user can unpack/unzip it and copy the contents to a folder on the PC. The steps of the process along with the contents of the folder are shown in the following image.
3.2. Flashing the application on the sensor board STEVAL-STWINKT1B
Once the package has been downloaded and unpacked, the next step is to program the sensor node with the binary of the function pack. For the convenience of the users, the function pack is equipped with a pre-built binary file of the project. The sensor board can be very easily programmed with the provided binary by simply performing a drag-and-drop action as shown in the figure below.
3.3. Setting up the Console
Once the sensor board is programmed with the binary of the project (as shown in section 2), the next step is to set up the serial connection of the board with the PC through the Tera Term. To do so, start Tera Term, and create a new connection by either selecting from the toolbar, select the proper port to establish the serial communication with the board. In the figure below, this is COM10 - USB Serial Device (COM 10)
.
Set the following parameters:
Once the connection is made the user will see a message like below. If this message does not appear, the user can try to reset the board, to make this message appear.
Typing help
will show the list of all available commands.
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
6. Resources
- SensorTile Wireless Industrial Node (STWIN) Development Kit 1B
- Motor Control Nucleo Pack with NUCLEO-G431RB and X-NUCLEO-IHM16M1
- FP-AI-NANOEDG1
- Artificial Intelligence (AI) Condition Monitoring Function Pack for STM32Cube Stmicroelectronics
- Getting started with FP-AI-NANOEDG1 V2.0
- Getting started with FP-AI-NANOEDG1 V1.0
- User Manual for FP-AI-NANOEDG1 V2.0
- User Manual for FP-AI-NANOEDG1
- NanoEdge AI Studio
- STM32 Motor Control Software Development Kit (MCSDK)