Skip to content

Commit 68d467c

Browse files
committed
0.0.5a
1 parent 07720ae commit 68d467c

32 files changed

Lines changed: 802 additions & 247 deletions

.udp.py.un~

15.2 KB
Binary file not shown.

DOCUMENTATION

Lines changed: 70 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,26 @@
5959
- Sets the antilag setting.
6060
often - if the system fires often
6161

62-
es.engine.setMixture(value)
62+
es.engine.setMixture(state)
6363
- Sets the mixture
6464
true: rich
6565
false: normal
6666

67+
es.engine.SetThrottle(value)
68+
- Sets the throttle to a certain value
69+
70+
es.engine.SetManifoldPressure(value)
71+
- Sets the manifold pressure to a certain value
72+
73+
es.engine.SetIntakeFlow(value)
74+
- Sets the intake flow to a certain value
75+
76+
es.engine.setIgnition(state, minRPM)
77+
- Sets the EFI Ignition simulation values
78+
79+
es.engine.setInjection(state, minRPM)
80+
- Sets the EFI Injection simulation values
81+
6782
es.engine.setCrankWeight(value)
6883
- Sets the crankshaft weight to value (kilograms)
6984

@@ -76,10 +91,41 @@
7691
es.engine.setConrodWeight(value)
7792
- Sets the conrod weight to value (grams)
7893

94+
LOADER FUNCTIONS:
95+
96+
es.loader.setGlobalInput(value)
97+
- Sets the global input to true or false
98+
99+
es.loader.import(filename)
100+
- Loads a file
101+
102+
es.loader.initDNet()
103+
- Inits DNet
104+
105+
es.loader.sendDNet(message)
106+
- Sends a message using DNet
107+
108+
es.loader.json.new()
109+
- Clears the JSON
110+
111+
es.loader.json.addString(key, str)
112+
- Adds a string to the JSON
113+
114+
es.loader.json.addInt(key, integer)
115+
- Adds a integer to the JSON
116+
117+
es.loader.json.addNumber(key, number)
118+
- Adds a number to the JSON
119+
120+
es.loader.json.getString()
121+
- Gets the string of the JSON
122+
79123
VARIABLES:
80124

81125
(GET) means you can only get the value. Setting the value won't do anything.
82126
(GET, SET) means you can get and set the value.
127+
128+
(GET, SET) variables need to be set using 'Set(VARIABLE_NAME)'
83129

84130
INPUT_Q, INPUT_W ... INPUT_N, INPUT_M (GET)
85131
- Input values in format:
@@ -92,29 +138,44 @@
92138
- Gets the simulator version.
93139

94140

95-
es.engine.Engine_Name (GET)
141+
es.engine.Name (GET)
96142
- Gets the engine name.
97143

98-
es.engine.Engine_RPM (GET)
144+
es.engine.RPM (GET)
99145
- Gets the current engine RPM.
100146

101-
es.engine.Engine_AFR (GET)
147+
es.engine.Speed (GET)
148+
- Gets the vehicle speed
149+
150+
es.engine.Redline (GET)
151+
- Gets the engine redline
152+
153+
es.engine.Gear (GET)
154+
- Gets the current gear
155+
156+
es.engine.AFR (GET)
102157
- Gets the current engine A/F ratio.
103158

104-
es.engine.Engine_Throttle (GET, SET)
159+
es.engine.Throttle (GET, SET)
105160
- Gets or sets the engine throttle.
106161
NOTE: throttle 1 means the throttle is closed and 0 means opened.
107162

108-
es.engine.Engine_ManifoldPressure (GET, SET)
163+
es.engine.ManifoldPressure (GET, SET)
109164
- Gets or sets the current manifold pressure (in atmospheres).
110165
NOTE: set pressure is ADDED to the current pressure.
111166

112-
es.engine.Engine_ExhaustFlow (GET)
167+
es.engine.ExhaustFlow (GET)
113168
- Gets the average exhaust flow.
114169

115-
es.engine.Engine_IntakeFlow (GET, SET)
170+
es.engine.IntakeFlow (GET, SET)
116171
- Gets or sets the intake flow.
117172

118-
es.Simulator_FPS (GET)
173+
es.engine.dyno.Torque (GET)
174+
- Gets the dyno torque
175+
176+
es.engine.dyno.Power (GET)
177+
- Gets the dyno power
178+
179+
Simulator_FPS (GET)
119180
- Gets the current simulator FPS.
120181

assets/config/bigassTurbo.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
turbo_spool = 0
3+
turbo_max = -60
4+
5+
turbo_flow_mult = 10000
6+
turbo_down = 0.05
7+
turbo_threshold = 0.00000000000000000000000001
8+
9+
turbo_to_press = 5
10+
turbo_press_to_flow = 5000
11+
turbo_rpm_to_flow = 50000
12+
13+
turbo_antilag_flow = 500
14+
15+
es.trace("Turbo Mod: Big ass turbo loaded")

assets/config/smallTurbo.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
turbo_spool = 0
3+
turbo_max = -5
4+
5+
turbo_flow_mult = 10000
6+
turbo_down = 0.05
7+
turbo_threshold = 0.00000000000000000000000001
8+
9+
turbo_to_press = 5
10+
turbo_press_to_flow = 5000
11+
turbo_rpm_to_flow = 10000
12+
13+
turbo_antilag_flow = 100
14+
15+
es.trace("Turbo Mod: Small turbo loaded")

assets/engines/atg-video-2/01_subaru_ej25_eh.mr

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public node subaru_ej25 {
144144
hf_gain: 0.01,
145145
noise: 1.0,
146146
jitter: 0.5,
147-
simulation_frequency: 20000
147+
simulation_frequency: 10000
148148
)
149149

150150
wires wires()
@@ -362,14 +362,17 @@ private node impreza {
362362
private node impreza_transmission {
363363
alias output __out:
364364
transmission(
365-
max_clutch_torque: 300 * units.lb_ft
365+
max_clutch_torque: 3000 * units.lb_ft
366366
)
367367
.add_gear(3.636)
368368
.add_gear(2.375)
369369
.add_gear(1.761)
370370
.add_gear(1.346)
371371
.add_gear(0.971)
372-
.add_gear(0.756);
372+
.add_gear(0.756)
373+
.add_gear(0.556)
374+
.add_gear(0.356)
375+
.add_gear(0.156);
373376
}
374377

375378
public node main {

assets/engines/atg-video-2/03_2jz.mr

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ public node t2jz {
365365
wb_ignition(
366366
wires: wires,
367367
timing_curve: timing_curve,
368-
rev_limit: 6500 * units.rpm
368+
rev_limit: 7500 * units.rpm
369369
)
370370
)
371371
}
@@ -385,14 +385,18 @@ private node supra_vehicle {
385385
private node supra_transmission {
386386
alias output __out:
387387
transmission(
388-
max_clutch_torque: 500 * units.lb_ft
388+
max_clutch_torque: 5000 * units.lb_ft
389389
)
390390
.add_gear(5.25)
391391
.add_gear(3.36)
392392
.add_gear(2.17)
393393
.add_gear(1.72)
394394
.add_gear(1.32)
395-
.add_gear(1.0);
395+
.add_gear(1.0)
396+
.add_gear(0.7)
397+
.add_gear(0.5)
398+
.add_gear(0.3)
399+
.add_gear(0.1);
396400
}
397401

398402
public node main {

assets/engines/kohler/lawnmower.mr

Lines changed: 62 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ private node i_distributor {
2323
alias output __out:
2424
ignition_module(timing_curve: timing_curve, rev_limit: rev_limit, limiter_duration: limiter_duration)
2525
.connect_wire(wires.wire1, (0.0 / 6.0) * cycle)
26-
.connect_wire(wires.wire2, (1.0 / 6.0) * cycle)
27-
.connect_wire(wires.wire3, (2.0 / 6.0) * cycle)
28-
.connect_wire(wires.wire4, (3.0 / 6.0) * cycle)
29-
.connect_wire(wires.wire5, (4.0 / 6.0) * cycle)
30-
.connect_wire(wires.wire6, (5.0 / 6.0) * cycle);
26+
.connect_wire(wires.wire2, (0.75 / 6.0) * cycle)
27+
.connect_wire(wires.wire3, (1.75 / 6.0) * cycle)
28+
.connect_wire(wires.wire4, (2.75 / 6.0) * cycle)
29+
.connect_wire(wires.wire5, (3.75 / 6.0) * cycle)
30+
.connect_wire(wires.wire6, (4.75 / 6.0) * cycle);
3131
}
3232

3333
public node i_camshaft_builder {
@@ -134,11 +134,11 @@ public node kohler_ch750 {
134134
engine engine(
135135
name: "Modded Kohler CH750",
136136
starter_torque: 150 * units.lb_ft,
137-
starter_speed: 200 * units.rpm,
138-
redline: 8400 * units.rpm,
137+
starter_speed: 6200 * units.rpm,
138+
redline: 18400 * units.rpm,
139139
fuel: fuel(
140-
molecular_mass: 200 * units.g,
141-
energy_density: 45.5 * units.kJ / units.g,
140+
molecular_mass: 25200 * units.g,
141+
energy_density: 25.5 * units.kJ / units.g,
142142
density: 0.85 * units.kg / units.L,
143143
molecular_afr: 29.0 / 2.0
144144
)
@@ -148,7 +148,7 @@ public node kohler_ch750 {
148148
wires wires()
149149

150150
crankshaft c0(
151-
throw: 70 * units.mm / 2,
151+
throw: 76 * units.mm / 2,
152152
flywheel_mass: 2.0 * units.lb,
153153
mass: 1.5 * units.lb,
154154
friction_torque: 8.0 * units.lb_ft,
@@ -184,20 +184,20 @@ public node kohler_ch750 {
184184
mass: 150.0 * units.g,
185185
moment_of_inertia: 0.0015884918028487504,
186186
center_of_mass: 0.0,
187-
length: 4.0 * units.inch
187+
length: 4.5 * units.inch
188188
)
189189

190190
cylinder_bank_parameters bank_params(
191191
bore: 70 * units.mm,
192-
deck_height: (4 + 1) * units.inch + 69 * units.mm / 2
192+
deck_height: (4.5 + 1) * units.inch + 69 * units.mm / 2
193193
)
194194

195195
intake intake(
196196
plenum_volume: 1.0 * units.L,
197197
plenum_cross_section_area: 10.0 * units.cm2,
198198
intake_flow_rate: k_carb(200.0),
199199
idle_flow_rate: k_carb(0.0),
200-
idle_throttle_plate_position: 0.995,
200+
idle_throttle_plate_position: 0.9955,
201201
throttle_gamma: 1.0
202202
)
203203

@@ -212,12 +212,12 @@ public node kohler_ch750 {
212212
exhaust_system exhaust0(
213213
es_params,
214214
audio_volume: 0.85,
215-
impulse_response: ir_lib.real_engine_1
215+
impulse_response: ir_lib.default_0
216216
)
217217
exhaust_system exhaust1(
218218
es_params,
219219
audio_volume: 0.7,
220-
impulse_response: ir_lib.real_engine_1
220+
impulse_response: ir_lib.default_0
221221
)
222222

223223
cylinder_bank b0(bank_params, angle: 0 * units.deg)
@@ -277,9 +277,9 @@ public node kohler_ch750 {
277277
engine.add_crankshaft(c0)
278278

279279
harmonic_cam_lobe lobe(
280-
duration_at_50_thou: 150 * units.deg,
281-
gamma: 1.1,
282-
lift: 200 * units.thou,
280+
duration_at_50_thou: 140 * units.deg,
281+
gamma: 1.0,
282+
lift: 400 * units.thou,
283283
steps: 100
284284
)
285285

@@ -299,21 +299,54 @@ public node kohler_ch750 {
299299

300300
function timing_curve(1000 * units.rpm)
301301
timing_curve
302-
.add_sample(0000 * units.rpm, 60 * units.deg)
303-
.add_sample(1000 * units.rpm, 60 * units.deg)
304-
.add_sample(2000 * units.rpm, 60 * units.deg)
305-
.add_sample(3000 * units.rpm, 60 * units.deg)
306-
.add_sample(4000 * units.rpm, 60 * units.deg)
307-
.add_sample(5000 * units.rpm, 65 * units.deg)
308-
.add_sample(6000 * units.rpm, 70 * units.deg)
309-
.add_sample(7000 * units.rpm, 75 * units.deg)
310-
.add_sample(8000 * units.rpm, 80 * units.deg)
311-
.add_sample(9000 * units.rpm, 80 * units.deg)
302+
.add_sample(0000 * units.rpm, 30 * units.deg)
303+
.add_sample(1000 * units.rpm, 30 * units.deg)
304+
.add_sample(2000 * units.rpm, 30 * units.deg)
305+
.add_sample(3000 * units.rpm, 30 * units.deg)
306+
.add_sample(4000 * units.rpm, 30 * units.deg)
307+
.add_sample(5000 * units.rpm, 35 * units.deg)
308+
.add_sample(6000 * units.rpm, 40 * units.deg)
309+
.add_sample(7000 * units.rpm, 45 * units.deg)
310+
.add_sample(8000 * units.rpm, 50 * units.deg)
311+
.add_sample(9000 * units.rpm, 50 * units.deg)
312312

313313
engine.add_ignition_module(
314314
i_distributor(
315315
wires: wires,
316316
timing_curve: timing_curve,
317-
rev_limit: 9000 * units.rpm
317+
rev_limit: 19000 * units.rpm
318318
))
319319
}
320+
321+
public node k_transmission {
322+
alias output __out:
323+
transmission(
324+
max_clutch_torque: 4000000 * units.lb_ft
325+
)
326+
.add_gear(2.636)
327+
.add_gear(2.536)
328+
.add_gear(2.436)
329+
.add_gear(2.336)
330+
.add_gear(2.236)
331+
.add_gear(2.136)
332+
.add_gear(2.036)
333+
.add_gear(1.936)
334+
.add_gear(1.836)
335+
.add_gear(1.736)
336+
.add_gear(1.636)
337+
.add_gear(1.536)
338+
.add_gear(1.436)
339+
.add_gear(1.336)
340+
.add_gear(1.236)
341+
.add_gear(1.136)
342+
.add_gear(1.036)
343+
.add_gear(0.936)
344+
.add_gear(0.836)
345+
.add_gear(0.736)
346+
.add_gear(0.636)
347+
.add_gear(0.536)
348+
.add_gear(0.436)
349+
.add_gear(0.336)
350+
.add_gear(0.236);
351+
352+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ time = 0
88
function OnProcess(dt)
99

1010
-- this function is executed on EngineSimApplication::process()
11-
-- avaiable vars and functions are listed in the documentation
11+
-- available vars and functions are listed in the documentation
1212

1313
end
1414

@@ -32,7 +32,7 @@ addTickHandler(OnTick)
3232

3333
message = string.format("Loaded Example Mod %s", ModVersion)
3434
es.trace(message)
35-
es.setModel("piston", "HemiPiston")
35+
-- es.setModel("piston", "HemiPiston")
3636

3737
-- Please don't do this.
3838
-- info("Loaded mod")

0 commit comments

Comments
 (0)