Ratios for cranking with 2-stroke engine

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Ratios for cranking with 2-stroke engine

Jump to solution
2,279 Views
Stephane_Pain
Contributor I

Hello,

I need your help.

I'm Currently using Engine Control eTPU Library on a 2 Stroke engine with TRK-MPC5634M on S32 Design Studio.

The Trigger wheel is 36-1 teeth with Missing teeth located at 90 degrees BTDC

I have a issue to understand and use the right ratio specially "win_ratio_after_timeout" for my engine (run on simulator for the moment).

When the engine is running heavenly (tooth_period = previous_teeth_period and Missing_teeth_period = tooth_period * (teeth_in_gap+1) ), there is no problem of synchronization.

But when i crank my current engine, i have a big rpm slow down during the compression.

To try to understand how works the ratios, i made a spreadsheet with the conditions and max and minimum time for my current Cranking timing.

The code is the the basic code from the AN4907SW.

 

Can someone help me please ?

 

Thanks

0 Kudos
1 Solution
2,195 Views
johndiener
Contributor IV

I used your tooth time measurements to generate a simulation in the ASH WARE environment, along with your window ratios:

write_val("@" STRINGIFY(CRANK_CHAN) ".crank_local.gap_ratio", "0.6" );
write_val("@" STRINGIFY(CRANK_CHAN) ".crank_local.win_ratio_normal", "0.8" );
write_val("@" STRINGIFY(CRANK_CHAN) ".crank_local.win_ratio_across_gap", "0.2" );
write_val("@" STRINGIFY(CRANK_CHAN) ".crank_local.win_ratio_after_gap", "0.3" );
write_val("@" STRINGIFY(CRANK_CHAN) ".crank_local.win_ratio_after_timeout", "0.8" );

You did not mention what you are using for gap_ratio, so I just used 0.6, which seems to be a typical default number.  As expected, crank sync cannot be achieved:

sync_failure.jpg

Note the crank state numbers are as follows:

#define CRANK_SEEK 0
#define CRANK_BLANK_TIME 1
#define CRANK_BLANK_TEETH 2
#define CRANK_FIRST_TRANS 3
#define CRANK_SECOND_TRANS 4
#define CRANK_TEST_POSSIBLE_GAP 5
#define CRANK_VERIFY_GAP 6
#define CRANK_COUNTING 7
#define CRANK_COUNTING_TIMEOUT 8
#define CRANK_TOOTH_BEFORE_GAP 9
#define CRANK_TOOTH_BEFORE_GAP_NOT_HRM 10
#define CRANK_ADDITIONAL_TOOTH 10
#define CRANK_TOOTH_AFTER_GAP 11

As can be seen, gap verification is attempted multiple times in a cycle due to the compression slow-downs.  The verification fails at the actual missing tooth because the "win_ratio_after_gap" is too small.  Even when that is opened up to 0.45, gap verification still fails because the 0.6 gap_ratio is too stringent and the second half of the ABA test fails.  Bumping it up to 0.75 allows it to succeed:

write_val("@" STRINGIFY(CRANK_CHAN) ".crank_local.gap_ratio", "0.75" );
write_val("@" STRINGIFY(CRANK_CHAN) ".crank_local.win_ratio_normal", "0.8" );
write_val("@" STRINGIFY(CRANK_CHAN) ".crank_local.win_ratio_across_gap", "0.2" );
write_val("@" STRINGIFY(CRANK_CHAN) ".crank_local.win_ratio_after_gap", "0.45" );
write_val("@" STRINGIFY(CRANK_CHAN) ".crank_local.win_ratio_after_timeout", "0.8" );

sync_success.png

Anyways, these might not be the ideal numbers but it is likely you can tune them to get what you need.  This is easy to experiment with in simulation - I've attached my project.

John Diener

View solution in original post

8 Replies
2,196 Views
johndiener
Contributor IV

I used your tooth time measurements to generate a simulation in the ASH WARE environment, along with your window ratios:

write_val("@" STRINGIFY(CRANK_CHAN) ".crank_local.gap_ratio", "0.6" );
write_val("@" STRINGIFY(CRANK_CHAN) ".crank_local.win_ratio_normal", "0.8" );
write_val("@" STRINGIFY(CRANK_CHAN) ".crank_local.win_ratio_across_gap", "0.2" );
write_val("@" STRINGIFY(CRANK_CHAN) ".crank_local.win_ratio_after_gap", "0.3" );
write_val("@" STRINGIFY(CRANK_CHAN) ".crank_local.win_ratio_after_timeout", "0.8" );

You did not mention what you are using for gap_ratio, so I just used 0.6, which seems to be a typical default number.  As expected, crank sync cannot be achieved:

sync_failure.jpg

Note the crank state numbers are as follows:

#define CRANK_SEEK 0
#define CRANK_BLANK_TIME 1
#define CRANK_BLANK_TEETH 2
#define CRANK_FIRST_TRANS 3
#define CRANK_SECOND_TRANS 4
#define CRANK_TEST_POSSIBLE_GAP 5
#define CRANK_VERIFY_GAP 6
#define CRANK_COUNTING 7
#define CRANK_COUNTING_TIMEOUT 8
#define CRANK_TOOTH_BEFORE_GAP 9
#define CRANK_TOOTH_BEFORE_GAP_NOT_HRM 10
#define CRANK_ADDITIONAL_TOOTH 10
#define CRANK_TOOTH_AFTER_GAP 11

As can be seen, gap verification is attempted multiple times in a cycle due to the compression slow-downs.  The verification fails at the actual missing tooth because the "win_ratio_after_gap" is too small.  Even when that is opened up to 0.45, gap verification still fails because the 0.6 gap_ratio is too stringent and the second half of the ABA test fails.  Bumping it up to 0.75 allows it to succeed:

write_val("@" STRINGIFY(CRANK_CHAN) ".crank_local.gap_ratio", "0.75" );
write_val("@" STRINGIFY(CRANK_CHAN) ".crank_local.win_ratio_normal", "0.8" );
write_val("@" STRINGIFY(CRANK_CHAN) ".crank_local.win_ratio_across_gap", "0.2" );
write_val("@" STRINGIFY(CRANK_CHAN) ".crank_local.win_ratio_after_gap", "0.45" );
write_val("@" STRINGIFY(CRANK_CHAN) ".crank_local.win_ratio_after_timeout", "0.8" );

sync_success.png

Anyways, these might not be the ideal numbers but it is likely you can tune them to get what you need.  This is easy to experiment with in simulation - I've attached my project.

John Diener
2,163 Views
Stephane_Pain
Contributor I

Thanks for your help,

I'll test that.

With the ASH WARE simulator, it looks easier to set the some parameters.

I'll think about that.

 

Thanks

 

0 Kudos
2,150 Views
johndiener
Contributor IV

Just a quick note to let you know, the barrier to experimenting with the simulator is fairly low - the free demo version (https://www.ashware.com/Demos) comes packaged with, and can simulate, the AN4907 eTPU code.

John Diener
0 Kudos
2,245 Views
stephane_pain77
Contributor I

Try to change the missing teeth in the higher point of compression, to have a big gap.

But same result.

Is this possible to have a ratio bigger than 1 ?

Screenshot_2021-09-04-10-39-23.png

CH1: "ETPU_CRANK_CHAN" in "etpu_crank_isr"

CH3: Crank Sensor (Hall Effect Sensor) of 36-1 teeth during Cranking

0 Kudos
2,220 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

All ratios are fractional number, so it cannot be bigger than 1.

2,245 Views
stephane_pain77
Contributor I

Thanks for your help,

In my condition, the Crank State never "verified the gap" so the engine position can not pass the "First Half Syn".

Can i still using "crank_windowing_ratio_timeout" even when it never passed the "SEEK" State ?

stephane_pain77_0-1630715390391.png

Attached a screenshot of FreeMASTER reading the ECU with the cranking signal

Screenshot_2021-09-04-10-33-02.png

CH1: "ETPU_CRANK_CHAN" in "etpu_crank_isr"

CH3: Crank Sensor (Hall Effect Sensor) of 36-1 teeth during Cranking

0 Kudos
2,221 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Timeouts you may see described here:

davidtosenovjan_0-1631172222063.png

 

0 Kudos
2,254 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

I would recommend to consult also with documentation for original etpu automotive function set (set 2).

AN3768 - eTPU Automotive Function Set 2
AN3769 - Using the Engine Position (CRANK and CAM) eTPU Functions
AN3770 - Using the FUEL eTPU Function
AN3772 - Using the Knock Window eTPU
AN3801 - Using the Tooth Generator eTPU Function


In the AN3769, sections 3.2 Windowing Signals and 3.3 Error Handling described "timeouts".

davidtosenovjan_0-1630656758806.png

 

0 Kudos