Motor Control Errors Example Project MBDT S32K3

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Motor Control Errors Example Project MBDT S32K3

2,371 次查看
RobSpanjers
NXP Employee
NXP Employee

Hello,

I have some errors while building the Motor Control PMSM example project from the MBDT for S32K3. After opening the example project I check the model settings and set the hardware board to NXP S32K344-Q257 and to use the S32 Config Tool, and to use the COM10 serial port. 

When I generate and build the project I get errors (see Build_Error.docx).

Do I have to adjust some other settings, or other Block Parameters?

I'm using:
-MATLAB R2021a
-MBDT S32K3 V1.2

Thanks in advance.

Rob Spanjers

0 项奖励
回复
4 回复数

2,339 次查看
Irina_Costachescu
NXP Employee
NXP Employee

Hi @RobSpanjers ,

For addressing the issue you are currently encountering, I will also add some information on how the MBDT for S32K3 operates that you might find useful. Please find my answer structured as it follows:

Default and Custom Configuration Projects

The MBDT for S32K3 uses the integration of external tools (EB Tresos or S32 Config Tools) for configuring the hardware for a specific application (peripherals, pins, clocks). The toolbox provides a default configuration (available both in EBT or S32 Config Tools), enabling all the components we offer support for, for each of the supported processors. Such a default configuration is used during the build of Simulink models, being a folder in case of EB Tresos, identified as modelName_TresosProject, or a file, identified as modelNameConfig.mex in case of the S32 Configuration Tools selection.

However, if the model is already delivered with an associated project (a TresosProject folder or a .mex file placed next to the model), that is the one that will be used during the build process for generating corresponding configuration code based on the enabled settings. The motor control examples we provide use such custom projects, as you can see in the picture below, highlighted in red.

Irina_Costachescu_0-1664979843712.png

For a better understanding of when default or custom projects are used, you can check the Dio applications. For example, you can navigate to the S32K3_Examples/dio/s32k344_dio_ebt folder. As you can see, in this case, there is no project placed next to the model, hence the default configuration will be used when building this application.

Irina_Costachescu_1-1664980120058.png

Motor Control Custom Configuration Projects

The custom projects contain settings enabled to fit specific applications particularities, like motor control. When you change the configuration tool for the PMSM model (to S32 Configuration Tools), the custom project is not automatically translated into the new configuration tool. What happens is that the default S32 Config Tools project (not customized for motor control) will be used for the Simulink build process.

Since the model you are trying to build was designed based on the EB Tresos custom configuration placed next to it, the default S32 Configuration project will not contain all the settings (channels, hardware units, etc.) needed by the model, hence the build will fail.

Please also note that changing the Hardware Part will trigger the same behavior. The model is configured specifically for the S32K344-Q257 processor. If you change it to a different selection, the default configuration project (not customized for motor control) will be used for the following steps. A pop up dialog also informs you on this when you make the change.

Irina_Costachescu_2-1664980311454.png

Therefore, you could keep the custom project the toolbox provides for this example, install EB Tresos and use it as the Configuration Tool, leaving the model settings unaltered. In this way you could also take a look inside the s32k3xx_mc_pmsm_TresosProject configuration, and see how the components are set for such a specific application.

Unlimited Configuration Mode

Please also note that the toolbox also allows you to create your own custom projects. By pressing the Configure button of any of the blocks in the model, the configuration project found next to the model will open. Inside this environment you can make any changes you like for addressing the particularities of your application. Saving the project and going back to your model, the Refresh button will update the new settings into the Simulink environment.

Irina_Costachescu_4-1664981626062.png

 

In this way, you have complete flexibility of configuring the hardware you are using, according to the application you are designing. 

Hope this information will help you,

Irina

0 项奖励
回复

2,291 次查看
RobSpanjers
NXP Employee
NXP Employee

@Irina_Costachescu 

The Motor Control Example project now will build on the board, but when I check EBTresos the PWM ports it uses are default ports, so the example project will not run with the DEVKIT-MOTORGD without editing the configuration. But when trying to configure the correct output pins, I get some errors. 
Is there a setup for the EBTresos environment that can be used with the Motor Example Project so I can see it working, or do I need to configure something?

With kind regards,


Rob Spanjers

0 项奖励
回复

2,217 次查看
Irina_Costachescu
NXP Employee
NXP Employee

Hi @RobSpanjers ,

Could you share with us more details about your hardware setup? What motor are you using for testing the application? 

Thanks,

Irina

0 项奖励
回复

2,191 次查看
RobSpanjers
NXP Employee
NXP Employee

Hello @Irina_Costachescu,

I'm using the S32K3X4EVB-Q257 (See picture 1), and the LINIX BLDC MOTOR 45ZWN24-40 with the DEVKIT-MOTORGD (See picture 2&3, the DEVKIT-MOTORGD is on this picture connected on the S32K1X4, but I use it connected on the S32K3x4EVB)

Attached as well the PMSM MC example project I use.

 

Rob Spanjers

0 项奖励
回复