Jump to content

Number of 'key presses' to move EU/EP 07/08's brake lever all the way round?


Recommended Posts

I've just finished 3D printing my 'mini' EU/EP 07/08 brake lever to go with my wheel controller 

image.thumb.png.7ba19664df5467e411b71bb608c5e253.png

This is the one controller i'm having problems with converting the potentiometers rotation into key presses, as the other controllers i've made have specific notches they move between... so the arduino code simply checks when the potentiometer output goes past a set point (between 2 notches) and sends a keycode depending on the direction it's moved, and everything so far works ok (the new animations for control movements mean i need a 70 ms delay between keypresses to avoid the in sim control getting out of sync)

:

But this brake lever really needs analogue input as it does not move between notches, so the best i could do is set it so it sends a keypress for moving each time the potentiometer moves a certain distance. 

However, i've counted the key presses needed to move the brake lever in the trains from 'disabled/off to emergency' positions and back again (using a rotary encoder which sends a single keypress when moved one click... so no repeating key issues as using a keyboard) 

And i'm getting different numbers of key presses needed for the brake valve in different versions of this train. 

Someone on discord suggested framerate could play into why i'm getting different results,  but i was wondering if a dev could tell me how many key presses it should take to move the lever fully around and back, and if the number of key presses does indeed vary between the different loco variants? (and if so, why, as AFAIK it's the same brake valve in them all)

this is the data i've got so far... 

---------------------

 

EP07-174:  

114 apply
111 release

EP08-001:

109 apply
105 release


EU07-092:

123 apply
134 release


EU07-241:

106 apply
101 release


EU07-068:

112 apply
103 release

-----------------------

 

like i say, frame rate could play into this, i could only get one of them from single player and moving the lever when the train is parked in the sidings, the other variants i had to stop in an empty server and count the keypresses, but other trains came past as i was doing this, and that could have glitched things? 

 

I do have the key press for 'move brake lever to drive position' sent when my lever moves to the 'drive' notch, but with the new input system / lever animations, this only moves the lever when it is more than xx number of clicks away from the drive position, so things still get out of sync 😞

  • Like 2
Link to comment
Share on other sites

You could turn towards a solution like the Knorr D series or the Dako BS levers
Those have 9 positions for service brake and the lever clicks on every position so you know how far you pulled it back and how far the pressure will drop without looking at it
 

Basically their positions are:
Fill
Drive
Neutral
Service 1-9
Emergency
Disabled

Think you could also go with virtually predetermined positions if you could pull it off some way

Link to comment
Share on other sites

i figured frame rate played a role... it really showed this when i was driving an EP08 tonight, in Warszawa Centralna station, where if i have the mirrors in view it drops to ~5fps (from my usual 60+) moving my brake lever about 5 clicks resulted in the lever in the train going right the way round to emergency.... which should be about 65 clicks. 

i wonder how this will be handled when we get joystick input, and the input/output system, 
hopefully we can have 2 way controls, i.e. we tell the lever to move to xx position, the lever in the sim moves and reports back it's position,  so then the input system knows the lever has or has not moved the correct amount and can self adjust.

 

This functionality would be very handy when taking over a train, as the sim will report all the controls positions, switches included, and any toggle / rotary switches we have on our 'driving desk' will report their positions and the ones in sim will move so they match... no more having to move switches in the sim with the mouse to match the initial switch positions on our 'driving desk' when we forget to reset some of them (can't reset them all as some need to be on when we take over a train in motion)

 

Link to comment
Share on other sites

wow, framerate really does affect the number of key presses to move the brake lever... i guess the new animations for the power wheel and notch lever take care of frame rate changing their number?  as it's always 43 to go from 0 to the last notch on the power wheel. 

 

Just counted the EU07-085's brake lever key presses in the single player 3.5 hour run,  at the beginning before i even turned the battery on,  i zoomed in on the brake lever and was getting 96-97 fps,  counted 151 key presses to go from disabled to emergency, and 152 to go from emergency to disabled positions. 

Zoomed out and i was getting around 67 fps,  and the number went down to around 100 steps to move the same amount, 

 

So without some really clever arduino code that reads the sim's frame rate and adjusts the number of keypresses sent for a given movement of my 3D printed lever's potentiometer, it's not really possible to do a movement to keypress thing for this lever untill we get the input/output thing 😞 

Link to comment
Share on other sites

On 1/1/2024 at 7:49 PM, Gazz292 said:

i guess the new animations for the power wheel and notch lever take care of frame rate changing their number?

It's more that there's a fundamental difference between a "notch step" and advancing through a continuous range.  In the former case, one keypress advances exactly one notch.  In the latter case, the time the key is held down determines how far the control moves.

A solution here would be to make the input system more independent of the graphical framerate, ie. in a separate thread so that it can monitor the precise time keys are held down for.  This would also help normal keyboard players by making their control responses more consistent, so it doesn't immediately become redundant when joystick-type inputs for custom controllers are implemented.

  • I agree 1
Link to comment
Share on other sites

  • SIMRAIL Team

It's not trivial in Unity (for me, but it's not my area of work), as Update function (once per frame) and FixedUpdate (step with const delta of time) are working in the same loop, but FixedUpdate is called from 0 to infinity times per frame to match the time between two frames. But maybe I will have a small surprise for you 🙂

  • Like 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy