Line |
Branch |
Decision |
Exec |
Source |
1 |
|
|
|
|
2 |
|
|
|
#include "pch.h" |
3 |
|
|
|
|
4 |
|
|
|
#if HW_PROTEUS || HW_HELLEN |
5 |
|
|
|
|
6 |
|
|
|
#include "defaults.h" |
7 |
|
|
|
#include "proteus_meta.h" |
8 |
|
|
|
#include "canam.h" |
9 |
|
|
|
#include "canam_canned.cpp" |
10 |
|
|
|
#include "lua_lib.h" |
11 |
|
|
|
|
12 |
|
|
|
// set engine_type 54 |
13 |
|
|
|
// https://www.youtube.com/watch?v=j8DOFp02QDY |
14 |
|
|
✗ |
void setMaverickX3() { |
15 |
|
|
✗ |
strcpy(engineConfiguration->engineMake, "Rotax"); |
16 |
|
|
✗ |
strcpy(engineConfiguration->engineCode, "900 ACE"); |
17 |
|
|
|
|
18 |
|
|
✗ |
engineConfiguration->cylindersCount = 3; |
19 |
|
|
✗ |
engineConfiguration->firingOrder = FO_1_2_3; |
20 |
|
|
✗ |
engineConfiguration->displacement = 0.9; |
21 |
|
|
✗ |
engineConfiguration->injectionMode = IM_SEQUENTIAL; |
22 |
|
|
|
// ? engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS; |
23 |
|
|
✗ |
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; |
24 |
|
|
|
|
25 |
|
|
|
// portion of this file was generated by TuneCanTool.java |
26 |
|
|
✗ |
engineConfiguration->trigger.type = trigger_type_e::TT_TOOTHED_WHEEL_36_2; |
27 |
|
|
✗ |
engineConfiguration->vvtMode[0] = VVT_SINGLE_TOOTH; |
28 |
|
|
✗ |
engineConfiguration->isForcedInduction = true; |
29 |
|
|
✗ |
engineConfiguration->vvtOffsets[0] = 116; |
30 |
|
|
✗ |
engineConfiguration->injector.flow = 320; |
31 |
|
|
✗ |
engineConfiguration->etbIdleThrottleRange = 10; |
32 |
|
|
|
|
33 |
|
|
✗ |
engineConfiguration->iacByTpsHoldTime = 2; |
34 |
|
|
✗ |
engineConfiguration->iacByTpsDecayTime = 2; |
35 |
|
|
✗ |
engineConfiguration->iacByTpsTaper = 5; |
36 |
|
|
✗ |
engineConfiguration->useIdleTimingPidControl = true; |
37 |
|
|
✗ |
engineConfiguration->idleTimingSoftEntryTime = 1; |
38 |
|
|
|
|
39 |
|
|
✗ |
engineConfiguration->tpsAccelLookback = 0.3; |
40 |
|
|
✗ |
engineConfiguration->tpsAccelEnrichmentThreshold = 12; |
41 |
|
|
✗ |
engineConfiguration->tpsDecelEnleanmentThreshold = 7; |
42 |
|
|
✗ |
engineConfiguration->tpsAccelFractionPeriod = 3; |
43 |
|
|
|
|
44 |
|
|
✗ |
engineConfiguration->isBoostControlEnabled = true; |
45 |
|
|
|
|
46 |
|
|
✗ |
engineConfiguration->idleTimingPid.dFactor = 0.0005; |
47 |
|
|
✗ |
engineConfiguration->idleTimingPid.minValue = -5; |
48 |
|
|
✗ |
engineConfiguration->idleTimingPid.maxValue = 5; |
49 |
|
|
✗ |
engineConfiguration->fanOnTemperature = 87; |
50 |
|
|
✗ |
engineConfiguration->fanOffTemperature = 82; |
51 |
|
|
✗ |
engineConfiguration->disableFan1WhenStopped = true; |
52 |
|
|
✗ |
engineConfiguration->disableFan2WhenStopped = true; |
53 |
|
|
✗ |
engineConfiguration->fan2ExtraIdle = 0; |
54 |
|
|
✗ |
engineConfiguration->idlePidDeactivationTpsThreshold = 2; |
55 |
|
|
✗ |
engineConfiguration->useSeparateAdvanceForIdle = true; |
56 |
|
|
✗ |
engineConfiguration->vvtControlMinRpm = 2000; |
57 |
|
|
|
|
58 |
|
|
✗ |
engineConfiguration->startButtonSuppressOnStartUpMs = 1000; |
59 |
|
|
✗ |
engineConfiguration->vssToothCount = 10; |
60 |
|
|
|
|
61 |
|
|
✗ |
engineConfiguration->etb.pFactor = 12.0794; |
62 |
|
|
✗ |
engineConfiguration->etb.iFactor = 213.349; |
63 |
|
|
✗ |
engineConfiguration->etb.dFactor = 0.113607; |
64 |
|
|
✗ |
engineConfiguration->disableEtbWhenEngineStopped = true; |
65 |
|
|
|
|
66 |
|
|
✗ |
cannedsparkDwellValues(); |
67 |
|
|
✗ |
canneddwellVoltageCorrValues(); |
68 |
|
|
✗ |
cannedignitionRpmBins(); |
69 |
|
|
✗ |
cannedignitionLoadBins(); |
70 |
|
|
✗ |
cannedidleAdvanceBins(); |
71 |
|
|
✗ |
cannedidleAdvance(); |
72 |
|
|
✗ |
cannedveRpmBins(); |
73 |
|
|
✗ |
cannedveLoadBins(); |
74 |
|
|
✗ |
cannedboostRpmBins(); |
75 |
|
|
✗ |
cannedpedalToTpsRpmBins(); |
76 |
|
|
✗ |
cannedcltIdleRpm(); |
77 |
|
|
✗ |
cannedcltIdleCorr(); |
78 |
|
|
✗ |
cannedcltCrankingCorr(); |
79 |
|
|
|
|
80 |
|
|
|
|
81 |
|
|
|
|
82 |
|
|
|
|
83 |
|
|
✗ |
setPPSCalibration(0.25, 1.49, 0.49, 2.98); |
84 |
|
|
|
// todo: matches Hyundai TODO extract method? |
85 |
|
|
✗ |
setTPS1Calibration(98, 926, 891, 69); |
86 |
|
|
|
|
87 |
|
|
|
#if HW_PROTEUS && EFI_PROD_CODE |
88 |
|
|
|
engineConfiguration->camInputs[0] = PROTEUS_DIGITAL_6; |
89 |
|
|
|
engineConfiguration->vehicleSpeedSensorInputPin = PROTEUS_DIGITAL_5; |
90 |
|
|
|
engineConfiguration->auxAnalogInputs[0] = PROTEUS_IN_ANALOG_VOLT_4; |
91 |
|
|
|
setProteusEtbIO(); |
92 |
|
|
|
engineConfiguration->starterControlPin = Gpio::PROTEUS_LS_14; |
93 |
|
|
|
engineConfiguration->startStopButtonPin = PROTEUS_IN_AV_6_DIGITAL; |
94 |
|
|
|
|
95 |
|
|
|
engineConfiguration->boostControlPin = Gpio::PROTEUS_LS_16; |
96 |
|
|
|
|
97 |
|
|
|
gppwm_channel *accRelayPwm = &engineConfiguration->gppwm[1]; |
98 |
|
|
|
accRelayPwm->pin = Gpio::PROTEUS_LS_4; |
99 |
|
|
|
|
100 |
|
|
|
engineConfiguration->luaDigitalInputPins[2] = PROTEUS_IN_AV_10_DIGITAL; |
101 |
|
|
|
engineConfiguration->luaDigitalInputPins[3] = PROTEUS_IN_AV_8_DIGITAL; |
102 |
|
|
|
#endif // HW_PROTEUS |
103 |
|
|
|
|
104 |
|
|
✗ |
engineConfiguration->gppwm[0].pwmFrequency = 0; |
105 |
|
|
✗ |
engineConfiguration->gppwm[0].dutyIfError = 100; |
106 |
|
|
✗ |
engineConfiguration->gppwm[0].rpmAxis = GPPWM_Iat; |
107 |
|
|
✗ |
engineConfiguration->gppwm[0].loadAxis = GPPWM_Map; |
108 |
|
|
✗ |
strcpy(engineConfiguration->gpPwmNote[1], "Acc Relay"); |
109 |
|
|
|
|
110 |
|
|
|
|
111 |
|
|
|
#if HW_PROTEUS |
112 |
|
|
|
#include "canam_2021.lua" |
113 |
|
|
|
#endif // HW_PROTEUS |
114 |
|
|
|
|
115 |
|
|
✗ |
} |
116 |
|
|
|
|
117 |
|
|
|
#endif // HW_PROTEUS || HW_HELLEN |
118 |
|
|
|
|