Skip to content

Commit c0a2969

Browse files
committed
0.0.51a
fixed on samples not being recorded right with recorder
1 parent 68d467c commit c0a2969

10 files changed

Lines changed: 778 additions & 43 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
supercharger_spool = 0
3+
supercharger_max = 5
4+
5+
supercharger_down = 0.01
6+
7+
supercharger_to_press = 5
8+
supercharger_press_to_flow = 5000
9+
supercharger_rpm_to_flow = 1000
10+
11+
es.trace("Supercharger Mod: Normal supercharger loaded")

assets/config/reallysmolTurbo.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 = -4.5
4+
5+
turbo_flow_mult = 10000
6+
turbo_down = 0.1
7+
turbo_threshold = 0.00000000000000000000000001
8+
9+
turbo_to_press = 5
10+
turbo_press_to_flow = 5000
11+
turbo_rpm_to_flow = 1000
12+
13+
turbo_antilag_flow = 100
14+
15+
es.trace("Turbo Mod: Really Smol turbo loaded")
Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
import "engine_sim.mr"
2+
3+
units units()
4+
constants constants()
5+
impulse_response_library ir_lib()
6+
7+
label cycle(2 * 360 * units.deg)
8+
9+
private node wires {
10+
output wire1: ignition_wire();
11+
output wire2: ignition_wire();
12+
output wire3: ignition_wire();
13+
}
14+
15+
private node kubota_d722_distributor {
16+
input wires;
17+
input timing_curve;
18+
input rev_limit: 6600 * units.rpm;
19+
input limiter_duration: 0.050 * units.sec;
20+
alias output __out:
21+
ignition_module(timing_curve: timing_curve, rev_limit: rev_limit, limiter_duration: limiter_duration)
22+
.connect_wire(wires.wire1, (0.25 / 3.0) * cycle)
23+
.connect_wire(wires.wire2, (1.0 / 3.0) * cycle)
24+
.connect_wire(wires.wire3, (1.75 / 3.0) * cycle);
25+
}
26+
27+
private node kubota_d722_camshaft_builder {
28+
input lobe_profile;
29+
input intake_lobe_profile: lobe_profile;
30+
input exhaust_lobe_profile: lobe_profile;
31+
input lobe_separation: 114.0 * units.deg;
32+
input intake_lobe_center: lobe_separation;
33+
input exhaust_lobe_center: lobe_separation;
34+
input advance: 0.0 * units.deg;
35+
input base_radius: 0.75 * units.inch;
36+
37+
output exhaust_cam: _exhaust_cam;
38+
output intake_cam: _intake_cam;
39+
40+
camshaft_parameters params(
41+
advance: advance,
42+
base_radius: base_radius
43+
)
44+
45+
camshaft _exhaust_cam(params, lobe_profile: exhaust_lobe_profile)
46+
camshaft _intake_cam(params, lobe_profile: intake_lobe_profile)
47+
48+
label rot(2 * (360 / 3.0) * units.deg)
49+
label rot90(90 * units.deg)
50+
label rot360(360 * units.deg)
51+
52+
_exhaust_cam
53+
.add_lobe(rot360 - exhaust_lobe_center)
54+
.add_lobe(rot360 - exhaust_lobe_center + 1 * rot)
55+
.add_lobe(rot360 - exhaust_lobe_center + 1.75 * rot)
56+
_intake_cam
57+
.add_lobe(rot360 + intake_lobe_center)
58+
.add_lobe(rot360 + intake_lobe_center + 1 * rot)
59+
.add_lobe(rot360 + intake_lobe_center + 1.75 * rot)
60+
}
61+
62+
public node kubota_d722 {
63+
alias output __out: engine;
64+
65+
engine engine(
66+
name: "Kubota D722",
67+
starter_torque: 50 * units.lb_ft,
68+
starter_speed: 500 * units.rpm,
69+
redline: 3600 * units.rpm
70+
)
71+
72+
wires wires()
73+
74+
crankshaft c0(
75+
throw: 68 * units.mm / 2,
76+
flywheel_mass: 5 * units.lb,
77+
mass: 5 * units.lb,
78+
friction_torque: 10.0 * units.lb_ft,
79+
moment_of_inertia: 0.22986844776863666 * 0.5,
80+
position_x: 0.0,
81+
position_y: 0.0,
82+
tdc: 120 * units.deg
83+
)
84+
85+
rod_journal rj0(angle: (0.0 / 3.0) * 360 * units.deg)
86+
rod_journal rj1(angle: (2.0 / 3.0) * 360 * units.deg)
87+
rod_journal rj2(angle: (3.0 / 3.0) * 360 * units.deg)
88+
c0
89+
.add_rod_journal(rj0)
90+
.add_rod_journal(rj1)
91+
.add_rod_journal(rj2)
92+
93+
piston_parameters piston_params(
94+
mass: 400 * units.g,
95+
//blowby: k_28inH2O(0.1),
96+
compression_height: 1.0 * units.inch,
97+
wrist_pin_position: 0.0,
98+
displacement: 0.0
99+
)
100+
101+
connecting_rod_parameters cr_params(
102+
mass: 300.0 * units.g,
103+
moment_of_inertia: 0.0015884918028487504,
104+
center_of_mass: 0.0,
105+
length: 4.4 * units.inch
106+
)
107+
108+
cylinder_bank_parameters bank_params(
109+
bore: 67 * units.mm,
110+
deck_height: (4.0 + 1) * units.inch + 69 * units.mm / 2
111+
)
112+
113+
intake intake(
114+
plenum_volume: 1.0 * units.L,
115+
plenum_cross_section_area: 10.0 * units.cm2,
116+
intake_flow_rate: k_carb(50.0),
117+
idle_flow_rate: k_carb(0.0),
118+
idle_throttle_plate_position: 0.975,
119+
throttle_gamma: 1.0
120+
)
121+
122+
exhaust_system_parameters es_params(
123+
outlet_flow_rate: k_carb(300.0),
124+
primary_tube_length: 5.0 * units.inch,
125+
primary_flow_rate: k_carb(200.0),
126+
velocity_decay: 1.0,
127+
volume: 20.0 * units.L
128+
)
129+
130+
exhaust_system exhaust0(
131+
es_params,
132+
audio_volume: 1.0,
133+
impulse_response: ir_lib.default_0
134+
)
135+
136+
cylinder_bank b0(bank_params, angle: 0 * units.deg)
137+
b0
138+
.add_cylinder(
139+
piston: piston(piston_params, blowby: k_28inH2O(0.01)),
140+
connecting_rod: connecting_rod(cr_params),
141+
rod_journal: rj0,
142+
intake: intake,
143+
exhaust_system: exhaust0,
144+
ignition_wire: wires.wire1
145+
)
146+
.add_cylinder(
147+
piston: piston(piston_params, blowby: k_28inH2O(0.01)),
148+
connecting_rod: connecting_rod(cr_params),
149+
rod_journal: rj1,
150+
intake: intake,
151+
exhaust_system: exhaust0,
152+
ignition_wire: wires.wire2
153+
)
154+
.add_cylinder(
155+
piston: piston(piston_params, blowby: k_28inH2O(0.01)),
156+
connecting_rod: connecting_rod(cr_params),
157+
rod_journal: rj2,
158+
intake: intake,
159+
exhaust_system: exhaust0,
160+
ignition_wire: wires.wire3
161+
)
162+
163+
engine
164+
.add_cylinder_bank(b0)
165+
166+
engine.add_crankshaft(c0)
167+
168+
harmonic_cam_lobe lobe(
169+
duration_at_50_thou: 160 * units.deg,
170+
gamma: 1.1,
171+
lift: 200 * units.thou,
172+
steps: 100
173+
)
174+
175+
kubota_d722_camshaft_builder camshaft(
176+
lobe_profile: lobe,
177+
lobe_separation: 114 * units.deg,
178+
base_radius: 500 * units.thou
179+
)
180+
181+
b0.set_cylinder_head (
182+
generic_small_engine_head(
183+
chamber_volume: 50 * units.cc,
184+
intake_camshaft: camshaft.intake_cam,
185+
exhaust_camshaft: camshaft.exhaust_cam
186+
)
187+
)
188+
189+
function timing_curve(1000 * units.rpm)
190+
timing_curve
191+
.add_sample(0000 * units.rpm, 20 * units.deg)
192+
.add_sample(1000 * units.rpm, 20 * units.deg)
193+
.add_sample(2000 * units.rpm, 20 * units.deg)
194+
.add_sample(3000 * units.rpm, 20 * units.deg)
195+
.add_sample(4000 * units.rpm, 20 * units.deg)
196+
197+
engine.add_ignition_module(
198+
kubota_d722_distributor(
199+
wires: wires,
200+
timing_curve: timing_curve,
201+
rev_limit: 5000 * units.rpm
202+
))
203+
}
204+
205+
private node direct_drive {
206+
alias output __out: transmission;
207+
208+
transmission transmission(
209+
max_clutch_torque: 1075 * units.lb_ft
210+
)
211+
212+
transmission.add_gear(5.0)
213+
transmission.add_gear(4.0)
214+
transmission.add_gear(3.0)
215+
transmission.add_gear(2.0)
216+
transmission.add_gear(1.0)
217+
transmission.add_gear(0.75)
218+
transmission.add_gear(0.5)
219+
transmission.add_gear(0.35)
220+
transmission.add_gear(0.15)
221+
}
222+
223+
private node static_load {
224+
alias output __out:
225+
vehicle(
226+
mass: 563 * units.lb,
227+
drag_coefficient: 0.1,
228+
cross_sectional_area: (20 * units.inch) * (47 * units.inch),
229+
diff_ratio: 2.353,
230+
tire_radius: 8.5 * units.inch,
231+
rolling_resistance: 10 * units.N
232+
);
233+
}
234+
235+
public node main {
236+
set_engine(kubota_d722())
237+
set_transmission(direct_drive())
238+
set_vehicle(static_load())
239+
}

0 commit comments

Comments
 (0)