How to turn on a motor - Example with MCSDK & Cube IDE: “FOC duration” fault or/and "Software error"
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Email to a Friend
- Printer Friendly Page
- Report Inappropriate Content
on
2021-01-05
1:02 AM
- edited on
2025-08-01
1:25 AM
by
Laurids_PETERSE
1. Pre-work
I have followed all the steps presented in the Motor control Getting started:
- Generation from MC Workbench and compilation in STM32CubeIDE done OK without any warnings and errors.
- I have successfully uploaded the code to MCU and I have connected to monitor part of MC Workbench by COM port communication, but the "FOC duration" fault or/and "Software error" was indicated if I press "Start Motor" button.
I use MCSDK v5.x, STM32CubeMX v6.x and STM32CubeIDE v1.x. What is wrong with my MC Kit IHM03?
2. Motor control requirements
There is one unknown point for non familiar user. The MC (Motor Control) application driven by FOC algorithm is based on a bit complex calculations of transformations and another mathematics which request precise timing and fast computations. It is mandatory to use the optimization level for speed in used IDE.
The generated project for STM32CubeIDE contains two Build Configurations: Debug and Release.
The real code debugging with break points and/or stepping in over code rows is not possible in the MC application because we cannot loose the continuity in generated stator field. The Debug is a default configuration. The optimization in this configuration is switched off.
3. Switch on optimization level for speed
We have to switch on the optimization level for speed or we have to use "Release" build configuration with well switched on optimization.
3.1 Option 1: Switch on the optimization for speed
3.2 Option 2: set Build configuration "Release" as active
3.3 Option 3 : Directly Build the "Release" build configuration
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Email to a Friend
- Report Inappropriate Content
It does not work with STEVAL-SPIN3202,
If it is HAL - Example program will not fit in Flash.
If it is LL - it will fit.
Anyway, it does not connect with ST MotorPilot via UART for some unknown reason that no one wants to help me with,