From abdc3b17392d751cffcbabfa327d28d8f2d8ea2c Mon Sep 17 00:00:00 2001 From: Raphael Luz <luz@ivt.tugraz.at> Date: Wed, 28 Aug 2013 14:39:32 +0200 Subject: [PATCH] - Look Ahead Coasting Distance Correction fix. - Torque Converter updates ....still in development --- VECTO Changelog.txt | 4 +- VECTO/Input Files/cGBX.vb | 80 +++++++++++++++++++++++++++++++++------ VECTO/MODcalc/cPower.vb | 78 +++++++++++++++----------------------- VECTO/MODcalc/cVh.vb | 6 ++- VECTO/cDEV.vb | 2 + 5 files changed, 107 insertions(+), 63 deletions(-) diff --git a/VECTO Changelog.txt b/VECTO Changelog.txt index 944eaa0ba8..c87911b5f0 100644 --- a/VECTO Changelog.txt +++ b/VECTO Changelog.txt @@ -21,8 +21,8 @@ VECTO x.x (current source - next release) o Engages if Pwheel < 0 o Disengages if Underspeed is reached. - Improved gear shift model for torque converter -- Updates in torque converter IN DEVELOPMENT - +- Updates in torque converter [IN DEVELOPMENT] +- Look-Ahead Coasting now uses real coasting also if road gradient > 0 which means the coasting deceleration can be so high that no braking is necessary. In this case the braking phase will be ommitted and the total deceleration time can be shorter than expected by the given target coasting deceleration. diff --git a/VECTO/Input Files/cGBX.vb b/VECTO/Input Files/cGBX.vb index f8d9b575a6..8936d6d9bd 100644 --- a/VECTO/Input Files/cGBX.vb +++ b/VECTO/Input Files/cGBX.vb @@ -48,7 +48,7 @@ Public Class cGBX Public TC_PeBrake As Single Public TCMout As Single Public TCnout As Single - + Public TCmustReduce As Boolean Public Sub New() @@ -275,7 +275,7 @@ Public Class cGBX End Function - Public Function TCiteration(ByVal nUout As Single, ByVal PeOut As Single) As Boolean + Public Function TCiteration(ByVal nUout As Single, ByVal PeOut As Single, ByVal t As Integer) As Boolean Dim nUin As Single Dim Mout As Single Dim VZ As Integer @@ -289,9 +289,10 @@ Public Class cGBX Dim MsgSrc As String - MsgSrc = "GBX/TCiteration" + MsgSrc = "GBX/TCiteration/t= " & t TC_PeBrake = 0 + TCmustReduce = False 'Dim nUmin As Single 'Dim nUmax As Single @@ -304,23 +305,53 @@ Public Class cGBX 'nUmax = nnormTonU(GBX.fGSnnUp(Mout)) 'Start values: Estimate torque converter state - nUin = Math.Min(VEH.nNenn, nUout * 2) + 'nUin = Math.Min(VEH.nNenn, nUout * 2) + If t = 0 Then + nUin = nUout + Else + nUin = MODdata.nU(t - 1) + End If 'If nUin > nUmax Then nUin = nUmax 'If nUin < nUmin Then nUin = nUmin - nUstep = DEV.TCnUstep - VZ = 1 - lastErr = 99999 - nu = nUout / nUin + + If nu > TCnu(TCdim) Then + nu = TCnu(TCdim) + nUin = nUout / nu + ElseIf nu < TCnu(0) Then + nu = TCnu(0) + nUin = nUout / nu + End If + mu = fTCmu(nu) MoutCalc = fTCtorque(nu, nUin) * mu + nUstep = DEV.TCnUstep + + If MoutCalc > Mout Then + VZ = -1 + Else + VZ = 1 + End If + + lastErr = 99999 + 'Iteration Do While Math.Abs(1 - MoutCalc / Mout) > DEV.TCiterPrec And nUstep > DEV.TCnUstepMin +lb10: nUin += VZ * nUstep nu = nUout / nUin + + If nu > TCnu(TCdim) Or nu < TCnu(0) Then + nUin -= VZ * nUstep + nUstep /= 2 + VZ *= -1 + GoTo lb10 + End If + + mu = fTCmu(nu) MoutCalc = fTCtorque(nu, nUin) * mu If Math.Abs(1 - MoutCalc / Mout) > lastErr Then @@ -330,24 +361,49 @@ Public Class cGBX lastErr = Math.Abs(1 - MoutCalc / Mout) Loop + If nUin < VEH.nLeerl Then MODdata.ModErrors.TCextrapol = "" nUin = VEH.nLeerl nu = nUout / nUin + + If nu > TCnu(TCdim) Then + nu = TCnu(TCdim) + nUin = nUout / nu + ElseIf nu < TCnu(0) Then + + WorkerMsg(tMsgID.Err, "Torque converter creeping not possible with current TC characteristics!", MsgSrc) + Return False + + 'nu = TCnu(0) + 'nUin = nUout / nu + End If + mu = fTCmu(nu) MoutCalc = fTCtorque(nu, nUin) * mu + End If + + + If Math.Abs(1 - MoutCalc / Mout) > DEV.TCiterPrec Then + If MoutCalc < Mout Then - WorkerMsg(tMsgID.Err, "MoutCalc < Mout while nUin = nIdle!", MsgSrc) - Return False - End If + + + If MoutCalc > 0 Then TCmustReduce = True + + Else + + TC_PeBrake = nMtoPe(nUout, Mout - MoutCalc) - TC_PeBrake = nMtoPe(nUout, Mout - MoutCalc) + + End If End If + TCMin = MoutCalc / mu TCnUin = nUin diff --git a/VECTO/MODcalc/cPower.vb b/VECTO/MODcalc/cPower.vb index 872dbd8140..f388d0dbf6 100644 --- a/VECTO/MODcalc/cPower.vb +++ b/VECTO/MODcalc/cPower.vb @@ -39,6 +39,9 @@ Public Class cPower Private LastGearChange As Integer Private LastClutch As tEngClutch + Public Positions As New List(Of Short) + + Public Sub New() bHEVinit = False bHorEVinit = False @@ -407,7 +410,6 @@ lb10: Dim nU As Single Dim nn As Single Dim vCoasting As Single - Dim Positions As New List(Of Short) Dim Vmax As Single Dim Vmin As Single Dim Tlookahead As Integer @@ -424,6 +426,7 @@ lb10: Dim MsgSrc As String + MsgSrc = "Power/PreRun" 'Check Input @@ -442,6 +445,8 @@ lb10: Gvorg = DRI.Gvorg Nvorg = DRI.Nvorg + Positions = New List(Of Short) + 'Generate Positions List For i = 0 To MODdata.tDim Positions.Add(0) @@ -634,7 +639,7 @@ lb10: If Vh.V(i - 1) - Vh.V(i) > 0.0001 And Not Positions(i) = 4 Then Positions(i) = 1 Next - 'Mark Look-Ahead Coasting Positions + 'Look-Ahead Coasting i = MODdata.tDim + 1 Do i -= 1 @@ -688,7 +693,7 @@ lb10: 'If Vrollout < Vist Then Vh.SetSpeed(j, vCoasting) Positions(j) = 3 - Vh.NoDistCorr(j) = True + ' Vh.NoDistCorr(j) = True Else Exit For End If @@ -701,35 +706,6 @@ lb10: Loop Until LookAheadDone Or i = 0 - 'Correct distance error - 'If t - 1 > 0 Then - ' DistError = 0 - ' For i = t To i0 - ' DistError += (Vh.Vsoll(i) - Vh.V(i)) - ' Next - - ' DistError0 = DistError - - ' Do While DistError - Vh.V(t) > 0 'Math.Abs(DistError - Vh.V(t - 1)) < Math.Abs(DistError) - ' Vh.DuplicatePreRun(t - 1) - ' DistError -= Vh.V(t) - ' MODdata.tDim += 1 - ' Loop - - - - ' 'Vh.Weg(i0) += DistError0 - - ' 'For i = t To i0 - ' ' Vh.NoDistCorr(i) = True - ' 'Next - - ' 'For i = i0 To 0 Step -1 - ' ' Vh.Weg(i) -= DistError0 - ' 'Next - - 'End If - i = i0 End If @@ -949,19 +925,20 @@ lbGschw: GoTo lbGschw - '- Deceleration limit --------------------------- - 'Else - ' 'Check whether Deceleration too high - ' amax = GEN.aDesMin(Vist) - ' If amax > -0.001 Then - ' WorkerMsg(tMsgID.Err, "aDesMax(dec) invalid! v= " & Vist & ", aDesMax(dec) =" & amax, MsgSrc) - ' Return False - ' End If - ' If aist < amax - 0.0001 Then - ' Vh.SetSpeed0(jz, Vh.V0(jz) + amax) - ' GoTo lbGschw - ' End If - '---------------------------------------------------- + + ElseIf FirstSecItar Then 'this is necessary to avoid speed reduction failure + + 'Check whether Deceleration too high + amax = GEN.aDesMin(Vist) + If amax > -0.001 Then + WorkerMsg(tMsgID.Err, "aDesMax(dec) invalid! v= " & Vist & ", aDesMax(dec) =" & amax, MsgSrc) + Return False + End If + If aist < amax - 0.0001 Then + Vh.SetSpeed0(jz, Vh.V0(jz) + amax) + GoTo lbGschw + End If + End If @@ -1013,7 +990,6 @@ lbGschw: ' GoTo lbGschw 'End If - '************************************ Gear selection ************************************ If VehState0 = tVehState.Stopped Or TracIntrOn Then @@ -1233,11 +1209,17 @@ lbCheck: PaGetr = fPaG(Vist, aist) Pkup = PvorD + PlossGB + PlossDiff + PaGetr + PlossRt - If Not GBX.TCiteration(fnUout(Vist, Gear), Pkup) Then + If Not GBX.TCiteration(fnUout(Vist, Gear), Pkup, jz) Then WorkerMsg(tMsgID.Err, "TC Iteration failed!", MsgSrc & "/t= " & jz + 1) Return False End If + If GBX.TCmustReduce Then + Vh.ReduceSpeed(jz, 0.999) + FirstSecItar = False + GoTo lbGschw + End If + nn = (GBX.TCnUin - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl) Else @@ -1901,7 +1883,7 @@ lb_nOK: Dim Grad As Single - vstep = 0.1 + vstep = 5 nU = fnU(v, Gear, False) Pdrag = FLD.Pdrag((nU - VEH.nLeerl) / (VEH.nNenn - VEH.nLeerl)) diff --git a/VECTO/MODcalc/cVh.vb b/VECTO/MODcalc/cVh.vb index b7d23dbb48..b3ba12e67d 100644 --- a/VECTO/MODcalc/cVh.vb +++ b/VECTO/MODcalc/cVh.vb @@ -269,7 +269,6 @@ Public Class cVh End Sub - Public Sub SetMaxAcc(ByVal t As Integer) Dim a As Single Dim v As Single @@ -430,6 +429,8 @@ Public Class cVh lVairBeta.Insert(t, lVairBeta(t)) End If + MODdata.Px.Positions.Insert(t, MODdata.Px.Positions(t)) + MODdata.Duplicate(t) If PHEMmode = tPHEMmode.ModeADVANCE Then @@ -505,6 +506,9 @@ Public Class cVh lVairBeta.RemoveAt(t) End If + MODdata.Px.Positions.RemoveAt(t) + + MODdata.Cut(t) If PHEMmode = tPHEMmode.ModeADVANCE Then diff --git a/VECTO/cDEV.vb b/VECTO/cDEV.vb index d938b10928..035d0cee1a 100644 --- a/VECTO/cDEV.vb +++ b/VECTO/cDEV.vb @@ -154,6 +154,7 @@ Public Class cDEV Conf0.SingleVal = -0.000001 MyOptions.Add("negFCerr", Conf0) + '**************************** END: Parameters Configuration '***************************** '***************************************************************************************** '***************************************************************************************** @@ -175,6 +176,7 @@ Public Class cDEV negFCerr = MyOptions("negFCerr").SingleVal + End Sub 'Demo for Delegate Function -- GitLab