WORK IN PROGRESS BY: H. Pandit
n.Tec-5 is a modular, AI-driven engine tuning and control platform. It functions like a custom Electronic Control Unit (ECU) that manages engine performance through adaptive calibration updates based on real-time sensor data. Inspired by MoTeC-style systems, this back end forms the brain of the tuning architecture.
- Adaptive Engine Calibration: AI-guided updates to boost/fuel/ignition maps.
- Modular Structure: Independent modules for tuning, detuning, lambda control, and aerodynamics.
- Configuration via YAML: Tuning parameters, thresholds, and targets are externally configurable.
- Diagnostics & Logging: Safe detuning on part degradation, with full traceable logs.
- Cross-Platform Deployment: Runs on PC, Raspberry Pi, or embedded Linux.
BaseMap: Holds calibration parameters (fuel_map,boost_map, etc.).Tuner: Applies gradient updates (+/-ε) based on AI tuner decisions.AITuner: Neural net decision engine; predicts tuning direction (+1,0,-1).Detuner: Applies safe detune steps based on part health (e.g. reduce boost if turbo degraded).ActiveLamdaController: Adjusts lambda (AFR) setpoint based on sensor feedback.AeroController: Controls DRS and brake stability from speed/wheel data.
- Collect sensor input
- Predict adjustment via
AITuner - Tune or detune parameters
- Update aero and lambda targets
- Log state & write back updated map
new_val = tuner.apply_gradient_increment("fuel_map", direction=+1)part_status = {'turbocharger': True}
params = detuner.check_part_degradation(part_status)input_vec = [steering, throttle, accel, brake, lambda_err]
direction = ai_tuner.predict_adjustment(input_vec)
# • +1 = enrich/increase
# • -1 = lean/decrease
# • 0 = no changefuel_map: 1.0
boost_map: 1.0lamda_ctrl = ActiveLamdaController(target_lambda=1.0, adjustment_step=0.01)
new_target = lamda_ctrl.update_lambda(current_lambda=1.1)- If AFR too lean → enrich
- If AFR too rich → lean out
configs/tuning_config.yaml:
gradient_step: 0.01
detune_gradient_step: 0.01
lambda_target: 1.0
lambda_adjustment_step: 0.01
tolerance: 0.05Load Config Example:
with open("configs/tuning_config.yaml", 'r') as f:
cfg = yaml.safe_load(f)sensor_data = {
'steering': 0.5,
'throttle': 0.7,
'lambda': 1.05,
'vehicle_speed': 100.0,
'wheel_speeds': [90, 91, 89, 92],
}msg = can_bus.recv()
if msg.arbitration_id == SPEED_CAN_ID:
sensor_data['vehicle_speed'] = decode_speed(msg.data)drs_active = aero_controller.update_drs(vehicle_speed=100, lap_time=60, race_mode=True)adjustments = aero_controller.update_braking_stability([90, 92, 88, 91])All modules log decisions and map changes. Example output:
[Tuning] 'fuel_map' adjusted to 1.01
[Detune] 'boost_map' detuned to 0.95
[Lambda] target lambda=0.990
[Aero] DRS=Active, BrakeAdjust=0.97
The n.Tec-5 Back-End can integrate with:
- MoTeC dash or ECU
- Python front-end GUI
- Embedded control loop on vehicle
- Logging servers (via REST/WebSocket)
The back end operates headless and exposes internal states via logs or API. It is designed for robustness in motorsport or simulation environments.
WORK IN PROGRESS BY: H. Pandit
Part of the n.Tec-5 Performance AI Tuning Suite.
https://github.com/user-attachments/assets/66abe772-5801-432f-b7e9-d87fa1156551
https://github.com/user-attachments/assets/2193e625-aed2-4b76-ac46-6499485f27ee
