ST FP-IND-DATALOGMC User Manual
ST FP-IND-DATALOGMC User Manual

ST FP-IND-DATALOGMC User Manual

Getting started with the stm32cube function pack motor control high speed datalogging
Table of Contents

Advertisement

Quick Links

UM3304
User manual
Getting started with the STM32Cube function pack Motor Control high speed
datalogging
Introduction
The
FP-IND-DATALOGMC
function pack for
STEVAL-STWINBX1
and
EVLSPIN32G4-ACT
is a powerful integrated toolkit for
the next generation of smart actuators.
This toolkit is derived from a
FP-SNS-DATALOG2
function pack and it allows the collection of heterogeneous data, combining
STWIN.box sensor information with STSPIN32G4 motor control data and it provides a comprehensive view of the system's
operational conditions. This enables both real-time monitoring and accurate performance assessment.
The v1.1.0 introduces a further firmware example called DATALOGMC_AI that implements a motor fault classification based on
a machine learning solution developed through NanoEdgeAIStudio. The machine learning model allows an accurate
classification of motor behavior into two states: good and faulty.
Users can also customize the model by adding their own classes, which can be achieved by incorporating additional data and
modifying the training process.
The package also includes a portable mechanical setup that can be replicated with a 3D printer.
EVLSPIN32G4-ACT
is designed to drive a variety of three-phase brushless DC motors (not included in the kit) and ready for
FOC control algorithms. The list of supported motors is provided in the motor control SDK documentation (X-CUBE-MCSDK-6)
and installation details are available in the Quick Start guide.
The FP-IND-DATALOGMC, thanks to its data-centric design and user-friendly Python SDK, may run with hardware boards that
supply real-time data streams and motor telemetries, empowering users with full control of the data acquisition process.
The included firmware is compatible with the
STBLESensor
app, which lets you manage: the board, motor, and sensor
configurations; start/stop data acquisition on SD card, and control data labeling. Sensor data and motor telemetries can also be
stored onto a microSD™ card.
The software is also available on GitHub, where the users can signal bugs and propose new ideas through [Issues] and [Pull
requests] tabs.
UM3304 - Rev 2 - July 2024
www.st.com
For further information contact your local STMicroelectronics sales office.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FP-IND-DATALOGMC and is the answer not in the manual?

Questions and answers

Summary of Contents for ST FP-IND-DATALOGMC

  • Page 1 Quick Start guide. The FP-IND-DATALOGMC, thanks to its data-centric design and user-friendly Python SDK, may run with hardware boards that supply real-time data streams and motor telemetries, empowering users with full control of the data acquisition process.
  • Page 2: Fp-Ind-Datalogmc Software Expansion For Stm32Cube

    UM3304 FP-IND-DATALOGMC software expansion for STM32Cube FP-IND-DATALOGMC software expansion for STM32Cube Overview FP-IND-DATALOGMC features: • High data rate (up to 6 Mbit/s) data capture software suite: – Simultaneously log motor control telemetries and sensor data. – Python real-time control and data analysis –...
  • Page 3: Folder Structure

    UM3304 FP-IND-DATALOGMC software expansion for STM32Cube On top of such features, which are inherited from STM32Cube, FP-IND-DATALOGMC adds the code reusability at application level. FP-IND-DATALOGMC is an eLooM-based application-level firmware. It is based on several firmware modules that interface and offer their data to other application modules according to well defined design patterns and specific APIs.
  • Page 4: Getting Started

    UM3304 Getting started Getting started System configuration FP-IND-DATALOGMC requires the following hardware to run: • STEVAL-STWINBX1 • EVLSPIN32G4-ACT • 3-phase brushless motor • Power supply Figure 3. System configuration STEVAL-STWINBX1 must be programmed with the FP-IND-DATALOGMC firmware as shown in Section 2.3: How to program...
  • Page 5: Figure 5. Power Supply Chain

    The power supply voltage depends on the motor used, which is the one that has been properly selected during the generation of the EVLSPIN32G4-ACT firmware. For more details, visit the FP-IND-DATALOGMC QUICK START GUIDE. UM3304 - Rev 2 page 5/51...
  • Page 6: How To Program Evlspin32G4-Act

    UM3304 Getting started How to program EVLSPIN32G4-ACT • Download and install X-CUBE-MCSDK-6 • Run MotorControl WorkBench Figure 6. MotorControl WorkBench - step 1 • Select new project Figure 7. MotorControl WorkBench - step 2 • In General Info tag select FOC as algorithm and Inverter as Hardware as shown in figure, and click next Figure 8.
  • Page 7: Figure 9. Motorcontrol Workbench - Step 4

    UM3304 Getting started • Select your motor in Motors tab as shown in figure and press next Figure 9. MotorControl WorkBench - step 4 • Choose EVLSPIN32G4-ACT in the Inverter tab and click ok Figure 10. MotorControl WorkBench - step 5 UM3304 - Rev 2 page 7/51...
  • Page 8: Figure 11. Motorcontrol Workbench - Step 6

    UM3304 Getting started • As a result, the final configured block diagram is shown. Press Save and Generate the project Figure 11. MotorControl WorkBench - step 6 • Press Generate to generate the project source code Figure 12. MotorControl WorkBench - step 7 UM3304 - Rev 2 page 8/51...
  • Page 9: Figure 13. Motorcontrol Workbench - Step 8

    UM3304 Getting started • After code generation press OPEN FOLDER button Figure 13. MotorControl WorkBench - step 8 • Open the STM32CubeIDE folder and lunch .project Figure 14. MotorControl WorkBench - step 9 UM3304 - Rev 2 page 9/51...
  • Page 10: How To Program Stwin.box

    (i.e.: in the folders Projects\STM32U585AI- STWIN.box\Applications\DATALOGMC\Binary). Figure 16. FP-IND-DATALOGMC application binary folders You are also free to recompile and modify the needed application with your preferred toolchain. 2.3.1 FFOTA - Fast Firmware update Over The Air...
  • Page 11: Figure 17. Double-Bank Flash Memory

    The board presents itself as BLEDfFw. During the BLE pairing, if requested, you must insert the following PIN: 123456. By selecting a specific tab in the ST BLESensor app, the application can display and plot data coming from the board.
  • Page 12: How To Program The Stwin.box In "Usb Mode

    STEVAL- STWINBX1 flash, download a new firmware or upgrade the current firmware with the latest version available from st.com. 2.3.2 How to program the STWIN.box in “USB mode” This is the easiest mode if you just want to download a binary into the board via USB, without the need of any debugging capabilities.
  • Page 13: Figure 20. Stm32Cubeprogrammer - Usb Mode Selection

    UM3304 Getting started Step 4. You can upgrade the firmware by following the steps below: Step 4a. Open STM32CubeProgrammer. Step 4b. Select [USB] on the top-right corner. Figure 20. STM32CubeProgrammer - USB mode selection Step 4c. Click on [Connect]. Figure 21. STM32CubeProgrammer - connection Step 4d.
  • Page 14: How To Program The Stwin.box With An External Debugger

    Figure 23. STWIN.box and STLINK-V3MINIE programmer Alternatively, to offer more alternatives, an adapter to ST-LINK V2-1 (STM32 Nucleo development board) or standard JTAG connector is included in the kit. When using an STM32 Nucleo development board as an external debugger, you need to disconnect the on-board STM32 by removing the two jumpers on CN2 (see the picture below).
  • Page 15: How To Handle Double Bank Flash Memory

    Figure 24. STWIN.box, adapter, and STM32 Nucleo development board Figure 25. STWIN.box and ST-LINK/V2 debugger (JTAG 20-pin 2.54 mm pitch connector) Once the hardware connections are in place, you can either: • download one of the sample application binaries provided using STM32CubeProgrammer •...
  • Page 16: Figure 26. Swap Flash Bank With Mobile App

    UM3304 Getting started Figure 26. Swap flash bank with mobile app • STM32CubeProgrammer – Check the option byte configuration and make sure that the SWAP_BANK field (for STWIN.box and SensorTile.box) or BFB2 field (for STWIN) is unchecked. Figure 27. Swap flash bank with STM32CubeProgrammer 1/4 UM3304 - Rev 2 page 16/51...
  • Page 17: Figure 28. Swap Flash Bank With Stm32Cubeprogrammer 2/4

    UM3304 Getting started Figure 28. Swap flash bank with STM32CubeProgrammer 2/4 Figure 29. Swap flash bank with STM32CubeProgrammer 3/4 UM3304 - Rev 2 page 17/51...
  • Page 18: Datalogmc Sample Application

    UM3304 Getting started Figure 30. Swap flash bank with STM32CubeProgrammer 4/4 DATALOGMC sample application DATALOGMC comes with two operating modes: • DATALOGMC via USB: allows user to control the motor, acquire, stream and plot in real-time via Python Application GUI sensors and motor control data. •...
  • Page 19: Figure 31. Device Manager Windows

    UM3304 Getting started Figure 31. Device Manager Windows To verify it, check whether you can see a Multi-Sensor Streaming device in the Device Manager Windows settings. Figure 32. Device Manager settings UM3304 - Rev 2 page 19/51...
  • Page 20: Hsdatalog_Mc_Gui

    HSDPython_SDK, which is developed in Python 3.10 on Windows and Linux environments. Important: HSDPython_SDK requires different Python modules, distributed together with FP-IND-DATALOGMC. By installing them through the provided installers, all the required dependencies are automatically solved. For further details on HSDPython_SDK, refer to Section 2.5:...
  • Page 21: Figure 34. Real Time Plot Gui - Fast Telemetries Configuration

    UM3304 Getting started Figure 34. Real Time Plot GUI - Fast telemetries configuration The Real Time Plot GUI also allows users to: • Choose which tag classes to use for the next acquisition. • Handle data tagging and labeling during an ongoing acquisition. •...
  • Page 22: Figure 36. Real Time Plot Gui - Floating Widgets

    UM3304 Getting started To reset the widget to the default setup, move the cursor on the lower-left corner and click on the A button that appears. Figure 36. Real Time Plot GUI - Floating widgets Once the test has been finished, you can also check and plot the desired dataset by clicking on the Plot the last acquisition button.
  • Page 23: Figure 38. Real Time Plot Gui - Offline Plot (2 Of 2)

    UM3304 Getting started Figure 38. Real Time Plot GUI - Offline plot (2 of 2) The plot features are using the plot class from the HSDPython_SDK, shown as a standalone example in the hsdatalog_plot.py Python script. Further detailed information is available in Section 2.5: HSDPython_SDK.
  • Page 24: Stblesensor App

    UM3304 Getting started 2.4.3 STBLESensor app ® The DATALOGMC application can be controlled via Bluetooth Low Energy using the STBLESensor app (both Android and iOS from v5.2 and above), which lets you manage start/stop motor, set motor velocity, slow and fast telemetries configurations, sensor configurations, start/stop data acquisition on SD card and control data labelling.
  • Page 25: Figure 40. Stblesensor App (2 Of 3)

    UM3304 Getting started Figure 40. STBLESensor App (2 of 3) By tapping the Motor Control button on bottom left, user can: • Start/stop the motor. • Set up the motor speed (once the motor has been already started). • Visualize Slow Motor Telemetries (once the motor has been already started). UM3304 - Rev 2 page 25/51...
  • Page 26: Sd Card Considerations

    UM3304 Getting started Figure 41. STBLESensor App (3 of 3) Once the system is in idle state, by tapping the Configuration button on bottom right, user can: • Choose sensors and telemetries configuration. • Choose tag classes to be used for the next acquisition. •...
  • Page 27: Data Labelling

    UM3304 Getting started For a complete description of HSDPytyhon_SDK, see Section 2.5: HSDPython_SDK. 2.4.5 Data labelling Labelled data are a group of samples that have been tagged with one or more labels. Labelled data are specifically useful in certain types of data driven algorithms such as supervised machine learning (for example, to create a labelled dataset for a classifier).
  • Page 28: Figure 43. Tags Configuration Using Python Gui

    UM3304 Getting started Figure 43. Tags configuration using Python GUI Tags can also be customized, by changing the label name or switching them on/off. This feature is available in the STBLESensor app and hsdatalog_MC_GUI, but also handled in the SD card standalone mode, by manually acting on the tags_info component inside the device_config.json file.
  • Page 29: Figure 45. Acquisition_Info.json With Tag References

    UM3304 Getting started Figure 45. acquisition_info.json with tag references For a complete description of device_config.json and acquisition_info.json, refer to Section 2.6: Acquisition folders. UM3304 - Rev 2 page 29/51...
  • Page 30: Hsdpython_Sdk

    Figure 46. HSDPython_SDK available scripts The HSDPython_SDK contains many Python scripts, examples and Jupiter notebook that can be used to log and elaborate data acquired using FP-IND-DATALOGMC. The SDK is organized in three dedicated Python modules: • st_pnpl: Includes a collection of generic Graphical Widgets (based on pySide6) that could represent: –...
  • Page 31: How To Install Python

    UM3304 Getting started Figure 47. HSDPython_SDK packages 2.5.1 How to install Python Before using HSDPython_SDK, Python (from version 3.10 on) must be properly installed on your machine. The following steps are valid for a Windows machine. Similar approach can be used also on other OS. •...
  • Page 32: Hot To Install Hsdpython_Sdk

    UM3304 Getting started • Once the setup is complete Figure 49. Python setup you can use Python on your machine 2.5.2 Hot to install HSDPython_SDK HSDPython_SDK is composed by different modules that are distributed as Python wheels that can be installed by pip or apt-get command.
  • Page 33: Acquisition Folders

    In the DATALOGMC use case, devices consists of only one element, whose fields are: • board_id, the unique identifier of a board type, according to ST catalogs • fw_id, the unique identifier of a firmware type, according to ST catalogs •...
  • Page 34: Figure 51. Device_Config.json Fields

    UM3304 Getting started Figure 51. device_config.json fields A sensor component is described by a struct, whose key is a unique name composed by the sensor part number and the sensor type (partNumber_sensorType; for example, iis2dlpc_acc). The value of the field is another struct, composed by different key-value couples describing the actual configuration of the single sensor (for example, whether the sensor is active or not, enumerative value for actual ODR and FS, time offset, data transmitted per unit of time, etc.).
  • Page 35: Figure 52. Iis2Dlpc_Acc Component

    UM3304 Getting started Figure 52. iis2dlpc_acc component UM3304 - Rev 2 page 35/51...
  • Page 36: Figure 53. Fast_Mc_Telemetries Component

    UM3304 Getting started Figure 53. fast_mc_telemetries component Note: odr and fs fields are enumerative values defined into the Device Template Model. Please refer to Device Template Model and DATALOGMC DTM for the mapping between the enum values and the real ODR and Full Scale.
  • Page 37: Acquisition_Info.json

    UM3304 Getting started Figure 54. Informative components The tags_info component describes the labels activated by the user. Figure 55. tags_info component The available fields are: • label: the tag name and can be customized by the user • enabled: if true, the tag is available and can be used during the acquisition; if false, it is disabled. It can be set up by the user •...
  • Page 38: Raw Data Files (.Dat)

    UM3304 Getting started It consists of the following fields: • schema_version: reference to the schema version adopted • dat_ext: file extension for the data acquired • uuid: unique identifier of an acquisition, same as the one within the “device_config.json” • name: optional field for a name of an acquisition •...
  • Page 39: Figure 57. Sensor Raw Data Folder

    UM3304 Getting started Figure 57. Sensor raw data folder One file is generated for each sub-sensor. Composite sensors such as ISM330DHCX ILPS22QS may thus generate multiple files. For example, ilps22qs_press.dat contains pressure raw data from ILPS22QS sensor or ism330dhcx_gyro.dat contains gyroscope raw data from the ISM330DHCX sensor.
  • Page 40: Device Template Model

    Each ST DTDL-based firmware has a device template model associated, which completely describes its capabilities, properties and behaviors. All the available DTDL are organized in an online catalog, used both by Python SDK and ST BLESensor app to retrieve information about the firmware.
  • Page 41: Figure 60. Mapping Table 2

    UM3304 Getting started Figure 60. Mapping table 2 Figure 61. Mapping table 4 Figure 62. Mapping table 5 UM3304 - Rev 2 page 41/51...
  • Page 42: System Setup Guide

    UM3304 System setup guide System setup guide The FP-IND-DATALOGMC, can be used to develop specific AI motor control and datalogging applications for early detection of warning signs of potential failure. Hardware description 3.1.1 STEVAL-STWINBX1 evaluation kit The STWIN.box (STEVAL-STWINBX1) is a development kit and reference design that simplifies prototyping and testing of advanced industrial sensing applications in IoT contexts such as condition monitoring and predictive maintenance.
  • Page 43: Software Setup

    Software setup The following software components are required for the setup of a suitable development environment: • FP-IND-DATALOGMC firmware, available on www.st.com • A standard user terminal as Putty or Tera Term, only for debug purposes (v. 4.97 or higher) •...
  • Page 44: Datalog Troubleshooting

    PC goes in standby or sleep, the USB port also goes in a low power state thus impacting on USB streaming performances • Common issues with ST BLESensor app: – BLE app is stuck (command not working properly, demo page not updating, broken files, or...
  • Page 45: Revision History

    UM3304 Revision history Table 1. Document revision history Date Revision Changes 21-Mar-2024 Initial release. Updated Section Introduction, Section 2.4.2: hsdatalog_MC_GUI, 29-Jul-2024 Section 2.4.3: STBLESensor app Section 2.4.5: Data labelling. UM3304 - Rev 2 page 45/51...
  • Page 46: Table Of Contents

    Contents FP-IND-DATALOGMC software expansion for STM32Cube ......2 Overview ..............2 Architecture .
  • Page 47 UM3304 Contents List of tables ................48 List of figures.
  • Page 48: List Of Tables

    UM3304 List of tables List of tables Table 1. Document revision history ............. 45 UM3304 - Rev 2 page 48/51...
  • Page 49 STWIN.box, adapter, and STM32 Nucleo development board ........15 Figure 25. STWIN.box and ST-LINK/V2 debugger (JTAG 20-pin 2.54 mm pitch connector) ..... . 15 Figure 26.
  • Page 50 UM3304 List of figures Figure 54. Informative components............. 37 Figure 55.
  • Page 51 ST’s terms and conditions of sale in place at the time of order acknowledgment. Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of purchasers’...

This manual is also suitable for:

Steval-stwinbx1Evlspin32g4-act

Table of Contents