Hi,
I'm trying to use S32K144 EVB and a drive board to control PMSM, then I need to sample phase currents and phase voltage.
I used FTM0 channel 0-5 to generate 6-channel complementary PWM, and the AD interrupt should be triggered in the middle of the low PWM. I need to trigger AD in the middle of the rising edge of FTM0 channel 1 and channel 3, respectively, to obtain the current passing through the resistors of the two sampling points.
I referred to the doc: AN5303, and found the way to configurate ADC triggered by FTM through PDB, and i can read ADC0->R[0] to get the Ia result. But I don't know how to configurate to get Ib and phase voltage.
Hi Lilac,
Would you please refer to AN12235: 3-Phase Sensorless PMSM Motor Control Kit with S32K144 Application Note
It will show you how to sample DC bus voltage and Phase B stator current.
Please download MCSPTE1AK144 Development Kit Application Software
Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Thanks for your reply. This helps a lot.
But I'm not used to use components, I want to modify the method of writing registers directly which is mentioned in AN5303.
Below are screenshots of my setup process, in the ADC0_IRQHandler, I can get the result of ADC0->R[0], but in ADC1_IRQHandler, I can't get any results from ADC1.
Thank you!
Sorry for the late reply.
I didn't find a bare metal example, but you can debug the (MCSPTE1AK144 Development Kit Application Software)project , and then write your bare metal code according to its configuration process.