Skip to content

Commit 3e447f4

Browse files
authored
Merge pull request DCC-EX#228 from DCC-EX/213-continue-to-expand-on-ex-rail-command-reference
213 continue to expand on ex rail command reference
2 parents 394d710 + 729dba0 commit 3e447f4

File tree

10 files changed

+306
-223
lines changed

10 files changed

+306
-223
lines changed

docs/automation/EX-RAIL-intro.rst

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,11 @@ Introduction to EX-RAIL Automation
66
17 Feb 2022: *Now included* in **DCC++EX 4.0!**
77
Available to download and use now!
88

9-
* :ref:`automation/EX-RAIL-intro:Introduction`
10-
* :ref:`automation/EX-RAIL-intro:Things You Can Do With EX-RAIL`
11-
* :ref:`automation/EX-RAIL-intro:What You Don't Need`
12-
* :ref:`automation/EX-RAIL-intro:How It Works`
13-
* :ref:`automation/EX-RAIL-intro:The Automation Process`
14-
* :ref:`automation/EX-RAIL-intro:Some Simple Examples`
15-
* :ref:`automation/EX-RAIL-intro:Defining Turnouts`
16-
* :ref:`automation/EX-RAIL-intro:Defining Signals`
17-
* :ref:`automation/EX-RAIL-intro:Starting the system`
18-
* :ref:`automation/EX-RAIL-intro:Drive-Away Feature`
19-
* :ref:`automation/EX-RAIL-intro:Roster Entries`
20-
* :ref:`automation/EX-RAIL-intro:Sounds`
21-
* :ref:`automation/EX-RAIL-intro:Sensors`
22-
* :ref:`automation/EX-RAIL-intro:Outputs`
23-
* :ref:`automation/EX-RAIL-intro:Sequence Numbers`
24-
* :ref:`automation/EX-RAIL-intro:Tips and Techniques`
25-
* :ref:`automation/EX-RAIL-intro:Why Can't I Put a Script on an SDCard?`
9+
.. sidebar:: On this page
2610

11+
.. contents::
12+
:depth: 1
13+
:local:
2714

2815
Introduction
2916
==============
@@ -41,6 +28,16 @@ To begin, let's define a few terms:
4128

4229
Most people wanting to do animations or run trains through an automated route will use a SEQUENCE, but those with :doc:`throttles </throttles/index>` that support it (:doc:`/throttles/engine-driver`, :doc:`WebThrottle-EX </throttles/ex-webthrottle>`) can add routes and automations. Both of these terms are just tags that let throttles with this feature automatically assign sequences to control buttons. "Routes" go into route buttons and can set turnouts, signals, etc., so you can drive your train along that route. "Automations" can appear on a "handoff" button that will supply or handoff the Loco ID to EX-RAIL where it can take over and run the train autonomously. An automation example would be manually driving a train into a station and pressing the assigned handoff button in the throttle that runs an AUTOMATION to take it on a journey around the layout.
4330

31+
Things You Can Do With EX-RAIL
32+
====================================
33+
34+
- Create "Routes" which set multiple turnouts and signals at the press of a button in WebThrottle-EX or EngineDriver (other WiThrottle-compatible throttles are available)
35+
- Automatically drive multiple trains simultaneously, and manage complex interactions such as single line working and crossovers by setting up "Automations"
36+
- Drive trains manually, and hand a train over to an Automation
37+
- Animate accessories such as lights, crossings, or cranes
38+
- Intercept turnout changes to automatically adjust signals or other turnouts
39+
- Turn on the coffee pot when the train reaches the station
40+
4441
.. sidebar:: A note from the Author
4542

4643
My original aim was to see if I could create an automated layout with lots going on, that didn’t just run around in circles. Having looked at JMRI (briefly, I must say) and DCC++, I began to wonder whether I could actually make a simpler automation system, and run it entirely on the Arduino used for DCC++.
@@ -55,18 +52,6 @@ Most people wanting to do animations or run trains through an automated route wi
5552

5653
- Chris Harlow
5754

58-
59-
60-
Things You Can Do With EX-RAIL
61-
====================================
62-
63-
- Create "Routes" which set multiple turnouts and signals at the press of a button in WebThrottle-EX or EngineDriver (other WiThrottle-compatible throttles are available)
64-
- Automatically drive multiple trains simultaneously, and manage complex interactions such as single line working and crossovers by setting up "Automations"
65-
- Drive trains manually, and hand a train over to an Automation
66-
- Animate accessories such as lights, crossings, or cranes
67-
- Intercept turnout changes to automatically adjust signals or other turnouts
68-
- Turn on the coffee pot when the train reaches the station
69-
7055
What You Don't Need
7156
====================
7257

docs/automation/EX-RAIL-reference.rst

Lines changed: 219 additions & 151 deletions
Large diffs are not rendered by default.

docs/automation/EX-RAIL-summary.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ __________________________________
125125
* - DELAYRANDOM( min_delay, max_delay )
126126
- Delay a random time between min and max milliseconds
127127
* - IF( sensor_id )
128-
- If sensor activated or latched, continue. Otherwise skip to ELSE or matching ENDIF
128+
- If sensor activated or latched, continue, otherwise skip to ELSE/ENDIF, use negative values for active HIGH sensors
129129
* - IFNOT( sensor_id )
130-
- If sensor NOT activated and NOT latched, continue. Otherwise skip to ELSE or matching ENDIF
130+
- If sensor NOT activated and NOT latched, continue, otherwise skip to ELSE/ENDIF, use negative values for active HIGH sensors
131131
* - IFCLOSED( turnout_id )
132132
- Check if turnout is closed
133133
* - IFGTE( sensor_id, value )
@@ -223,15 +223,15 @@ __________________________________
223223
* - :category:`--- Sensor input & event handlers ---`
224224
-
225225
* - AT( sensor_id )
226-
- Wait until sensor is active/triggered
226+
- Wait until sensor is active/triggered, use negative values for active HIGH sensors
227227
* - ATTIMEOUT( sensor_id, timeout_ms )
228-
- Wait until sensor is active/triggered, or if the timer runs out, then continue and set a testable "timed out" flag
228+
- Wait until sensor is active/triggered, or if the timer runs out, then continue and set a testable "timed out" flag, use negative values for active HIGH sensors
229229
* - ATGTE( analogpin, value)
230230
- waits for analog pin to reach value
231231
* - ATLT (analogpin,value)
232232
- waits for analog pin to go below value
233233
* - AFTER( sensor_id )
234-
- Waits for sensor to trigger and then go off for 0.5 seconds
234+
- Waits for sensor to trigger and then go off for 0.5 seconds, use negative values for active HIGH sensors
235235
* - LATCH( sensor_id )
236236
- Latches a sensor on (Sensors 0-255 only)
237237
* - UNLATCH( sensor_id )

docs/conf.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,20 @@
8383

8484
html_favicon = "./_static/images/favicon.ico"
8585

86+
# Added commented out lines below for 'titles_only' and 'navigation_depth'.
87+
# If we wish to have the menu expand to lower levels than just page titles,
88+
# uncomment these lines and comment the other option out to enable this in
89+
# the menu.
8690
html_theme_options = {
8791
'style_nav_header_background': 'white',
8892
'logo_only': True,
8993
# Toc options
9094
'includehidden': True,
95+
# 'titles_only': False,
9196
'titles_only': True,
9297
'collapse_navigation': False,
93-
'navigation_depth': -1
98+
# 'navigation_depth': 3
99+
'navigation_depth': -1
94100
}
95101

96102
html_context = {

docs/throttles/tech-reference.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@ All throttle specific commands are summarised here, refer below for elaboration
2525
- Response
2626
- Description
2727
* - ``<JT>``
28-
- ``<jT ID1 ID2 ID3 ...>``
28+
- ``<jT id1 id2 id3 ...>``
2929
- Returns the defined turnout IDs.
30-
* - ``<JT ID>``
31-
- ``<jT ID state "[description]">``
30+
* - ``<JT id>``
31+
- ``<jT id state "[description]">``
3232
- Returns the ID, state, and description of the specified turnout ID.
3333
* - ``<JA>``
34-
- ``<jA ID1 ID2 ID3 ...>``
34+
- ``<jA id1 id2 id3 ...>``
3535
- Returns the defined automation and route IDs.
36-
* - ``<JA ID>``
37-
- ``<jA ID type "[description]">``
36+
* - ``<JA id>``
37+
- ``<jA id type "[description]">``
3838
- Returns the ID, type (A=automation or R=route), and description of the specified automation/route ID.
3939
* - ``<JR>``
40-
- ``<jR ID1 ID2 ID3 ...>``
40+
- ``<jR id1 id2 id3 ...>``
4141
- Returns the defined roster entry IDs.
42-
* - ``<JR ID>``
43-
- ``<jR ID "description" "function1/function2/function3/...">``
42+
* - ``<JR id>``
43+
- ``<jR id "description" "function1/function2/function3/...">``
4444
- Returns the ID, description, and function map of the specified roster entry ID.
4545
* - ``<t cabid>``
4646
- ``<l cabid slot speedbyte functionMap>``

docs/turntable-ex/get-started.rst

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ Getting started
66
:alt: Conductor Level
77
:scale: 50%
88

9+
.. sidebar:: On this page
10+
11+
.. contents::
12+
:depth: 2
13+
:local:
14+
915
Assembly
1016
=========
1117

@@ -99,7 +105,7 @@ Summary table of all connections required during assembly:
99105
Of course for the Tinkerers and Engineers, if you're not using a Nano or a prototyping shield, adapt the details as suits your configuration.
100106

101107
1. BEFORE you start
102-
^^^^^^^^^^^^^^^^^^^^
108+
____________________
103109

104110
Gather all your components and visually check them all for any obvious damage, paying particular attention to pins on the Arduino to make sure they are straight.
105111

@@ -112,7 +118,7 @@ Gather all your components and visually check them all for any obvious damage, p
112118
:scale: 50%
113119

114120
2. Insert the Nano into the shield
115-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
121+
___________________________________
116122

117123
Insert the Nano into the prototype shield socket, taking care to ensure the USB socket is located at the same end as the DC power jack, and that all pins are straight and aligned correctly with the female headers.
118124

@@ -135,7 +141,7 @@ With the shield used in these assembly photos, you will note that each of the Na
135141
:scale: 50%
136142

137143
3. Connect the stepper controller and motor
138-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
144+
____________________________________________
139145

140146
Firstly, note that the ULN2003 controller will have four pins marked "IN1" through "IN4", as well as a pair of pins with "+" and "-". There is a likely a jumper installed across two pins beside these that is unmarked, leave this in place.
141147

@@ -180,7 +186,7 @@ Insert the stepper motor connector into the recepticle on the ULN2003 controller
180186
:scale: 50%
181187

182188
4. Connect the hall effect sensor
183-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
189+
__________________________________
184190

185191
The hall effect sensor has three pins, and likely only two of these pins are marked, the left with "-" and right with "S". The middle pin is likely to be unmarked, and will be the 5V pin. There are probably many different varieties of sensors and designs out there, but both that I have (from different suppliers) are marked identically.
186192

@@ -209,7 +215,7 @@ Use three of the Dupont wires and connect these from the hall effect sensor to t
209215
:scale: 50%
210216

211217
5. Connect the dual relay board
212-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
218+
________________________________
213219

214220
Note there should be six pins on the dual relay board marked "VCC", "GND", "IN1", "IN2", "COM", and "GND". The "COM" and "GND" pins should have a jumper installed to connect these together. Leave this in place.
215221

@@ -240,7 +246,7 @@ Use four Dupont wires to connect the other four pins as below:
240246
:scale: 50%
241247

242248
6. Connect power and test
243-
^^^^^^^^^^^^^^^^^^^^^^^^^^
249+
__________________________
244250

245251
At this point, it should be safe to plug in the power supply to the DC power jack on the prototyping shield.
246252

@@ -261,7 +267,7 @@ To validate the hall effect sensor is connected correctly, put a magnet in close
261267
:scale: 50%
262268

263269
7. Load the Turntable-EX software
264-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
270+
__________________________________
265271

266272
.. tip::
267273

@@ -288,7 +294,7 @@ If you don't have the magnet installed at this point, or if it is too far from t
288294
If your testing of the hall effect sensor in step 6 above succeeded, then the issue is likely to be the distance the magnet is from the sensor, and this will require adjustment. See :ref:`turntable-ex/troubleshooting:troubleshooting turntable-ex` for further assistance if required.
289295

290296
Automatic calibration
291-
""""""""""""""""""""""
297+
^^^^^^^^^^^^^^^^^^^^^^
292298

293299
.. note::
294300

@@ -316,7 +322,7 @@ At this point, the full turn step count is written to the Arduino's EEPROM so th
316322
You can now safely power off Turntable-EX and remove the USB cable from your PC as it is no longer required for normal operation, and all further commands will be issued by the CommandStation.
317323

318324
8. Add the Turntable-EX device driver to CommandStation-EX
319-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
325+
___________________________________________________________
320326

321327
.. note::
322328

@@ -404,7 +410,7 @@ Follow the rest of the directions for :ref:`reference/software/hal-config:adding
404410
Note there is no point in checking the driver at this stage as Turntable-EX is not connected, and will show as "OFFLINE".
405411

406412
9. Connect Turntable-EX to your CommandStation
407-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
413+
_______________________________________________
408414

409415
To control Turntable-EX from your CommandStation, you will need a connection to the I2C (SDA, SCL) pins.
410416

docs/turntable-ex/index.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ Turntable-EX (Beta)
55
Welcome to the home of Turntable-EX, a fully integrated turntable controller for DCC++ EX.
66

77
.. toctree::
8-
:maxdepth: 1
8+
:maxdepth: 1
99

10-
turntable-ex
11-
get-started
12-
test-and-tune
13-
traverser
14-
configure
15-
troubleshooting
10+
turntable-ex
11+
get-started
12+
test-and-tune
13+
traverser
14+
configure
15+
troubleshooting

docs/turntable-ex/test-and-tune.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ Testing, Tuning, and Control
66
:alt: Conductor Level
77
:scale: 50%
88

9+
.. sidebar:: On this page
10+
11+
.. contents::
12+
:depth: 2
13+
:local:
14+
915
Turntable-EX commands
1016
======================
1117

docs/turntable-ex/traverser.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ Traversers and Limited Rotation Turntables
66
:alt: Tinkerer Level
77
:scale: 50%
88

9+
.. sidebar:: On this page
10+
11+
.. contents::
12+
:depth: 2
13+
:local:
14+
915
Overview
1016
=========
1117

docs/turntable-ex/turntable-ex.rst

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,33 @@ Overview
66
:alt: Conductor Level
77
:scale: 50%
88

9+
.. sidebar:: On this page
10+
11+
.. contents::
12+
:depth: 2
13+
:local:
14+
915
What is Turntable-EX?
1016
======================
1117

12-
.. note::
18+
Turntable-EX is a fully integrated turntable controller, using an additional Arduino microcontroller to drive a stepper driver to rotate a turntable and align the bridge track with the surrounding layout tracks. An Arduino Nano or Uno are suitable microcontrollers for Turntable-EX.
19+
20+
The aim is to keep things as simple as possible, and to maintain alignment with the categories of our users as defined in our :ref:`get-started/levels:choose your level` guide for CommandStation-EX (Conductor, Tinkerer, and Engineer).
21+
22+
The out-of-the-box example configuration should allow a Conductor level user to get up and running relatively quickly using the ubiquitous ULN2003/28BYJ-48 stepper driver and motor combination that are readily available.
23+
24+
To make full use of Turntable-EX, you will need a basic understanding of :ref:`EX-RAIL<automation/ex-rail-intro:introduction to ex-rail automation>` automation, but we'll share the details and some examples to help with this.
25+
26+
Essentially, if you have setup your own CommandStation, the expectation is that Turntable-EX will be a natural extension of this, and be equally as easy to setup (at least from the electronics and software perspective).
27+
28+
.. note::
1329

1430
Turntable-EX is in public Beta testing, and as such, we encourage regular feedback on the success or otherwise of both the software and documentation. Please reach out via any of our support methods and help us get Turntable-EX as easy to use and reliable as possible.
1531

1632
For a current overview of all outstanding feature requests or enhancements and known bugs to be fixed, visit the Turntable-EX view of the `DCC++ EX GitHub project <https://github.com/orgs/DCC-EX/projects/7/views/1>`_.
1733

1834
For those who wish to help us with Beta testing, you're encouraged to follow the testing processes outlined in the `Regression Testing process <https://github.com/DCC-EX/Support-Planning/blob/master/Testing/Turntable-EX/TTEX_Regression_Testing.md>`_, and then submit your test results using the `Beta Test Results <https://github.com/DCC-EX/Turntable-EX/issues/new/choose>`_ issue template.
1935

20-
Turntable-EX is a fully integrated turntable controller, using an additional Arduino microcontroller to drive a stepper driver to rotate a turntable and align the bridge track with the surrounding layout tracks. An Arduino Nano or Uno are suitable microcontrollers for Turntable-EX.
21-
22-
The aim is to keep things as simple as possible, and to maintain alignment with the categories of our users as defined in our :ref:`get-started/levels:choose your level` guide for CommandStation-EX (Conductor, Tinkerer, and Engineer).
23-
24-
The out-of-the-box example configuration should allow a Conductor level user to get up and running relatively quickly using the ubiquitous ULN2003/28BYJ-48 stepper driver and motor combination that are readily available.
25-
2636
.. sidebar:: Supported stepper drivers and motors
2737

2838
.. image:: ../_static/images/conductor.png
@@ -37,10 +47,6 @@ The out-of-the-box example configuration should allow a Conductor level user to
3747

3848
Using other pre-defined, supported stepper drivers and motors should also be achievable at the Conductor level, but may enter into Tinkerer territory depending on the specific hardware.
3949

40-
To make full use of Turntable-EX, you will need a basic understanding of :ref:`EX-RAIL<automation/ex-rail-intro:introduction to ex-rail automation>` automation, but we'll share the details and some examples to help with this.
41-
42-
Essentially, if you have setup your own CommandStation, the expectation is that Turntable-EX will be a natural extension of this, and be equally as easy to setup (at least from the electronics and software perspective).
43-
4450
The Turntable-EX integration includes:
4551

4652
* Support for an Arduino Nano or Uno

0 commit comments

Comments
 (0)