rocnet:article-en
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | rocnet:article-en [2018/11/12 08:56] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | | //This is an article of RocNet for the MERG Journal planned for Vol 48-4, the Christmas Edition.// (Britisch English please...) | | ||
+ | |||
+ | |||
+ | \\ | ||
+ | {{: | ||
+ | |||
+ | \\ | ||
+ | ====== Model Railway Automation with Raspberry Pi. ====== | ||
+ | The popular and inexpensive Raspberry Pi((“Raspberry Pi" is a trademark of the Raspberry Pi Foundation.)) tiny PC offers some interesting I/O like I2C and GPIO. Because the I2C bus is a common and standard one, the idea to use it for Model Railway automation was born in 2013.\\ | ||
+ | Together with Peter Giling, who lives in the Netherlands, | ||
+ | And I am Rob Versluis, living in Germany, the founder and main developer of the Rocrail Project: __**http:// | ||
+ | |||
+ | ===== History ===== | ||
+ | In September 2011, before the Raspberry Pi was released, one forum member mentioned that the Raspberry Pi might make for a Rocrail server that would fit under the layout. | ||
+ | |||
+ | Various forum members also tried a variety of TCP/IP protocols like SRCP (1). \\ | ||
+ | While SRCP is certainly one possibility, | ||
+ | |||
+ | While this was occurring, various other experiments were conducted by Peter and others.\\ | ||
+ | A variety of I2C (3) peripheral devices were tried for various functions.\\ | ||
+ | Some were successful, some less so. One fact became increasingly clear as a result of these experiments. The Raspberry Pi (and its I2C bus) is a stable, robust and very capable platform.\\ | ||
+ | The very best of these prototypes resulted in modules available from GCA (= Giling Computer Applications). | ||
+ | In retrospect the Linux based Raspberry have proven to be more than just a simple controller for model railways.\\ | ||
+ | Coupled with Rocrail/ | ||
+ | \\ | ||
+ | **(1) SCRP = Simple Railraod Command Protocol**\\ | ||
+ | \\ | ||
+ | (2) **TCP/IP socket communications** requires that the IP address of the remote node be known before communications can start.\\ | ||
+ | To resolve this issue, IP-Multicast is used so that remote node communications can occur without prior knowledge of the destination IP address.\\ | ||
+ | This also means that the Raspberry' | ||
+ | \\ | ||
+ | (3) **I2C = IIC = Inter Integrated Circuit**.\\ | ||
+ | This hardware based communication protocoll , originated by Philips, is a 2 wire communication system between chips on the ame board.\\ | ||
+ | Later improvements and speed-up, together with availability of bus transcievers and buffers like used in the RocNet modules, made it possible to extend the communication lines to more than 10 meter. | ||
+ | \\ | ||
+ | |||
+ | ===== Setup ===== | ||
+ | The whole system is kind of like ' | ||
+ | An Internet gateway is only necessary for updating the Rocnetnode software.\\ | ||
+ | |||
+ | ====Small or Large==== | ||
+ | |||
+ | The following diagram shows a small and a large setup example:\\ | ||
+ | | {{: | ||
+ | The DHCP-Switch ( a small box used to interconnect TC/IP devices) is responsible for assigning IP addresses to the RasPi' | ||
+ | The large setup example is especially interesting for modular layout like my own ' | ||
+ | |||
+ | |||
+ | \\ | ||
+ | |||
+ | ===== Software ===== | ||
+ | The Rocrail project has developed a protocol based on IP-Multicast Ethernet communication which was chosen for this RasPi solution.\\ | ||
+ | The Rocnetnode is the software part running on the RasPi and will manage I/O, Servos and throttles. All hardware modules are I2C based and do not need any firmware; Rocnetnode handles it all.\\ | ||
+ | The Rocnet Protocol is Open Source and is documented on the Rocrail Wiki pages: __**http:// | ||
+ | |||
+ | \\ | ||
+ | |||
+ | =====Hardware===== | ||
+ | This diagram shows the many and flexible possibilities of the Raspberry Pi solution in combination with Rocrail and Rocnetnode: | ||
+ | {{: | ||
+ | |||
+ | \\ | ||
+ | ==== Available modules ==== | ||
+ | ^ Interface | ||
+ | | [[: | ||
+ | | [[: | ||
+ | \\ | ||
+ | |||
+ | **There are seven hardware modules available: | ||
+ | | Pi01 | The main module which connects directly on the RasPi GPIO header. | | ||
+ | | Pi02 | 32 port I/O module which is compatible with all GCA interface modules: __**http:// | ||
+ | | Pi03 | 16 port PWM module for controlling servos. It's an adapter for the Adafruit PCA9685 PWM controller. \\ Also usable for dimming LEDs (4095 steps) | | ||
+ | | Pi04 | A hand-held throttle with 28 functions. | | ||
+ | | Pi05 | Large scale decoder which can report RFID tags scanned between the tracks. (This is still work in progress.) | | ||
+ | | Pi06 | 3A power supply and I2C hub together | | ||
+ | | Pi07 | Zero loss occupancy detection which can handle low and high current for large scale locos. | \\ | ||
+ | \\ | ||
+ | All modules have I2C line drivers to make long cables possible.\\ | ||
+ | You can choose between RJ45(CAT) and RJ12(LocoNet) connector types.\\ | ||
+ | I personally prefer RJ12 because this type is easy to assemble yourself with very flexible cable, and it cannot be accidentally swapped with the RJ45 Ethernet cables.\\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | |||
+ | ===Pi01 Raspberry Pi connection=== | ||
+ | The Pi01 connects on the RasPi GPIO header and serves also as a power supply when connected to the Pi06.\\ | ||
+ | {{: | ||
+ | The board offers two LEDs and one button. The green LED starts to blink if Rocnetnode has been started.\\ | ||
+ | The red LED is used for identification when requested by Rocrail, which is very useful in the case of a large setup.\\ | ||
+ | A short push on the button will identify this Rocnetnode to Rocrail and will popup the configuration utility with this node selected.\\ | ||
+ | A long push of several seconds duration will shutdown this RasPi as indicated by fast blinking of the green LED.\\ | ||
+ | |||
+ | It is not necessary to shutdown the RasPi because the configuration is saved on the SD-Card. But for those who will get a bad conscience when pulling the power supply plug of a Raspberry Pi, the shutdown(all) option is available in some variations.\\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ===Pi02=== | ||
+ | {{: | ||
+ | The Pi02 is a module with 32 programable I/O for a wide range of applications like: | ||
+ | * LEDs (Signals) | ||
+ | * Pushbuttons | ||
+ | * Frog polarisation | ||
+ | * Coil switches | ||
+ | * Servos | ||
+ | * and so on... | ||
+ | |||
+ | ==Interfaces== | ||
+ | The list of compatible interfaces for the Pi02 is long and is documented here: __**http:// | ||
+ | |||
+ | A small overview of possible interfaces: | ||
+ | * Occupancy detection based on current: **GCA93** | ||
+ | * Hall sensors and reed contacts (Magnets): **GCA173** | ||
+ | * Fiddle Yard / Turntable / Traverse controller: **GCA145** | ||
+ | * Coil drivers up to 10A: **GCA76**, **GCA77** | ||
+ | * Relay board for frog polarisation: | ||
+ | * Servo drivers: **GCA136** | ||
+ | |||
+ | LEDs or other low power consuming parts can be connected directly with the needed resistor.\\ | ||
+ | Also push buttons can be connected directly to be able to create a CTC.\\ | ||
+ | \\ | ||
+ | |||
+ | ===Pi03 PWM Controller=== | ||
+ | The Pi03 uses the Adafruit PCA9685 PWM controller as piggyback because the footprint of the chip is for our techniques too small.\\ | ||
+ | {{: | ||
+ | An alternative would have been to let the chip be mounted directly on the professional board but this investment would not fit in our hobby budget.\\ | ||
+ | But also as piggyback solution this board is just great for servos and general PWM. (Day and Night lighting.)\\ | ||
+ | |||
+ | |||
+ | \\ | ||
+ | |||
+ | ===Pi04 Throttle=== | ||
+ | This throttle, also called ' | ||
+ | {{: | ||
+ | The commandos are scanned by Rocnetnode running on the RasPi and are forwarded to Rocrail.\\ | ||
+ | Rocrail will dispatch the received commands to the configured Command Station in its own native protocol like Xpressnet for example.\\ | ||
+ | It can be hot plugged in any free I2C connector.\\ | ||
+ | === Features === | ||
+ | * Rotary knob for speed; 50 steps which are recalculated to meet the real loco speed steps. | ||
+ | * Direction switch with V=0 position. | ||
+ | * 28 functions divided in groups of 4. The group number is represented as binary number by the LEDs above the buttons. | ||
+ | * Lights. | ||
+ | * Flashing Scan/Run LED. | ||
+ | * Up to 8 connected on one RocNetNode. | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ===Pi06 Power Supply=== | ||
+ | The Pi06 serves as power supply for all modules and the RasPi.\\ | ||
+ | {{: | ||
+ | It also is a concentrator for the I2C bus.\\ | ||
+ | It has only four connectors but all modules can be daisy chained in sequence.\\ | ||
+ | |||
+ | The project was started using common 5V USB power supplies but that solution has been dropped because of the bad quality of those units and never delivered the promised 5V.\\ | ||
+ | The Pi06 made the project more accepted by avoiding many unwanted 5V adapters.\\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ===Pi07 Zero loss current detection=== | ||
+ | The original idea came from Richard Andrews (Texas).\\ | ||
+ | {{: | ||
+ | Peter and I did not take it very serious at start but Richards experiments came to a good useable result.\\ | ||
+ | After prototyping by Peter we added this to the Pi line of hardware.\\ | ||
+ | |||
+ | |||
+ | \\ | ||
+ | |||
+ | =====Modular Example===== | ||
+ | I already migrated two modules. Module 2 is shown in the picture below with all its hardware:\\ | ||
+ | {{: | ||
+ | * Software Command Station: RocNetNode + DCC232 + ORD3/4 -> __**http:// | ||
+ | * Only one 16V AC 70VA transformer is needed for the whole ' | ||
+ | * The small Ethernet Switch is a low budget one for less the €10 which can be daisy chained from one layout module to the other. | ||
+ | |||
+ | |||
+ | \\ | ||
+ | |||
+ | =====Configuration===== | ||
+ | For configuring the Rocnetnode options, I/O and Servos there is a very advanced utility in Rocrail in which every detail can be viewed and set.\\ | ||
+ | {{: | ||
+ | |||
+ | ====Configuration Tabs==== | ||
+ | ^ Tab name ^ Configuration ^ | ||
+ | | **Index** | A list of automatically registered Rocnetnodes. | | ||
+ | | **RocNet** | A tree view of all nodes with the basic settings. | | ||
+ | | **Options** | Defines which hardware is connected; Even the SPROG can be included. | | ||
+ | | **Pi02 Port Setup** | I/O configuration. | | ||
+ | | **Pi03 Channel Setup** | Servo and/or PWM configuration. | | ||
+ | | **Macro** | Especially for signal system with more then 4 aspects. | | ||
+ | | **Update** | On the fly update the Rocnetnode software. | | ||
+ | See for detailed information: | ||
+ | |||
+ | |||
+ | \\ | ||
+ | |||
+ | ===== Boards and Kits ===== | ||
+ | Professional boards and kits can be ordered at the Web site of Peter Giling : __**http:// | ||
+ | Also a pre-configured SD-Card or Micro Sd-Card with installed Raspbian and Rocnetnode is available in combination with an order.\\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ===== Support ===== | ||
+ | The support of Rocrail and all related Hardware is covered by a very good Forum with many good Moderators.\\ | ||
+ | The Forum Internet address is: __**http:// | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ===== The Future ===== | ||
+ | Because the Raspberry Pi OS is Open Source, the Rocrail/ | ||
+ | A sound client is one idea by using the audio output of the RasPi. | ||
+ | |||
+ | |||
+ | \\ | ||
+ | ===== Abbreviations ===== | ||
+ | ^ Abbreviation ^ Meaning ^ Internet link ^ | ||
+ | | I/O | Input/ | ||
+ | | I2C | Serial computer bus invented by Philips. | http:// | ||
+ | | GPIO | General Purpose I/O | http:// | ||
+ | | TCP/IP | Internet protocol suite | http:// | ||
+ | | SRCP | Simple Railroad Command Protocol | http:// | ||
+ | | GCA | Giling Computer Applications | http:// | ||
+ | | DHCP | Dynamic Host Configuration Protocol | http:// | ||
+ | | IP address | Internet Protocol address | http:// | ||
+ | | IP Multicasting | Sending Internet Protocol (IP) datagrams to a group of interested receivers | http:// | ||
+ | | RasPi | Short form of " | ||
+ | | PWM | Pulse-width modulation | http:// | ||
+ | | SD-Card | Secure Digital (SD) is a non-volatile memory card format for use in portable devices. | http:// | ||
+ | | CTC | Centralized traffic control | http:// | ||
+ | | FREMO | Freundeskreises Europäischer Modellbahner – FREMO e. V. | http:// | ||
+ | | Ethernet Switch | Network Switch(Hub) | http:// | ||
+ | |||
rocnet/article-en.txt · Last modified: 2018/11/12 08:56 by 127.0.0.1