Mattzobricks / MattzoControllers

MattzoController firmware
20 stars 10 forks source link

MTC4BT: Locos do not resume their speed after all locos are connected #16

Closed Mattzobricks closed 1 year ago

Mattzobricks commented 2 years ago

Locos do not resume their speed when initially connected or have reconnected after a partial or full disconnect. An additional Rocrail command is required to get the loco started - or stopped in certain situations.

To overcome this problem, you could set the presently desired speed for the loco right after connecting to all BLE hubs of that loco. For this reason, it is required that you actually store the last received loco command within the MTC4BT for each loco, or, even better, keep the desired speed of a loco in the loco object, and keep it up-to-date whenever you receive a Rocrail command - no matter if the locos of the train are fully connected or not.

Of course, all other aspects of moving or stopping trains shall be obeyed, especially the power-off feature. If Rocrail general power is off, the train must not move.

Related issues:

19 (same for lights).

20 (behaviour after partial disconnect).

joosbuijsNL commented 2 years ago

I'm not sure which behavior I would prefer:

  1. a train resuming the speed before it disconnected;
  2. or a train waiting for the operator to reset it's speed once he verified the track is clear and ready to go
Mattzobricks commented 2 years ago

I thought about this for a while as well. IMHO a train that has temporarily disconnected is still an active train, it is on the correct path and the route is locked and allocated for this train only. As soon as the train is back online, it should proceed. The operator always has the option to stop the train first or generally shut the power off in Rocrail, so I see no harm.

Mattzobricks commented 1 year ago

I would like to extend the scope of this issue. When a train has been connected, and then partially or completely disconnects, it does not receive any train commands. Only after the reconnection of all locos, it accepts train commands again. This is critical in situations were a loco disconnects just before hitting a sensor that would make it stop. The train will actually stop because of the partial disconnect, but then start driving again after reconnection, because it missed the stop command.

Mattzobricks commented 1 year ago

Description of the issue modified (extended scope by the reconnection case).

raymondbrink commented 1 year ago

Please create a new issue as the old one is implemented and merged already.

Op za 24 dec. 2022 13:27 schreef Mattzobricks @.***>:

Description of the issue modified (extended scope by the reconnection case).

— Reply to this email directly, view it on GitHub https://github.com/Mattzobricks/MattzoControllers/issues/16#issuecomment-1364522581, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUKFHIFPC6Q66PNA5LHS7DWO3T4LANCNFSM6AAAAAARASDSBA . You are receiving this because you were assigned.Message ID: @.***>

Mattzobricks commented 1 year ago

I just tested it. The feature does not appear to work.

Test set-up:

Shall I still create a new issue, or shall we keep this one open?

raymondbrink commented 1 year ago

My Rocrail is dead at the moment, so I can't test it. I've pushed a branch (https://github.com/Mattzobricks/MattzoControllers/tree/16-mtc4bt-resume-speed-after-all-locos-reconnect) for testing. Could anyone give this a try...?

Mattzobricks commented 1 year ago

Thank you... and sure, I can help testing. I am presently on vacation and have no PU hubs or SBrick in the vicinity, but I will do so as soon as possible once I am back.

Mattzobricks commented 1 year ago

Tested with a Mattzes ICE train with 2 locos (SBricks) and bidirectional auto lights (two standard PF light sets in each loco).

Test 1 Setup:

Results:

Test 2 Setup:

Results:

Test 3 Setup:

Results:

Test 4: Setup:

Results:

Total result: nice job, but we need to deal with the auto light problem. The auto light problem was addressed in a similar way in #19 already. Maybe we can tackle this issue there. I will place a command in this issue.

Mattzobricks commented 1 year ago

I would recommend to merge this branch into develop.

raymondbrink commented 1 year ago

Pull request submitted. This issue was never about lights, so didn't give it any attention. Will do when I start on #19.

raymondbrink commented 1 year ago

@Mattzobricks As this is now merged into develop, shouldn't this issue be closed?

Mattzobricks commented 1 year ago

Yes, thank you.