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,179件の閲覧回数
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 解決策
2,712件の閲覧回数
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 返答(返信)
2,713件の閲覧回数
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,712件の閲覧回数
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 件の賞賛