| Next revisionBoth sides next revision |
common_code_v1 [2016/08/26 12:02] – created hakcenter | common_code_v1 [2016/08/26 12:49] – [Variables] hakcenter |
---|
**Debug Serial Messages** | **Debug Serial Messages** |
\\ ''<fc #4682b4>const boolean</fc> serial_out = **true;**'' **-- enables serial output** | \\ ''<fc #4682b4>const boolean</fc> serial_out = **true;**'' **-- enables serial output** |
| |
| **Startup** |
| \\ ''<fc #4682b4>byte</fc> startup = <fc #ff0000>**200**</fc>;'' **-- startup timer to wait until turbo is ready** |
| \\ ''<fc #4682b4>boolean</fc> turbo_online = <fc #ff0000>**false**</fc>;'' -- true CANBUS from turbo is working |
| |
**Timers** | **Timers** |
\\ ''<fc #4682b4>byte</fc> current_mode = 2;'' -- run mode byte | \\ ''<fc #4682b4>byte</fc> current_mode = 2;'' -- run mode byte |
\\ ''<fc #4682b4>const String</fc> current_mode_array[7] = { "Idle", "Idle Walk Down", "Normal", "Spare", "Brake", "Cruise", "Performance" };'' | \\ ''<fc #4682b4>const String</fc> current_mode_array[7] = { "Idle", "Idle Walk Down", "Normal", "Spare", "Brake", "Cruise", "Performance" };'' |
\\ ''<fc #4682b4>boolean</fc> idle_mode = false;'' -- | \\ ''<fc #4682b4>boolean</fc> idle_mode = false;'' -- toggles when turbo_rpm < idle_rpm |
\\ ''<fc #4682b4>boolean</fc> idle_walkdown_mode = false;'' -- toggles when code is walking turbo down to idle | \\ ''<fc #4682b4>boolean</fc> idle_walkdown_mode = false;'' -- toggles when code is walking turbo down to idle |
\\ ''<fc #4682b4>boolean</fc> spare_mode = false;'' **-- spare digital i/o toggle** | \\ ''<fc #4682b4>boolean</fc> spare_mode = false;'' **-- spare digital i/o toggle** |
\\ ''<fc #4682b4>const byte</fc> perf_pos_2 = <fc #ffa500>**80**</fc>;'' **-- position 2 for performance toggle** | \\ ''<fc #4682b4>const byte</fc> perf_pos_2 = <fc #ffa500>**80**</fc>;'' **-- position 2 for performance toggle** |
| |
| **Turbo Idle** |
| \\ ''<fc #4682b4>long</fc> idle_rpm = <fc #ffa500>**11000**</fc>;'' -- under this value turbo is idling |
| \\ ''<fc #4682b4>long</fc> idle_walkdown_rpm = <fc #ffa500>**11000**</fc>;'' -- once turbo_rpm reaches this, start walkdown process |
| |
**Turbo Curves & Factors** | **Turbo Factors** |
\\ ''<fc #4682b4>const byte</fc> two_cm = <fc #ff0000>**80**</fc>;'' -- vane value for 2 cm² | \\ ''<fc #4682b4>const byte</fc> two_cm = <fc #ff0000>**80**</fc>;'' -- vane value for 2 cm² |
\\ ''<fc #4682b4>const byte</fc> one_cm = <fc #ff0000>**40**</fc>;'' -- vane value for 1 cm² | \\ ''<fc #4682b4>const byte</fc> one_cm = <fc #ff0000>**40**</fc>;'' -- vane value for 1 cm² |
\\ ''<fc #4682b4>const byte</fc> half_cm = <fc #ff0000>**20**</fc>;'' -- vane value for 1/2 cm² | \\ ''<fc #4682b4>const byte</fc> half_cm = <fc #ff0000>**20**</fc>;'' -- vane value for 1/2 cm² |
\\ ''<fc #4682b4>const byte</fc> quarter_cm = <fc #ff0000>**10**</fc>;'' -- vane value for 1/4 cm² | \\ ''<fc #4682b4>const byte</fc> quarter_cm = <fc #ff0000>**10**</fc>;'' -- vane value for 1/4 cm² |
\\ ''<fc #4682b4>const unsigned int</fc> idle_rpm = 12000;'' -- rpm when turbo is considered idling | |
\\ ''<fc #4682b4>const unsigned int</fc> idle_walkdown_rpm = 21000;'' | **Turbo Curves** |
| \\ ''<fc #4682b4>byte</fc> current_curve = 0;'' -- current curve |
\\ ''<fc #4682b4>const unsigned long</fc> top_end_rpm = 105000;'' -- first point in top end curve | \\ ''<fc #4682b4>const unsigned long</fc> top_end_rpm = 105000;'' -- first point in top end curve |
\\ ''<fc #4682b4>const unsigned int</fc> curve_rpm[5] = { <fc #ff0000>**17000, 22000, 30000, 45000, 65000**</fc> };'' **-- curve rpm points** | \\ ''<fc #4682b4>const unsigned int</fc> curve_rpm[5] = { <fc #ff0000>**17000, 22000, 30000, 45000, 65000**</fc> };'' **-- curve rpm points** |
\\ ''<fc #4682b4>const unsigned int</fc> turbo_curve_4[5] = { <fc #ffa500>**820,780,740,700,660**</fc> };'' | \\ ''<fc #4682b4>const unsigned int</fc> turbo_curve_4[5] = { <fc #ffa500>**820,780,740,700,660**</fc> };'' |
| |
**Turbo** | **Turbo Variables** |
\\ ''<fc #4682b4>unsigned int</fc> minimum_turbo_rpm = <fc #ffa500>**1000**</fc>;'' **-- minimum required turbo rpm for pretty much everything** | \\ ''<fc #4682b4>unsigned int</fc> minimum_turbo_rpm = <fc #ffa500>**1000**</fc>;'' **-- minimum required turbo rpm for pretty much everything** |
\\ ''<fc #4682b4>long</fc> turbo_rpm = 0;'' -- current turbo rpm | \\ ''<fc #4682b4>long</fc> turbo_rpm = 0;'' -- current turbo rpm |
\\ ''<fc #4682b4>long</fc> last_turbo_rpm[2] = { 0,0 };'' -- turbo rpm 10ms & 100ms ago | \\ ''<fc #4682b4>long</fc> last_turbo_rpm[2] = { 0,0 };'' -- turbo rpm 10ms & 100ms ago |
\\ ''<fc #4682b4>int</fc> turbo_accel[3] = { 0,0,0 };'' **-- turbo acceleration variable** | \\ ''<fc #4682b4>int</fc> turbo_accel[3] = { 0,0,0 };'' **-- turbo acceleration variable** |
| |
| **CANBUS Variables** |
| \\ ''<fc #4682b4>long</fc> can_id = <fc #ff0000>**0**</fc>;'' |
| \\ ''<fc #4682b4>byte</fc> can_length;'' |
| \\ ''<fc #4682b4>byte</fc> can_data[8] = <fc #ff0000>**{ 0, 0, 0, 0, 0, 0, 0, 0 }**</fc>;'' |
| \\ ''<fc #4682b4>byte</fc> turbo_flags[8] = <fc #ff0000>**{ 0, 0, 0, 0, 0, 0, 0, 0 }**</fc>;'' |
| \\ ''<fc #4682b4>int</fc> turbo_position = <fc #ff0000>**0**</fc>;'' |
| \\ ''<fc #4682b4>byte</fc> turbo_temp = <fc #ff0000>**0**</fc>;'' |
| \\ ''<fc #4682b4>int</fc> turbo_cmd_position = <fc #ff0000>**0**</fc>;'' |
| \\ ''<fc #4682b4>byte</fc> turbo_feedback = <fc #ff0000>**0**</fc>;'' |
| |
| **Sweep Variables** |
| \\ ''<fc #4682b4>boolean</fc> sweep_position = <fc #ff0000>**false**</fc>;'' **-- toggles on sweep command** |
| \\ ''<fc #4682b4>boolean</fc> sweep_update = <fc #ff0000>**false**</fc>;'' **-- toggles every sweep** |
| \\ ''<fc #4682b4></fc>int sweep_counter = <fc #ff0000>**0**</fc>;'' **-- counter chooses direction of sweep** |
| |
**Timer2 Variables** | **Timer2 Variables** |