Elvas Tower: Trying to fix starting friction myself - Elvas Tower

Jump to content

  • 7 Pages +
  • « First
  • 3
  • 4
  • 5
  • 6
  • 7
  • You cannot start a new topic
  • You cannot reply to this topic

Trying to fix starting friction myself Any advice is appreciated here Rate Topic: -----

#41 User is offline   NickonWheels 

  • Conductor
  • Group: Status: Active Member
  • Posts: 327
  • Joined: 05-December 19
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 30 January 2020 - 08:44 AM

Some pictures for comparison of the older code section and the addition working side by side (no further code changes yet)

At zero speed the friction values of the first two ES44s are by way of the older code using ORTSBearingType ( Low ), which looks reasonable for such a modern engine. the third engine uses the two new lines as described before.
--212.5 us tons in weight / 6 axles / 13.24 square meters of frontal area / modern roller bearings

The three Davis lines are the same with all three engines. All six lines at once
ORTSDavis_A ( 2606.907023 )
ORTSDavis_B ( 31.875 )
ORTSDavis_C ( 1.607582 )
ORTSBearingType ( Low )
ORTSStandstillFriction ( 3506.25 )
ORTSMergeSpeed ( 0.870116 )




Here the train just met the merge speed of the third engine, lower than the ubiquitos 5 mph of old; ORTSMergeSpeed ( 0.870116 ) means about 1.9464 mph. The values of the other engines are still on their way down...



Above 5 mph all three engines behave the same as they have the same Davis values (though the first has frontal resistance).

#42 User is offline   NickonWheels 

  • Conductor
  • Group: Status: Active Member
  • Posts: 327
  • Joined: 05-December 19
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 01 February 2020 - 04:37 AM

Back here after reviewing the code...

I just added the function of the friction rising back up when slowing down below the inserted merge speed of a given vehicle, just like in the unstable U20xx versions but sadly not in the X... versions.

For comparison the current friction code starts like
                if (AbsSpeedMpS > MpS.FromMpH(5.05f))     // if speed above 5 mph then turn off low speed calculations
                    IsLowSpeed = false;
                else if (AbsSpeedMpS < MpS.FromMpH(4.95f))
                    IsLowSpeed = true;
                if (AbsSpeedMpS <= 0.0)
                    IsLowSpeed = true;


And the extension...
                    if (AbsSpeedMpS > MpS.FromMpH(MergeSpeedMpS / 1.609344f * 3.6f))     // if speed above merge speed then turn off low speed calculations
                        IsBelowMergeSpeed = false;
                    else if (AbsSpeedMpS < MpS.FromMpH(MergeSpeedMpS / 1.60934f * 3.6f))
                        IsBelowMergeSpeed = true;
                    if (AbsSpeedMpS <= 0.0)
                        IsBelowMergeSpeed = true;


The effect is essential the same in the end. I know dividing a variable by unit of speed conversion factors looks a bit awkward but is was obviously neccesary to make it work, but I guess I´m repeating myself here...

#43 User is offline   NickonWheels 

  • Conductor
  • Group: Status: Active Member
  • Posts: 327
  • Joined: 05-December 19
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 02 February 2020 - 08:09 AM

The next step is to include ORTS freight animation weight differences, for example FullORTSStandstillFriction...

I think I have most of it done but there are some anomalies; ORTS takes the empty weight standstill friction and merge speed when the tender is full and also messes up the Davis A value as it uses some value in between.

If there´s anyone interested in this here



Sadly this subject seemingly had run out of attention and admiration, left me thinking whether ORTS is as open as intended...

#44 User is offline   copperpen 

  • Executive Vice President
  • Group: Status: Elite Member
  • Posts: 3,139
  • Joined: 08-August 05
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 03 February 2020 - 03:45 AM

Open Rails is open source, but that does not mean any code is accepted into the main trunk without validation. How does your code output compare with published real world resistance curves?.

#45 User is offline   NickonWheels 

  • Conductor
  • Group: Status: Active Member
  • Posts: 327
  • Joined: 05-December 19
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 03 February 2020 - 08:25 AM

View Postcopperpen, on 03 February 2020 - 03:45 AM, said:

How does your code output compare with published real world resistance curves?


The code I´m working on and which values are used in the end are two different things. The code addition should only give users the chance of inserting values that seem to be appropriate. Though it´s hard to know or calculate such values but the current ORTS friction model serves as a good indicator, at least when talking about starting friction. Of course calculating merge speed is more than subjective.

As said before the modification I´m working on is just an extension, everything working at the moment would still work uninterrupted and as before, only with a nice addition you would just have to use if preferable. Admiring traction force curves and what is possible with them really out forward the experience when driving so it is just natural to have similar chances about resistance. I´m not saying the current model on this could not be modified; indeed I have some ideas on how to fix this but in the end I don´t made my personal version just for fun. I´m rather serious about this because it´s a serious problem and I´m not the only one who thinks the current model on starting friction is a problem. Though it´s not the only issue with ORTS so some effort is reasonable in order to move on to the next issue, whatever it is.

At last I need all the help I can get so it would be nice to have the chance of helping you to make ORTS more realistic.

#46 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,986
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 07 February 2020 - 11:49 PM

View PostNickonWheels, on 06 February 2020 - 09:25 AM, said:

Hi Carlo

as there is low interest in bug solutions I offer you the new starting resistance calculation I made; as told numerous times before it will not change anything, just adding two new lines. Also included is the fix for resistance going back up when decelerating below merge speed, originally done by Peter Newell, don´t know whether you already use this fix. Either I don´t know what sections of the file are maybe to be overlooked as only certain parts are about said addition. Sadly I could not get it to include ORTS weight reducing freight animation settings as I would need more advise on how to do (and because there are some other issues with it), so it´s best suited for wagons. For how to use I have a readme...

Attachment MSTSWagon.txt
Attachment new friction section readme.txt

Hi,
as a general policy I try not to interfere to the physics code that Peter Newell generates, because I'm not at all an expert in that field, so I won't insert your code suggestion in OR NewYear MG, at least at the moment, sorry.
If you would like to make your code changes accessible to a broader range of people, I suggest you to zip the Orts.Simulation.dll and Orts.Simulation.pdb files that you obtain inserting your changes in the latest Unstable, or Testing, or stable, or OR NewYear MG version and to attach such zipped file here (obviously saying from which OR version it is derived). So interested people can easily get (after having backed up the original files) an OR version with your changes, make their tests and report here.

#47 User is offline   NickonWheels 

  • Conductor
  • Group: Status: Active Member
  • Posts: 327
  • Joined: 05-December 19
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 08 February 2020 - 01:37 AM

Thanks, I will be back after some setup struggles with VisualStudio, hopefully...

While testing my private version ORTS often crashes, sometimes even without the typical error log attached to it. And when this is the case it teels me some errors outside of the friction code addition, I guess it works after all but ORTS is still quite unstable in general (even though I know Trainz is horribly unstable in the most annoying cases). You know, distination array being too long or somethin...

Talking about ORTS freight animation there is an issue with Davis A. While testing Scott´s brilliant 2-8-0 with the original Davis friction code (and my sadly-non-working addition which I deleted angrily), having FullORTSDavis_A ( 2242.943641 ) & EmptyORTSDavis_A ( 1044.365861 ) when getting past 5mph standard merge speed the HUD shows about 1800 newtons with a full tender. This cannot be true, the value should be above 2250 at least.

Comment ( ##### FRICTION  - FREIGHT ANIMATION ##### )
comment ( 146.9 & 68.4 us tons / 6 axles / 12.26 square meters frontal area / oil-lubricated friction bearings )	
	ORTSFreightAnims 
	( 
		WagonEmptyWeight( 68.4t-us )
		EmptyMaxBrakeForce ( 68.4kN )    
		EmptyMaxHandbrakeForce ( 50kN ) 
		EmptyORTSDavis_A ( 1044.365861 ) 
		EmptyORTSDavis_B ( 10.26 ) 
		EmptyORTSDavis_C ( 1.468625 ) 
		EmptyORTSStandstillFriction ( 6498 )
		EmptyORTSMergeSpeed ( 0.507346 )
		EmptyCentreOfGravity_Y ( 1.4 ) 

		FreightAnimContinuous 
		( 
			FreightWeightWhenFull( 146.9t-us ) 
			FullMaxBrakeForce ( 146.9kN )
			FullMaxHandbrakeForce ( 50kN ) 
			FullORTSDavis_A ( 2242.943641 ) 
			FullORTSDavis_B ( 22.035 ) 
			FullORTSDavis_C ( 1.468625 ) 
			FullORTSStandstillFriction ( 13955.5 )
			FullORTSMergeSpeed ( 0.743511 )
			FullCentreOfGravity_Y ( 1.8 ) 
		) 
	)


#48 User is offline   NickonWheels 

  • Conductor
  • Group: Status: Active Member
  • Posts: 327
  • Joined: 05-December 19
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 09 February 2020 - 02:25 AM

After VS issue got fixed I downloaded the source again and took no code changes, just compiled it in order to observe whether it was up to my code changes which may caused ORTS to crash after some distance on CN Ruel Sub. Now it still crashes at the same time as it did with changes in it.


Sometimes this appears but sometimes ORTS just crashes without log. A test route works fine but Ruel Sub does not, though the route works with the U/X versions, so there must be an error with the downloadable code.

#49 User is offline   copperpen 

  • Executive Vice President
  • Group: Status: Elite Member
  • Posts: 3,139
  • Joined: 08-August 05
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 09 February 2020 - 03:03 PM

I suggest uploading a zip of the complete log, not just the final error message,

#50 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,986
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 09 February 2020 - 11:07 PM

Two further points:
1) build in debug mode, so the code lines where the program crashes are displayed
2) from which version of the code have you built: stable or testing?

  • 7 Pages +
  • « First
  • 3
  • 4
  • 5
  • 6
  • 7
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users