Shunlongwei Co Ltd.

Shunlongwei Co. ltd.

IGBT Module / LCD Display Distributor

Customer Service
+86-755-8273 2562

The Future of Digital Motor Control: Multiple Motors, Embedded AI, and Advanced Algorithms on One MCU

Posted on: 10/22/2024

Enabling the future

Digitally controlled, electronically commutated motors are rapidly displacing traditional designs due to the unprecedented dynamic control, power, and efficiency these make available to the designer. As engineers push such designs in industrial, HVAC, consumer, and automotive systems, we are asked to deliver smarter algorithms and increasingly complex control features while still constraining costs. We have recently created a demonstration that shows how Renesas is helping make this possible.

Our solution example flexes the muscles of the RA8T1 motor control MCU, showing independent control of two motors while simultaneously running multiple AI inference modules to detect anomalies of operation. We address shaft misalignment and unbalanced load conditions – common, real-world concerns in motor systems. But these are only examples of the myriad of advanced algorithms the RA8 core enables engineers to bring to their embedded motor control designs. The demonstration is built around our RealityCheck™ Motor toolbox for creating and deploying sensorless motor control-based AI solutions. This workflow links features in e² studio with the Renesas cloud-based Reality AI Tools® machine learning system. We also let users combine AI modules created by Reality AI Tools with open-source AI models imported from other machine learning platforms through the Renesas e-AI translator. All resulting code is compact and efficient, leaving plenty of resources still available on the MCU for other tasks.

A quick look at the RA8T1

The RA8T1 32-bit MCU introduces an Arm® Cortex®-M85 core with Helium technology at up to 480MHz in a package optimized for motor or inverter control. This offering is significantly faster and more advanced than other motor control solutions on the market and brings ample horsepower for advanced algorithms such as AI while maintaining precision electronic control of several independent motors.

When it comes to AI operation, with the combination of Arm’s Helium technology and 2MB of tightly coupled D-cache, the RA8 can accelerate inference up to 10x over other Arm cores at a similar clock rate. This provides a huge gain for the engineer, making feasible complex algorithms and decisions that could not previously be run on a moderate clock rate chip.

Two motors, Two AI modules, One core

Now let’s talk about the new application example. In this example, we are showing the RA8T1 independently controlling two different motors while simultaneously running two different AI inference modules. Watch the “Motor Anomaly Detection – Unbalanced Load & Shaft Misalignment” demonstration.

Image
MCK-RA8T1 with two inverter boards controlling two independent motor assemblies
Figure 1. MCK-RA8T1 with two inverter boards controlling two independent motor assemblies

This setup demonstrates the detection of two kinds of anomaly issues that arise in real-world motor operation: shaft misalignment and unbalanced load conditions. Shaft misalignment occurs when the output shaft of the motor is not perfectly aligned in space with the load it is driving, causing unplanned torques and friction. The unbalanced load condition occurs when the system driving the load is out of dynamic balance, causing oscillating forces as the motor rotates both orthogonal to the shaft and in the form of changing load resistance over the course of each rotation.

Both conditions are serious concerns for motor systems, causing issues with a range of severity, from power loss to excess noise and vibration to rapid bearing wear, dangerous bearing, and structural failures. In some applications, like high-power industrial systems, even small deviations from proper alignment and balance can cause major concerns over time. In other applications, like washer dryers, a certain amount of unbalance and misalignment is expected but in excess will cause internal collisions and failure of the machine.

To create shaft alignment issues on a small scale, our first motor is configured with a shaft connecting it to a gearbox. When the board holding the motors is distorted slightly by a finger push, the shaft is bent and moved out of alignment with the gearbox.  

To demonstrate balance issues, our second motor is configured with an aluminum hub into which we can optionally insert small M4 screws. Without screws, the hub presents a normal, balanced load to the driving motor. With a screw added, the motor load is brought out of balance by a small amount.

Image
Dashboard of status data sent from the board
Figure 2. Dashboard of status data sent from the board

Our two AI modules have been trained to detect these two conditions. We then added communications to a dashboard display (seen in Figure 2) so we could see what was happening in real time.  

The display has labeled conditions for each motor with states indicated by color code and text. It also includes a scrolling timeline that shows orange every time the system sees an anomaly (i.e. misalignment or unbalanced states) about a certain threshold.

As we see in Figure 3, there are quite a few processes running at once on the RA8 MCU. We have two independent instances of the vector motor control algorithm driving the BLDC motors. Each of these instances also sends live data from the control process to the two coupled AI inference modules. The AI modules watch this data for an indication of normal versus problem behavior. Since only internal motor control data is used, the AI system does not require additional sensors to monitor for anomalous conditions. This is a powerful feature of the RealityCheck™ Motor Toolbox, allowing engineers to create AI monitoring solutions without adding any sensor BOM cost to their designs.

As you can see in Table 1, our AI modules have a tiny RAM and flash footprint and, leveraging the advanced features of the RA8T1, they are both extremely fast. The total flash used for both is under 14KB and RAM is less than 5KB. Each module executes an inference in under 1ms so even at 8 inferences per second for each motor subsystem, the load on the CPU is quite small.

Image
Processes and data flow in the two motor AI examples
Figure 3. Processes and data flow in the two motor AI examples
Image
Embedded model metrics
Table 1. Embedded model metrics

How did we build this?

The story begins with the seamless integrated workflow Renesas provides for e² studio users to interface with Reality AI Tools, all of which is part of our RealityCheck™ Motor Toolbox. The functionality is shown below in Figure 4. An engineer can connect to a Renesas motor control MCU and collect data directly into our Data Storage tool plug-in. This can be done using either an evaluation board like the MCK-RA8T1 or within their own Renesas MCU-based hardware design. Our toolbox provides example code tied to the Renesas Flexible Software Package (FSP) stack, that guides users in selecting and capturing live data parameters from the vector motor control algorithm. In a few minutes, a user can be collecting data live from their board under actual motor use conditions.  

Specifically for unbalanced load detection, our data collection matrix has two columns of variation: (1) with and without screws in the hub and (2) the range of speeds we want to address. To build our demonstration, we collected samples of data over combinations of these conditions, repeating multiple times to cover random variation that occurs in any physical setup. Table 2 shows an example data coverage matrix.

Image
RealityCheck Motor toolbox provides a seamless round-trip workflow for creating motor AI
Figure 4. RealityCheck Motor toolbox provides a seamless round-trip workflow for creating motor AI

So how does one construct a useful classifier with the Renesas workflow?

Solid AI results always start with structured data collection. We collect data examples under a variety of conditions that address the detection classes of interest along with variations in the data spanning the motor conditions we expect to see in practice.

Image
Data collection plan for unbalanced load detection
Table 2. Data collection plan for unbalanced load detection

From the e² studio Data Storage plug-in, this data can be uploaded directly into the cloud where we use Reality AI Tools to train and optimize a machine learning model. The process is highly automated using our proprietary AI Explore™ methodology, but also provides a wide range of tests, tweaks, and optimizations the user can employ. (See the Reality AI Tools page for more information.) Once we are satisfied with our model’s accuracy in the cloud, we can then generate an inference module and export embedded library code right back into e² studio for testing. The user gets a simple, fast, end-to-end workflow from raw data to final code generation.

But what if you have your own AI model?

Image
e-AI Translator lets you easily import AI models from open-source platforms such as Keras, Tensor Flow, and PyTorch, as code in your e² studio project
Figure 5. e-AI Translator lets you easily import AI models from open-source platforms such as Keras, Tensor Flow, and PyTorch, as code in your e² studio project

Some customers prefer to bring in their own AI models, developed in well-known open-source frameworks such as Keras, Tensor Flow, or Pytorch. RealityCheck Motor lets you do that too, with the help of the Renesas e-AI Translator plugin. This powerful e² studio plugin enables users to import open-source-created AI, converting them to compact C code that can be linked directly into your project.

This is how we built the shaft misalignment detector. We again collected data, in a similar way to before, using RealityCheck Motor data capture and the Data Storage tool in e² studio. But instead of going through Reality AI Tools, we imported this new data into a Python framework and trained our demo AI model there, using Keras. We then used the e-AI Translator to import the fully trained Keras model into our project code. The model was already configured to work with data flowing from our RealityCheck Motor capture functions, making it easy to integrate the e-AI inference code with the rest of the project.

This example shows how we can readily combine AI modules created by our Reality AI Tools workflow with those imported from other sources through the e-AI translator. Users can import any deep learning or NN model from common training frameworks – so if you prefer to bring your own model, we are happy to help.

Summing it up…

The RealityCheck Motor toolbox combines the Renesas e² studio IDE with our cloud-based Reality AI Tools machine learning environment to create a seamless, end-to-end workflow for users to go from data collection to AI model building to compact, efficient embedded code. All this works with your Renesas Motor Control MCU of choice, whether on an evaluation board or in your own product hardware. Users can easily create AI modules that run right on the same MCU, in many cases without any additional sensors beyond the motor control algorithm’s live data. Customers that want to bring their own model from open-source AI platforms can do so, using the e-AI Translator import function.

The RA8T1 32-bit motor control-optimized MCU brings the high-performance Arm Cortex-M85 core and advanced features, including Helium and tightly coupled D-cache, to accelerate algorithms up to 10x. This horsepower enables multiple motors, multiple embedded AI modules, and other advanced algorithms all in one cost-effective MCU.

With Renesas technology and advanced AI solutions, your motor control system designs will be ready for the future – today.

Visit renesas.com/realityai-tools for more information including technical documentation and videos or request a demo from the engineering team.