Hello NXP Community,
I am trying to spin a PMSM motor using your Motor Control algorithms with Simulink, Embedded Coder and Model-Based Design Toolbox for S32K3xx, based on the NXP webinar for the S32K3xx family:
https://www.nxp.com/design/training/a-model-based-design-mbdt-environment-for-motor-control-algorith...
But I am having several issues (which I describe below). IOI was hoping you could please give me some pointers to overcome it and get the motor running.
I am using MATLAB 2022b and S32 Design Studio 3.5.
Regarding RTD and MBDT, I am using S32K3 Real-Time Drivers AUTOSAR 4.4 Version 2.0.1 in S32 Design Studio, but the SW32K3_RTD_4.4_2.0.0 is delivered with the toolbox. Model-Based Design Toolbox for S32K3xx 1.2.0 is being used, all downloaded from NXP website.
The EVB that is being used for test purposes is the S32K312-Q172 (I also have tried with the S32K344-Q-172). (These are "generic" EVBs; not the one with the small Brushless motor, because that seems to be unavailable).
After installing MATLAB and the needed Add-Ons, we executed a toolbox script to generate the appropriate settings for the installation environment, as indicated in the Model-Based Design Toolbox quick start guide for the S32K3xx.
Next, using the example for the Dio project, I was able to generate, build and deploy the Code in the S32K312-Q172 EVB with success, and this way assure that the configurations needed were performed correctly.
In the next step I have selected the PMSM Motor Control example from Simulink, using Library Browser.
Simulink Model
In the hardware-part selection window configuration, I chose the correct EVB, as you can see below, and the configuration process is using S32 Design Studio as the configuration tool instead of EB Tresos.
Hardware-Part Selection
When I try to generate, build and deploy the Code into the EVB, during the build process, Simulink gives a rebuild reason and several errors as you can see below:
“Code Generation Information file does not exist”:
Diagnostic Viewer
Error 1/2
Error 2/2
I have also tried other examples, such as PWM, on the same EVB that work properly.
I would like to understand:
- Can the newer version of the Real Time Drivers cause some incompatibility issues with the motor control lib example?
- The error that I have is related with the provided example? (if this is true, can you provide the correct example for the EVB in consideration?)
- Do I need to perform any other action, besides the ones that I already did, in order to get the example working using EVB's S32K312-Q172 or S32K344-Q-172?
- I have also found an existing post that I thought it could help me, but I can't reach step 2, since the build is not successful. (NXP Post: https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Export-generated-projects-in-MBDT-for-s... )
Note:
Please note that the goal here is to use sensorless FOC (we have a circuit with 3 phase current shunts if that can be used), but we do not want to use FOC with Hall sensors. (Hall sensors are excluded from our application).
With Best Regards,
Simão Serrano