Hello,
I am using S32K396-BGA-DC1 board, with Simulink in matlab2024a. I am working on the S32K396_MBDT_BASED_MC_0_9_0 Motor Control Example Project.
In my setup I have the nxp connected with a HIL-RT hardware emulating the power stage and a motor.
My question is regarding the Resolver SW, how can I change the resolver parameters (resolver pole pairs, offset, etc) in order to adjust to my application?
At the moment, I am able to read the SIN/COS signal and I get a speed value that is stable but it is not the real one (see figure 1). Motor has 3 pp.
I tried modifying the MCAT parameters without success. I also notice in the etpu_gct.h file the are some lines referring this:
#define ETPUDATA 0x800000
#define ATOFRE 20000 /* ATO frequency */
#define MOTOR_PP (3.0F)
#define MOTOR_PP_GAIN FRAC32(0.75)
#define MOTOR_PP_SHIFT (2)
but trying to modify the MOTOR_PP then the control in open loop for some reason does not works as before an become more unstable.
Can you please give me support on this and tell me what is missing or wrong in the config?
Thanks, Agustin.
Hello @MayurB51 , sorry to bother you but this topic is still open. The code does not respond to a change in resolver pole pair. Moreover is it limiting the maximum electrical speed to around 3600rad/s. So, i try to modify the WEL_MAX variable in the appconfig.h but nothing change also.
Can you please help me with this topic? Thanks.
Hi @agus_idiada,
Can you please try the below method to change the resolver setting in freemaster:
first you need to open the freemaster, click on the below icon.
then you have to go to the "Sensors" option as shown below and have to click on the checkbox of the Resolver or the sensor you want to use.
After above step you have to click on the "Tab menu" and check the checkbox of "Sensors" option as shown below:
After all these steps you have click on the "Apply" and "OK" button and you will see a new window with the name of "Sensors" will apear where you can do changs the Resolver parameters.
after all these changes you can "Update Target", "Store Data" and go to the "Output File" menu and "Generate Configuration File". Go to S32DS Build, compile and flash the code again.
Thanks,
Mayur
Thanks for the answer @MayurB51, I tried your suggestion without success. I got an error when I follow your steps (fig 2). I also noticed that there is not any variable in the data dictionary referring the Resolver parameters (fig 3). Maybe I can directly change them manually in the code if you can guide me where. Thanks.