common_code_v2
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
common_code_v2 [2018/07/02 13:06] – [Calculate Mode] hakcenter | common_code_v2 [2018/07/02 13:09] – [Accel Variable] hakcenter | ||
---|---|---|---|
Line 101: | Line 101: | ||
The acceleration variable, is computed at 100ms and 10ms, and it represents the turbo rpm acceleration rate in, rpm per ms. | The acceleration variable, is computed at 100ms and 10ms, and it represents the turbo rpm acceleration rate in, rpm per ms. | ||
< | < | ||
- | | + | |
- | if (timer % 10 == 0) { | + | turbo_accel = (int) (turbo_rpm - last_turbo_rpm) / 100.0f; |
- | turbo_accel[0] = (int) (turbo_rpm | + | last_turbo_rpm = turbo_rpm; |
- | | + | |
- | if (timer % 100 == 0) { | + | |
- | | + | |
- | last_turbo_rpm[1] = turbo_rpm; | + | |
- | } | + | |
- | if (turbo_rpm < top_end_rpm) { turbo_accel[2] = turbo_accel[1]; | + | |
- | } | + | |
</ | </ | ||
- | \\ **<fc # | + | \\ **<fc # |
- | \\ **<fc # | + | |
---- | ---- | ||
==== Idle ==== | ==== Idle ==== | ||
Line 127: | Line 119: | ||
idle_mode = false; | idle_mode = false; | ||
} | } | ||
- | if (turbo_accel[2] <= 2) { vane_position = idle_position; } else { vane_position = turbo_curve[0]; | + | if (turbo_accel <= 2) { |
+ | idle_counter++; | ||
+ | | ||
+ | idle_counter = 0; | ||
+ | | ||
+ | } | ||
+ | if (idle_counter > 1) { | ||
+ | idle_counter = 2; | ||
+ | vane_position = idle_position; | ||
+ | | ||
} else { | } else { | ||
// ----- | // ----- | ||
// Curve section | // Curve section | ||
if (turbo_rpm < idle_walkdown_rpm) { | if (turbo_rpm < idle_walkdown_rpm) { | ||
- | if (turbo_accel[2] <= 2) { | + | if (turbo_accel <= 2) { |
if (last_vane_position >= min_position + half_cm) { | if (last_vane_position >= min_position + half_cm) { | ||
| | ||
Line 147: | Line 148: | ||
else if (turbo_rpm <= curve_rpm[3]) { vane_position = map(turbo_rpm, | else if (turbo_rpm <= curve_rpm[3]) { vane_position = map(turbo_rpm, | ||
else { vane_position = map(turbo_rpm, | else { vane_position = map(turbo_rpm, | ||
- | if (turbo_accel[2] > 2) { idle_walkdown_mode = false; | + | if (turbo_accel > 2) { idle_walkdown_mode = false; } |
- | | + | |
</ | </ | ||
---- | ---- |
common_code_v2.txt · Last modified: 2018/07/02 13:28 by hakcenter