How to trigger an interrupt with software on an ftm channel set up as input capture?

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

How to trigger an interrupt with software on an ftm channel set up as input capture?

跳至解决方案
3,622 次查看
jamesnimmer
Contributor I

I'm working on a BLDC motor control project and I have the ftm's set up correctly for the outputs and inputs, however, I can only start the motor by first moving the motor shaft by hand to set a flag bit on a channel to start my commutation sequence. In other words, I need to know how trigger the interrupt I have set up for the halls with software so I can start the motor without touching it. Any ideas would be appreciated. 

标签 (1)
0 项奖励
回复
1 解答
3,155 次查看
pavelgrasblum
NXP Employee
NXP Employee

Hi James,

if I understand well, you read halls state using input capture. If the motor is stopped, there is no capture event, which would read the halls state and commutate the motor. There is no way how to force capture event by the software. For correct start of the BLDC motor you need to read initial rotor position and apply correct voltage according to required direction of rotation. Applying the voltage on the motor the rotor will move and the commutation will continue via input capture interrupt. This start up sequence you need to apply any time there is request to run motor. Simply said, you need to run the same code you have your interrupt routine (halls state reading + commutation routines) during every motor start up.

在原帖中查看解决方案

0 项奖励
回复
2 回复数
3,156 次查看
pavelgrasblum
NXP Employee
NXP Employee

Hi James,

if I understand well, you read halls state using input capture. If the motor is stopped, there is no capture event, which would read the halls state and commutate the motor. There is no way how to force capture event by the software. For correct start of the BLDC motor you need to read initial rotor position and apply correct voltage according to required direction of rotation. Applying the voltage on the motor the rotor will move and the commutation will continue via input capture interrupt. This start up sequence you need to apply any time there is request to run motor. Simply said, you need to run the same code you have your interrupt routine (halls state reading + commutation routines) during every motor start up.

0 项奖励
回复
3,155 次查看
jamesnimmer
Contributor I

Hi Pavel,

I assumed this was the answer but given the vast capabilities of the ftm's, I was thinking there was an easier way, but I guess not. Thank you for the response!

-James

0 项奖励
回复