16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 20:39:18 +02:00

Additional fetures for Voith-like gearbox, small fix for AI

This commit is contained in:
Królik Uszasty
2019-06-16 22:57:22 +02:00
parent 82ab1c6834
commit 7ef50b67ee
3 changed files with 44 additions and 27 deletions

View File

@@ -3546,30 +3546,29 @@ void TController::SetTimeControllers()
//5.1. Digital controller in DMUs with hydro //5.1. Digital controller in DMUs with hydro
if ((mvControlling->EngineType == TEngineType::DieselEngine) && (mvControlling->EIMCtrlType == 3)) if ((mvControlling->EngineType == TEngineType::DieselEngine) && (mvControlling->EIMCtrlType == 3))
{ {
if( mvControlling->Vel > 10 ) {
DizelPercentage_Speed = DizelPercentage; DizelPercentage_Speed = DizelPercentage; //wstepnie procenty
auto const Factor{ 10 * ( mvControlling->Vmax ) / ( mvControlling->Vmax + 3 * mvControlling->Vel ) }; auto MinVel{ std::min(mvControlling->hydro_TC_LockupSpeed, mvControlling->Vmax / 6) }; //minimal velocity
auto DesiredPercentage{ clamp( if (VelDesired > MinVel) //more power for faster ride
( VelDesired > mvControlling->Vel ? {
( VelDesired - mvControlling->Vel ) / Factor : auto const Factor{ 10 * (mvControlling->Vmax) / (mvControlling->Vmax + 3 * mvControlling->Vel) };
0 ), auto DesiredPercentage{ clamp(
0.0, 1.0 ) }; (VelDesired > mvControlling->Vel ?
if( ( VelDesired < 0.5 * mvControlling->Vmax ) (VelDesired - mvControlling->Vel) / Factor :
&& ( VelDesired - mvControlling->Vel < 10 ) ) { 0),
DesiredPercentage = std::min( DesiredPercentage, 0.75 ); 0.0, 1.0) }; //correction for reaching desired velocity
} if ((VelDesired < 0.5 * mvControlling->Vmax) //low velocity and reaching desired
DizelPercentage_Speed = std::round( DesiredPercentage * DizelPercentage ); && (VelDesired - mvControlling->Vel < 10)) {
if( VelDesired < std::min( mvControlling->hydro_TC_LockupSpeed, mvControlling->Vmax / 5 ) ) { DesiredPercentage = std::min(DesiredPercentage, 0.75);
DizelPercentage = std::min( DizelPercentage_Speed, 1 ); }
} DizelPercentage_Speed = std::round(DesiredPercentage * DizelPercentage);
} }
else { else
// HACK: workaround for the default mode breaking at low speeds {
DizelPercentage = DizelPercentage_Speed = ( AccDesired > 0.0 ? 100 : 0 ); DizelPercentage_Speed = std::min(DizelPercentage, mvControlling->Vel > 0.99 * VelDesired ? 1 : 0);
} }
auto const DizelActualPercentage { 100.4 * mvControlling->eimic_real }; auto const DizelActualPercentage { int(100.4 * mvControlling->eimic_real) };
auto const PosInc { mvControlling->MainCtrlPosNo }; auto const PosInc { mvControlling->MainCtrlPosNo };
auto PosDec { 0 }; auto PosDec { 0 };
@@ -3587,7 +3586,7 @@ void TController::SetTimeControllers()
&& ( ( DizelActualPercentage - DizelPercentage_Speed > 50 ) && ( ( DizelActualPercentage - DizelPercentage_Speed > 50 )
|| ( ( DizelPercentage_Speed == 0 ) || ( ( DizelPercentage_Speed == 0 )
&& ( DizelActualPercentage > 10 ) ) ) ) { && ( DizelActualPercentage > 10 ) ) ) ) {
//pozycję wczesniej powinno byc szybkie zejscie, jeśli trzeba //one position earlier should be fast decreasing
PosDec -= 1; PosDec -= 1;
} }
auto const DesiredPos { ( auto const DesiredPos { (

View File

@@ -1039,7 +1039,10 @@ public:
/* dizel_auto_min, dizel_auto_max: real; {predkosc obrotowa przelaczania automatycznej skrzyni biegow*/ /* dizel_auto_min, dizel_auto_max: real; {predkosc obrotowa przelaczania automatycznej skrzyni biegow*/
double dizel_nmax_cutoff = 0.0; /*predkosc obrotowa zadzialania ogranicznika predkosci*/ double dizel_nmax_cutoff = 0.0; /*predkosc obrotowa zadzialania ogranicznika predkosci*/
double dizel_nmin = 0.0; /*najmniejsza dopuszczalna predkosc obrotowa*/ double dizel_nmin = 0.0; /*najmniejsza dopuszczalna predkosc obrotowa*/
double dizel_nmin_hdrive = 0.0; /*najmniejsza dopuszczalna predkosc obrotowa w czasie jazdy na hydro */
double dizel_nmin_hdrive_factor = 0.0; /*wspolczynnik wzrostu obrotow minimalnych hydro zaleznosci od zadanego procentu*/
double dizel_minVelfullengage = 0.0; /*najmniejsza predkosc przy jezdzie ze sprzeglem bez poslizgu*/ double dizel_minVelfullengage = 0.0; /*najmniejsza predkosc przy jezdzie ze sprzeglem bez poslizgu*/
double dizel_maxVelANS = 3.0; /*predkosc progowa rozlaczenia przetwornika momentu*/
double dizel_AIM = 1.0; /*moment bezwladnosci walu itp*/ double dizel_AIM = 1.0; /*moment bezwladnosci walu itp*/
double dizel_engageDia = 0.5; double dizel_engageMaxForce = 6000.0; double dizel_engagefriction = 0.5; /*parametry sprzegla*/ double dizel_engageDia = 0.5; double dizel_engageMaxForce = 6000.0; double dizel_engagefriction = 0.5; /*parametry sprzegla*/
double engagedownspeed = 0.9; double engagedownspeed = 0.9;

View File

@@ -6513,7 +6513,7 @@ bool TMoverParameters::dizel_Update(double dt) {
double TMoverParameters::dizel_fillcheck(int mcp) double TMoverParameters::dizel_fillcheck(int mcp)
{ {
auto realfill { 0.0 }; auto realfill { 0.0 };
auto reg_factor { 0.98 }; auto nreg_min { dizel_nmin * 0.98 };
if( ( true == Mains ) if( ( true == Mains )
&& ( MainCtrlPosNo > 0 ) && ( MainCtrlPosNo > 0 )
@@ -6531,7 +6531,14 @@ double TMoverParameters::dizel_fillcheck(int mcp)
if (EIMCtrlType > 0) if (EIMCtrlType > 0)
{ {
realfill = std::max(0.0, eimic_real); realfill = std::max(0.0, eimic_real);
reg_factor = 1.0; if (eimic_real>0 && !hydro_TC_Lockup)
{
nreg_min = dizel_nmin_hdrive + eimic_real * dizel_nmin_hdrive_factor;
}
else
{
nreg_min = dizel_nmin;
}
} }
else else
realfill = RList[mcp].R; realfill = RList[mcp].R;
@@ -6580,7 +6587,7 @@ double TMoverParameters::dizel_fillcheck(int mcp)
realfill = 0; realfill = 0;
if (enrot < nreg) //pod predkoscia regulatora dawka zadana if (enrot < nreg) //pod predkoscia regulatora dawka zadana
realfill = realfill; realfill = realfill;
if ((enrot < dizel_nmin * reg_factor)&&(RList[mcp].R>0.001)) //jesli ponizej biegu jalowego i niezerowa dawka, to dawaj pelna if ((enrot < nreg_min)&&(RList[mcp].R>0.001)) //jesli ponizej biegu jalowego i niezerowa dawka, to dawaj pelna
realfill = 1; realfill = 1;
} }
} }
@@ -6629,7 +6636,7 @@ double TMoverParameters::dizel_Momentum(double dizel_fill, double n, double dt)
if ((IsPower) && (Mains) && (enrot>dizel_nmin*0.9)) if ((IsPower) && (Mains) && (enrot>dizel_nmin*0.9))
hydro_TC_Fill += hydro_TC_FillRateInc * dt; hydro_TC_Fill += hydro_TC_FillRateInc * dt;
//oproznianie przetwornika //oproznianie przetwornika
if (((!IsPower) && (Vel<3)) if (((!IsPower) && (Vel<dizel_maxVelANS))
|| (!Mains) || (!Mains)
|| (enrot<dizel_nmin*0.8)) || (enrot<dizel_nmin*0.8))
hydro_TC_Fill -= hydro_TC_FillRateDec * dt; hydro_TC_Fill -= hydro_TC_FillRateDec * dt;
@@ -9144,6 +9151,13 @@ void TMoverParameters::LoadFIZ_Engine( std::string const &Input ) {
extract_value( dizel_nmin, "nmin", Input, "" ); extract_value( dizel_nmin, "nmin", Input, "" );
dizel_nmin /= 60.0; dizel_nmin /= 60.0;
extract_value(dizel_nmin_hdrive, "nmin_hdrive", Input, "");
dizel_nmin_hdrive /= 60.0;
if (dizel_nmin_hdrive == 0.0) {
dizel_nmin_hdrive = dizel_nmin;
}
extract_value(dizel_nmin_hdrive_factor, "nmin_hdrive_factor", Input, "");
dizel_nmin_hdrive_factor /= 60.0;
// TODO: unify naming scheme and sort out which diesel engine params are used where and how // TODO: unify naming scheme and sort out which diesel engine params are used where and how
extract_value( nmax, "nmax", Input, "" ); extract_value( nmax, "nmax", Input, "" );
nmax /= 60.0; nmax /= 60.0;
@@ -9178,6 +9192,7 @@ void TMoverParameters::LoadFIZ_Engine( std::string const &Input ) {
extract_value(hydro_TC_TorqueOutOut, "TC_TOO", Input, ""); extract_value(hydro_TC_TorqueOutOut, "TC_TOO", Input, "");
extract_value(hydro_TC_LockupSpeed, "TC_LS", Input, ""); extract_value(hydro_TC_LockupSpeed, "TC_LS", Input, "");
extract_value(hydro_TC_UnlockSpeed, "TC_ULS", Input, ""); extract_value(hydro_TC_UnlockSpeed, "TC_ULS", Input, "");
extract_value(dizel_maxVelANS, "MaxVelANS", Input, "");
extract_value(hydro_R, "IsRetarder", Input, ""); extract_value(hydro_R, "IsRetarder", Input, "");
if (true == hydro_R) { if (true == hydro_R) {