AnsweredAssumed Answered

CRANK with no CAM function usage in 2-stroke engine

Question asked by Turgay Kale on Oct 18, 2019
Latest reply on Nov 9, 2019 by Turgay Kale

Hi, I want to use the standard ETPU engine control library (AN4907SW or NXP etpu function generator site) to decode a 35-1 teeth with no CAM function and therefore engine cycle is 36 teeth (1 revolution) because the engine is 2-stroke engine and no need for CAM function. I have changed macros in MCU application as below. How can I use the standard ETPU engine control library, do I need to edit the ETPU code in ETPU CRANK function for my case? What do I have to edit/ modify in CRANK function for 2-stroke engine (engine cyle is 360 degree) ?  Would you please help me to handle this problem?


#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)) 


I also used the formulations used in crank_ratios.xlsx document from the standard ETPU engine library as below;


P.S. MCU is NXP SPC5644A



Turgay Kale