Autor Wątek: WiP/Prace w toku: Real Hasler Speedometer for the Simulator  (Przeczytany 417 razy)

0 użytkowników i 1 Gość przegląda ten wątek.

Offline BravuraLion

  • Sponsor
  • Grupa XII
  • *
  • Wiadomości: 85
  • Siła reputacji: 442
  • BravuraLion prezesBravuraLion prezesBravuraLion prezesBravuraLion prezesBravuraLion prezesBravuraLion prezesBravuraLion prezesBravuraLion prezesBravuraLion prezesBravuraLion prezesBravuraLion prezesBravuraLion prezes
  • Always be friendly and respectful
    • My Youtube Channel
Real Hasler Speedometer for the Simulator
« dnia: 28 Czerwca 2024, 19:38:54 »
I thought I'd share a little project I'm currently working on:

At the beginning of the year, I received several parts from various driver’s cabs, including three Hasler speedometers that still work perfectly. I want to make two of them operational so that they can work with various simulators like Train Driver 2, Train Sim World, etc. The most complicated part is first converting the speedometer so that it can be digitally addressed at all.

The speedometer:


The speedometer is originally driven by a 35V 35W motor, which is not suitable for being controlled by a PC (it is possible, but cumbersome). The motor itself drives a shaft in the speedometer, which transitions into the mechanics of the speedometer and translates the speed.




I have now replaced the motor with a 12V geared motor, which can be more easily controlled with an Arduino and a motor driver:


Current status:

I have the speedometer working so that I can control it digitally and also pass on speeds. Now I still need a small companion software that can be started while playing, which takes the speed from the simulator and passes it to the speedometer. Reading the speed from TSW or TS Classic is relatively simple, but unfortunately, it's different with Train Driver 2. There is theoretically a COM interface that could output the speed, but unfortunately, it is currently defective, see https://git.ttsk.ngo/td2dev/simulator/-/issues/3480. Now I will try to do it with a desktop OCR solution that "recognizes" the speed on the screen. It's not ideal, but I can't think of another idea at the moment. Does anyone have any ideas? Plan B would be to read the Hasler tapes live from the game, but that's as unattractive as the OCR solution. I hope the API works again soon.

As soon as the software is running, I will mount the speedometer on a nice desktop stand and hide the electronics to make it look good. I will also convert a second speedometer accordingly and who knows, maybe I will sell the second one, but I'm not sure yet :)

Speedo in Action:


Milestone Update: Now works with TS Classic:


Milestone 2 Update: Now works with Train Driver 2, using OCR Tech to read the Speed Data from the Screen:

« Ostatnia zmiana: 29 Czerwca 2024, 15:51:04 wysłana przez BravuraLion »
Mein Discord Server: https://bravuralion.com/discord

Offline Pitek

  • Zasłużony
  • Pioneer
  • *
  • Wiadomości: 358
  • Siła reputacji: 84
  • Pitek prezesPitek prezesPitek prezesPitek prezesPitek prezesPitek prezesPitek prezesPitek prezesPitek prezesPitek prezesPitek prezesPitek prezes
    • Pitkowa Kolej
Odp: Real Hasler Speedometer for the Simulator
« Odpowiedź #1 dnia: 30 Czerwca 2024, 12:28:04 »
I made a similar issue 3 weeks ago to share information from the cabins to the outside - then we can adapt it to microcontrollers:
https://git.ttsk.ngo/td2dev/simulator/-/issues/3719

Speed is one of the many variables to send, here is thread with custom make dashboards of locomotives:
https://td2.info.pl/inna-tworczosc/pulpit-lokomotywy-eu07/60/

I wasn't there for many years and I don't update thread above, but here is my project, working with MaSzyna simulator.
I tried catch datas also from SimRail, but it's Sisyphus work everytime game get update - the same is here. As you can see in thread above, 8 years have passed when the first people starting made projects and still we don't have here datas from trains. Yours idea about using OCR is good, but probably you can't move camera when you drive and it will be problem to recognize another parameters like current, voltage, lamps etc.
I know a lot of people who have almost done projects like mine, but only in MaSzyna you can easily send information to a microcontroller.

Offline BravuraLion

  • Sponsor
  • Grupa XII
  • *
  • Wiadomości: 85
  • Siła reputacji: 442
  • BravuraLion prezesBravuraLion prezesBravuraLion prezesBravuraLion prezesBravuraLion prezesBravuraLion prezesBravuraLion prezesBravuraLion prezesBravuraLion prezesBravuraLion prezesBravuraLion prezesBravuraLion prezes
  • Always be friendly and respectful
    • My Youtube Channel
Odp: Real Hasler Speedometer for the Simulator
« Odpowiedź #2 dnia: 01 Lipca 2024, 18:23:09 »
I've already looked at your project, it's really impressive what you've done :)

It's a real shame that there's no clean API for projects like this. Of course I realize that only a few players need it, but it's a great way to implement great projects if you have the right data. As already mentioned, OCR is only a temporary solution because otherwise I don't know how to get the data easily. It works quite well in TD2 so far, even if you move the camera or are outside, you hardly get any incorrect data. Simrail still needs more fine-tuning. Of course, it would be nice if we had data on which switch is in which position, what the brake pressure is, etc. so that more instruments could be controlled accordingly. @Devs please give us a clean interface :)

PS this was published today
How was this implemented i wonder?
Mein Discord Server: https://bravuralion.com/discord

Offline xoorbes

  • Zarząd
  • Administrator
  • Developer
  • Weteran
  • Naczelnik administratorów
  • Sponsor
  • Grupa VIII
  • *
  • Wiadomości: 720
  • Siła reputacji: 407
  • xoorbes prezesxoorbes prezesxoorbes prezesxoorbes prezesxoorbes prezesxoorbes prezesxoorbes prezesxoorbes prezesxoorbes prezesxoorbes prezesxoorbes prezesxoorbes prezes
    • Blender Development Fund
Odp: Real Hasler Speedometer for the Simulator
« Odpowiedź #3 dnia: 01 Lipca 2024, 18:40:32 »
Cytuj
How was this implemented i wonder?

This is not a production-ready solution, but the idea (at the first stage) is to implement the communication protocol from MaSzyna and use exactly the same frame format. We will also implement a separate 'tab' in the TD2 configuration where it will be possible to define what data is on which bytes and bits and how TD2 should interpret it. We need additional time (I can't say how much right now) to fine-tune the current solution, to solve the problems I mentioned in the announcement and to prepare all the missing things required for regular users so that it is possible to simply plug TD2 into already existing desktops.  In addition, we have various plans and ideas for 'what's next', but it is too early to write about them yet.