Initial commit of 0.0.18 just as it was released!
[freeems-vanilla.git] / src / FuelTables.c
blob447c97cb1ae380928460461a69c8219dc3c1839e
1 /* FuelTables.c
3 Copyright 2008 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 send them upstream to us at admin@diyefi.org
22 Thank you for choosing FreeEMS to run your engine! */
24 #include "inc/freeEMS.h"
27 /* The main Volumetric Efficiency Table */
28 const volatile mainTable VETableMainFlash FUELTABLESD = {
29 MAINTABLE_RPM_LENGTH, /* VETableMain.RPMLength */
30 MAINTABLE_LOAD_LENGTH, /* VETableMain.LoadLength */
31 /* VETableMain.RPM */
33 0, 200, 700, 1050,
34 1400, 1750, 2100, 2450,
35 2800, 3150, 3500, 3850,
36 4200, 4550, 4900, 5250,
37 5600, 5950, 6300, 6650,
38 7000, 7350, 7700, 8050,
39 8400, 8750, 9100
41 /*VETableMain.Load */
43 1600, 3200, 4800, 6400,
44 8000, 9600, 11200, 12800,
45 14400, 16000, 17600, 19200,
46 20800, 22400, 24000, 25600,
47 27200, 28800, 30400, 32000,
48 33600
50 /* VETableMain.Table */
51 { /* Laid out to make sense for 24 RPM and 19 Load bins, 8 extras on end to make up size. */
52 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
53 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
54 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
55 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
56 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
57 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
59 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
60 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
61 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
62 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
63 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
64 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
66 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
67 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
68 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
69 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
70 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
71 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
73 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
74 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
75 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
76 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
77 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
78 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
79 49152, 49152, 49152, 49152, 49152, 0xFFFF /* 6 extras to allow different axis sizes. */
84 /* The secondary Volumetric Efficiency Table */
85 const volatile mainTable VETableSecondaryFlash FUELTABLESD = {
86 MAINTABLE_RPM_LENGTH, /* VETableSecondary.RPMLength */
87 MAINTABLE_LOAD_LENGTH, /* VETableSecondary.LoadLength */
88 /* VETableSecondary.RPM */
90 0, 200, 700, 1050,
91 1400, 1750, 2100, 2450,
92 2800, 3150, 3500, 3850,
93 4200, 4550, 4900, 5250,
94 5600, 5950, 6300, 6650,
95 7000, 7350, 7700, 8050,
96 8400, 8750, 9100
98 /*VETableSecondary.Load */
100 1600, 3200, 4800, 6400,
101 8000, 9600, 11200, 12800,
102 14400, 16000, 17600, 19200,
103 20800, 22400, 24000, 25600,
104 27200, 28800, 30400, 32000,
105 33600
107 /* VETableSecondary.Table */
109 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
110 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
111 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
112 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
113 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
114 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
116 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
117 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
118 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
119 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
120 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
121 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
123 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
124 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
125 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
126 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
127 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
128 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
130 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
131 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
132 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
133 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
134 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
135 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
136 49152, 49152, 49152, 49152, 49152, 0xEEEE /* 6 extras to allow different axis sizes. */
141 /* The secondary Volumetric Efficiency Table */
142 const volatile mainTable VETableTertiaryFlash FUELTABLESD = {
143 MAINTABLE_RPM_LENGTH, /* VETableSecondary.RPMLength */
144 MAINTABLE_LOAD_LENGTH, /* VETableSecondary.LoadLength */
145 /* VETableSecondary.RPM */
147 0, 200, 700, 1050,
148 1400, 1750, 2100, 2450,
149 2800, 3150, 3500, 3850,
150 4200, 4550, 4900, 5250,
151 5600, 5950, 6300, 6650,
152 7000, 7350, 7700, 8050,
153 8400, 8750, 9100
155 /*VETableSecondary.Load */
157 1600, 3200, 4800, 6400,
158 8000, 9600, 11200, 12800,
159 14400, 16000, 17600, 19200,
160 20800, 22400, 24000, 25600,
161 27200, 28800, 30400, 32000,
162 33600
164 /* VETableSecondary.Table */
166 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
167 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
168 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
169 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
170 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
171 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
173 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
174 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
175 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
176 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
177 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
178 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
180 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
181 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
182 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
183 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
184 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
185 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
187 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
188 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
189 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
190 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
191 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
192 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152, 49152,
193 49152, 49152, 49152, 49152, 49152, 0xDDDD /* 6 extras to allow different axis sizes. */
198 /* The Lambda Table */
199 const volatile mainTable LambdaTableFlash FUELTABLESD = {
200 MAINTABLE_RPM_LENGTH, /* LambdaTable.RPMLength */
201 MAINTABLE_LOAD_LENGTH, /* LambdaTable.LoadLength */
202 /* LambdaTable.RPM */
204 0, 200, 700, 1050,
205 1400, 1750, 2100, 2450,
206 2800, 3150, 3500, 3850,
207 4200, 4550, 4900, 5250,
208 5600, 5950, 6300, 6650,
209 7000, 7350, 7700, 8050,
210 8400, 8750, 9100
212 /*LambdaTable.Load */
214 1600, 3200, 4800, 6400,
215 8000, 9600, 11200, 12800,
216 14400, 16000, 17600, 19200,
217 20800, 22400, 24000, 25600,
218 27200, 28800, 30400, 32000,
219 33600
221 /* LambdaTable.Table */
222 { /* Laid out to make sense for 24 RPM and 19 Load bins, 8 extras on end to make up size. */
223 /* 14.7, 14.7, 14.35, 14.0, 13.5, 13.0, 12.5, 12.25, 12.0, 11.75, 11.5, 11.25, 11.0, 11.0, 11.0, 11.0, 11.0, 11.0, 11.0, */
224 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
225 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
226 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
227 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
228 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
229 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
231 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
232 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
233 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
234 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
235 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
236 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
238 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
239 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
240 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
241 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
242 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
243 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
245 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
246 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
247 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
248 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
249 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
250 32768, 32768, 31987, 31207, 30093, 28978, 27863, 27307, 26749, 26192, 25635, 25078, 24520, 24520, 24520, 24520, 24520, 24520, 24520,
251 24520, 24520, 24520, 24520, 24520, 0x9999 /* 6 extras to allow different axis sizes. Rich by default.*/