PC Ts World Raildriver And Joystick Interface

Discussion in 'TSW General Discussion' started by CobraOne, Nov 8, 2022.

  1. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    264
    Likes Received:
    228
    I have tried this with the original PieHid64.dll and a Raildriver and have exactly the same problem, so this is a fault with the loco itself and something my program won't fix.
    Chris
     
  2. admire123

    admire123 New Member

    Joined:
    Jan 24, 2025
    Messages:
    2
    Likes Received:
    3
    I am having the same problem, Class 390 and Class 801 in TSW5,

    No matter how i calibrate the throttle, the dynamic brake never reach "Emergency Brake" and maximum is 88%

    Is that the game bug?

    Btw, thanks Chris for making this interface program, i am a hardware and software engineer,
    your program saved me a lot of time, and i could concentrate on designing the levers with physical notches.

    I saw your program is Freeware, can i distribute it with my hardware together to my clients?

    Thanks.
     
    Last edited: Jan 24, 2025
    • Like Like x 1
  3. SGTDRE

    SGTDRE Well-Known Member

    Joined:
    Sep 6, 2022
    Messages:
    1,659
    Likes Received:
    854
    If Chris is willing maybe you and he can collaborate on building a better user interface. Yes? No?
     
  4. admire123

    admire123 New Member

    Joined:
    Jan 24, 2025
    Messages:
    2
    Likes Received:
    3
    If he is willing to share the codes, i think we could help to improve.

    But Chris has mentioned that, his code is over 25k lines, he has no time to explain the codes to others. that's why he doesn't make to opensouce.

    Anyway, i am writing another program to send my lever hardware physical notches as joystick input to his program, so far it works like as charm.

    The attached pictures are the prototype levers i am making, please ignore the colors, as i am making them for my little son, lol
     

    Attached Files:

    Last edited: Jan 25, 2025
    • Like Like x 2
  5. haskell99

    haskell99 New Member

    Joined:
    Jul 5, 2024
    Messages:
    29
    Likes Received:
    15
    Kinda seemed like that was the case. Thanks so much for looking at it!
     
  6. SGTDRE

    SGTDRE Well-Known Member

    Joined:
    Sep 6, 2022
    Messages:
    1,659
    Likes Received:
    854
    Wish you all the best, hope ya son has fun with it, and I can understand Cobraone's stance.
     
  7. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    264
    Likes Received:
    228
    I have tried both the 390 and 801 with the original PieHid64.dll, and they both as you say, stop at 88%. I can only get them to 100% by either pressing the keyboard key or the Emergency Brake button on the Raildriver. If I press the emergency brake button again, the brake goes back to 88%, so I am wondering if this has been deliberately designed into the raildriver code so that you don't apply the emegency brake by accident whilst using the lever, and can only apply it by pressing the emergency brake button.
    To resolve this with my software, you will need to assign a button to the emergency brake.

    Chris
     
  8. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    264
    Likes Received:
    228
    I'm OK with that provided you provide support if there is a problem with my program working with your hardware. (see my next post).
    Chris
     
  9. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    264
    Likes Received:
    228
    Unfortunately, due to life getting in the way and the gray cells no longer firing on all four cylinders due to old age, I am unable to develope either of my software any further. I will continue to offer support for as long as I can on the current versions though.
    Chris
     
  10. jannie#6483

    jannie#6483 New Member

    Joined:
    Nov 13, 2024
    Messages:
    17
    Likes Received:
    15
    Maybe this is far off the mark, but might be of some value. See my prototype rail driver pics further up.
    The making of a realistic controller for the 1972 London Underground was not straight forward.
    1. It needs a large sweep, more than the standard joystick can provide. 130 Degrees.
    2. The notches are NOT equally spaced, not by far.
    Center notch is 0.51 ie half the sweep already.
    Bottom half, 1.00 to 0.51 = 3 notches
    Top half, 0.51 to 0.00 = 8 notches
    3. It called for a lot of patience fine tuning to obtain a reasonable degree of separation for the notches. (See attached pic)
    4. Center position on The Raildriver config needs to be widened as follows:
    Devices=(DevicePath="\\\\.\\TrainSimWorld",Calibration=((CalibrationPointValues=(0.000000,0.5000000,1.000000)),(ControlIndex=1,CalibrationPointValues=(0.000000,0.400000,0.600000,1.000000). By Chris's instructions.
    5. Starting with a "blank" disc for the notches, the last thing I did was to mark the relevant positions on the disc and then to finally file each notch position.
    It runs off an Arduino Micro, is consistent, reliable and makes driving the 1972 a breeze.

    1972 LU notch settings.png
     
  11. Sharon E

    Sharon E Well-Known Member

    Joined:
    Dec 9, 2016
    Messages:
    2,043
    Likes Received:
    2,039
    I went in and checked the 390 and 801 with my RD. The 390 in braking positions goes from off to B6, the 801 stops at 88% as noted above. For me, this is fine, since I hope not to need max brake. For emergency brake I would hit the button on the rd, just like a driver would slap that big, red button on the console.
     
  12. SGTDRE

    SGTDRE Well-Known Member

    Joined:
    Sep 6, 2022
    Messages:
    1,659
    Likes Received:
    854
    I understand, and you do what you need to do, take care of ya self, by George yes I know what comes with age :) many here are thankful for what you have created, your program has made using the RD better in TSW5 as well as with other control interfaces.
    Thank you.
     
  13. pmanestar

    pmanestar New Member

    Joined:
    Jan 20, 2025
    Messages:
    2
    Likes Received:
    1
    Thank you Chris.

    I have taken everyone's advise and upgraded to TSW 5.
    The software executable line is "D:\Games\Train Sim World 5\WindowsNoEditor\TrainSimWorld.exe"

    I have downloaded the latest version of the joystick interface (V2.0.1.3) and setup a joystick to control throttle and brake.
    running joy.cpl shows the joystick (arduino leonardo) and shows the controls moving along with the input slider potentiometers.

    When i press "Start Callback" it again displays "Unable to connect to TSW - retrying connection."
    Again, i have tried all suggestions around running it with admin privilege's windowing the game and running it after TSW5 has loaded... all to no avail. It's a pity. I was looking forward to designing and building a train sim, but unless i can get a basic interface to work, i'm out of options.

    Is there anything else i can look at to see where the problem is? What is it that the joystick interface is looking for? Some sort of process? Could it be a firewall issue on my end?

    Hopefully someone can help.

    Paul.
     
  14. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    264
    Likes Received:
    228
  15. idwdeveloper

    idwdeveloper New Member

    Joined:
    Apr 23, 2024
    Messages:
    3
    Likes Received:
    0
    So you are using the same exact program (TSW Raildriver and Joystick Interface) for Run8 with no issues?


    Hi Chris,
    I am guessing these four number series correlate to in game calibration(Throttle Max, IDLE, DB Setup, Max DB)? Is this just an arbitrary entry then to satisfy TSW? If using a custom controller do you even need to calibrate in game? I only ask because in the follow up post, jannie#6483 actually has notches set in that 'neutral zone' and claims to be working.

    I am wondering if at this point for non RD controllers/custom hardware if the work order is just: Plug USB-> Run TSW RD&JI-> Calibrate in program -> Set axis-> Run TSW -> Set Notches accordingly?
     
  16. c0bra3055

    c0bra3055 New Member

    Joined:
    Feb 1, 2025
    Messages:
    1
    Likes Received:
    0
    Where is the DefaultSettings folder?
     
  17. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    264
    Likes Received:
    228
    It's in the folder where you installed my program.
     
  18. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    264
    Likes Received:
    228
    Yes, As TSW is expecting a Raildriver which has the ThrottleAndBrake split in the middle, I have to also split the ThrottleAndBrake in TSW for your Joystick/custom hardware, to do this, my program creates a default Raildriver.ini file for you. Having said that, my program ignores this split when not using a Raildriver so there is no real need for you to run the Raildriver calibration in TSW when using a Joystick/Custom hardware.
    Yes thats basically all you need to do, although, if you have already calibrated your controllers in windows, then there is no need to run the calibration in my program.
    Chris
     
  19. protonmw

    protonmw Active Member

    Joined:
    Mar 18, 2022
    Messages:
    180
    Likes Received:
    144
    Is this great tool broken by update from 17.02.? Nothing works for me since this update.
     
  20. Sharon E

    Sharon E Well-Known Member

    Joined:
    Dec 9, 2016
    Messages:
    2,043
    Likes Received:
    2,039
    I just played some on BCC and mine is working fine.
     
  21. protonmw

    protonmw Active Member

    Joined:
    Mar 18, 2022
    Messages:
    180
    Likes Received:
    144
    ok, thanks. some reboot attempts later its working again...
     
    • Like Like x 1
  22. idwdeveloper

    idwdeveloper New Member

    Joined:
    Apr 23, 2024
    Messages:
    3
    Likes Received:
    0
    Thanks for the response- my main issue is with the advanced notches, for some reason i cannot seem to have output values that are outside of the min/max values. I see Jannie above is able to execute several values outside of the min/max values.

     
  23. dr1980

    dr1980 Active Member

    Joined:
    Dec 8, 2016
    Messages:
    154
    Likes Received:
    145
    Hello, what are the steps to return to the vanilla TSW5 Raildriver support?
     
  24. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    264
    Likes Received:
    228
    Go to your "steamapps\common\Train Sim World 5\WindowsNoEditor\TS2Prototype\Binaries\ThirdParty\PieHid\Binaries" folder and you should have a PieHid64.dll and a PieHid64_bk.dll.
    If your PieHid64.dll file size is 31KB delete it.
    Then rename the PieHid64_bk.dll (which should be 71KB) back to PieHid64.dll

    Do not run my program again or the files will be reverted back automatically.
     
  25. tb1

    tb1 New Member

    Joined:
    Mar 5, 2025
    Messages:
    1
    Likes Received:
    0
    Brilliant software. Only problem I have is that the zuiki has so many notches, the game does not detect half of them and there is no neutral section when placing the zuiki in neutral. Anyone have a good config or so?
     
  26. DarthBelan

    DarthBelan New Member

    Joined:
    Aug 25, 2019
    Messages:
    23
    Likes Received:
    13
    I have a Raildriver, and utilize this excellent piece of software. Does anyone happen to have a custom xml file for the Class 350 that puts the minimum brake application past the notch on the throttle?
     
  27. jaapjan#1769

    jaapjan#1769 New Member

    Joined:
    Feb 28, 2024
    Messages:
    3
    Likes Received:
    0
    Hello CobraOne,

    Do you happen to have a reference/information/link/code which described what byte structure the PieHid64 wants to have in the ReadJoysticks() function when it passes it to the MainDataEvent (PHIDDataEvent) ?
     
  28. ixofxiii

    ixofxiii Well-Known Member

    Joined:
    Apr 21, 2020
    Messages:
    334
    Likes Received:
    273
    So i have a weird issue thats been ongoing. When using the program, The game's audio stutters...hard! Also, this file pops up in the program's folder. Ive done reinstalls of both the program and the game. And for the first few minutes, all is fine then the audio starts stuttering and it only stops and sounds normal when i shut down the app. I need the app on to have my raildriver connect to TSW5
    Screenshot 2025-03-09 032743.png
     
  29. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    264
    Likes Received:
    228
    Try calibrating your Raildriver again in my software, but don't push the Throttle lever all the way back, or if you do, bring it forward slightly.
    The reason is that the pots in the Raildriver are operated by plastic rods that can twist slight at the extremes.
    I would advise doing this for all levers.
    Chris
     
  30. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    264
    Likes Received:
    228
    If you download the PI Engineering Windows SDK from here
    https://xkeys.com/software/developer/developerwindowssdk.html
    and once installed go to "C:\Program Files (x86)\PI Engineering\PI Engineering SDK\Documentation" and open the index.html file, this will give you all the info you need.
    I would suggest scrolling down to the bottom of the "Data Reports" section and opening the "Raildriver Data Report" page.
    Chris
     
  31. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    264
    Likes Received:
    228
    I have not come across this before, so is going to be a little tricky to diagnose. Can you try the following:
    1. Run TSW without my program running and use the keyboard to drive the trains and see if you still get the audio problems.
    2. Do you have the sound going through the Raildriver, if so, have you got the power supply plugged in.
    3. Can you try running my program as an Administrator (Right click the exe file and select "Run as Administrator").
    Chris
     
    Last edited: Mar 9, 2025
  32. ixofxiii

    ixofxiii Well-Known Member

    Joined:
    Apr 21, 2020
    Messages:
    334
    Likes Received:
    273
    One was the first thing i did. (im use to troubleshooting, LOL). With your app off, the sound is perfect. It was the moment i opened it. 2 allows me to "feel" the locos. I have more wires from my PC than a Borg Cube on Star Trek. LOL. Everything is always plugged in and powered. 3 Seems to have been the trick. Im playing a few sessions to check the stability of the sound. Run As Admin seems to have done the trick so far. Thank you!
     
  33. Train Sim Society

    Train Sim Society Well-Known Member

    Joined:
    Aug 22, 2021
    Messages:
    448
    Likes Received:
    813
    Would anyone happen to know if these flexi-lever controls are compatible with this software?
    Flexi-Lever Controller - TS Controllers

    I'm currently using a thrustmaster control set for MSFS, but want something more fitting for TSW.
     
  34. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    264
    Likes Received:
    228
    As they use proprietary hardware and do not show up in windows as a joystick device, they will not work with my software.
    TS Controllers supply their own software for them that will work with TSC & TSW but without knowing how the software works, I don't know if you could use the two together.
    Have you tried contacting TS Controllers?

    Chris
     
    • Helpful Helpful x 1
  35. 21c164fightercommand

    21c164fightercommand Well-Known Member

    Joined:
    Nov 6, 2021
    Messages:
    932
    Likes Received:
    920
    There are also these controller hardware coming to market: SimHogger – WirelessBilly
    Geared towards USA locomotives and native interface to Run8's UDP
    But it might be worth contacting the developers to get the interface specs to broaden their market and improve the usability of your software by allowing these hardware with TSC/TSW?
     
  36. Train Sim Society

    Train Sim Society Well-Known Member

    Joined:
    Aug 22, 2021
    Messages:
    448
    Likes Received:
    813
    Thanks! I contacted them and they informed me that it wouldn’t be compatible but they’re working to get TSW compatibility soon with their own software. :)
     
    • Like Like x 1
  37. haskell99

    haskell99 New Member

    Joined:
    Jul 5, 2024
    Messages:
    29
    Likes Received:
    15
    OK, revisiting the GP38 issue where the throttle doesn't start responding until about half-scale. I thought Advanced Notches would work since you can specify "when the handle is between these positions, send this value." So I set it up as shown below. When I click Send on each notch it correctly moves the loco throttle. Awesome!
    [​IMG]
    BUT, when I Callback, moving the throttle one notch jumps instantly to Notch 7.
    [​IMG]
    Shouldn't Advance Notches translate that value and why would it jump all the way to 96% with a small handle movement? I realize the value to send is outside the range of the notch position, but isn't it "if the handle is between .064 and .187 send value .498 to TSW?"
    Or is that loco just a goner for joystick control?
    Thanks
     
  38. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    264
    Likes Received:
    228
    Hi haskell99
    The only controller that TSW was designed for is the Raildriver from PI Engineering, and it uses a single lever for the Throttle and Dynamic brake (0% - 48% = Dynamic and 52% - 100% = Throttle).
    TSW expects a value between 0 and 1 to represent the 0% - 100%, so my program has to do some conversions.

    Another problem is that the notches are not always equally distant, hence having had to design the Advanced Notch Calculator.

    When you use two separate levers for the Throttle and Dynamic, my program converts the 0% - 100% of travel on your levers to either 0% - 48% or 52% - 100% depending on the lever. It does this automatically so you don't have to.
    All you need to do is calculate your notches with a value of 0 to 1 representing the 0% to 100% travel of your lever.

    Her is a copy of the Throttle settings I have used for the GP-38

    GP-38 Throttle.png

    and for the Dynamic Brake

    GP-38 Dynamic.png

    Try these and see how you get on

    Chris
     
    • Like Like x 1
  39. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    264
    Likes Received:
    228
    That is something I am not prepared to do for the following reasons.
    1. They are a commercial enterprise
    2. If I converted my code to incorporate their hardware, and then they changed how the hardware works or add hardware to their arsenal, I would have to alter my code in order to keep compatabilty. Which means, I am doing the work for free for their profit.
    3. I am a pensioner, and my grey cells are no longer working at full capacity, that's why it is taking me longer to reply to posts.

    Chris
     
    • Like Like x 2
    • Helpful Helpful x 1
  40. haskell99

    haskell99 New Member

    Joined:
    Jul 5, 2024
    Messages:
    29
    Likes Received:
    15
    Thank you for the reply. Will give those settings a shot.

    Eddie
     
  41. Conductor B

    Conductor B Well-Known Member

    Joined:
    Feb 18, 2022
    Messages:
    262
    Likes Received:
    309
    Does anyone know how to calibrate the TSW Raildriver and Joystick Interface v2.0.0.8 for the ALP-46 on NEC NY-Trenton? I can't get the throttle to go to zero and it sits at dynamic brake position 1 when it should be zero. I tried the manual notch instructions in the manual but it doesn't seem to make a difference.

    You see, I'm not able to get the throttle in position 0 at all, no matter how delicately I try to move the lever. In fact, here is what happens. I load the loco and then click Start Callback. As soon as I do this, I'm in notch B2. Because of this, I'm not able to identify how to set notch 0, as per the manual.

    Any help is greatly appreciated.

    *** EDIT - UPDATE **

    After replacing the custom lever map with the default "Throttle and Dynamic" map, I'm now able to get the throttle to 0. However, I can't get it to sit at P1. It wants to jump right to P2.
     
    Last edited: Mar 23, 2025
  42. Sharon E

    Sharon E Well-Known Member

    Joined:
    Dec 9, 2016
    Messages:
    2,043
    Likes Received:
    2,039
    What do you have the Sensitivity set at? I run mine at 3 and have no jitters.
     
  43. Conductor B

    Conductor B Well-Known Member

    Joined:
    Feb 18, 2022
    Messages:
    262
    Likes Received:
    309
    I didn't try that, I'll give it a shot!
     
  44. Conductor B

    Conductor B Well-Known Member

    Joined:
    Feb 18, 2022
    Messages:
    262
    Likes Received:
    309
    Sensitivity was at 0. Increasing it made the jumps worse - from 0 to 3 instead of from 0 to 2.
     
  45. jannie#6483

    jannie#6483 New Member

    Joined:
    Nov 13, 2024
    Messages:
    17
    Likes Received:
    15
    • Helpful Helpful x 2
    • Like Like x 1
  46. Dr Iver

    Dr Iver New Member

    Joined:
    Sep 26, 2022
    Messages:
    20
    Likes Received:
    5
    Hmm, they look useful. I might be tempted. Would be nice to have the option to buy just 2 perhaps.

    Also - I like to use switches as well. Would it be easy to pull out the pot and replace it with a multi-turn rotary switch (eg, 3, 4 and 8 way)?

    TIA
     
    Last edited: Mar 30, 2025
  47. jannie#6483

    jannie#6483 New Member

    Joined:
    Nov 13, 2024
    Messages:
    17
    Likes Received:
    15
    Yes, I've had other request for single units. I am currently in the process of making a number of these to provide as one off's.
    I will post on here when they are ready. Maybe one week.
    The pot can be pulled out after undoing a small locking screw and undoing the mounting nut. However the replacement pot shaft needs to be 6mm dia x 20mm long.
    Regards
    Jan.
     
  48. nowi#7187

    nowi#7187 New Member

    Joined:
    Oct 24, 2024
    Messages:
    2
    Likes Received:
    0
    Hello,

    After last update 31st March all buttons are working normally but my levers doesn't, they are not even recognized by the sim (your software does though).

    Any advice? I don't get it to work...

    Thanks!
     
  49. nowi#7187

    nowi#7187 New Member

    Joined:
    Oct 24, 2024
    Messages:
    2
    Likes Received:
    0
    Sorted it out by copy/paste default .dll and recalibrating raildriver on TSW.
     
  50. Dr Iver

    Dr Iver New Member

    Joined:
    Sep 26, 2022
    Messages:
    20
    Likes Received:
    5
    Thanks, Jan
    OK, that's standard dimensions so it'll be fine.
    Once you've got the ordering organised I'll buy a couple.
     

Share This Page