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 1
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.
  • Our servers

    • Drivers | Maszyniści Drivers | Maszyniści
      • PL2
      • pl2
      • 59 / 80
          • Percentage filling 74%
          • Most players 90
      • PL3
      • pl3
      • 0 / 54
          • Percentage filling 0%
          • Most players 76
      • PL4
      • pl4
      • 6 / 81
          • Percentage filling 7%
          • Most players 84
      • PL8
      • pl8
      • 3 / 55
          • Percentage filling 5%
          • Most players 84
      • EN1
      • en1
      • 5 / 79
          • Percentage filling 6%
          • Most players 80
      • EN2
      • en2
      • 0 / 79
          • Percentage filling 0%
          • Most players 60
      • EN3
      • en3
      • 1 / 73
          • Percentage filling 1%
          • Most players 60
      • DE1
      • de1
      • 14 / 78
          • Percentage filling 18%
          • Most players 87
      • DE3
      • de3
      • 2 / 78
          • Percentage filling 3%
          • Most players 66
      • DE4
      • de4
      • 0 / 52
          • Percentage filling 0%
          • Most players 65
      • FR1
      • fr1
      • 2 / 81
          • Percentage filling 2%
          • Most players 49
      • UA1
      • ua1
      • 2 / 77
          • Percentage filling 3%
          • Most players 27
      • CN1
      • cn1
      • 2 / 81
          • Percentage filling 2%
          • Most players 28
      • CZ1
      • cz1
      • 9 / 79
          • Percentage filling 11%
          • Most players 61
      • ES1
      • es1
      • 0 / 81
          • Percentage filling 0%
          • Most players 23
    • Dispatchers | Dyżurni ruchu Dispatchers | Dyżurni ruchu
      • PL2
      • pl2
      • 16 / 27
          • Percentage filling 59%
          • Most players 27
      • PL3
      • pl3
      • 0 / 27
          • Percentage filling 0%
          • Most players 27
      • PL4
      • pl4
      • 8 / 27
          • Percentage filling 30%
          • Most players 27
      • PL8
      • pl8
      • 2 / 27
          • Percentage filling 7%
          • Most players 27
      • EN1
      • en1
      • 7 / 27
          • Percentage filling 26%
          • Most players 27
      • EN2
      • en2
      • 0 / 27
          • Percentage filling 0%
          • Most players 21
      • EN3
      • en3
      • 1 / 27
          • Percentage filling 4%
          • Most players 13
      • DE1
      • de1
      • 14 / 27
          • Percentage filling 52%
          • Most players 27
      • DE3
      • de3
      • 2 / 27
          • Percentage filling 7%
          • Most players 27
      • DE4
      • de4
      • 0 / 27
          • Percentage filling 0%
          • Most players 24
      • UA1
      • ua1
      • 0 / 27
          • Percentage filling 0%
          • Most players 17
      • FR1
      • fr1
      • 1 / 27
          • Percentage filling 4%
          • Most players 23
      • ES1
      • es1
      • 3 / 27
          • Percentage filling 11%
          • Most players 15
      • CZ1
      • cz1
      • 5 / 27
          • Percentage filling 19%
          • Most players 27
      • CN1
      • cn1
      • 2 / 27
          • Percentage filling 7%
          • Most players 19
    • 30 Total servers
    • 166 / 1513 Total players
    • 11% Filled servers
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy