MartinFranck/Configfile

I have started out with Mik´s config file and the plan is to change the few things that need to be changed. The config file looks like this.

Link to related information if possible.
\n
# Martin´s config 2005-01-24, Mini 4cyl, [m_franck at webspeed.dk]

# this configuration uses a 36-1 teeth wheel as primary trigger
# wasted spark ignition (Ford edis coil pack)

##### CRANKING & STARTING PARAMETERS #####

# priming pulse, all injectors fired once upon power on
primep=1E
primep_temp_scaling=B0

# cranking pulsewidths, see also 'alternate'
cwl=C0
cwh=17
# maximum rpm considered to be "cranking mode" 03 or 04 is perfect (399 or 499 RPM)
cranking_thres=03

# ignition advance when cranking: 8..10 crankdegrees is usually good, since 0.25 degrees resolution is used, decimal 40 (10 degrees) is nice (hexa 28)
ign_crank_advance=28

# Afterstart enrichments
awev=32  #26
awev_temp_scaling=A0
awc=3C

# warmup_clt_range defines the temperature bins used for interpolation
# the values in warmup_clt_range is degrees Fahrenheit + 40
# C = 5/9 * F - 40
# F = 9/5 * C + 72
warmup_clt_range[0]=00  # -40.0 C
warmup_clt_range[1]=14  # -28.8 C
warmup_clt_range[2]=28  # -17.7 C
warmup_clt_range[3]=3C  #  -6.6 C
warmup_clt_range[4]=50  #   4.4 C
warmup_clt_range[5]=64  #  15.5 C
warmup_clt_range[6]=78  #  26.6 C
warmup_clt_range[7]=8C  #  37.7 C
warmup_clt_range[8]=AA  #  54.4 C
warmup_clt_range[9]=C8  #  71.1 C

# warmup_clt is the value of each bin defined in warmup_clt_range
# this is the actual warmup enrichment. Values biased at 100
warmup_clt[0]=9a
warmup_clt[1]=9a
warmup_clt[2]=9a
warmup_clt[3]=99
warmup_clt[4]=96
warmup_clt[5]=8a
warmup_clt[6]=7D #81
warmup_clt[7]=73 #75
warmup_clt[8]=70 #6c
warmup_clt[9]=64

# warmup enrichment can be decreased as a function of rpm.
# set all to 0x64 to disable
warmup_rpm[0]=64 # 100%
warmup_rpm[1]=64
warmup_rpm[2]=64
warmup_rpm[3]=64
warmup_rpm[4]=64
warmup_rpm[5]=64
warmup_rpm[6]=64
warmup_rpm[7]=64

##### injector related parameters #####
req_fuel=60
divider=02
alternate=11  # fire all injectors during cranking

injopen=35 # [16usec] based, (mutiply MS standard value by 6.25 to get [16usec])
battfac=24 # [16usec] based, (mutiply MS standard value by 6.25 to get [16usec])

injocfuel=00
injrampup_battfac=00

injpwm=64
injpwmt=FF
injpwm6=1C

##### acceleration & fuelcut ##### 
# define the tps-dot bins: d(tps)/[0.1 sec]
tpsdotrate[0]=05
tpsdotrate[1]=14
tpsdotrate[2]=28
tpsdotrate[3]=4D

# the tps acc enrichment
tpsaq[0]=0e
tpsaq[1]=32
tpsaq[2]=5A #50
tpsaq[3]=96 #82

tpsdot_kpadot_conf=00
tps_thresh=04 #03
tpsasync=05
acmult=85
tpsacold=20
tpsdq=64
decel_fuelcut_thres=0F

overrun_fuelcut=ff #10
overrun_fuelresume=ff #0D

##### misc configuration #####

rpmk[0]=0B
rpmk[1]=B8
# 7500 RPM = 75 (hexa 4b)
rev_limit=4b

airden_ignore=00 #62
fastidle=C6

config11=31
config12=30 # 4 cylinders
config13=02 # WBO2
batt_cal=ff

mt_unused=00

kpafac=7F
kpaofs=52

baro=64
dbaro=10

tps_low=00
tps_high=FF

fan_temp=F2
fan_hyst=05
fan_channel=P259_0

engine_off_delay=08  # 2 seconds
# seconds [*0.262 sec] before fuelpump is turned off at poweron (without start of engine)
pump_on_mintime=0F # 4 seconds
fuelpump_channel=P259_4

##### IAC configuration #####

iac_step_seq=d8
iac_conf=7E #62
iac_max_steps=46
iac_tps_thres=11
iac_cold_idle_temp=ca #bf
iac_warm_idle_temp=d0 #c7
iac_cold_rpm=5F
iac_warm_rpm=50
iac_cold_start_pos=40
iac_warm_start_pos=0A
iac_afterstart_rpm=05
iac_afterstart_duration=1E
iac_afterstart_steps=0A
iac_kp=0A
iac_ki=14 #05
iac_kd=2e #13
iac_integral_speed=36
iac_integral_limit_dec=40 #20
iac_integral_limit_inc=70 #40 #20
iac_integral_deadband=0A #14
iac_deadband=05 #0a
iac_pid_conf=01
iac_overclose_interval=18
iac_ref_pos[0]=30
iac_ref_pos[1]=30
iac_ref_pos[2]=30
iac_ref_pos[3]=2f
iac_ref_pos[4]=2b
iac_ref_pos[5]=26
iac_ref_pos[6]=20
iac_ref_pos[7]=1b
iac_ref_pos[8]=11
iac_ref_pos[9]=00
iac_sol_channel=FF

iac_ign_advance_change=30 #50
iac_ign_retard_change=30 #50
iac_ign_advance_limit=20
iac_ign_retard_limit=20
iac_ign_threshold=08

##### EGO configuration #####

ego_conf=00 # this isn't used
ego_lag=0A #15
ego_coolant=40
ego_maxtps=ff # not configured yet
ego_maxmap=ff # not configured yet
ego_minrpm=04
ego_maxrpm=ff # not configured yet
ego_warmup=3C
ego_lean_limit=40
ego_rich_limit=80
ego_pid_kp=40 #60 # wbo2 speed
ego_delta=02
ego_target=19 # ego_target = 51 * O2_sensor_voltage (NBO2 sensor)
ego_pid_window=00

##### WBO2 ####

wbo2_warmup_ramp=A0 # 0.2 V/sec wbo2, warmup ramp speed [1.51 mV/sec]
wbo2_warmup_target=FF
wbo2_abs_limit=E4 # wbo2, heater absolute limit [?]  (DA)
wbo2_limit_maxt=A0 # wbo2, max time spent at abs_limit [262msec] (50)
wbo2_fallback=60 # wbo2, fallback V after maxt [?]
wbo2_retry_t=06 # wbo2, retry control after [4sec]
wbo2_edgetime_corr=BA
wbo2_edgetime_min=50
wbo2_ri_target=96 #wbo2, target Ri (pulse amplitude) [5V/8192]
wbo2_nernstdc_target=8D
wbo2_pump_pw_zero=66 ## Calibrate yourself for controller
wbo2_calibration=BE ## Calibrate yourself for sensor
wbo2_heater_pid_kp=46
wbo2_heater_pid_ki=10
wbo2_heater_pid_kd=1A
wbo2_heater_pid_ilimit=80
wbo2_pump_pid_kp=40 #2E
wbo2_pump_pid_ki=2E #1D
wbo2_pump_pid_kd=08
wbo2_pump_pid_ilimit=84
wbo2_ri_confidence_scale=80

##### VE auto-learning #####

ve_learn_coolant=D8    # 80 degress
ve_learn_max_power=ff
ve_learn_rpm_scale=28
ve_learn_kpa_scale=28
ve_learn_ego_scale=50
ve_learn_speed=E0  #80
ve_learn_limit=ff #30
ve_learn_min_weight=50
ve_learn_conf=00

##### lcd display #####
lcd_c0=06 #fe
lcd_delay=22
lcd_backlight=70

lcd_offs[0]=ff
lcd_offs[1]=ff
lcd_offs[2]=ff
lcd_offs[3]=ff
lcd_default_view=01

##### Trigger configuration #####

primary_trigger=01   # rising edge, **tooth wheel**, no filtering

# for alien advance measurement:
#secondary_trigger=08  # falling edge, enable, no filtering, coil, alien advance
# for cam trigger:
#secondary_trigger=3D  # rising edge, enable, filtering, coil, cam sync, both edges
# disable it:
secondary_trigger=ff

# with 36-1 teeth, each tooth==10 degrees 
tooth_wheel=23  # 35 teeth between the missing tooth

# =========== trigger section
# MartinFranck/Triggerwheel shows 36-1 wheel, so 180 degrees is 18 tooth, so hexa 12
another_trigger_tooth=12 

# as http://www.vems.hu/files/MartinFranck/triggerwheel_drawing.GIF shows
# TDC of cyl1 (and cyl4) comes 83 degrees after the point, when
# the first tooth after the missing tooth just passes the trigger.
# that is 8 tooth and a little on the 36-1 wheel.
# we place trigger_tooth to 20 degrees (02 teeth) 
# so 63 degrees remains for ign_tdcdelay so the sum is 83 degrees:
trigger_tooth=02
ign_tdcdelay=7e  # decimal 126 means 63 degrees

# for a 36-1 wheel:
tooth_wheel_twidth1=03 # 10 degrees, angular width of regular tooth
# if "make mtt" says no such variable in config_t (which you can check in global.h yourself) comment it out. This is firmware version dependent, so explicitely write the used version above
# tooth_wheel_twidth2=06 # 10 degrees, angular width of missing tooth

# reset_engphase_after == 2 [revolutions] * ( (36-2) * tooth_wheel_twidth1 + 2 * tooth_wheel_twidth2 )
# 216 = 2 * ( 34*3 + 2*3 )
reset_engphase_after=D8 # 216 

# Cam trigger goes high 90 degrees BTDC on cylinder 1 compression stroke
# This results in the 0->1 trigger 20 crank degrees before the trigger_tooth (70 BTDC)
# Cylinder 1 start of intake stroke is defined as phase==0
# A) cyl 1 start of intake:        0 degrees, phase=0   | upcoming primary trigger phase: 54-7*3 = 33
# B) cyl 1 start of compression: 180 degrees, phase=54  | upcoming primary trigger phase: 87
# C) cyl 1 start of combustion:  360 degrees, phase=108 | upcoming primary trigger phase: 141
# D) cyl 1 start of exhaust:     540 degrees, phase=162 | upcoming primary trigger phase: 195
# 0->1 cam trigger arrives between B and C, thus cam_sync_r_edge_phase = 141 (dec)
cam_sync_r_edge_phase=8D

# The 1->0 trigger arrives 180 cam degrees apart, thus cam_sync_f_edge_phase = (87+216/2)%216 = 33 (dec)
cam_sync_f_edge_phase=21

crank_minper=50  # for std. coil tach signal
#crank_minper=12 # 36-2 tooth wheel @ 6000 rpm : 18 (currently not used)

# =====================

ign_dwell14=27
ign_dwell6=A0
ign_out=70
ignchmax=01


##### Knock setup #####
knock1_frequency=29 #2A  # 7.27 kHz
knock1_gain=14
knock1_integrator=11

knock2_frequency=00
knock2_gain=00
knock2_integrator=00

knock_conf=01
knock_sampling_window=e2
knock_threshold=50
knock_noise_scale=10
knock_max_retard=30
knock_default_retard=10
knock_retard_step=04
knock_retard_delay=10
knock_advance_step=02
knock_advance_delay=10
knock_minrpm=05
knock_maxrpm=ff

##### the rest #####
# which isn't used in this configuration...

inj_stage2_rate=00
inj_stage2_start_tps=00
inj_stage2_start_map=00

als_ignretard=00
als_lowrpm=00
als_maxtps=00
als_rich=00

misc1out_minrpm=00
misc1out_maxrpm=00
misc1out_mintps=00
misc1out_maxtps=00
misc1out_minmap=00
misc1out_maxmap=00
misc1out_channel=FF

misc2out_minrpm=00
misc2out_maxrpm=00
misc2out_mintps=00
misc2out_maxtps=00
misc2out_minmap=00
misc2out_maxmap=00
misc2out_channel=FF

act_wot_rpm=FF		# WOT switch RPM threshold (FF=disable)
act_wot_channel=FF	# WOT switch output channel selector (P259_0)
act_rpm_rpm=FF		# RPM switch RPM threshold (FF=disable)
act_rpm_channel=FF	# RPM switch output channel selector  

egt1_cal=ff
egt1_offs=ff

boost_channel=ff
boost_conf=00
boost_minpressure=00
boost_pid_ilimit=00
boost_pid_kd=00
boost_pid_ki=00
boost_pid_kp=00
boost_targetoffs=00

water_pump_channel=ff
water_pump_hyst=00
water_pump_temp=00