T6C wrote: ↑Sun Oct 11, 2020 19:36
I've watched a few YouTube videos and read through the atc_command.txt file, but I can't figure this out. I want to automate a train line to be like this example...
- Start from station A at full speed.
- Slow down to half-speed along a certain segment of track.
- Speed up to full speed again after slow segment.
- Stop at station B for 30 seconds, then start again at half-speed.
- Stop at station C for 30 seconds, then go slowly through a turnaround to go back.
I see three types of special track: the station stop track, the Lua automation track, and the point speed restriction track. I've figured out how to make a train stop at a station, name the station, and tell it how long to stay stopped. But, I can't figure out how to tell it what speed to start again after the departure time. It always leaves the station at full speed.
I tried using the point speed restriction track to slow the train down for a certain segment of track, but it slows it down only for that point. The train immediately speeds up again.
Finally, I can't figure out the Lua automation track at all. I tried putting in something like "B3" to tell the train to brake to speed 3, but I just got the error "Not an existing environment" when the train went over it.
Any help on how to set up some simple automation would be appreciated. I'm not looking for anything fancy like setting routes or switches. I'm just trying to get two trains to run along the tracks (it's a dual-track system the whole way) in opposite directions between the termini. The idea is that the trains will reach and depart opposite termini at the same time. The track itself is about 2000 blocks long, with turns and elevation changes to fit the terrain.
Hi, let's break a few concepts down. First is the units of speed: although your driver's cab shows km/h, the internal units are m/s. The subway wagon has a max speed of 56 km/h which is actually 16 m/s (to convert, divide by 3.6). Whenever you set speed, like on a station/stop rail, point speed restriction rail or in ATC commands, it's in m/s.
The first thing you need is departure speed. In the Station/Stop rail, there is a field for departure speed. This is equivalent to the ATC command "S<x>" where x is the speed in that box; and of course it is in m/s. To start a train at half of it's top speed, take the top speed in m/s and divide it by two. For the subway wagon, 56 km/h = 16 m/s. 16 m/s / 2 = 8 m/s. So put 8 in the departure speed field.
The second thing you need can be phrased or implemented two ways: you want to train to accelerate to full service speed, or you want the train speed limit to become higher. The simplest way to achieve this is to use an ATC rail with an S command. Say our train is at a speed of 8 already and we want to go up to 16, then we give it the command "S16". What if we want the train to go all the way to its full speed, no matter what specific speed the train has? The special value "M" helps us there. "SM" will set the target speed to maximum. This is how we manage speed in terms of "set speed to this at this point" - by putting ATC rails down in the train's path.
So what about speed limits? Well, for this we have two types: The Point Speed Restriction rail, which you already familiar with. The train will pass through that rail at a maximum speed according to the restriction. The second way to manage this is the signs included with advtrains in the module advtrains_signals_ks. In your inventory they will be called the "Signal Sign". These signs can be placed and then assigned an influence point like many other components that are part of the interlocking system. Place the sign next to the track, then while holding the special key from minetest (default: E, my binding: F) right-click on the sign. This will open the formspec to assign an influence point (tip: this also works for all signals: red signals will stop a train, green will let it continue; but I digress, this is about speed right now). As per the in-game instructions, put the influence point facing the way the train will approach the sign. Now when the train hits that point, it will obey the speed in m/s posted on the sign. You can left-click with the trackworker on the speed sign to change the speed limit (there is also the special red S "stop for shunt" sign, you can ignore it, it has a special purpose), and right-click to rotate it in the same increments as the track - so if you have diagonal tracks, you can line it up nicely. The speed limit "E" means "end of speed limit".
So: put a speed limit of 8 sign where you want your subway wagons to go half speed, and put a speed limit "E" where the speed limit ends. If you have trains that go 72 km/h (=20 m/s), sadly we have the limitation that the speed limit signs only come in 8, 12, 16 and E varieties at the moment; yes I know, I would love to be able to enter any speed limit on them too.. request for improvement. Now at this point it's important to note if you have a signalling system: passing any green signal will remove any speed restriction! The Ks signals can show a yellow and impose a speed limit of 6 m/s (sorry this is a bit hard to describe, and anyway this is already a wall of text...)
You might ask what advantages having the speed limit would have over ATC commands. Well, trains physically cannot be made to disobey a speed limit that has been imposed, even when driven manually. You can only remove the speed restriction with a green signal or end speed restriction sign. This is good to enforce speed limits in areas where trains might hit people, because it forces train drivers to slow down.
I hope that addresses everything to do with speed. Now as for the turnaround: You have two options, a balloon loop or a single track terminus that the train enters and comes back out of. To make the single track terminus work, you will need to control the turnouts properly, or have them set up properly so that the train enters with the turnout set the wrong way and exits the other way after it reverses. I'm guessing you want to put your platform next to this terminus track. The station/stop rail can be used to make the train reverse after stopping. Below the departure speed field is a dropdown with options --- and Reverse. Choose the reverse option and the train will reverse when it leaves the station.
As for turnout control: you either manage it with interlocking or with LuaATC. For the interlocking approach, I recommend
my video. For the LuaATC approach, I recommend you read the manual in advtrains/advtrains_luaautomation/README.txt. This post is already too long to cover basic LuaATC as well. I think I'm gonna go put some of this on the
advtrains wiki now.