|
|
|
@@ -337,7 +337,7 @@ double physics::Vehicle::DieselElectricTargetRevolutions()
|
|
|
|
|
double tmp;
|
|
|
|
|
|
|
|
|
|
if (EIMCtrlType > 0) // sterowanie cyfrowe
|
|
|
|
|
tmp = (DElist[0].RPM + (DElist[MainCtrlPosNo].RPM - DElist[0].RPM) * std::max(0.0, eimic_real)) / 60.0;
|
|
|
|
|
tmp = (DElist[0].RPM + (DElist[MainCtrlPosNo].RPM - DElist[0].RPM) * std::max(0.0, eimicReal)) / 60.0;
|
|
|
|
|
else
|
|
|
|
|
tmp = DElist[protection.PressureSwitchTripped() ? MainCtrlNoPowerPos() : mainCtrlPos].RPM / 60.0;
|
|
|
|
|
|
|
|
|
@@ -467,7 +467,7 @@ void physics::Vehicle::DieselElectricShuntForce(double const tmpV, double &tmp)
|
|
|
|
|
// voltage and current limits too. returns the power the generator gives
|
|
|
|
|
double physics::Vehicle::DieselElectricDigitalForce(double const tmpV, double &tempUmax, double &tempImax)
|
|
|
|
|
{
|
|
|
|
|
auto eimic_positive = std::max(0.0, eimic_real);
|
|
|
|
|
auto eimic_positive = std::max(0.0, eimicReal);
|
|
|
|
|
auto const rpmratio{EngineRPMRatio()};
|
|
|
|
|
tempImax = DElist[MainCtrlPosNo].Imax * eimic_positive;
|
|
|
|
|
tempUmax = DElist[MainCtrlPosNo].Umax * std::min(eimic_positive, rpmratio);
|
|
|
|
@@ -527,7 +527,7 @@ void physics::Vehicle::DieselElectricGenerator(double const tmp, double const te
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
auto tempMCP = EIMCtrlType > 0 ? 1 + 99 * std::max(1.0, eimic_real) : mainCtrlPos;
|
|
|
|
|
auto tempMCP = EIMCtrlType > 0 ? 1 + 99 * std::max(1.0, eimicReal) : mainCtrlPos;
|
|
|
|
|
auto tempMCPN = EIMCtrlType > 0 ? 100 : MainCtrlPosNo;
|
|
|
|
|
// charakterystyka pradnicy obcowzbudnej (elipsa) - twierdzenie Pitagorasa
|
|
|
|
|
EngineVoltage = std::sqrt(std::abs(square(tempUmax) - square(tempUmax * Im / tempImax))) * (tempMCP - 1) + (1.0 - Im / tempImax) * tempUmax * (tempMCPN - tempMCP);
|
|
|
|
@@ -570,7 +570,7 @@ double physics::Vehicle::dieselelectric_dynamic_brake_demand() const
|
|
|
|
|
switch (DEDynamicBrake.source)
|
|
|
|
|
{
|
|
|
|
|
case diesel_electric_dynamic_brake::control::controller:
|
|
|
|
|
return std::clamp(-eimic_real, 0.0, 1.0);
|
|
|
|
|
return std::clamp(-eimicReal, 0.0, 1.0);
|
|
|
|
|
case diesel_electric_dynamic_brake::control::lever:
|
|
|
|
|
return DynamicBrakeRatio();
|
|
|
|
|
default:
|
|
|
|
@@ -608,7 +608,7 @@ double physics::Vehicle::dieselelectric_dynamic_brake_limit() const
|
|
|
|
|
void physics::Vehicle::update_dieselelectric_dynamic_brake(double const dt)
|
|
|
|
|
{
|
|
|
|
|
auto &brake{DEDynamicBrake};
|
|
|
|
|
auto const nopower{brake.source == diesel_electric_dynamic_brake::control::controller ? eimic_real <= 0.0 : IsMainCtrlNoPowerPos()};
|
|
|
|
|
auto const nopower{brake.source == diesel_electric_dynamic_brake::control::controller ? eimicReal <= 0.0 : IsMainCtrlNoPowerPos()};
|
|
|
|
|
if (lineBreaker.IsClosed() && DirActive != 0 && false == FuseFlag && false == slippingWheels && nopower)
|
|
|
|
|
{
|
|
|
|
|
brake.level += std::clamp(dieselelectric_dynamic_brake_demand() - brake.level, -brake.rate * dt, brake.rate * dt);
|
|
|
|
@@ -700,10 +700,10 @@ bool physics::Vehicle::dizel_AutoGearCheck(void)
|
|
|
|
|
auto OK{false};
|
|
|
|
|
|
|
|
|
|
auto const VelUp{(motor_param(ScndCtrlActualPos).mfi0 != 0.0 ?
|
|
|
|
|
motor_param(ScndCtrlActualPos).mfi0 + (motor_param(ScndCtrlActualPos).mfi - motor_param(ScndCtrlActualPos).mfi0) * std::max(0.0, eimic_real) :
|
|
|
|
|
motor_param(ScndCtrlActualPos).mfi0 + (motor_param(ScndCtrlActualPos).mfi - motor_param(ScndCtrlActualPos).mfi0) * std::max(0.0, eimicReal) :
|
|
|
|
|
motor_param(ScndCtrlActualPos).mfi)};
|
|
|
|
|
|
|
|
|
|
auto const VelDown{(motor_param(ScndCtrlActualPos).fi0 != 0.0 && eimic_real <= 0.0 ? motor_param(ScndCtrlActualPos).fi0 : motor_param(ScndCtrlActualPos).fi)};
|
|
|
|
|
auto const VelDown{(motor_param(ScndCtrlActualPos).fi0 != 0.0 && eimicReal <= 0.0 ? motor_param(ScndCtrlActualPos).fi0 : motor_param(ScndCtrlActualPos).fi)};
|
|
|
|
|
|
|
|
|
|
if (motor_param(ScndCtrlActualPos).AutoSwitch && lineBreaker.IsClosed())
|
|
|
|
|
{
|
|
|
|
@@ -832,7 +832,7 @@ void physics::Vehicle::dizel_ClutchByIntegratedController()
|
|
|
|
|
{
|
|
|
|
|
if (diesel.automaticGearShift == 0)
|
|
|
|
|
{
|
|
|
|
|
if ((torqueConverter.present && torqueConverter.fill > 0.01) || eimic_real > 0.005)
|
|
|
|
|
if ((torqueConverter.present && torqueConverter.fill > 0.01) || eimicReal > 0.005)
|
|
|
|
|
dizel_EngageSwitch(1.0);
|
|
|
|
|
else if (Vel > retarder.engageVelocity && retarder.present && retarder.fill > 0.01)
|
|
|
|
|
dizel_EngageSwitch(0.5);
|
|
|
|
@@ -984,10 +984,10 @@ double physics::Vehicle::dizel_fillcheck(int mcp, double dt)
|
|
|
|
|
double physics::Vehicle::dizel_DigitalFill(double dt)
|
|
|
|
|
{
|
|
|
|
|
double realfill;
|
|
|
|
|
realfill = std::max(0.0, std::min(eimic_real, 1 - motor_param(ScndCtrlActualPos).Isat));
|
|
|
|
|
if (eimic_real > 0.005 && !torqueConverter.lockedUp)
|
|
|
|
|
realfill = std::max(0.0, std::min(eimicReal, 1 - motor_param(ScndCtrlActualPos).Isat));
|
|
|
|
|
if (eimicReal > 0.005 && !torqueConverter.lockedUp)
|
|
|
|
|
{
|
|
|
|
|
diesel.governorMinRevolutions = std::min(diesel.governorMinRevolutions + 2.5 * dt, diesel.hydraulicMinRevolutions + eimic_real * diesel.hydraulicMinRevolutionsFactor);
|
|
|
|
|
diesel.governorMinRevolutions = std::min(diesel.governorMinRevolutions + 2.5 * dt, diesel.hydraulicMinRevolutions + eimicReal * diesel.hydraulicMinRevolutionsFactor);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@@ -1012,7 +1012,7 @@ double physics::Vehicle::dizel_GovernorFill(int const mcp, double realfill) cons
|
|
|
|
|
{
|
|
|
|
|
auto nreg{0.0};
|
|
|
|
|
if (EIMCtrlType > 0)
|
|
|
|
|
nreg = eimic_real > 0.005 ? diesel.governorMaxRevolutions : diesel.minRevolutions;
|
|
|
|
|
nreg = eimicReal > 0.005 ? diesel.governorMaxRevolutions : diesel.minRevolutions;
|
|
|
|
|
else
|
|
|
|
|
nreg = dizel_GovernorRevolutions(mcp, realfill);
|
|
|
|
|
if (enrot > nreg) // nad predkoscia regulatora zeruj dawke
|
|
|
|
@@ -1202,7 +1202,7 @@ void physics::Vehicle::hydro_TCFillCheck(double dt)
|
|
|
|
|
if (torqueConverter.present) // jesli przetwornik momentu
|
|
|
|
|
{
|
|
|
|
|
// napelnianie przetwornika
|
|
|
|
|
bool IsPower = EIMCtrlType > 0 ? eimic_real > 0.005 : MainCtrlPowerPos() > 0;
|
|
|
|
|
bool IsPower = EIMCtrlType > 0 ? eimicReal > 0.005 : MainCtrlPowerPos() > 0;
|
|
|
|
|
if (IsPower && lineBreaker.IsClosed() && enrot > diesel.minRevolutions * 0.9)
|
|
|
|
|
torqueConverter.fill += torqueConverter.fillRateIncrease * dt;
|
|
|
|
|
// oproznianie przetwornika
|
|
|
|
@@ -1266,7 +1266,7 @@ void physics::Vehicle::hydro_TCTorque()
|
|
|
|
|
|
|
|
|
|
double physics::Vehicle::dizel_MomentumRetarder(double n, double dt)
|
|
|
|
|
{
|
|
|
|
|
double RetarderRequest = lineBreaker.IsClosed() ? std::max(0.0, -eimic_real) : 0;
|
|
|
|
|
double RetarderRequest = lineBreaker.IsClosed() ? std::max(0.0, -eimicReal) : 0;
|
|
|
|
|
if (retarder.withIndividual)
|
|
|
|
|
RetarderRequest = LocalBrakeRatio();
|
|
|
|
|
if (Vel < retarder.minVelocity)
|
|
|
|
|