Hi, I'm using my own board of MKV10Z32VLC7 for motor control applications. I'm using center aligned PWM generated from FTM0. And I just want to measure the current at the center of PWM and referred some application notes(AN4410, AN5142) and processed as such but the trigger is not happens correctly.
For example, I need to generate a PWM of 10KHz, I used the following configurations in FTM(FTM0 is used) and PDB.
Configurations for PDB as follows:
The output waveform for the above configurations as below:
Channel 1(yellow) is FTM0_CH0 output and channel 2(green) is for LED toggle(450KHz as measured); the code shown below.
I need to trigger at the center of PWM, so for that what should be the configurations. Due to this PDB_ISR the other interrupts(such as periodic interrupts) are disabled. MarMi pavelrech kubanb kubanb vicentegomez khumphri Mandar dhaval
Thank you in advance .....
Do you want to control a PMSM with FOC? In the case, you need to sample two ADC channels simultaneouly at the center of bottom PWM High signal, the two ADC channels are from ADC0 and ADC1 module.
Do you control a BLDC? you just connect a shunt resistor in the poewer bus, it is okay.
I attach an4410.pdf, which focuses on the ADC triggering.
I think it is helpful.
For PMSM FOC control, you have to sample two current ADC channels at the center of bottom PWM signal in center-alignment mode of PWM, in other words, the expected sampling instant is the center of bottom PWM high logic which means that that the bottom MOSFET is on. But PWM waveform is related to the FTM mode, some waveform is High-Low-High in "High true pulse" mode, in the case, you can see the Figure 3. Timing for one ADC instance in an4410.
some waveform is low-high-low in "Low true pulse" mode, the center of bottom PWM high logic is not at the start of PWM signal, you have to use PDB or unused FTM channel to set the sampling instant.
Hope it can help you.