2015-12-30 13:02:18 -08:00
|
|
|
/*
|
|
|
|
* @file toyota_jzs147.cpp
|
|
|
|
*
|
|
|
|
* toyota aristo
|
|
|
|
* https://en.wikipedia.org/wiki/Lexus_GS
|
|
|
|
* http://rusefi.com/forum/viewtopic.php?f=15&t=969
|
|
|
|
*
|
2016-01-02 12:02:37 -08:00
|
|
|
* http://wilbo666.pbworks.com/w/page/37134472/2JZ-GTE%20JZS147%20Aristo%20Engine%20Wiring
|
|
|
|
*
|
2016-07-13 19:02:35 -07:00
|
|
|
* NON VVTi
|
2017-01-06 07:04:41 -08:00
|
|
|
* set engine_type 38
|
2015-12-30 13:02:18 -08:00
|
|
|
*
|
2016-07-13 19:02:35 -07:00
|
|
|
* VVTi
|
2017-01-06 07:04:41 -08:00
|
|
|
* set engine_type 44
|
2016-07-13 19:02:35 -07:00
|
|
|
*
|
2015-12-30 13:02:18 -08:00
|
|
|
* @date Dec 30, 2015
|
2020-01-13 18:57:43 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-12-30 13:02:18 -08:00
|
|
|
*/
|
|
|
|
|
2021-08-03 19:05:01 -07:00
|
|
|
#include "pch.h"
|
|
|
|
|
2015-12-30 13:02:18 -08:00
|
|
|
#include "toyota_jzs147.h"
|
2016-01-23 15:01:40 -08:00
|
|
|
#include "custom_engine.h"
|
2020-05-09 21:42:33 -07:00
|
|
|
#include "mazda_miata_vvt.h"
|
2015-12-30 13:02:18 -08:00
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
static void common2jz() {
|
|
|
|
setFrankensoConfiguration(); // default pinout
|
2015-12-30 13:02:18 -08:00
|
|
|
|
|
|
|
engineConfiguration->specs.displacement = 3.0;
|
|
|
|
engineConfiguration->specs.cylindersCount = 6;
|
2016-07-20 16:04:27 -07:00
|
|
|
engineConfiguration->specs.firingOrder = FO_1_5_3_6_2_4;
|
2017-01-06 06:03:33 -08:00
|
|
|
// set ignition_mode 1
|
2016-06-13 17:01:47 -07:00
|
|
|
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS;
|
2015-12-30 13:02:18 -08:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
engineConfiguration->ignitionPins[0] = Gpio::E14;
|
|
|
|
engineConfiguration->ignitionPins[1] = Gpio::C7;
|
|
|
|
engineConfiguration->ignitionPins[2] = Gpio::C9;
|
|
|
|
engineConfiguration->ignitionPins[3] = Gpio::E10;
|
|
|
|
engineConfiguration->ignitionPins[4] = Gpio::E8;
|
|
|
|
engineConfiguration->ignitionPins[5] = Gpio::E12;
|
2016-06-11 09:02:00 -07:00
|
|
|
|
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
engineConfiguration->injectionPins[0] = Gpio::B9; // #1
|
|
|
|
engineConfiguration->injectionPins[1] = Gpio::E2; // #2
|
|
|
|
engineConfiguration->injectionPins[2] = Gpio::B8; // #3
|
|
|
|
engineConfiguration->injectionPins[3] = Gpio::B7; // #4
|
|
|
|
engineConfiguration->injectionPins[4] = Gpio::E3; // #5
|
|
|
|
engineConfiguration->injectionPins[5] = Gpio::E4; // #6
|
2016-06-11 09:02:00 -07:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
engineConfiguration->fuelPumpPin = Gpio::Unassigned;
|
2016-01-23 15:01:40 -08:00
|
|
|
|
2016-06-11 20:02:58 -07:00
|
|
|
// chartsize 450
|
|
|
|
engineConfiguration->engineChartSize = 450;
|
|
|
|
|
|
|
|
// engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
2016-06-13 17:01:47 -07:00
|
|
|
|
2016-06-22 06:01:43 -07:00
|
|
|
engineConfiguration->map.sensor.type = MT_CUSTOM;
|
|
|
|
|
|
|
|
engineConfiguration->injector.flow = 430;
|
|
|
|
|
2016-06-16 15:01:48 -07:00
|
|
|
/**
|
|
|
|
* http://thesafetyaversionsociety.com/wordpress/wp-content/uploads/2010/08/Troubleshooting-2JZ-GTE.pdf
|
|
|
|
* pages 44&46
|
|
|
|
*/
|
2019-10-02 18:00:10 -07:00
|
|
|
engineConfiguration->clt.config = {-20, 40, 120.0, 15000, 1200, 200.0, 2700};
|
|
|
|
engineConfiguration->iat.config = {-20, 40, 120.0, 15000, 1200, 200.0, 2700};
|
2016-06-16 15:01:48 -07:00
|
|
|
|
2016-07-13 19:02:35 -07:00
|
|
|
}
|
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
void setToyota_jzs147EngineConfiguration() {
|
|
|
|
common2jz();
|
2016-07-13 19:02:35 -07:00
|
|
|
|
2022-04-02 23:21:37 -07:00
|
|
|
setCamOperationMode();
|
2016-07-13 19:02:35 -07:00
|
|
|
engineConfiguration->trigger.type = TT_2JZ_1_12;
|
|
|
|
|
|
|
|
//// temporary while I am fixing trigger bug
|
2022-04-02 23:21:37 -07:00
|
|
|
// setCrankOperationMode();
|
2017-01-06 07:04:41 -08:00
|
|
|
// //set trigger_type 16
|
2016-07-13 19:02:35 -07:00
|
|
|
// engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
|
|
|
|
// engineConfiguration->trigger.customTotalToothCount = 36;
|
|
|
|
// engineConfiguration->trigger.customSkippedToothCount = 2;
|
|
|
|
//
|
|
|
|
// engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
|
|
|
// engineConfiguration->twoWireBatchIgnition = true;
|
|
|
|
//
|
|
|
|
// engineConfiguration->crankingInjectionMode = IM_BATCH;
|
|
|
|
// engineConfiguration->injectionMode = IM_BATCH;
|
|
|
|
// engineConfiguration->twoWireBatchInjection = true;
|
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
// engineConfiguration->triggerInputPins[0] = Gpio::A5;
|
|
|
|
// engineConfiguration->triggerInputPins[1] = Gpio::C6;
|
2016-07-13 19:02:35 -07:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->isSdCardEnabled = false;
|
2016-07-13 19:02:35 -07:00
|
|
|
|
2016-06-16 15:01:48 -07:00
|
|
|
|
2015-12-30 13:02:18 -08:00
|
|
|
}
|
|
|
|
|
2020-05-09 20:47:51 -07:00
|
|
|
/**
|
|
|
|
* TOYOTA_2JZ_GTE_VVTi
|
|
|
|
* set engine_type 44
|
|
|
|
*/
|
2021-11-16 01:15:29 -08:00
|
|
|
void setToyota_2jz_vics() {
|
|
|
|
common2jz();
|
2016-07-13 19:02:35 -07:00
|
|
|
|
2022-04-02 23:21:37 -07:00
|
|
|
setCrankOperationMode();
|
2020-05-09 20:47:51 -07:00
|
|
|
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_36_2;
|
2016-07-14 20:02:55 -07:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
engineConfiguration->triggerInputPins[0] = Gpio::A5; // crank sensor
|
|
|
|
engineConfiguration->triggerInputPins[1] = Gpio::Unassigned; // cam sensor will he handled by custom vtti code
|
2016-07-15 05:01:45 -07:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
engineConfiguration->camInputs[0] = Gpio::C6;
|
2021-02-08 18:50:31 -08:00
|
|
|
engineConfiguration->vvtMode[0] = VVT_2JZ;
|
2016-08-23 20:03:01 -07:00
|
|
|
|
2017-01-06 07:04:41 -08:00
|
|
|
// set global_trigger_offset_angle 155
|
2016-07-15 17:01:35 -07:00
|
|
|
engineConfiguration->globalTriggerAngleOffset = 155; // todo
|
2016-07-15 05:01:45 -07:00
|
|
|
|
|
|
|
engineConfiguration->ignitionMode = IM_WASTED_SPARK; // just for now
|
|
|
|
engineConfiguration->injectionMode = IM_BATCH; // just for now
|
|
|
|
engineConfiguration->twoWireBatchIgnition = true;
|
|
|
|
engineConfiguration->twoWireBatchInjection = true;
|
|
|
|
|
2021-11-17 00:54:21 -08:00
|
|
|
strcpy(engineConfiguration->engineMake, ENGINE_MAKE_TOYOTA);
|
|
|
|
strcpy(engineConfiguration->engineCode, "2JZ");
|
|
|
|
strcpy(engineConfiguration->vehicleName, "VVT example");
|
2016-07-15 05:01:45 -07:00
|
|
|
|
2020-05-09 21:42:33 -07:00
|
|
|
// todo: these magic values would be hardcoded once we find out proper magic values
|
2022-02-01 21:49:44 -08:00
|
|
|
// engineConfiguration->scriptSetting[4] = 175 - 45;
|
|
|
|
// engineConfiguration->scriptSetting[5] = 175 + 45;
|
2020-05-09 21:42:33 -07:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
engineConfiguration->vvtPins[0] = Gpio::E3; // VVT solenoid control
|
2020-05-09 21:42:33 -07:00
|
|
|
|
|
|
|
// Mazda VVT settings have nothing to do wit Toyota 2JZ settings but those are a good starting point for settings
|
2021-11-16 01:15:29 -08:00
|
|
|
setMazdaNB2VVTSettings();
|
2016-07-13 19:02:35 -07:00
|
|
|
}
|
2015-12-30 13:02:18 -08:00
|
|
|
|
|
|
|
|