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

    • Drivers | Maszyniści Drivers | Maszyniści
      • PL2
      • pl2
      • 67 / 94
          • Percentage filling 71%
          • Most players 93
      • PL3
      • pl3
      • 3 / 48
          • Percentage filling 6%
          • Most players 76
      • PL4
      • pl4
      • 23 / 83
          • Percentage filling 28%
          • Most players 84
      • PL8
      • pl8
      • 6 / 89
          • Percentage filling 7%
          • Most players 84
      • EN1
      • en1
      • 54 / 108
          • Percentage filling 50%
          • Most players 81
      • EN2
      • en2
      • 1 / 62
          • Percentage filling 2%
          • Most players 60
      • EN3
      • en3
      • 1 / 79
          • Percentage filling 1%
          • Most players 60
      • DE1
      • de1
      • 71 / 87
          • Percentage filling 82%
          • Most players 87
      • DE3
      • de3
      • 2 / 85
          • Percentage filling 2%
          • Most players 67
      • DE4
      • de4
      • 3 / 49
          • Percentage filling 6%
          • Most players 65
      • FR1
      • fr1
      • 14 / 80
          • Percentage filling 18%
          • Most players 49
      • UA1
      • ua1
      • 6 / 81
          • Percentage filling 7%
          • Most players 27
      • CN1
      • cn1
      • 3 / 83
          • Percentage filling 4%
          • Most players 28
      • CZ1
      • cz1
      • 0 / 0
          • Percentage filling 0%
          • Most players 61
      • ES1
      • es1
      • 1 / 92
          • Percentage filling 1%
          • Most players 23
    • Dispatchers | Dyżurni ruchu Dispatchers | Dyżurni ruchu
      • PL2
      • pl2
      • 28 / 34
          • Percentage filling 82%
          • Most players 34
      • PL3
      • pl3
      • 3 / 34
          • Percentage filling 9%
          • Most players 28
      • PL4
      • pl4
      • 10 / 34
          • Percentage filling 29%
          • Most players 32
      • PL8
      • pl8
      • 4 / 34
          • Percentage filling 12%
          • Most players 27
      • EN1
      • en1
      • 30 / 34
          • Percentage filling 88%
          • Most players 34
      • EN2
      • en2
      • 1 / 34
          • Percentage filling 3%
          • Most players 21
      • EN3
      • en3
      • 3 / 34
          • Percentage filling 9%
          • Most players 13
      • DE1
      • de1
      • 28 / 34
          • Percentage filling 82%
          • Most players 34
      • DE3
      • de3
      • 4 / 34
          • Percentage filling 12%
          • Most players 29
      • DE4
      • de4
      • 4 / 34
          • Percentage filling 12%
          • Most players 29
      • UA1
      • ua1
      • 2 / 34
          • Percentage filling 6%
          • Most players 17
      • FR1
      • fr1
      • 6 / 34
          • Percentage filling 18%
          • Most players 23
      • ES1
      • es1
      • 3 / 34
          • Percentage filling 9%
          • Most players 15
      • CZ1
      • cz1
      • 0 / 0
          • Percentage filling 0%
          • Most players 28
      • CN1
      • cn1
      • 3 / 34
          • Percentage filling 9%
          • Most players 19
    • 30 Total servers
    • 384 / 1596 Total players
    • 24% Filled servers
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy