AnsweredAssumed Answered

ETPU crank tooth period (TCR1) to RPM conversion

Question asked by Turgay Kale on Feb 17, 2020
Latest reply on Feb 25, 2020 by Andrei Chichak

Hi, I am using the standard ETPU engine control library (AN4907SW or NXP etpu function generator site) decoding a 35-1 teeth with no CAM function and therefore engine cycle is 36 teeth (1 revolution). The engine is 2-stroke engine and no need for CAM function. I have changed macros in MCU application as below. I couldn't understand the tooth period (TCR1) and RPM conversion. Can you express where does it come from?


#define SYS_FREQ_HZ                                                150E6 
#define TCR1_FREQ_HZ                                              (SYS_FREQ_HZ/2) 
#define TEETH_TILL_GAP                                            35 
#define TEETH_IN_GAP                                                 1 
#define TEETH_PER_CYCLE                                       36 
#define TCR2_TICKS_PER_TOOTH                           1000
#define TCR2_TICKS_PER_CYCLE                            ((TEETH_PER_CYCLE)*(TCR2_TICKS_PER_TOOTH))
#define MSEC2TCR1(x)                                                (TCR1_FREQ_HZ/1E3*(x)/1E0)
#define USEC2TCR1(x)                                                (TCR1_FREQ_HZ/1E3*(x)/1E3)
#define DEG2TCR2(x)                                                  ((x)*TCR2_TICKS_PER_CYCLE/360
#define UFRACT24(x)                                                  ((x)*0xFFFFFF)

#define TCR12USEC(x)                                                (x / ( TCR1_FREQ_HZ / 1E6 ))

#define TCR2DEG(x)                                                    (360*(x)/TCR2_TICKS_PER_CYCLE) 


/* Tooth Period [TCR1] and RPM */
#define RPM2TP(x)                                                      (TCR1_FREQ_HZ/(x)*60/(TEETH_PER_CYCLE)) 
#define TP2RPM(x)                                                      (TCR1_FREQ_HZ/(x)*60/(TEETH_PER_CYCLE)) 


In NXP AN4908 Engine control demo application document page 6, the conversion is below for a 4-stroke engine;