Discussion in 'Workbenches, including workshop techniques.' started by parky, 14 January 2019.

  1. parky

    parky Western Thunderer

    Following on from my mention of MERG in my Workbench thread, I will split that topic out here so we can give it the attention it requires

    Starting off with ne of my DCC setups. This is my basic home version that I made portable. It did include a 5A booster as built but that has been replaced by a 10A version while I built a booster for someone else (you never know when a whole yard of Heljan sound fitted locos might appear at our local club) :)

    DCC in a box.jpg

    I also built larger setup for one of the OO gauge layouts that I work on at the club. It does include more District cutouts DCO as it's split up into three bus bars and the DCO's mean that if a short occurs on one circuit the rest of the layout still runs. Very advantageous at exhibitions so I am told

    So working around from top right and around to top left
    CANUSB4 which is the USB computer interface
    CANCMD the main DCC board
    Booster 5A or 10A depending on some resistor changes as you build it
    District Cut Out DCO can be set at 1.5A or 3A for current limiting
    Raspberry Pi 3B running Raspian/JMRI and acting as a wireless access point

    Control is by phone of your choice Windows/Android/Apple using Engine Driver/IThrottle. A screen can be plugged into the RPi and used along with the Bluetooth keyboard/trackpad which is included in the setup

    I used the RPi3b as it comes with WiFi built in. A bit of reconfiguration and that can be turned into a Wireless access point. Other people use a separate WiFi system but this saves yet another component. I have plugged the RPi into my home network at one stage and used the WiFi that is already there, which is another option

    A further alternative is to plug the CANUSB4 directly into a laptop running JMRI and then you have the full KVM setup It also saves the cost of a RPi

    I quite often run the system headless as I have also configured the JMRI to load on boot so you just plug it in, wait a bit and connect the phone. Some will castigate me for this but I just take the power away to shut it all down. I wouldn't do that if it was running Windows, but Linux is a bit more resilient and if it does corrupt I can just restore the image

    Ah another thing I considered was security. Putting a password on the WiFi means that no one else takes control of your layout especially at exhibitions

    So for me it fits with how I see a setup like this working and it fits in with my learnings on spending now I live in Yorkshire :D

    I did start off with an NCE PowerCab, but didn't fancy paying out another £150 to get the 5A booster. Adding another handset by someone else spending their Dosh added another £150. See learning Yorkshire

    This whole lot is about £200 all in and if you want another handset get out that redundant phone from the drawer. It's great for use at the club as any visitors that turn up you can set their phone up for a running session. If you are paranoid you can change the password after they have gone :thumbs:

    Next edition will be digging into CBUS and the boards on offer. Add any questions on the above and I can go through them as well
    simond, 76043 and adrian like this.
  2. adrian

    adrian Flying Squad

    Thanks for posting - I've only been dipping into the MERG CBUS units so a quick question. Originally I believe they were 5v units but there are modifications to run them off a standard 12v supply. Are you running 5v or 12v units? So far the few units I've built I've modified to 12v supply.

    I was quite chuffed to manage to build the CANPAN module with a little modification into a little hand held control box (I've been using ethernet connectors for CBUS network - just for simple cabling between baseboards and control unit.

    merg - 1.jpg

    all this fitted into this ( it was quite a tight fit but it did go!!)

    merg - 2.jpg

    My kids have been upgrading their phones so I have a box full of old iPhones which I'm thinking will be perfect wireless throttles hence my interest in Raspberry Pi / JMRI interface.
    76043 likes this.
  3. parky

    parky Western Thunderer

    I see where you are going now Adrian. I have kept my setup standard and was looking at what it could do by design


    The left hand sheet of ply and the right hand board is a CANACE8 which is just a switch or other 5v input. The other one is a CANSERVO8 which is another board modified slightly to drive servos though if you want more that one it needs a separate 5v supply
    These are the old school boards and the CANSERVO8 takes 15v AC as this comes from an era when everyone had a Duette or similar with that accessory output. The CANACE8 is powered at 5v DC which is a product of the CANSERVO8 and is linked by the orange wire across the top

    The right hand ply board is the one you will be interested in Adrian as it's all 12v DC powered. For running the whole lot off my 15v AC supply for ease the little boards top left are just some cheap 15v AC to 12v DC convertors at a princely sum of 80p each
    So working around the boards. The top right is the new CANMIO which is the one which is the equivalent to the CANSERVO8 and has the capacity to self power all 8 servos. This board has been designed as a modular system and you just build it slightly differently for other options like an input board
    Lower left is the CANUSB4 as used on the DCC system to allow for connection of an RPi/laptop. The middle is just a CBUS activity monitor which just flashes away when it sees data on the Bus
    Lower right is the CANPAN in it's standard format with the test board sitting on top. This allows you to have button and LEDs locally before you connect it into your layout system

    Sorry but I made the wiring a bit confusing as I have used blue and yellow for both 15v AC and the data bus. On the right board you will see there is the black and red of the 12v DC off the regulator boards going to each module. The blue and yellow off each board go into a choc block with some clear speaker wire in. This is all that is used for the CBUS and is what the 2 wire system is all about for those that were mystified about it

    JMRI and RPi next up now I have described each board
  4. parky

    parky Western Thunderer

    Thinking about it, it might be worth going through the whole gambit of Flim/Slim and then onto JMRI Decoder Pro/Panel Pro
  5. Pannier Tank

    Pannier Tank Western Thunderer

    Firstly, thank you Alan for starting this MERG/DCC thread.

    I like your use of "Really Useful Boxes" to house your Portable MERG / DCC Setup.

    I have also built the MERG Booster (5A) for use with the NCE Power Cab. CBUS wise I have built the CANUSB4 and the CANPAN with the CANTM7 Test Module plus I have a CANmio Board and a CANPiCAP to build. I think once MERG start producing further variations of the CANmio Boards that will be the way to go for "new builds". I'm in the process of setting up a Work Bench in the Railway Room so that I can progress with setting it all up.

    Interesting to hear you are using the Raspberry Pi 3B running Raspian/JMRI are you using the MERG CANPiCAP?

    I look forward to reading / learning from this thread.
    Last edited: 14 January 2019
  6. Pannier Tank

    Pannier Tank Western Thunderer

    Adrian, you did well to squeeze all of that into the Hand Held Control Box. Nice box by the way.
  7. parky

    parky Western Thunderer

    David, I use the CANUSB4 for the interface using an A to B cable like you get with printers. It sits on the CBUS like the rest of the modules and if desired the two setups can be connected via a common bus

    The DCC setup just works without any setup, it's the older style CBUS board on the left ply board that that can use the earlier SLIM setup. As built they can learn and react to actions between each other (Simple Layout)

    The later modules work on FLIM (Full Layout) and each has a unique identity and you configure it via the FLIM config and tell each what you require. Any permutation of input output can be configured so it can react to a number of inputs and drive a number of actions. These can then trigger an event somewhere else, so a full feedback system


    Once you have all these events configured this is then when you bring in Panel Pro. There you can create a track plan and assign the events to the likes of points. You can then select the point on the screen either by mouse or touch screen and the event is actioned. If you use Engine Driver on a phone you can select from a list of points and action it from there. Decoder Pro is the application that you use to as you would expect the loco decoders which is another feature within Engine Driver

    If you want to see a large implementation of all this then see if you can get a visit to Pete Waterman's Leamington Spa as that has so many modules that it has got two distinct buses. They do have a bridging module to join the two buses, but when I went they were plucking up the courage to put it in, in case it didn't go well. Whilst the config software is complex it does have the ability to save all the configuration and then if you have a failed module you can 'blow' it onto a replacement module

    So as you can see it's quite a competent system and quite a bit to get your head around. This is why I ended up buying a number of differing modules so that I could hang them all together and give it a go. I did consider fitting CBUS to the layout that I added the DCC unit, but considered it would be too complex a system for a layout that could potentially go to exhibitions

    Adrian's want of automation is possible, but needs a bit of work, let the discussions begin
    Last edited: 15 January 2019
  8. Kev T

    Kev T Active Member

    I notice that you’re using the software node to teach the events to the consumer modules. I struggle to get my head around this.
    what is the advantage doing it this way rather than using the producer nodes to teach the events? If I understand correctly there is no reason why you can’t have multiple producers doing the same thing,e.g.2mimic panels controlling the layout.

    I’m using the universal firmware for the Canmios which means I can use the servo midpoint happening on the points to operate a frog relay from Mioadd board on the same Canmio. It’s certainly a cost effective way of controlling a layout.
  9. parky

    parky Western Thunderer

    I amended the image as that was the default view when I opened the software which shows the CANMIO taking events from the CANACE8C

    Yes it's not the most intuitive software and I did ask whether we were to get a new version written in a higher level language. This version was considered logical to use. Having seen the config saved in the one that controls Pete Waterman's it's good to know that you can save it and reload it whenever you want
  10. Pannier Tank

    Pannier Tank Western Thunderer

    Thank for your detailed explanation of your setup and the use of Flim Utility. I look forward to setting up my CBUS Test Bench when no doubt I will have a few questions to ask on the Events and Event Variables etc.

    I assume you are doing your "Interlocking" with Panel Pro? Although I will be trying various methods of Interlocking, my long term aim is to use the Scalefour Lever Frame with a Arduino Mega for the Interlocking. I am currently experimenting with the Arduino using 14 on/off switches and 14 LED's.
  11. Kev T

    Kev T Active Member

    Now that's an understatement if ever I saw one.

    Will you be giving a breakdown on how you got the wireless stuff working? That'll be on my radar in late Spring. On that issue, is the wireless connectivity reliable, I shudder at the thought of a train at speed when the connection drops!

  12. parky

    parky Western Thunderer

    Raspberry Pi configuration as an access point is an easy one to do as it's all documented officially on the Raspberry Pi site

    Setting up a Raspberry Pi as an access point in a standalone network (NAT) - Raspberry Pi Documentation

    How to use your Raspberry Pi as a wireless access point - The Pi

    You don't need the Bridge section, but if you follow the instructions it just works. It's then out with the phone and search for your new WiFi network.

    Download Engine Driver and then you have to configure WiThrottle to auto-start and confirm the port you use when you run Engine Driver. The latest version of Engine Driver has a huge number of configurations and if you want to have an all encompassing experience then you could move to a tablet device
  13. Nigel Cliffe

    Nigel Cliffe Western Thunderer

    Or, even easier: buy a PI, download Steve Todd's SD card image containing all you need(*), put SD card into PI, and turn it on. It just works, is an access point as it powers up.

    ( * PI operating system, JMRI, pre-configured to auto-recognise many systems, including MERG )

    Link to Steve's Image file via this page: JMRI RaspberryPi as Access Point | M Steve Todd

    - Nigel
  14. parky

    parky Western Thunderer

    Nigel, Not seen that one and that makes it even easier for people that don't have the IT interest

    Not sure on the ability of Panel Pro to perform interlocking, but I was assuming if you got the logic right in FLIM then that would do it. The feedback from events should be able to be used to make these decisions and potentially block invalid ones
    The logic will be one big piece to do, but using the FLiM interface could be equally challenging. I am sure that once you get fully involved in using the FLiM config then it will become second nature, so I don't want to be seen as having a downer on it as I could never have created it
  15. Pannier Tank

    Pannier Tank Western Thunderer

    I look forward to learning more about Flim and seeing what options are available with regards Interlocking. Mortonhampstead Signal has only 11 Levers so the Locking Table is not too demanding.
  16. Nigel Cliffe

    Nigel Cliffe Western Thunderer

    It can do it. Depends what type of signalling you want to emulate. I wrote tutorials on UK signalling in JMRI many years ago, and the capabilities have improved since those were written. Mechanical box interlocking emulation is also possible, and I've known people implement that and use it to drive actual interlocking motors to lock a mechanical lever frame. (The one I can remember used the Scalefour Society frame kit, with a small servo motor below each lever to lock or release it in accordance with the locking rules).

    Its decision time - do it in the hardware/firmware of the CBUS modules, or do it entirely in the software on the JMRI computer. I'd find the JMRI side a lot quicker, simpler and more flexible, but that's my background.

    - Nigel
  17. parky

    parky Western Thunderer

    It's good that interlocking can be done in either software or hardware/firmware, it gives people an option depending upon their expertise. Also if you have tutorials on producing the results in JMRI then it saves me trying to describe FLiM too much

    I did look at those fabulous S4 locking frames, but have enough on the workbench to built without adding to it. I don't have a layout at present anyway so they are not needed. The plan is to build stock and run it at the club
  18. Pannier Tank

    Pannier Tank Western Thunderer

    Using the Scalefour Lever Frame with Servo Motors driving the Interlocking Frame is my preferred option; I just need to decide on a Mechanical Layout. Having the option of choosing to use a Lever Frame or Control Panel / JMRI Software would be nice. So I'm open to various options, just need to get on and do something!
  19. Nigel Cliffe

    Nigel Cliffe Western Thunderer

    The example I saw previously used the S4 lever frame (without the new locking kit). The levers were extended below their standard length, and a row of narrow servos (one size smaller than the standard servo) installed below the extended levers, with the servo output shaft immediately below the centre position of the lever frame lever. At the top of each servo's rotary shaft was a cylindrical "crown" (a cylinder with a wide slot cut across it). The servo rotates 90 degrees. When in "locked" the walls of the crown would prevent the lever from moving forwards or backwards. When "unlocked" the slot allows the lever to swing through to another position.

    So, locking that in software (opening and closing each servo as appropriate) would give a fully inter-locked frame, and the software could "unlock" everything to allow non-locked operation. And if left "unlocked" would also allow screen based running, rather than lever frame control.

    - Nigel
    simond likes this.
  20. JimG

    JimG Western Thunderer

    This brings back a memory of another fully interlocked frame - the one Les Bevis-Smith installed on his S scale "Thame" layout way back in the 70s. I think I remember that the interlocking on that was a long bar under the levers which in the UP position locked all the levers and in the down position allowed them to be pulled. The bar was operated when the catch on a lever was operated. You could only pull one lever so I reckon there was detection of more than one lever being pulled. The long bar was solenoid operated and it operated with quite a loud CLUNK. The electronic logic was provided by TTL or CMOS chips and was designed by a friend of Les. I thought that the single locking bar was a beautifully simple solution to locking a frame with electronic logic and I always intended to install something similar if I ever got the length of building a layout with a lever frame - and I haven't. :)