unknown type name 'rtDW_ComputeElectricAngle_ADC_Sensing_g_T'

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

unknown type name 'rtDW_ComputeElectricAngle_ADC_Sensing_g_T'

1,226 Views
s_kirchmeyr
Contributor I

Hello!


I am using Matlab Simulink R2019a and stepped through the 3-Phase PMSM Control Workshop (-Phase PMSM Control Workshop with NXP's Model-Based Design Toolbox ).

I automatically converted the project to be compatible with the newer Matlab version.

I had to fix the following error:

FTM PWM Disable Enable block 'ADC_Sensing/S32K14x EVB/FastLoopControl/PWMCommands/Control_Logic/t2_init/FTM_PWM_Disable_Enable' has no FTM PWM Config block

This was done quite easily. I had to change the Module from 0 to 3 in all "FTM PWM Enable Disable" blocks.

The problem now are compiler errors.

Unfortunately I can't get the Modules M6, M7, M8 and M9 running due to compiler errors now.

The errors are getting longer and longer from M6 to M9.

The errors for M6 are this:

In file included from pdb1_isr.h:2:0, from ADC_Sensing.h:44, from ADC_Sensing.c:19: ADC_Sensing_private.h:91:24: error: unknown type name 'rtDW_ComputeElectricAngle_ADC_Sensing_g_T' real32_T *rty_theta, rtDW_ComputeElectricAngle_ADC_Sensing_g_T *localDW); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ADC_Sensing_private.h:92:52: error: unknown type name 'rtB_SPI_Comm_ADC_Sensing_g_T' extern void ADC_Sensing_SPI_Comm(uint8_T rtu_Data, rtB_SPI_Comm_ADC_Sensing_g_T * ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ADC_Sensing_private.h:117:3: error: unknown type name 'rtDW_SlowLoopControl_ADC_Sensing_T' rtDW_SlowLoopControl_ADC_Sensing_T *localDW, real32_T *rtd_SPEED_CMD, real32_T ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gmake: *** [ADC_Sensing.o] Error 1

How can I solve this error? Is it due to compatibility problems with R2019a?

0 Kudos
4 Replies

920 Views
mahdikazemi12
Contributor I

Hello,

I have the same problem.  I am using Matlab 2019a and MBDT 4.1.

Do you have any solution?

Thank you.

0 Kudos

920 Views
dumitru-daniel_
NXP Employee
NXP Employee

Hi mahdikazemi12@gmail.com‌, s.kirchmeyr@abatec.at

The error ...

unknown type name 'rtDW_ComputeElectricAngle_ADC_Sensing_g_T' real32_T *rty_theta,

.. is caused by the Matlab Code generator. It does not like the atomic subsystems. 

An easy workaround is to change all the atomic subsystem from the motor into non-atomic with Code Generation function packing set to Auto

pastedImage_3.png

pastedImage_4.png

At some point all the model will be updated. For the moment, you can use the models of Motor Control shipped with the Toolbox 4.1.0. Those were already upgraded. You can take inspiration from there and if you wish you can upload your updated models as solutions in workshop articles.

Best regards,
Daniel

0 Kudos

920 Views
s_kirchmeyr
Contributor I

Thank you for your answer!

I am using version 4.1.0 of the MBDT.

The function packaging of the block "ADC_Sensing > S32K14x EVB > ADC Sensing > ADC1_IRQHandler" is already set to "Reuseable function". I played around a little bit with some other options and other functions and blocks, but I could not get rid of the error.

0 Kudos

920 Views
mariuslucianand
NXP Employee
NXP Employee

Hello s.kirchmeyr@abatec.at‌,

The PWM Enable Disable block must be used alongside with a PWM config block for a certain module, as you've already done.

What MBDT version are you using?

Form the provided log, I assume that inside of the s-function triggered by the PDB interrupt block, there are some ADC read blocks used, so I assume that changing the Code generation function packaging from Auto to Inline or Reusable function might solve your problem.

Best Regards,

Marius 

0 Kudos