1 /* FreeEMS - the open source engine management system
3 * Copyright 2008-2012 Fred Cooke
5 * This file is part of the FreeEMS project.
7 * FreeEMS software is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * FreeEMS software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with any FreeEMS software. If not, see http://www.gnu.org/licenses/
20 * We ask that if you make any changes to this file you email them upstream to
21 * us at admin(at)diyefi(dot)org or, even better, fork the code on github.com!
23 * Thank you for choosing FreeEMS to run your engine!
29 * @ingroup dataInitialisers
31 * @brief First fixed config block
33 * This file contains the definition of the first fixed configuration block.
34 * The declaration can be found in the global constants header file.
36 * Please ensure that all variables added here have good default values.
40 #include "../inc/freeEMS.h"
43 /// @copydoc fixedConfig1
44 const volatile fixedConfig1 fixedConfigs1 FIXEDCONF1
= {
46 #if CONFIG == TRUCK_ID
47 perCylinderVolume
: CYLINDER_VOLUME(500),
48 injectorFlow
: CC_PER_MINUTE(550), // RX7 "550" which em_knaps had tested at 650cc
49 #elif CONFIG == PRESTO_ID
50 perCylinderVolume
: CYLINDER_VOLUME(400),
51 injectorFlow
: CC_PER_MINUTE(213),
52 #elif CONFIG == SEANKLT1_ID
53 perCylinderVolume
: CYLINDER_VOLUME(727),
54 injectorFlow
: CC_PER_MINUTE(525),
55 #elif SEANKR1 // No ID assigned yet!
56 perCylinderVolume
: CYLINDER_VOLUME(250),
57 injectorFlow
: CC_PER_MINUTE(230), // http://www.witchhunter.com/flowdatapix/bcdh210.jpg
58 #elif CONFIG == SNOTROCKET_ID
59 perCylinderVolume
: CYLINDER_VOLUME(525),
60 injectorFlow
: CC_PER_MINUTE(310),
61 #elif CONFIG == SLATER_ID
62 perCylinderVolume
: CYLINDER_VOLUME(324),
63 injectorFlow
: CC_PER_MINUTE(320),
64 #elif CONFIG == PETERJSERIES_ID
65 perCylinderVolume
: CYLINDER_VOLUME(585),
66 injectorFlow
: CC_PER_MINUTE(320),
67 #elif CONFIG == DEUCECOUPE_ID
68 perCylinderVolume
: CYLINDER_VOLUME(522),
69 injectorFlow
: CC_PER_MINUTE(235),
70 #elif CONFIG == DEUCES10_ID
71 perCylinderVolume
: CYLINDER_VOLUME(548),
72 injectorFlow
: CC_PER_MINUTE(235),
73 #elif CONFIG == SCAVENGER_ID
74 perCylinderVolume
: CYLINDER_VOLUME(399.25),
75 injectorFlow
: CC_PER_MINUTE(540),
77 perCylinderVolume
: CYLINDER_VOLUME(500),
78 injectorFlow
: CC_PER_MINUTE(550),
80 stoichiometricAFR
: stoichiometricAFRPetrol
,
81 densityOfFuelAtSTP
: densityOfPetrol
84 baudDivisor
: SCI_BAUD_DIVISOR(115200) // 21.7013889 (22) http://duckduckgo.com/?q=40000000+%2F+%2816*115200%29
85 // http://duckduckgo.com/?q=40000000+%2F+%2816*22%29 113.636 kHz actual speed
86 // http://duckduckgo.com/?q=22+%2F+%28%2840000000%2F16%29%2F115200%29 1.376% error in speed
88 coarseBitBangSettings
:{
89 #if CONFIG == SNOTROCKET_ID // 24 events for a 24+1 CAS setup with 4 cylinder tacho
90 outputActions
: {1,0,0,2,0,0,1,0,0,2,0,0,1,0,0,2,0,0,1,0,0,2,0,0},
91 #elif CONFIG == SLATER_ID // 11 events for 12-1 crank setup with 4 cylinder tacho
92 outputActions
: {1,0,0,2,0,0,1,0,0,2,0},
94 outputActions
: standardTachoArray
,
96 ports
: standardTachoPorts
,
97 masks
: standardTachoMasks
,
101 // Sadly, FreeEMS car numero uno is gone, RIP Volvo! http://forum.diyefi.org/viewtopic.php?f=55&t=1068
103 #if CONFIG == TRUCK_ID // Fred's Ford Courier http://forum.diyefi.org/viewtopic.php?f=55&t=1069
104 anglesOfTDC
: {ANGLE(0), ANGLE(180), ANGLE(360), ANGLE(540), ANGLE(0), ANGLE(180), ANGLE(360), ANGLE(540)},
105 outputEventPinNumbers
: {0,1,2,3,4,5,4,5}, // COP and semi-sequential
106 schedulingConfigurationBits
: {0,0,0,0,1,1,1,1}, // First four ignition, last four fuel
107 decoderEngineOffset
: ANGLE(90.00), // FE-DOHC, 4and1 CAS approximately centre
108 numberOfConfiguredOutputEvents
: 8, // Migrated to new way
109 numberOfInjectionsPerEngineCycle
: 2 // Used to be batch, dead time being wrong could have affected AFRs
111 #elif CONFIG == HOTEL_ID // Fred's Hotel Hyundai (Stellar) http://forum.diyefi.org/viewtopic.php?f=55&t=1086
112 anglesOfTDC
: {ANGLE(0)}, // Simple dual edge dizzy
113 outputEventPinNumbers
: {0}, // First pin
114 schedulingConfigurationBits
: {0}, // Ignition only
115 decoderEngineOffset
: ANGLE(0.00), // Locked dizzy with timing of TDC on edge, used for static timing during cranking.
116 numberOfConfiguredOutputEvents
: 1, // One per decoder cycle = 4
117 numberOfInjectionsPerEngineCycle
: 1 // Ditto
119 #elif CONFIG == PRESTO_ID // Preston's silver-top-on-a-stand http://forum.diyefi.org/viewtopic.php?f=55&t=1101
120 anglesOfTDC
: {ANGLE(0), ANGLE(180), ANGLE(360), ANGLE(540), ANGLE(0), ANGLE(180), ANGLE(360), ANGLE(540)},
121 outputEventPinNumbers
: {0,1,0,1,4,5,4,5}, // Wasted spark, semi-sequential TODO migrate this to sequential
122 schedulingConfigurationBits
: {0,0,0,0,1,1,1,1}, // First four ignition, last four injection
123 decoderEngineOffset
: ANGLE(128.52), // Stock silver-top using G? for RPM2 and NE for RPM1, CAS approximately centre, @todo TODO find values for extremes of dizzy placement
124 numberOfConfiguredOutputEvents
: 8, // See two lines above
125 numberOfInjectionsPerEngineCycle
: 2 // Semi-sequential, for now.
127 #elif CONFIG == SEANKLT1_ID // http://forum.diyefi.org/viewtopic.php?f=55&t=1146
128 anglesOfTDC
: {ANGLE(0), ANGLE(90), ANGLE(180), ANGLE(270), ANGLE(360), ANGLE(450), ANGLE(540), ANGLE(630), ANGLE(0), ANGLE(90), ANGLE(180), ANGLE(270), ANGLE(360), ANGLE(450), ANGLE(540), ANGLE(630)},
129 outputEventPinNumbers
: {0,0,0,0,0,0,0,0,2,3,4,5,2,3,4,5}, // LTCC e-dizzy, semi-sequential injection 1/6, 8/5, 4/7, 3/2, and repeat
130 schedulingConfigurationBits
: {0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1}, // See below two lines
131 decoderEngineOffset
: ANGLE(0.00), // Decoder has a true zero zero mechanically hard coded
132 numberOfConfiguredOutputEvents
: 16, // First half ignition, second half injection
133 numberOfInjectionsPerEngineCycle
: 2 // Full sync semi-sequential
135 #elif CONFIG == SNOTROCKET_ID // http://forum.diyefi.org/viewtopic.php?f=3&t=1263 Sim's 2.1 Volvo, semi-squential fuel with CNP using LS1 coils.
136 anglesOfTDC
: {ANGLE(0), ANGLE(180), ANGLE(360), ANGLE(540), ANGLE(0), ANGLE(180), ANGLE(360), ANGLE(540)}, // 1,2,3,4: Firing order: 1-3-4-2 set up in loom
137 outputEventPinNumbers
: {0,1,2,3,4,5,4,5}, // COP/CNP ignition, semi-sequential fuel
138 schedulingConfigurationBits
: {0,0,0,0,1,1,1,1}, // First four ignition, last four fuel
139 decoderEngineOffset
: ANGLE(566.00), // Volvo B21A with DSM/Miata CAS + 24and1 disk
140 numberOfConfiguredOutputEvents
: 8, // COP PT2-PT5, injectors drivers wired to PT6 and PT7, pulse-paired, until Xgate
141 numberOfInjectionsPerEngineCycle
: 2 // Syncronized semi-sequential
143 #elif CONFIG == SPUDMN_ID // http://forum.diyefi.org/viewtopic.php?f=55&t=1507 Spudmn's mk1 racing mini in NZ :-)
144 anglesOfTDC
: {ANGLE(0), ANGLE(180)}, // 1 and 4, 2 and 3
145 outputEventPinNumbers
: {0,1}, // Ignition only
146 schedulingConfigurationBits
: {0,0}, // Ditto
147 decoderEngineOffset
: ANGLE(5.00), // To verify from source build!
148 numberOfConfiguredOutputEvents
: 2, // Wasted spark
149 numberOfInjectionsPerEngineCycle
: 1 // Ditto
151 #elif CONFIG == SLATER_ID // http://forum.diyefi.org/viewtopic.php?f=62&t=1336 Citroen with t25 turbo on a flat 4 air cooled engine
152 anglesOfTDC
: {ANGLE(0), ANGLE(180),(0), ANGLE(180)}, // 1 and 4, 2 and 3, repeat
153 outputEventPinNumbers
: {0,1,4,5}, // 2 and 3 are unused in this config, fuel are on 4/5 because he plans to use the same hardware on the V8 Supra with wasted spark and thus 2/3 are required for ignition on that
154 schedulingConfigurationBits
: {0,0,1,1}, // 2 ignition 2 injection
155 decoderEngineOffset
: ANGLE(120.00), // May need adjusting
156 numberOfConfiguredOutputEvents
: 4, // Wasted spark, semi-sequential
157 numberOfInjectionsPerEngineCycle
: 2 // Semi-sequential, crank sync only
159 #elif CONFIG == PETERJSERIES_ID // Firing order 1-4-2-5-3-6 http://forum.diyefi.org/viewtopic.php?f=62&t=1533
160 anglesOfTDC
: {ANGLE(0), ANGLE(120), ANGLE(240), ANGLE(360), ANGLE(480), ANGLE(600)},
161 outputEventPinNumbers
: {0,3,1,4,2,5}, // An example of wiring your engine with cylinder one on output one, harder to grok
162 schedulingConfigurationBits
: {1,1,1,1,1,1}, // Ones represent scheduling for injection, zeros represent scheduling for ignition
163 decoderEngineOffset
: ANGLE(0.00), // Trim fuel injection END point with this value.
164 numberOfConfiguredOutputEvents
: 6, // THESE ARE NOT IGN, THEY ARE FUEL
165 numberOfInjectionsPerEngineCycle
: 1 // Sequential, baby, yeah!
167 #elif CONFIG == DEUCECOUPE_ID // DeuceEFI's GM 3100 V6, firing order 1-6-5-4-3-2, wasted spark DIS ignition http://forum.diyefi.org/viewtopic.php?f=3&t=1278
168 anglesOfTDC
: {ANGLE(0), ANGLE(120), ANGLE(240), ANGLE(360), ANGLE(480), ANGLE(600), ANGLE(0), ANGLE(120), ANGLE(240), ANGLE(360), ANGLE(480), ANGLE(600)},
169 outputEventPinNumbers
: {0,0,0,0,0,0,2,3,4,2,3,4}, // DIS E-dizzy and semi-sequential, for now.
170 schedulingConfigurationBits
: {0,0,0,0,0,0,1,1,1,1,1,1}, // Six E-dizzy style DIS ignition outputs and six injection events, two per cycle, semi sequential
171 decoderEngineOffset
: ANGLE(0.00), // Nothing for now, so as to be able to figure out what is going on.
172 numberOfConfiguredOutputEvents
: 12, // See three lines above
173 numberOfInjectionsPerEngineCycle
: 2 // Semi-sequential, for now.
175 #elif CONFIG == DEUCES10_ID // Firing order 1-3-4-2 setup in wiring harness http://forum.diyefi.org/viewtopic.php?f=55&t=1962
176 anglesOfTDC
: {ANGLE(0), ANGLE(180), ANGLE(360), ANGLE(540), ANGLE(0), ANGLE(180), ANGLE(360), ANGLE(540)},
177 outputEventPinNumbers
: {0,0,0,0,2,3,4,5}, // DIS E-dizzy and Sequential (2 == Port-T4)
178 schedulingConfigurationBits
: {0,0,0,0,1,1,1,1}, // First 4 ign, Last 4 fuel
179 decoderEngineOffset
: ANGLE(0.00), // GM DIS 2x Reference signal is at 0 degrees.
180 numberOfConfiguredOutputEvents
: 8, // 4 coil events and 4 injector events.
181 numberOfInjectionsPerEngineCycle
: 1 // Sequential Fueling!
183 #elif CONFIG == PETERTRUCK_ID // Firing order 1-5-3-6-2-4
184 anglesOfTDC
: {ANGLE(0), ANGLE(120), ANGLE(240), ANGLE(360), ANGLE(480), ANGLE(600)},
185 outputEventPinNumbers
: {0,4,2,5,1,3}, // An example of wiring your engine with cylinder one on output one, harder to grok
186 schedulingConfigurationBits
: {0,0,0,0,0,0}, // Ones represent scheduling for injection, zeros represent scheduling for ignition
187 decoderEngineOffset
: ANGLE(0.00), // Trim fuel injection END point with this value.
188 numberOfConfiguredOutputEvents
: 6, // THESE ARE IGN, THEY ARE NOT FUEL
189 numberOfInjectionsPerEngineCycle
: 1 // Sequential, baby, yeah!
191 #elif CONFIG == SCAVENGER_ID // hentai
192 anglesOfTDC
: {ANGLE(0), ANGLE(180), ANGLE(360), ANGLE(540), ANGLE(0), ANGLE(180), ANGLE(360), ANGLE(540)},
193 outputEventPinNumbers
: {0,1,0,1,2,3,2,3}, // Wasted spark, semi-sequential TODO migrate this to sequential
194 schedulingConfigurationBits
: {0,0,0,0,1,1,1,1}, // First four ignition, last four injection
195 decoderEngineOffset
: ANGLE(128), // Hentai initial setup value, will change a bit
196 numberOfConfiguredOutputEvents
: 8, // See two lines above
197 numberOfInjectionsPerEngineCycle
: 2 // Semi-sequential, for now.
199 #else // Nothing scheduled by default, no sensible default for all possible vehicle setups.
200 anglesOfTDC
: {}, // Depends on cylinder count and other variables
201 outputEventPinNumbers
: {0,1,2,3,4,5}, // Default to a variety of pins for testing purposes. Note: Won't do anything without
202 schedulingConfigurationBits
: {}, // All ignition by guarantee of C, configured explicitly for real setups.
203 decoderEngineOffset
: ANGLE(0), // Start with zero, work your way to the correct value
204 numberOfConfiguredOutputEvents
: 0, // This disables scheduling completely, should match the first, second and third arrays
205 numberOfInjectionsPerEngineCycle
: 1 // 720 degree decoders with one injection per cycle
208 cutAndLimiterSettings
:{
210 #if CONFIG == SNOTROCKET_ID
211 disableThreshold
: RPM(6300),
212 reenableThreshold
: RPM(6200)
213 #elif CONFIG == SLATER_ID
214 disableThreshold
: RPM(7000),
215 reenableThreshold
: RPM(6900)
216 #elif CONFIG == DEUCES10_ID
217 disableThreshold
: RPM(5600),
218 reenableThreshold
: RPM(5400)
219 #elif CONFIG == SCAVENGER_ID
220 disableThreshold
: RPM(7200),
221 reenableThreshold
: RPM(7150)
223 disableThreshold
: RPM(5850),
224 reenableThreshold
: RPM(5800) // Come back on before ignition does
228 #if CONFIG == HOTEL_ID
229 disableThreshold
: RPM(5800),
230 reenableThreshold
: RPM(5750) // Nice and close to save the exhaust
231 #elif CONFIG == SNOTROCKET_ID
232 disableThreshold
: RPM(6300),
233 reenableThreshold
: RPM(6150)
234 #elif CONFIG == SLATER_ID
235 disableThreshold
: RPM(7000),
236 reenableThreshold
: RPM(6850)
237 #elif CONFIG == PETERJSERIES_ID
238 disableThreshold
: RPM(6000),
239 reenableThreshold
: RPM(5950)
240 #elif CONFIG == PETERTRUCK_ID
241 disableThreshold
: RPM(5000),
242 reenableThreshold
: RPM(4950)
243 #elif CONFIG == DEUCES10_ID
244 disableThreshold
: RPM(5600),
245 reenableThreshold
: RPM(5300)
246 #elif CONFIG == SCAVENGER_ID
247 disableThreshold
: RPM(7200),
248 reenableThreshold
: RPM(7100)
250 disableThreshold
: RPM(5800),
251 reenableThreshold
: RPM(5750) // Come back on after injection does
255 disableThreshold
: KPA(250), // Cut close to std sensor max
256 reenableThreshold
: KPA(105) // Re enable when boost gone all together (Setting to anything at or below 100kPa can cause a dead engine)
279 #if CONFIG == DEUCECOUPE_ID
281 variable
: &CoreVars0
.RPM
,
282 upperValue
: RPM(400),
283 lowerValue
: RPM(300),
284 port
: (unsigned char*)&PORTT
,
288 #elif CONFIG == DEUCES10_ID
290 variable
: &CoreVars0
.RPM
,
291 upperValue
: RPM(400),
292 lowerValue
: RPM(300),
293 port
: (unsigned char*)&PORTT
,
299 variable
: &CoreVars0
.RPM
,
300 upperValue
: RPM(5000),
301 lowerValue
: RPM(4000),
302 port
: (unsigned char*)&PORTK
,
308 variable
: &CoreVars0
.CHT
,
309 upperValue
: DEGREES_C(100),
310 lowerValue
: DEGREES_C(90),
311 port
: (unsigned char*)&PORTK
,
319 userTextField
: "Place your personal notes about whatever you like in here!"
320 " Don't hesitate to tell us a story about something interesting."
321 " Do keep in mind though that when you upload your settings file to "
322 "the forum this message WILL be visible to all and sundry, so don't "
323 "be putting too many personal details, bank account numbers, "
324 "passwords, PIN numbers, license plates, national insurance numbers, "
325 "IRD numbers, social security numbers, phone numbers, email addresses,"
326 " love stories and other private information in this field. In fact it"
327 " is probably best if you kee"