MBDT realizes motor control design

Publisher:BoldDreamerLatest update time:2024-07-31 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

**1 Generate motor control code from MBDT**

This issue is also part of the MBDT (Model-Based Design Tools) Getting Started section, which focuses on advanced motor control algorithms. Motor control is very suitable for model-based design (MBD) exercises.


MBDT has many motor control example models, which can generate code directly, and provides a configured FreeMASTER project, which can view Hall signals, current, voltage and other information. As shown in the figure below, double-click to open and view the model.

picture

Example Models for Motor Control Provided by MBDT - From autoMBD

In order not to damage the original model, it is not recommended to open the model from the library. The following takes the MBDT sample project BLDC_ClosedLoop_s32k144.mdl as an example to show how to use MBDT to generate and run the motor control algorithm. The hardware used is MCSPTE1AK144.

Find the directory location of the example model BLDC_ClosedLoop_s32k144.mdl and copy the entire directory to a suitable location. By default, the location of the example model is in this directory:

picture

MBDT example model location path - From autoMBD

The first part of the path may be different due to the different installation locations and computer configurations, so be careful to distinguish. Then put the MATLAB workspace to the location you copied, and open the BLDC_ClosedLoop_s32k144.mdl model:

picture

Open the example model - From autoMBD

It is important to note that the original MBDT BLDC_ClosedLoop_s32k144.mdl model configuration is a bit wrong and needs to be modified. The pin configuration of Hall A and Hall B in the original model needs to be modified to the following configuration:

  • Hall A: PTD11 changed to PTA15

  • Hall B: PTD10 changed to PTA16

picture

Modify Hall A/B reference - From autoMBD

The specific modification basis can be found in the schematic diagram of S324144EVB. Here is a screenshot for readers' reference:

picture

Hall A/B Circuit Diagram - From autoMBD

It can be seen that PTD11 and PTD10 are in DNP (Do Not Populate) status and cannot be used. PTA15 and PTA16 can be used.

At this point, the basics of MBDT are complete. Readers can also view other example models and try to generate code and run them themselves, which will give them a deeper understanding of MBD.

The motor control model has a certain degree of complexity and richness. Carefully reading how the model is built can help you understand many MBD development methods, including the construction of state machines, event control, algorithm implementation, etc.

2 Use of MC DevKits

NXP also provides a pure code motor control solution, which is briefly introduced here as a comparison with MBDT.

You can download the software for MCSPTE1AK144 for free on the NXP official website, or you can find it in the resources of the official account. Reply to the keyword "MBDT" in the dialog box to receive resource information.

picture

MC DevKits - From autoMBD

Double-click to start the installation. If you use the default installation (default installation is strongly recommended), you can find four projects in this location:

picture

Four projects of MC DevKits - From autoMBD

These four projects can be directly compiled and downloaded in S32 Design Studio for ARM Version 2.2 (S32DS). At the same time, the project also provides the MCAT real-time debugging tool based on FreeMASTER, which is more powerful than the motor control model of MBDT and can be used for sensorless algorithms or motor control algorithms with FreeRTOS.

Take MCSPTE1AK144_PMSM_FOC_2Sh as an example

If you are not a computer major and have never been exposed to embedded development, it may take a long time to understand how these projects work. In comparison, MBDT is much simpler. If you can understand the model, you can know how the motor control algorithm is implemented.

Of course, these two methods are very different in implementation and have their own advantages, so they cannot be generalized. I think only by mastering both methods can the greatest advantages of MBD be brought into play.


Reference address:MBDT realizes motor control design

Previous article:Position-free closed-loop control of brushless DC motor BLDC based on Simulink
Next article:Solution for the full life cycle management system of CNC machine tools based on identification resolution technology

Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号