Getting started with FP-AI-NANOEDG1

Revision as of 10:32, 29 June 2020 by Registered User
Under construction.png The preparation of this wiki page is under progress...

This article is a quick start guide for FP-AI-NanoEdg1, which is a condition monitoring function pack using vibration sensor data using STM32Cube and STM32 microcontroller family. This article will provide a brief overview on the hardware and software used, setting the software and hardware, using the function pack to do the data collection, installing the NanoEdgeAI machine learning library and testing it, and finally the links to useful online resources which can help a user to get started.

1. Hardware and Software Review

1.1. Discovery kit with STM32L562QE MCU Hardware Description

The STM32L562E-DK Discovery kit is a complete demonstration and development platform for Arm® Cortex®-M33 with Arm® TrustZone® and ARMv8-M mainline security extension core-based STM32L562QEI6QU microcontroller, with 512 Kbytes of Flash memory and 256 Kbytes of SRAM. The key specifications of the board are

File:STM32L562E-DK.png
STM32L562E-DK Board
  • STM32L562QEI6QU microcontroller featuring 512 Kbytes of Flash memory and 256 Kbytes of SRAM
  • 1.54" 240 × 240 pixel-262K color TFT LCD module with parallel interface and touch-control pane
  • MEMS digital microphones
  • 512-Mbit Octal-SPI Flash memory
  • Bluetooth® V4.1 Low Energy module
  • iNEMO 3D accelerometer and 3D gyroscope
  • 2 user LEDs
  • User and reset push-buttons
  • Board connectors:
  • USB Type-C™
    • microSD™ card
    • Stereo headset jack including analog microphone input
    • JTAG debugger

1.2. FP-AI-NanoEdg1 Software Description

The FP-AI-NANOEDG1 function pack helps to easily jump-start the development and implementation of condition monitoring applications designed with the NanoEdge™ AI Studio solution from Cartesiam.

File:SoftwareDescription.png
Overall Software Architecture

The key features of the software are

  • Complete firmware to develop a sensor node for condition monitoring and predictive maintenance applications based on vibration data:
  • Simple LCD user interface
  • Autonomous mode controlled by user button.
  • Wired interactive command-line interface (CLI) for
    • Node configuration
    • AI utility for data logging on a microSD™ card
    • Management of the learning and detection phases of Cartesiam Machine Learning solution
  • Free, user-friendly license terms

2. Setup and Application Examples

2.1. HW prerequisites for STM32L562E-DK

To use the FP-AI-NanoEdg1 function pack on STM32L562E-DK, the user need to have following hardware items in hand:

  • 1x STM32L562E-DK development board
  • Laptop/PC with Windows 7 or later.
  • 1x USB cable to connect the PC to the Micro-B USB connector on the board CN17-STLNK
  • 1x micro SDcard for data logging operations
Hardware Required

2.2. Software and other prerequisites

2.2.1. FP-AI-NanoEdg1

  • Download the FP-AI-NANOEDG1 package from www.st.com, copy the .zip file contents into a folder on your PC. The package contains binaries and source code with project files (STM32CubeIDE only) based on STM32L562E-DK.

2.2.2. STM32CubeIDE

  • Integrated Development Environment for STM32
  • Download and install STM32CubeIDE.

2.2.3. STM32 ST-Link Utility

  • full-featured software interface for programming STM32 microcontrollers.
  • Download and install STSW-LINK004.

2.2.4. TeraTerm

  • Open source free software terminal emulator
  • Download and install TeraTerm

2.3. FP-AI-NANOEDG1 Console Application

FP-AI-NANOEDG1 provides an interactive Command Line Interface (CLI) application which lets a user to configure and control the sensor node to log the data to generate the Cartesiam NanoEdge AI libraries and then test these libraries by performing training and condition monitoring on the edge. Following sections provide small details along with image illustrations on how to use this CLI application.

2.3.1. Get the Function Pack

The first step is to get the Function Pack. The FP-AI-NANOEDG1 can be downloaded from [www.st.com| www.st.com]. Once the pack is downloaded as a zip the user has to unpack it. The following image shows the process to download and unpack the function pack as well as its contents.

Downloading and Unpacking the FP-AI-NANOEDG1

2.3.2. Flash the Application

Once the user has downloaded and unpacked the function pack the next step is to flash the sensor node with the binary of the function pack. For the convenience of the users, ST provide a pre-build binary for the project. Following image shows the steps required to flash the board.

File:flash the application.png
Steps to flash the board with FP-AI-NANOEDG1 binary

2.3.3. Use the Command Line Interface (CLI)

File:using command line interface.png
Using the Command Line Interface Application for FP-AI-NANOEDG1

3. Data Collection

Once the user has flashed the sensor node and has already connected the sensor node through the CLI, user can start doing the data log. In this section the guide for doing the data log is provided step by step.

3.1. Configure the Sensor for Data Logging

File:data logging.png
Sensor Configuration and Data logging using FP-AI-NANOEDG1

3.2. Logging the Data

4. Installing and Testing NanoEdgeAI Machine Learning Library

4.1. Preparing the Data

4.2. Generating a Library with NanoEdgeAI Studio

The process of generating the libraries with Cartesiam NanoEdge AI studio consists of five steps.

  1. Hardware description
    • Choosing a microcontroller type : ARM® Cortex® M33
    • Maximum amount of RAM to be allocated for the library: Usually few KBs will suffice (depends on the dataframe length used in the process of data preparation.
    • Sensor type : 3-axes accelerometer
  1. Providing the sample contextual data to adjust and gauge the performance of the chosen model. This step will require data for:
    • Nominal or Normal case
    • Abnormal case
  1. Benchmarking of available models and choosing the one which complies with the requirements.
  2. Validating the model for learning and testing through the provided emulator which emulates the behavior of the library on the edge.
  3. The final step is to compile and download the libraries. In this process the flag mfloatabi has to be unchecked for using libraries with hardware FPU.

4.3. Installing the Generated Library

Once the libraries are generated and downloaded from Cartesiam NanoEdge AI Studio the next step is to incroporate these libraries to FP-AI-NANOEDG1. To do so the user needs to copy the header file and the library file in to the Middleware folders as shown in the figure below.

File:installing and testing generated libraries.png
Installing and Testing Cartesiam generated AI libraries

4.4. Testing the Generated Library

5. Documents and Related Resources