PDB_ISR block - What does it do

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

PDB_ISR block - What does it do

跳至解决方案
391 次查看
Sriram
Contributor IV

Sriram_0-1713419172946.png

Hello,

im going through the pmsm closed loop example of s32k144. want to know what does the PDB isr block do . there is already an option to set delays for pre triggers in the pdb config block. is the pdb isr block neccessary for the execution of pmsm closed loop.

 

thanks

标记 (2)
0 项奖励
回复
1 解答
343 次查看
stefancinipeanu
NXP Employee
NXP Employee

Hello @Sriram 

The PDB peripheral is an up-counting timer used to trigger ADC conversion at specific timings in order to measure at least 2 phase currents on the right moments. Also, the PDB is hardware triggered by FTM peripheral(responsible for generating the PWM signals) by asserting the FTM-INIT signal.

For dual-shunt current reconstruction method used in this PMSM example, the PDB pre-trigger delay values are set to trigger the ADC conversion for currents A and B in the middle of PWM period and indeed, these values are set using the PDB Configuration Simulink block. The 3-phase currents are reconstructed inside the ADC ISR and also all control loops (slow loop and fast loop) are triggered inside the ADC ISR. To be able to execute all these tasks inside the ADC ISR, it is needed to disable first the FTM-PDB trigger.  As you can seen in the following figure, this is the first step we achieve by calling the PWM Init Trigger Disable and then get the ADC raw data for currents.

stefancinipeanu_0-1713792101832.png

After all real-time motor control tasks are executed, the hardware trigger from FTM to PDB has to be reinitialized to get new data for 3-phase current reconstruction and this is achieved using the PDB interrupt block that is going to be enabled after the PDB counter has reached the Interrupt Delay value of 4999. Inside the PDB_ISR function the FTM PWM Init Trigger Enable is called.

stefancinipeanu_1-1713792506073.png

In the following figure, you can observe the application timing diagram for PWM-ADC synchronization:

stefancinipeanu_2-1713792659067.png

For more details on how the PWM-PDB-ADC synchronization is achieved for PMSM motor control application, check out the following application note: AN12235

Hope this helps!

Regards,

Stefan.

在原帖中查看解决方案

1 回复
344 次查看
stefancinipeanu
NXP Employee
NXP Employee

Hello @Sriram 

The PDB peripheral is an up-counting timer used to trigger ADC conversion at specific timings in order to measure at least 2 phase currents on the right moments. Also, the PDB is hardware triggered by FTM peripheral(responsible for generating the PWM signals) by asserting the FTM-INIT signal.

For dual-shunt current reconstruction method used in this PMSM example, the PDB pre-trigger delay values are set to trigger the ADC conversion for currents A and B in the middle of PWM period and indeed, these values are set using the PDB Configuration Simulink block. The 3-phase currents are reconstructed inside the ADC ISR and also all control loops (slow loop and fast loop) are triggered inside the ADC ISR. To be able to execute all these tasks inside the ADC ISR, it is needed to disable first the FTM-PDB trigger.  As you can seen in the following figure, this is the first step we achieve by calling the PWM Init Trigger Disable and then get the ADC raw data for currents.

stefancinipeanu_0-1713792101832.png

After all real-time motor control tasks are executed, the hardware trigger from FTM to PDB has to be reinitialized to get new data for 3-phase current reconstruction and this is achieved using the PDB interrupt block that is going to be enabled after the PDB counter has reached the Interrupt Delay value of 4999. Inside the PDB_ISR function the FTM PWM Init Trigger Enable is called.

stefancinipeanu_1-1713792506073.png

In the following figure, you can observe the application timing diagram for PWM-ADC synchronization:

stefancinipeanu_2-1713792659067.png

For more details on how the PWM-PDB-ADC synchronization is achieved for PMSM motor control application, check out the following application note: AN12235

Hope this helps!

Regards,

Stefan.