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
Solved! Go to Solution.
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:
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" );
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.
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:
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" );
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.
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
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.
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 ?
CH1: "ETPU_CRANK_CHAN" in "etpu_crank_isr"
CH3: Crank Sensor (Hall Effect Sensor) of 36-1 teeth during Cranking
All ratios are fractional number, so it cannot be bigger than 1.
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 ?
Attached a screenshot of FreeMASTER reading the ECU with the cranking signal
CH1: "ETPU_CRANK_CHAN" in "etpu_crank_isr"
CH3: Crank Sensor (Hall Effect Sensor) of 36-1 teeth during Cranking
Timeouts you may see described here:
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".