Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 0b54becf authored by Raphael LUZ's avatar Raphael LUZ
Browse files

- Fixes some error messages (units)

- Same job file list for BATCH and STANDARD
- FC extrapolation will not abort calculation. Invalid FC values are marked in output as "ERROR".
- Bugfix: FC interpolation failed when load points matched map points exactly.
- Bugfix: Invalid "FC= -10000!" errors when outside of FC-Map
- Updates in torque converter IN DEVELOPMENT
- No abortion if transmission output and input torque have different signs (In>0, Out<0)
- Updated modal results header
- New parameters in modal results (see changelog)
- Bugfix: Error if Look-Ahead Coasting was disabled.
- Eco-Roll revised (see changelog)
- Removed "IgnoreFCextrapol" form DEV-Options
parent 84a035e3
Branches
Tags milestones/1.3.1.1-beta1
No related merge requests found
Showing with 326 additions and 111 deletions
VECTO ?.? (future release)
- Rollout Speed: PvD + PlossDiff must be Zero, not Pwheel?!
- roll coefficient as function of relative axle load?
- Eaux [kWh] for all single auxiliaries.
- User Manual: Don't use secondary retarder if retarder losses are already defined in transmission loss maps
- User Manual: "Don't use secondary retarder if retarder losses are already defined in transmission loss maps"
- Gearbox Rules must be set when loading .gbx file to aviod invalid settings (e.g. AT with Skip Gears)
- Correct Pg and Proll calculation (Road gradient)??
- Stop/Start not working if Paux>0 => correct User Manual or Code?
VECTO x.x (current source - next release)
- Bugfix: FC interpolation failed when load points matched map points exactly.
- Bugfix: Invalid "FC= -10000!" errors when outside of FC-Map
- FC extrapolation will not abort calculation. Invalid FC values are marked in output as "ERROR".
- Same job file list for BATCH and STANDARD (Job file list does not change when switching mode)
- Changes in header and new parameters in modal results (.vmod):
o engine speed > n
o torque > Tq_eng
o New: Tq_clutch = torque before clutch
o New: Tq_full = full load torque
o New: Tq_drag = drag torque
o Removed: Pe_norm, n_norm
- No abortion if transmission output and input torque have different signs (In>0, Out<0). (Caused "Transmission Loss Map invalid" error messages)
- Bugfix: Error if Look-Ahead Coasting was disabled.
- Eco-Roll revised:
o Engages if Pwheel < 0
o Disengages if Underspeed is reached.
- Improved gear shift model for torque converter
- Updates in torque converter IN DEVELOPMENT
VECTO 1.3.1.1
......
......@@ -37,10 +37,9 @@ Namespace My
LOGfile.WriteLine("Failed to create directory '" & MyConfPath & "'!")
e.Cancel = True
End Try
IO.File.Create(MyConfPath & "stdGENlist.txt")
IO.File.Create(MyConfPath & "batchGENlist.txt")
IO.File.Create(MyConfPath & "DRIlist.txt")
IO.File.Create(MyConfPath & "ADVlist.txt")
IO.File.Create(MyConfPath & "joblist.txt")
IO.File.Create(MyConfPath & "cyclelist.txt")
'IO.File.Create(MyConfPath & "ADVlist.txt")
End If
If Not IO.Directory.Exists(FB_FilHisDir) Then
Try
......
......@@ -514,13 +514,13 @@ Public Class F_MAINForm
'FileLists
GenList = New cFileListView(MyConfPath & "stdGENlist.txt")
GenList = New cFileListView(MyConfPath & "joblist.txt")
GenList.LVbox = Me.LvGEN
AdvList = New cFileListView(MyConfPath & "ADVlist.txt")
AdvList.LVbox = Me.LvGEN
DriList = New cFileListView(MyConfPath & "DRIlist.txt")
DriList = New cFileListView(MyConfPath & "cyclelist.txt")
DriList.LVbox = Me.LvDRI
BatchGenList = New cFileListView(MyConfPath & "batchGENlist.txt")
BatchGenList = New cFileListView(MyConfPath & "joblist.txt")
BatchGenList.LVbox = Me.LvGEN
'Load GUI Options (here, the GEN/ADV/DRI lists are loaded)
......
......@@ -109,7 +109,7 @@ lbErr:
Try
PauxEff = EffMap.Intpol(nUaux, PsplyAux)
Catch ex As Exception
MODdata.ModErrors.AuxMapExtr = fFILE(Filepath, False) & ", U= " & nUaux & ", PsupplyAux= " & PsplyAux
MODdata.ModErrors.AuxMapExtr = fFILE(Filepath, False) & ", U= " & nUaux & " [1/min], PsupplyAux= " & PsplyAux & " [kW]"
Return 0
End Try
......
......@@ -714,8 +714,6 @@ lbEr:
MsgSrc = "Main/DRI/ConvStoT"
WorkerMsg(tMsgID.Normal, "Converting cycle (v(s) => v(t))", MsgSrc)
If Not GEN.DesMaxJa Then
WorkerMsg(tMsgID.Err, "No a(v) data defined!", MsgSrc)
Return False
......
......@@ -414,7 +414,7 @@ lbEr:
'Extrapolation for x < x(1)
If Lnn(0) >= nnorm Then
If Lnn(0) > nnorm Then MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [U/min]"
If Lnn(0) > nnorm Then MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [1/min]"
i = 1
GoTo lbInt
End If
......@@ -426,7 +426,7 @@ lbEr:
'Extrapolation for x > x(imax)
If Lnn(i) < nnorm Then
MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [U/min]"
MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [1/min]"
End If
lbInt:
......@@ -443,7 +443,7 @@ lbInt:
'Extrapolation for x < x(1)
If Lnn(0) >= nnorm Then
If Lnn(0) > nnorm Then MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [U/min]"
If Lnn(0) > nnorm Then MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [1/min]"
i = 1
GoTo lbInt
End If
......@@ -455,7 +455,7 @@ lbInt:
'Extrapolation for x > x(imax)
If Lnn(i) < nnorm Then
MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [U/min]"
MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [1/min]"
End If
lbInt:
......@@ -474,7 +474,7 @@ lbInt:
'Extrapolation for x < x(1)
If Lnn(0) >= nnorm Then
If Lnn(0) > nnorm Then MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [U/min]"
If Lnn(0) > nnorm Then MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [1/min]"
i = 1
GoTo lbInt
End If
......@@ -486,7 +486,7 @@ lbInt:
'Extrapolation for x > x(imax)
If Lnn(i) < nnorm Then
MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [U/min]"
MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [1/min]"
End If
lbInt:
......@@ -499,7 +499,7 @@ lbInt:
'Extrapolation for x < x(1)
If Lnn(0) >= nnorm Then
If Lnn(0) > nnorm Then MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [U/min]"
If Lnn(0) > nnorm Then MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [1/min]"
i = 1
GoTo lbInt
End If
......@@ -511,7 +511,7 @@ lbInt:
'Extrapolation for x > x(imax)
If Lnn(i) < nnorm Then
MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [U/min]"
MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [1/min]"
End If
lbInt:
......@@ -529,7 +529,7 @@ lbInt:
'Extrapolation for x <x(1)
If Lnn(0) >= nnorm Then
If Lnn(0) > nnorm Then MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [U/min]"
If Lnn(0) > nnorm Then MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [1/min]"
i = 1
GoTo lbInt
End If
......@@ -541,7 +541,7 @@ lbInt:
'Extrapolation for x > x(imax)
If Lnn(i) < nnorm Then
MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [U/min]"
MODdata.ModErrors.FLDextrapol = "n= " & nnormTonU(nnorm) & " [1/min]"
End If
lbInt:
......
......@@ -304,7 +304,7 @@ Public Class cGBX
'nUmax = nnormTonU(GBX.fGSnnUp(Mout))
'Start values: Estimate torque converter state
nUin = nUout
nUin = Math.Min(VEH.nNenn, nUout * 2)
'If nUin > nUmax Then nUin = nUmax
'If nUin < nUmin Then nUin = nUmin
......
......@@ -950,7 +950,7 @@ lbEr:
Try
Return FuelMap.Intpol(nnorm, Pnorm)
Catch ex As Exception
WorkerMsg(tMsgID.Err, "Cannot extrapolate FC map! n= " & nnormTonU(nnorm).ToString("0") & " [U/min], Me= " & PnormToM(nnorm, Pnorm).ToString("0.0") & " [Nm]", "MAP/FC_Intp")
WorkerMsg(tMsgID.Err, "Cannot extrapolate FC map! n= " & nnormTonU(nnorm).ToString("0") & " [1/min], Me= " & PnormToM(nnorm, Pnorm).ToString("0.0") & " [Nm]", "MAP/FC_Intp")
Return -10000
End Try
End Function
......
......@@ -557,11 +557,7 @@ lbError:
M_in = CDbl(line(1))
M_loss = CDbl(line(2))
If M_in > 0 Then
M_out = M_in - M_loss
Else
M_out = M_in + M_loss
End If
'old version: Power instead of torque: GBmap0.AddPoints(nU, nMtoPe(nU, M_out), nMtoPe(nU, M_in))
GBmap0.AddPoints(nU, M_out, M_in)
......@@ -601,11 +597,26 @@ lbError:
Dim AbMin As Double
Dim iMin As Integer
Dim PeOutX As Double
Dim GrTxt As String
Dim MsgSrc As String
MsgSrc = "VEH/TrLossMapInterpol/G" & Gear
If Gear = 0 Then
GrTxt = "A"
Else
If GBX.TCon Then
If Gear = 1 Then
GrTxt = "TC"
Else
GrTxt = (Gear - 1).ToString
End If
Else
GrTxt = Gear.ToString
End If
End If
If GetrEffDef(Gear) Then
If PeOut > 0 Then
......@@ -652,7 +663,7 @@ lbError:
Else
'Drag => Drivetrain: ERROR!
WorkerMsg(tMsgID.Err, "Transmission Loss Map invalid! Gear= " & Gear & ", nU= " & nU.ToString("0.00") & ", PeIn=" & PeIn.ToString("0.0") & ", PeOut=" & PeOutX.ToString("0.0"), MsgSrc)
WorkerMsg(tMsgID.Err, "Transmission Loss Map invalid! Gear= " & GrTxt & ", nU= " & nU.ToString("0.00") & " [1/min], PeIn=" & PeIn.ToString("0.0") & " [kW], PeOut=" & PeOutX.ToString("0.0") & " [kW]", MsgSrc)
WorkerAbort()
Return 0
......@@ -661,10 +672,9 @@ lbError:
Else
If PeIn > 0 Then
'Drivetrain => Drag: ERROR!
WorkerMsg(tMsgID.Err, "Transmission Loss Map invalid! Gear= " & Gear & ", nU= " & nU.ToString("0.00") & ", PeIn=" & PeIn.ToString("0.00") & ", PeOut=" & PeOutX.ToString("0.00"), MsgSrc)
WorkerAbort()
Return 0
'WorkerMsg(tMsgID.Warn, "Change of sign in Transmission Loss Map! Gear= " & GrTxt & ", nU= " & nU.ToString("0.00") & " [1/min], PeIn=" & PeIn.ToString("0.00") & " [kW], PeOut=" & PeOutX.ToString("0.00") & " [kW]", MsgSrc)
'WorkerAbort()
WG = (PeIn - (PeIn - PeOutX)) / PeIn
Else
......@@ -680,7 +690,7 @@ lbError:
'Calculate efficiency with PeIn for original PeOut
PeIn = PeOut / WG
MODdata.ModErrors.TrLossMapExtr = "Gear= " & Gear & ", nU= " & nU.ToString("0.00") & " [U/min], MeOut=" & nPeToM(nU, PeOut).ToString("0.00") & " [Nm]"
MODdata.ModErrors.TrLossMapExtr = "Gear= " & GrTxt & ", nU= " & nU.ToString("0.00") & " [1/min], MeOut=" & nPeToM(nU, PeOut).ToString("0.00") & " [Nm]"
End Try
......@@ -701,11 +711,25 @@ lbError:
Dim AbMin As Double
Dim iMin As Integer
Dim PeInX As Double
Dim GrTxt As String
Dim MsgSrc As String
MsgSrc = "VEH/TrLossMapInterpolFwd/G" & Gear
If Gear = 0 Then
GrTxt = "A"
Else
If GBX.TCon Then
If Gear = 1 Then
GrTxt = "TC"
Else
GrTxt = (Gear - 1).ToString
End If
Else
GrTxt = Gear.ToString
End If
End If
If GetrEffDef(Gear) Then
......@@ -751,7 +775,7 @@ lbError:
Else
'Drag => Drivetrain: ERROR!
WorkerMsg(tMsgID.Err, "Transmission Loss Map invalid! Gear= " & Gear & ", nU= " & nU.ToString("0.00") & ", PeIn=" & PeInX.ToString("0.00") & ", PeOut=" & PeOut.ToString("0.00"), MsgSrc)
WorkerMsg(tMsgID.Err, "Transmission Loss Map invalid! Gear= " & GrTxt & ", nU= " & nU.ToString("0.00") & " [1/min], PeIn=" & PeInX.ToString("0.00") & " [kW], PeOut=" & PeOut.ToString("0.00") & " [kW] (fwd)", MsgSrc)
WorkerAbort()
Return 0
......@@ -760,10 +784,9 @@ lbError:
Else
If PeInX > 0 Then
'Drivetrain => Drag: ERROR!
WorkerMsg(tMsgID.Err, "Transmission Loss Map invalid! Gear= " & Gear & ", nU= " & nU.ToString("0.00") & ", PeIn=" & PeInX.ToString("0.00") & ", PeOut=" & PeOut.ToString("0.00"), MsgSrc)
WorkerAbort()
Return 0
WorkerMsg(tMsgID.Warn, "Change of sign in Transmission Loss Map! Set efficiency to 10%. Gear= " & GrTxt & ", nU= " & nU.ToString("0.00") & " [1/min], PeIn=" & PeInX.ToString("0.00") & " [kW], PeOut=" & PeOut.ToString("0.00") & " [kW] (fwd)", MsgSrc)
'WorkerAbort()
WG = 0.1
Else
......@@ -777,7 +800,7 @@ lbError:
'Calculate efficiency with PeIn for original PeOut
PeOut = PeIn * WG
MODdata.ModErrors.TrLossMapExtr = "Gear= " & Gear & ", nU= " & nU.ToString("0.00") & " [U/min], MeIn=" & nPeToM(nU, PeIn).ToString("0.00") & " [Nm] (fwd)"
MODdata.ModErrors.TrLossMapExtr = "Gear= " & GrTxt & ", nU= " & nU.ToString("0.00") & " [1/min], MeIn=" & nPeToM(nU, PeIn).ToString("0.00") & " [Nm] (fwd)"
End Try
......@@ -1106,7 +1129,7 @@ lbInt:
'Extrapolation for x < x(1)
If RtnU(0) >= nU Then
If RtnU(0) > nU Then MODdata.ModErrors.RtExtrapol = "n= " & nU & " [U/min]"
If RtnU(0) > nU Then MODdata.ModErrors.RtExtrapol = "n= " & nU & " [1/min]"
i = 1
GoTo lbInt
End If
......@@ -1117,7 +1140,7 @@ lbInt:
Loop
'Extrapolation for x> x(imax)
If RtnU(i) < nU Then MODdata.ModErrors.RtExtrapol = "n= " & nU & " [U/min]"
If RtnU(i) < nU Then MODdata.ModErrors.RtExtrapol = "n= " & nU & " [1/min]"
lbInt:
'Interpolation
......
......@@ -57,7 +57,7 @@ Public Class cEm
'Delaunay
v = MAP.fFCdelaunay_Intp(MODdata.nn(i), MODdata.Pe(i))
If v < 0 Then
If v < 0 And v > -999 Then
If v < DEV.negFCerr Then
WorkerMsg(tMsgID.Err, "FC= " & v & "!", "MAP/FC_Intp")
Result = False
......
......@@ -414,16 +414,16 @@ Public Class cMOD
If Not GEN.VehMode = tVehMode.EV Then
s.Append(",engine speed,Pe,n_norm,Pe_norm")
sU.Append(",[rpm],[kW],[-],[-]")
sU.Append(",[1/min],[kW],[-],[-]")
End If
s.Append(",engine speed,PeEM,PeBat,PiBat,Ubat,Ibat,SOC")
sU.Append(",[rpm],[kW],[kW],[kW],[V],[A],[-]")
sU.Append(",[1/min],[kW],[kW],[kW],[V],[A],[-]")
Else
s.Append(",engine speed,torque,Pe,n_norm,Pe_norm,Pe_full,Pe_drag,Pe_clutch,Pa Eng,Paux")
sU.Append(",[rpm],[Nm],[kW],[-],[-],[kW],[kW],[kW],[kW],[kW]")
s.Append(",n,Tq_eng,Tq_clutch,Tq_full,Tq_drag,Pe,Pe_full,Pe_drag,Pe_clutch,Pa Eng,Paux")
sU.Append(",[1/min],[Nm],[Nm],[Nm],[Nm],[kW],[kW],[kW],[kW],[kW],[kW]")
End If
......@@ -433,7 +433,7 @@ Public Class cMOD
sU.Append(",[-],[kW],[kW],[kW],[kW],[kW],[kW],[kW],[kW],[kW],[kW]")
If GBX.TCon Then
s.Append(",TCν,TCμ,TC_M_Out,TC_n_Out")
s.Append(",TCν,TCμ,TC_T_Out,TC_n_Out")
sU.Append(",[-],[-],[Nm],[1/min]")
End If
......@@ -588,17 +588,37 @@ Public Class cMOD
'Revolutions
s.Append(Sepp & .nn(t) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl)
If Math.Abs(2 * Math.PI * (.nn(t) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) / 60) < 0.00001 Then
s.Append(Sepp & "-" & Sepp & "-" & Sepp & "-" & Sepp & "-")
Else
'Torque
s.Append(Sepp & 1000 * .Pe(t) * VEH.Pnenn / (2 * Math.PI * (.nn(t) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) / 60))
'Torque at clutch
s.Append(Sepp & 1000 * (.Pe(t) * VEH.Pnenn - .PaEng(t) - .PauxSum(t)) / (2 * Math.PI * (.nn(t) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) / 60))
'Full-load and Drag torque
If .EngState(t) = tEngState.Stopped Then
s.Append(Sepp & "-" & Sepp & "-")
Else
If t = 0 Then
s.Append(Sepp & 1000 * FLD.Pfull(.nn(t)) / (2 * Math.PI * (.nn(t) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) / 60) & Sepp & 1000 * FLD.Pdrag(.nn(t)) / (2 * Math.PI * (.nn(t) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) / 60))
Else
s.Append(Sepp & 1000 * FLD.Pfull(.nn(t), .Pe(t - 1)) / (2 * Math.PI * (.nn(t) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) / 60) & Sepp & 1000 * FLD.Pdrag(.nn(t)) / (2 * Math.PI * (.nn(t) * (VEH.nNenn - VEH.nLeerl) + VEH.nLeerl) / 60))
End If
End If
End If
'Power
s.Append(Sepp & .Pe(t) * VEH.Pnenn)
'Revolutions normalized
s.Append(Sepp & .nn(t))
's.Append(Sepp & .nn(t))
'Power normalized
s.Append(Sepp & .Pe(t))
's.Append(Sepp & .Pe(t))
'Full-load and Drag
If .EngState(t) = tEngState.Stopped Then
......@@ -689,7 +709,13 @@ Public Class cMOD
Em0 = .Em.EmComp(StrKey)
If Em0.WriteOutput Then
If Em0.FinalVals(t) > -0.0001 Then
s.Append(Sepp & Em0.FinalVals(t))
Else
s.Append(Sepp & "ERROR")
End If
End If
Next
......
......@@ -427,7 +427,7 @@ lb10:
MsgSrc = "Power/PreRun"
'Check Input
If GEN.a_lookahead >= 0 Then
If GEN.LookAheadOn AndAlso GEN.a_lookahead >= 0 Then
WorkerMsg(tMsgID.Err, "Lookahead deceleration invalid! Value must be below zero.", MsgSrc)
Return False
End If
......@@ -541,14 +541,18 @@ lb10:
If GEN.EcoRollOn Then
If Vh.Grad(i) < 0 Then
If PvorD < 0 Or (i > 0 AndAlso Vh.EcoRoll(i - 1)) Then
Vmax = MODdata.Vh.Vsoll(i) + GEN.OverSpeed / 3.6
Vmin = Math.Max(0, MODdata.Vh.Vsoll(i) - GEN.UnderSpeed / 3.6)
vRollout = fRolloutSpeed(i, 1)
aRollout = (2 * vRollout - Vh.V0(i)) - Vh.V0(i)
If vRollout <= Vmax Then
If vRollout < Vmin Then
'Eco-Roll deactivated
ElseIf vRollout <= Vmax Then
If 2 * vRollout - Vh.V0(i) > Vmax Then
Vh.SetSpeed0(i, Vmax)
......@@ -560,6 +564,8 @@ lb10:
End If
Positions(i) = 4
'Mark position for Calc
Vh.EcoRoll(i) = True
Else
......@@ -572,6 +578,9 @@ lb10:
Positions(i) = 1
'Mark position for Calc
Vh.EcoRoll(i) = True
End If
......@@ -583,7 +592,7 @@ lb10:
If GEN.OverSpeedOn Then
vCoasting = fCoastingSpeed(i, Gear, False)
vCoasting = fCoastingSpeed(i, Gear)
Vmax = MODdata.Vh.Vsoll(i) + GEN.OverSpeed / 3.6
If vCoasting <= Vmax Then
......@@ -639,9 +648,11 @@ lb10:
End If
Next
If GEN.LookAheadOn Then
Tlookahead = CInt((vset2 - vset1) / GEN.a_lookahead)
t = Math.Max(0, i - Tlookahead)
End If
LookAheadDone = False
adec = GEN.aDesMin(Vist)
......@@ -649,6 +660,13 @@ lb10:
i0 = i
If GEN.LookAheadOn Then
Do While i0 > t AndAlso fCoastingSpeed(t, Gears(t), i0 - t) < Vh.V(i0)
t += 1
Loop
End If
Do
i -= 1
aist = Vh.a(i)
......@@ -664,7 +682,7 @@ lb10:
For j = t To i0
Vist = Vh.V(j)
vCoasting = fCoastingSpeed(j, Gears(j), True)
vCoasting = fCoastingSpeed(j, Gears(j))
aCoasting = (2 * vCoasting - Vh.V0(j)) - Vh.V0(j)
If vCoasting < Vist And aCoasting >= GEN.aDesMin(Vist) Then
'If Vrollout < Vist Then
......@@ -681,7 +699,7 @@ lb10:
LookAheadDone = True
End If
Loop Until LookAheadDone
Loop Until LookAheadDone Or i = 0
'Correct distance error
'If t - 1 > 0 Then
......@@ -816,9 +834,11 @@ lb10:
TracIntrTurnOff = False
If GEN.izykwael = 4 Then
'never
Kuppln_norm = 0.05
KupplEta = 0.4
Else
'always
Kuppln_norm = 0.03
KupplEta = 1
End If
......@@ -1043,8 +1063,12 @@ lbGschw:
'Gear-shifting Model
If PKWja Then
Gear = fGearPKW(jz)
Else
If GBX.TCon Then
Gear = fGearTC(jz)
Else
Gear = fGearVECTO(jz)
End If
'Gear = fGearLKW(jz)
End If
......@@ -1077,10 +1101,9 @@ lbGschw:
End If
'Eco-Roll
If Vh.EcoRoll(jz) AndAlso Math.Abs(PvorD) < 0.01 * VEH.Pnenn Then
If Vh.EcoRoll(jz) AndAlso PvorD < 0.01 * VEH.Pnenn Then
Clutch = tEngClutch.Opened
Gear = 0
End If
' Important checks
......@@ -1192,8 +1215,7 @@ lbCheck:
End If
Loop Until Math.Abs(Pmin - PminX) < 0.001 Or nU <= VEH.nLeerl Or i = 999
'TODO: Switch off?
If i = 999 Then WorkerMsg(tMsgID.Warn, "i=999", MsgSrc & "/t= " & jz + 1)
'If i = 999 Then WorkerMsg(tMsgID.Warn, "i=999", MsgSrc & "/t= " & jz + 1)
nn = (Math.Max(VEH.nLeerl, nU) - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl)
......@@ -1567,6 +1589,12 @@ lb_nOK:
End If
MODdata.TCMout.Add(GBX.TCMout)
MODdata.TCnOut.Add(GBX.TCnout)
Else
If Clutch = tEngClutch.Opened Then
MODdata.TCnu.Add(0)
MODdata.TCmu.Add(0)
MODdata.TCMout.Add(0)
MODdata.TCnOut.Add(0)
Else
MODdata.TCnu.Add(1)
MODdata.TCmu.Add(1)
......@@ -1574,6 +1602,7 @@ lb_nOK:
MODdata.TCnOut.Add(nU)
End If
End If
End If
If Cfg.WegKorJa Then Vh.DistCorrection(jz, VehState0)
......@@ -1853,13 +1882,17 @@ lb_nOK:
End Function
Private Function fCoastingSpeed(ByVal t As Integer, ByVal Gear As Integer, ByVal NoPosGrad As Boolean) As Single
Private Function fCoastingSpeed(ByVal t As Integer, ByVal Gear As Integer) As Single
Return fCoastingSpeed(t, Gear, MODdata.Vh.V(t), MODdata.Vh.a(t))
End Function
Private Function fCoastingSpeed(ByVal t As Integer, ByVal Gear As Integer, ByVal v As Single, ByVal a As Single, Optional ByVal v0 As Single? = Nothing) As Single
Dim vstep As Double
Dim vVorz As Integer
Dim Pe As Single
Dim a As Single
Dim v As Single
Dim PvD As Single
Dim LastDiff As Single
Dim Diff As Single
......@@ -1867,19 +1900,14 @@ lb_nOK:
Dim Pdrag As Single
Dim Grad As Single
v = MODdata.Vh.V(t)
vstep = 0.1
a = MODdata.Vh.a(t)
nU = fnU(v, Gear, False)
Pdrag = FLD.Pdrag((nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl))
'Do not allow positive road gradients
If NoPosGrad Then
Grad = Math.Min(MODdata.Vh.Grad(t), 0)
Else
Grad = MODdata.Vh.Grad(t)
End If
PvD = fPvD(t, v, a, Grad)
Pe = PvD + fPlossGB(PvD, v, Gear) + fPlossDiff(PvD, v) + fPaG(v, a) + fPlossRt(v, Gear) + fPaux(t, nU) + fPaMot(t, Gear, v, a)
......@@ -1906,7 +1934,11 @@ lb_nOK:
v += vVorz * vstep
If v0 Is Nothing Then
a = 2 * (v - MODdata.Vh.V0(t)) / 1 'dt = 1[s]
Else
a = 2 * (v - v0) / 1 'dt = 1[s]
End If
nU = fnU(v, Gear, False)
Pdrag = FLD.Pdrag((nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl))
......@@ -1925,6 +1957,41 @@ lb_nOK:
End Function
Private Function fCoastingSpeed(ByVal t As Integer, ByVal Gear As Integer, ByVal dt As Integer) As Single
Dim a As Single
Dim v As Single
Dim vtemp As Single
Dim t0 As Integer
Dim v0 As Single
Dim v0p As Single
v0 = MODdata.Vh.V0(t)
v = MODdata.Vh.V(t)
a = MODdata.Vh.a(t)
If t + dt > MODdata.tDim - 1 Then
dt = MODdata.tDim - 1 - t
End If
For t0 = t To t + dt
vtemp = fCoastingSpeed(t0, Gear, v, a, v0)
If 2 * vtemp - v0 < 0 Then vtemp = v0 / 2
v0p = 2 * vtemp - v0
a = v0p - v0
v = (MODdata.Vh.V0(t0 + 2) + v0p) / 2
a = MODdata.Vh.V0(t0 + 2) - v0p
v0 = v0p
Next
Return vtemp
End Function
#Region "Schaltmodelle"
Private Function fFastGearCalc(ByVal V As Single, ByVal Pe As Single) As Integer
......@@ -2052,6 +2119,65 @@ lb_nOK:
End Function
Private Function fGearTC(ByVal t As Int16) As Integer
Dim LastGear As Int16
Dim tx As Int16
Dim nU As Single
Dim nn As Single
Dim nnUp As Single
Dim nnDown As Single
Dim Md As Single
Dim Pe As Single
'First time step OR first time step after stand still
If t = 0 OrElse MODdata.VehState(t - 1) = tVehState.Stopped Then Return 1
'Previous Gear
tx = 1
LastGear = 0
Do While LastGear = 0 And t - tx > -1
LastGear = MODdata.Gear(t - tx)
tx += 1
Loop
'If idling (but no vehicle stop...?) then
If LastGear = 0 Then Return 1
'If lockup-clutch already closed then goto normal shift model
If LastGear > 1 Then Return fGearVECTO(t)
'Rpm
nU = MODdata.nU(t - 1)
nn = MODdata.nn(t - 1)
'previous power demand
Pe = MODdata.Pe(t - 1) * VEH.Pnenn
'previous torque demand
Md = Pe * 1000 / (nU * 2 * Math.PI / 60)
'Up/Downshift rpms
nnUp = GBX.fGSnnUp(Md)
nnDown = GBX.fGSnnDown(Md)
If nn > nnUp Then
If fnn(Vist, 2, False) > nnDown Then
Return 2
Else
Return 1
End If
ElseIf nn < nnDown Then
Return 0
Else
Return 1
End If
End Function
Private Function fGearVECTO(ByVal t As Integer) As Integer
Dim nU As Single
Dim nn As Single
......
......@@ -18,6 +18,8 @@ Module M_MAIN
Private jsubcycle As Integer
Private jsubcyclecount As Integer
Public FCerror As Boolean
Friend Function NrOfRunStr() As String
If PHEMmode = tPHEMmode.ModeSTANDARD Then
'Return CStr(jgen * (CyclesDim + 1) + jzkl + 1) & "-" & CStr(jsubcycle)
......@@ -302,13 +304,14 @@ lbADV:
'***************************** VECTO-loading-loop *********************************
'**************************************************************************************
'Entry point for SOC-start iteration
If GEN.ModeHorEV And SOCnJa Then SOCfirst = True
'Clean up
MODdata.Init()
FCerror = False
'Read cycle
If (Not (PHEMmode = tPHEMmode.ModeADVANCE)) Then
......@@ -323,6 +326,7 @@ lbADV:
'Convert v(s) into v(t) (optional)
If DRI.Scycle Then
If MsgOut Then WorkerMsg(tMsgID.Normal, "Converting cycle (v(s) => v(t))", MsgSrc)
If Not DRI.ConvStoT() Then
CyclAbrtedByErr = True
GoTo lbAusg
......@@ -486,11 +490,14 @@ lbADV:
'Calculate Raw emissions
If Not MODdata.Em.Raw_Calc() Then
If Not DEV.IgnoreFCextrapol Then
CyclAbrtedByErr = True
WorkerMsg(tMsgID.Normal, "Calculation aborted!", MsgSrc)
GoTo lbAusg
End If
'If Not DEV.IgnoreFCextrapol Then
' CyclAbrtedByErr = True
' WorkerMsg(tMsgID.Normal, "Calculation aborted!", MsgSrc)
' GoTo lbAusg
'End If
FCerror = True
End If
'TC Parameter umrechnen in Differenz zu Kennfeld-TC-Parameter |@@| Convert TC parameters to differences with Map-TC-parameters
......
......@@ -2,7 +2,7 @@
Module VECTO_Global
Public Const VECTOvers As String = "1.3.1.1"
Public Const VECTOvers As String = "1.3.1.1+ beta 1 - 18.07.2013"
Public MyAppPath As String
Public MyConfPath As String
Public MyDeclPath As String
......
......@@ -15,7 +15,6 @@ Public Class cDEV
Public SpeedPeEps As Single
Public PreRun As Boolean
Public IgnoreFCextrapol As Boolean
Public negFCerr As Single
......@@ -151,10 +150,6 @@ Public Class cDEV
Conf0.BoolVal = True
MyOptions.Add("PreRun", Conf0)
Conf0 = New cDEVoption(tDEVconfType.tBoolean, "Don't abort calculation if extrapolation or values < negFCerr in FC map. FC output is not valid!!", False)
Conf0.BoolVal = False
MyOptions.Add("IgnoreFCextrapol", Conf0)
Conf0 = New cDEVoption(tDEVconfType.tSingleVal, "FC values below negFCerr cause errors and abort calculation. Values between zero and negFCerr are set to zero.")
Conf0.SingleVal = -0.000001
MyOptions.Add("negFCerr", Conf0)
......@@ -178,7 +173,6 @@ Public Class cDEV
PreRun = MyOptions("PreRun").BoolVal
IgnoreFCextrapol = MyOptions("IgnoreFCextrapol").BoolVal
negFCerr = MyOptions("negFCerr").SingleVal
End Sub
......
......@@ -92,9 +92,9 @@ Public Class cDelaunayMap
Dim l0 As Double()
Dim tr As dTriangle
j = -1
'Try exact solution for IsInside()
j = -1
For Each tr In lDT
j += 1
If IsInside(tr, x, y, True) Then
......@@ -104,6 +104,7 @@ Public Class cDelaunayMap
Next
'Try approx. solution (fixes rounding errors when points lies exactly on an edge of a triangle)
j = -1
For Each tr In lDT
j += 1
If IsInside(tr, x, y, False) Then
......@@ -240,6 +241,8 @@ Public Class cDelaunayMap
u = (dot11 * dot02 - dot01 * dot12) * invDenom
v = (dot00 * dot12 - dot01 * dot02) * invDenom
'Debug.Print(u & ", " & v & ", " & u + v)
' Check if point is in triangle
If Exact Then
Return (u >= 0) And (v >= 0) And (u + v <= 1)
......
......@@ -510,6 +510,14 @@ Class cERG
'Dump x/h if ADVANCE mode -or- EngineOnly -or- Units not in x/h and therefore Conversion into x/km is not possible
If Em0.WriteOutput Then
If FCerror Then
If Em0.NormID = tEmNorm.x Or GEN.VehMode = tVehMode.EngineOnly Or PHEMmode = tPHEMmode.ModeADVANCE Then
ErgEntries(Em0.IDstring).ValueString = "ERROR"
Else
ErgEntries(Em0.IDstring & "_km").ValueString = "ERROR"
End If
Else
If Em0.NormID = tEmNorm.x Or GEN.VehMode = tVehMode.EngineOnly Or PHEMmode = tPHEMmode.ModeADVANCE Then
ErgEntries(Em0.IDstring).ValueString = Em0.FinalAvg.ToString
Else
......@@ -517,6 +525,8 @@ Class cERG
End If
End If
End If
Next
'Power, Revolutions
......
......@@ -30,9 +30,9 @@
'Totals/Average Values
Public FinalAvg As Single 'Durchschnittswert [g/h]
Public FinalSum As Single 'Summe [g]
Public FinalAvgPos As Single 'Durchschnittswert ohne negative Werte [g/h]
Public FinalSumPos As Single 'Summe ohne negative Werte [g]
Private FinalSum As Single 'Summe [g]
Private FinalAvgPos As Single 'Durchschnittswert ohne negative Werte [g/h]
Private FinalSumPos As Single 'Summe ohne negative Werte [g]
Public Sub New()
RawVals = New System.Collections.Generic.List(Of Single)
......@@ -123,4 +123,6 @@
End Sub
End Class
......@@ -78,6 +78,8 @@ Public Class cVSUM
If VSUMsingleRef.Loading > 0 Then VSUMsingleRef.CO2gtkm = VSUMsingleRef.CO2gkm / VSUMsingleRef.Loading
VSUMsingleRef.AvgSpeed = Vquer
VSUMsingleRef.FCerror = FCerror
SingleResults.Add(VSUMsingleRef)
Return True
......@@ -128,12 +130,19 @@ Public Class cVSUM
file.WriteLine(vbTab & vbTab & "Loading: " & vbTab & VSUMsingleRef.Loading & vbTab & "[t]")
file.WriteLine(vbTab & vbTab & "Average Speed: " & vbTab & VSUMsingleRef.AvgSpeed.ToString & vbTab & "[km/h]")
file.WriteLine(vbTab & vbTab & "Fuel Consumption" & vbTab & vbTab & "CO2 Emissions")
If VSUMsingleRef.FCerror Then
file.WriteLine(vbTab & vbTab & "ERROR")
Else
file.WriteLine(vbTab & vbTab & VSUMsingleRef.FCl100km.ToString("#.0") & vbTab & "[l/100km]" & vbTab & VSUMsingleRef.CO2gkm.ToString("#.0") & vbTab & "[g/km]")
If VSUMsingleRef.Loading = 0 Then
file.WriteLine(vbTab & vbTab & "-" & vbTab & "[l/100tkm]" & vbTab & "-" & vbTab & "[g/tkm]")
Else
file.WriteLine(vbTab & vbTab & VSUMsingleRef.FCl100tkm.ToString("#.0") & vbTab & "[l/100tkm]" & vbTab & VSUMsingleRef.CO2gtkm.ToString("#.0") & vbTab & "[g/tkm]")
End If
End If
Next
......@@ -153,6 +162,7 @@ Public Class cVSUMsingle
Public CO2gkm As Single
Public CO2gtkm As Single
Public DescStr As String
Public FCerror As Boolean
Public Sub ResetMe()
FCl100km = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment