Questions about the PWMMAC tpu function for MPC5746R

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

Questions about the PWMMAC tpu function for MPC5746R

Jump to solution
1,052 Views
umsteigen
Contributor II

Now I have downloaded the PWMMAC function code from the official website and added into my project. The function works well but I still have the following questions:

(1) besides 6 pins for 3-phase, when the corresponding pin rated to the channel is configured also as a TPU output pin, a PWM signal can also be detected on this pin. But in my application, I have to get the match time of this PWM signal to trigger the AD conversions (the ASAC TPU function doesn't fit my requirements), how to get the match time of this PWM rising edge? I don't know the parameter offset. Could you please tell me the parameter offset of the match time?

(2) on the PAGE 14 of the AN2969 (Using the AC Motor Control PWM eTPU functions), there are words "One period", "Period Update Time", "Minimum Update Time" and "Longest Thread". What are their meaning? I don't understand of them.

(3) when doing initialization with the function fs_etpu_pwmmac_init_3ph,  one has to set "update_time" and "min_pw", what do they stand for? If I don't set them correctly, what will happen?

 

Thank you very much.

Labels (1)
0 Kudos
1 Solution
837 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, I have obtained an answer from our eTPU expert:

(1)

The PWMMAC master channel generates a signal, which shown the activity of this channel. It shows, by pin state high, when the PWMMAC services are processed which may help in debugging the application timing. Due to eTPU processing latencies this timing is not fully deterministic and this signal should not be used for any triggering. What are you needs not satisfied by ASAC?
(2)
"One period" – how much eTPU cycles is the eTPU engine busy during one PWM period (this number / PWM period length in eTPU cycles = eTPU engine usage by PWMMAC)
"Period Update Time" – should be “period minus/without update time” – how much eTPU cycles is eTPU engine busy from the beginning of the PWM period until the start of Update.
"Minimum Update Time" - The Update starts “Update Time” before the end of the PWM period. Correct setting of the Update Time ensures correct PWM generation. This number can be set as the update Time parameters if PWMMAC is the only function running the eTPU engine. In case there are additional functions running on other channels, which may delay the PWMMAC Update processing, the Update Time must be increased correspondingly.
"Longest Thread" - how much eTPU cycles takes the longest PWMMAC thread – needed for calculation of worst case latencies on other channels
(3)
If you set the Update Time too small, the next PWM period might not be scheduled in time and the dead-times might be not correct.
If you set Update Time too big, it requires your application to set the PWMMAC updates (e.g. duty cycles) unnecessarily early and it shortens the time for FOC etc.
See Fig. 21. The Update Time must be smaller than PWM_period/2.
Min_pw sets a minimum pulse width. If a PWM pulse is
- smaller than min_pw/2, the pulse is not generated (0% or  100% PWM is generated instead)
- wider than min_pw/2, but smaller than min_pw, the a pulse of min_pw width is generated
- wider than min_pw, normal generation

View solution in original post

2 Replies
838 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, I have obtained an answer from our eTPU expert:

(1)

The PWMMAC master channel generates a signal, which shown the activity of this channel. It shows, by pin state high, when the PWMMAC services are processed which may help in debugging the application timing. Due to eTPU processing latencies this timing is not fully deterministic and this signal should not be used for any triggering. What are you needs not satisfied by ASAC?
(2)
"One period" – how much eTPU cycles is the eTPU engine busy during one PWM period (this number / PWM period length in eTPU cycles = eTPU engine usage by PWMMAC)
"Period Update Time" – should be “period minus/without update time” – how much eTPU cycles is eTPU engine busy from the beginning of the PWM period until the start of Update.
"Minimum Update Time" - The Update starts “Update Time” before the end of the PWM period. Correct setting of the Update Time ensures correct PWM generation. This number can be set as the update Time parameters if PWMMAC is the only function running the eTPU engine. In case there are additional functions running on other channels, which may delay the PWMMAC Update processing, the Update Time must be increased correspondingly.
"Longest Thread" - how much eTPU cycles takes the longest PWMMAC thread – needed for calculation of worst case latencies on other channels
(3)
If you set the Update Time too small, the next PWM period might not be scheduled in time and the dead-times might be not correct.
If you set Update Time too big, it requires your application to set the PWMMAC updates (e.g. duty cycles) unnecessarily early and it shortens the time for FOC etc.
See Fig. 21. The Update Time must be smaller than PWM_period/2.
Min_pw sets a minimum pulse width. If a PWM pulse is
- smaller than min_pw/2, the pulse is not generated (0% or  100% PWM is generated instead)
- wider than min_pw/2, but smaller than min_pw, the a pulse of min_pw width is generated
- wider than min_pw, normal generation

837 Views
umsteigen
Contributor II

Thank you for you detailed explanation, I understand.

Actually I have written code to test this function. I found that the master channel's rising edge is at the time when the parameters update happens. The update time is determined by the initialization parameter "update_time".  

Because the samples current, speed, position are required to be synchronized to the PWM signals. I need a signal which is synchronized to the edge of PWM period (not the edge of the PWM signal of one phase).

My solution now is as following:

(1) One parameter is stored in the parameter table of PWMMAC function with the offset "FS_ETPU_PWMMAC_EDGETIME_OFFSET". The parameter indicates the starting time of the next period. I use this parameter to generate a synchronized TPU signal.

(2) such TPU signal is used to trigger synchronized tasks.

0 Kudos