mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
AI does not fear SlippingWheels when driving ElectricInductionMotor vehicle + fix for adhesion calculation when slipping
This commit is contained in:
committed by
tmj-fstate
parent
73af767312
commit
a767e36be8
@@ -5544,7 +5544,7 @@ TController::UpdateSituation(double dt) {
|
||||
// część wykonawcza tylko dla AI, dla człowieka jedynie napisy
|
||||
|
||||
// zapobieganie poslizgowi u nas
|
||||
if (mvControlling->SlippingWheels) {
|
||||
if (mvControlling->SlippingWheels && mvControlling->EngineType != TEngineType::ElectricInductionMotor) {
|
||||
|
||||
if( false == mvControlling->DecScndCtrl( 2 ) ) {
|
||||
// bocznik na zero
|
||||
|
||||
@@ -4001,12 +4001,18 @@ void TMoverParameters::ComputeTotalForce(double dt) {
|
||||
&& ( std::abs(Fwheels) > TotalMassxg * Adhesive( RunningTrack.friction ) ) ) {
|
||||
SlippingWheels = true;
|
||||
}
|
||||
if( true == SlippingWheels ) {
|
||||
double temp_nrot = nrot;
|
||||
if (true == SlippingWheels) {
|
||||
|
||||
double temp_nrot = ComputeRotatingWheel(Fwheels -
|
||||
Sign(nrot * M_PI * WheelDiameter - V) *
|
||||
Adhesive(RunningTrack.friction) * TotalMassxg,
|
||||
dt, nrot);
|
||||
temp_nrot = ComputeRotatingWheel(Fwheels - Sign(nrot * M_PI * WheelDiameter - V) *
|
||||
Adhesive(RunningTrack.friction) * TotalMassxg, dt, nrot);
|
||||
if (Sign(nrot * M_PI * WheelDiameter - V)*Sign(temp_nrot * M_PI * WheelDiameter - V) < 0)
|
||||
{
|
||||
SlippingWheels = false;
|
||||
temp_nrot = V / M_PI / WheelDiameter;
|
||||
}
|
||||
}
|
||||
if (true == SlippingWheels) {
|
||||
Fwheels = Sign(temp_nrot * M_PI * WheelDiameter - V) * TotalMassxg * Adhesive(RunningTrack.friction);
|
||||
if (Fwheels*Sign(V)>0)
|
||||
{
|
||||
@@ -4025,12 +4031,6 @@ void TMoverParameters::ComputeTotalForce(double dt) {
|
||||
{
|
||||
WheelFlat = sqrt(square(WheelFlat) + abs(Fwheels) / NAxles*Vel*0.000002);
|
||||
}
|
||||
if (Sign(nrot * M_PI * WheelDiameter - V)*Sign(temp_nrot * M_PI * WheelDiameter - V) < 0)
|
||||
{
|
||||
SlippingWheels = false;
|
||||
temp_nrot = V / M_PI / WheelDiameter;
|
||||
}
|
||||
|
||||
|
||||
nrot = temp_nrot;
|
||||
}
|
||||
@@ -5368,9 +5368,9 @@ double TMoverParameters::v2n(void)
|
||||
|
||||
n = V / (M_PI * WheelDiameter); // predkosc obrotowa wynikajaca z liniowej [obr/s]
|
||||
deltan = n - nrot; //"pochodna" prędkości obrotowej
|
||||
if (SlippingWheels)
|
||||
/* if (SlippingWheels)
|
||||
if (std::abs(deltan) < 0.001)
|
||||
SlippingWheels = false; // wygaszenie poslizgu
|
||||
SlippingWheels = false; // wygaszenie poslizgu */ //poslizg jest w innym miejscu wygaszany też
|
||||
if (SlippingWheels) // nie ma zwiazku z predkoscia liniowa V
|
||||
{ // McZapkie-221103: uszkodzenia kol podczas poslizgu
|
||||
if (deltan > dmgn)
|
||||
|
||||
@@ -820,7 +820,8 @@ debug_panel::update_section_ai( std::vector<text_line> &Output ) {
|
||||
+ ", slope: " + to_string( mechanik.fAccGravity + 0.001f, 2 ) + " (" + ( mechanik.fAccGravity > 0.01 ? "\\" : ( mechanik.fAccGravity < -0.01 ? "/" : "-" ) ) + ")"
|
||||
+ "\n brake threshold: " + to_string( mechanik.fAccThreshold, 2 )
|
||||
+ ", delays: " + to_string( mechanik.fBrake_a0[ 0 ], 2 )
|
||||
+ "+" + to_string( mechanik.fBrake_a1[ 0 ], 2 );
|
||||
+ "+" + to_string( mechanik.fBrake_a1[ 0 ], 2 )
|
||||
+ "\n virtual brake position: " + to_string(mechanik.BrakeCtrlPosition, 2);
|
||||
|
||||
Output.emplace_back( textline, Global.UITextColor );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user