/* * @file trigger_toyota.cpp * * https://thedeltaecho.wordpress.com/2010/03/14/2jz-ge-cam-crank-signals/ * * @date Dec 14, 2015 * @author Andrey Belomutskiy, (c) 2012-2016 */ #include "trigger_toyota.h" EXTERN_ENGINE; void initialize2jzGE1_12(TriggerShape *s) { s->initialize(FOUR_STROKE_CAM_SENSOR, true); float crankD = 360 / 12 / 2; // 15 float crankAngle = 10; s->addEvent(crankAngle, T_SECONDARY, TV_FALL, -1, 721); // 120 for (int i = 0; i < 2; i++) { s->addEvent(crankAngle + crankD, T_SECONDARY, TV_RISE, -1, 721); crankAngle += crankD; s->addEvent(crankAngle + crankD, T_SECONDARY, TV_FALL, -1, 721); // 120 crankAngle += crankD; } s->addEvent(75, T_PRIMARY, TV_RISE, -1, 721); for (int i = 0; i < 21; i++) { s->addEvent(crankAngle + crankD, T_SECONDARY, TV_RISE, -1, 721); crankAngle += crankD; s->addEvent(crankAngle + crankD, T_SECONDARY, TV_FALL, -1, 721); // 120 crankAngle += crankD; } s->addEvent(crankAngle + crankD, T_SECONDARY, TV_RISE, -1, 721); crankAngle += crankD; s->addEvent(720, T_PRIMARY, TV_FALL, -1, 721); s->isSynchronizationNeeded = false; } void initialize2jzGE3_34(TriggerShape *s) { s->initialize(FOUR_STROKE_CAM_SENSOR, true); float camD = 720 / 6; // 120 float crankAngle = 20; // skipping two teeth for (int i = 0; i < 10; i++) { s->addEvent(crankAngle + 5, T_SECONDARY, TV_RISE, -1, 721); s->addEvent(crankAngle + 9.9, T_SECONDARY, TV_FALL, -1, 721); // 120 crankAngle += 10; } // 2 + 10 float camAngle = 0; camAngle += camD; s->addEvent(camAngle, T_PRIMARY, TV_RISE, -1, 721); // 120 for (int i = 0; i < 12; i++) { s->addEvent(crankAngle + 5, T_SECONDARY, TV_RISE, -1, 721); s->addEvent(crankAngle + 9.9, T_SECONDARY, TV_FALL, -1, 721); // 120 crankAngle += 10; } // 2 + 22 camAngle += camD; s->addEvent(camAngle, T_PRIMARY, TV_FALL, -1, 721); // 240 for (int i = 0; i < 12; i++) { s->addEvent(crankAngle + 5, T_SECONDARY, TV_RISE, -1, 721); s->addEvent(crankAngle + 9.9, T_SECONDARY, TV_FALL, -1, 721); // 120 crankAngle += 10; } // 2 + 34 camAngle += camD; s->addEvent(camAngle, T_PRIMARY, TV_RISE, -1, 721); // 360 crankAngle += 20; // skipping two teeth one more time for (int i = 0; i < 10; i++) { s->addEvent(crankAngle + 5, T_SECONDARY, TV_RISE, -1, 721); s->addEvent(crankAngle + 9.9, T_SECONDARY, TV_FALL, -1, 721); // 120 crankAngle += 10; } // 2 + 10 camAngle += camD; s->addEvent(camAngle, T_PRIMARY, TV_FALL, -1, 721); // 480 for (int i = 0; i < 12; i++) { s->addEvent(crankAngle + 5, T_SECONDARY, TV_RISE, -1, 721); s->addEvent(crankAngle + 9.9, T_SECONDARY, TV_FALL, -1, 721); // 120 crankAngle += 10; } // 2 + 22 camAngle += camD; s->addEvent(camAngle, T_PRIMARY, TV_RISE, -1, 721); // 600 for (int i = 0; i < 12; i++) { s->addEvent(crankAngle + 5, T_SECONDARY, TV_RISE, -1, 721); s->addEvent(crankAngle + 9.9, T_SECONDARY, TV_FALL, -1, 721); // 120 crankAngle += 10; } // 2 + 32 camAngle += camD; s->addEvent(camAngle, T_PRIMARY, TV_FALL, -1, 721); // 720 s->isSynchronizationNeeded = false; }