ETPU - Converting TCR1 time to TCR2 angle

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

ETPU - Converting TCR1 time to TCR2 angle

ソリューションへジャンプ
927件の閲覧回数
mertk
Contributor IV

Hello, 

I am working with EngineControl_AN4907 demo. Basically, I am concentrating on the FUEL (etpuc_fuel.c) function and I want to learn how can we get angle from the time by the below calculation. 

mertk_0-1637082634563.png

tmp: the value of the total injection pulse time in TCR1 

Why we are shifting trr right by 6? And then, why we are shifting the result of the divison left by 3?  

Thank you for your help!

Regards, 

Mert KİREMİTCİ

タグ(2)
0 件の賞賛
1 解決策
898件の閲覧回数
johndiener
Contributor IV

The TRR (tick rate) register has 9 fractional bits, hence the total shift by 9 bits to get the correct units.  The breakdown of the needed 9 bit shift into components of 6 and 3 is an attempt to maximize precision while keeping the calculation simple and preventing any overflow issues, I believe.  I've developed a slightly more complicated algorithm to enhance precision, see below.  Other options exist.

johndiener_0-1637167342497.png

 

John Diener

元の投稿で解決策を見る

2 返答(返信)
899件の閲覧回数
johndiener
Contributor IV

The TRR (tick rate) register has 9 fractional bits, hence the total shift by 9 bits to get the correct units.  The breakdown of the needed 9 bit shift into components of 6 and 3 is an attempt to maximize precision while keeping the calculation simple and preventing any overflow issues, I believe.  I've developed a slightly more complicated algorithm to enhance precision, see below.  Other options exist.

johndiener_0-1637167342497.png

 

John Diener
879件の閲覧回数
mertk
Contributor IV

Hi John,

Thanks for your answer.

Take care of yourself.

0 件の賞賛