Article in Gazette Volume 20 number 2 - Feb 2017
Philip Willis
The Model Electronics Railway Group (MERG) has, for many years, designed and sold a range of electronic kits to support railway modellers. This includes some simple scenic electrical effects such as flickering LEDS to represent fires or welding, basic automation such as train shuttles, through to mimic panel support and many others. They also offer a wide range of electronic components as well as printed circuit boards and complete kits for more complex devices. All of this is backed by an excellent range of downloadable instructions and some very high quality Technical Bulletins giving more detailed advice. There are many years of experience behind all of this and at times you have to remind yourself that it is unpaid volunteers who have achieved it.
We read a lot about the merits of DCC compared to analogue but DCC isn’t the only digital option. MERG do offer some DCC items but I was very attracted to their own digital offering to control the points and, eventually, the signals on my own new layout. Their CBUS system makes use of a commercial digital bus called CANBUS: Controller Area Network. MERG explain that, for example, most modern cars use digital control of all the auxiliary items. When you flick a switch on the dashboard, it is more likely to be sending a digital message around the car’s digital network than it is to connect directly to the device you are controlling. CANBUS is the international standard for this digital network. For us railway modellers that means the chips to interface to the bus are cheap, have been around for a long time and are reliable in operation. MERG have fully exploited these features to produce a system which also offers some advantages compared to DCC.
It is worth making clear one particular difference between DCC and CBUS. DCC is designed to support a command system: Digital Command and Control. A central controller issues a command to a specific target device, which responds to it in a predetermined way. The target device has an address and the command has that address embedded in. It’s a bit like posting a letter (the command) which gets delivered to a particular house (the target) and causes something to happen there (such as you paying your gas bill).
CBUS works differently. Anything attached to the bus can issue a message. Anything attached to the bus can respond to that message, in ways of its own choosing. Several devices can respond to the same message; or none at all; or all of them. There is no target address in the messages. There can indeed be a traditional control panel but there can also be several; perhaps one for a fiddle yard, one for the main line and one for the branch line. But control panels have no special properties on the bus which distinguishes them from anything else on the bus. It is still the case that anything on the bus can send a message and anything on the bus can react to any message.
Physically the bus consists of a twisted pair of wires. This is literally two wires twisted together. The close intertwining means that any electrical noise is likely to be the same on both wires. Any voltage difference between the two wires is thus the wanted signal. Each end is terminated with a simple 120 ohm resistor. In addition a twin-wire AC supply is needed. This group of four wires runs around the layout and connects to the various MERG modules which do the useful work, such as changing the points.
My layout is on boards 1200mm above ground and the network runs on vertical fascia boards which support the plywood baseboards. This makes the network and other wiring very easy to install and maintain. The picture shows one end of my own network, tucked under the baseboard. At various convenient points around the layout, typically where there are groups of points, I have fixed 6-way tag strips. To these are soldered two 2-way power cables, which are in fact grey domestic lighting cable. The upper one provides the 16 VAC supply needed for the control boards. The lower one is reserved for a later low-voltage DC supply and is not in use at the moment. The lowest pair of tag strip contacts hold the green/yellow twisted pair which is the data bus. Normally all six of the wires continue to the next tag strip. Because this is the end of the run, there is a 120 ohm resistor across the twisted pair of data wires and the power cables stop as well. The data bus wire is two colours of conventional low-current flex, readily available from any of the usual suppliers. To twist it together, take a long length of each colour and knot one end of each together and fix it to anything convenient. Stretch the pair out to its fullest extent and put the other two ends in the chuck of a hand drill. Use the drill to do the twisting, tighter than you need because the wires will partly unravel when you release them. It is essential to use two colours because they need connecting in a consistent way.
The bus carries data messages and connects to every module. Each message corresponds to an Event. An Event means something has changed, such as a switch being thrown. Events can be ‘on’ events or ‘off’ events, just like the switch. This is just a labelling. All it means is that the ‘off’ event is the inverse to the ‘on’ event. The digital message includes this information, as well as the unique number of the Event. The twisted pair ensures that the message is broadcast to every module. Each module hears the message and decides what to do about it, which includes ignoring it.
Photo 2 shows a typical part of my own layout. The AC, DC and network connections run through the tag strip. The black wires are tapping into the AC supply and are taken via a fast-acting fuse to one of the MERG boards.
The board shown in photo 3 goes under the name CANACC5 but more important is what it is actually doing here, which is powering four slowacting point motors. The blue wires connected to the right-hand green connector go in pairs, one pair to each motor. The yellow heat-shrink on one of each blue pair makes sure I connect everything consistently and avoids confusion when trying to make each point go in the correct direction. This close-up also shows the labelled chip, which contains the software which gives the board its behaviour. You don’t have to programme this, it comes pre-loaded. As with DCC, the software does respond to certain parameters which you can change, as described later. The black AC supply wires feed into the board on its left, where the green/yellow network pair are also connected. The two large black metal objects are heat sinks associated with the power rails on the board. Look closely and you will also see a white disk with a cross-shaped screwdriver slot. This is a variable resistor and you can use it to decide the output voltage coming from the green connectors. I have it set relatively high, 15 VDC or so off load, to power the point motors briskly. However you can adjust it downwards for other devices and indeed the same board can be configured to drive eight independent devices.
Three of the pairs of blue wires shown in photo 3 disappear behind the fascia and run to points nearby. One pair doubles back to the left, to the Cobalt point motor shown in photo 4. I have connected all of the wires from the Cobalt to a multiway socket connector. Wiring becomes a solder-free exercise from then on, plus you can unplug any suspect point to isolate it. You can see that the mating plug connector carries the pair of blue power wires. It also has a white wire and two black wires, the latter with colourcoding via heat-shrink sleeving. These three are connected to one of the single pole, two way switches on the motor and provide the frog switching in the usual way. The point motor wiring is thus entirely conventional.
There are several modules available, capable of all the common functions you might need to control a railway. MERG supply them in kit form to reduce cost, though any of them can be built and tested in 1-2 hours. Most fall in to one of two categories: input modules or output modules. If you want to use a switch to change a point, the switch attaches to an input module and the point motor connects to an output module.
However, modules are very adaptable and can be taught how to behave. This is one of the strengths of the MERG CBUS system. For example, the CANACC5 module mentioned earlier has eight outputs, each of which can independently give a high or low voltage. Suppose an ‘on’ message appears on the bus from some other module. Our output module will, by default, ignore it. But we can train it to respond so that, for example, one of the outputs goes high. A subsequent identical ‘off’ message will set the output low again. In fact we can independently train each of the eight outputs. We could get the same ‘on’ message to set a second output low, when the subsequent ‘off’ message will cause it to go high. So our two outputs are now changing in opposite ways, in response to the same message. This is just what we need for a stall motor. To complete the picture, any other output board attached to the bus can also be trained to respond to this same message, in its own way.
Before we look at how to train a module, it will probably help to give an example of the message passing. Let’s start with a single point which is driven by a stall motor such as a Tortoise. Let’s also assume that the point is controlled from a central mimic panel, which has a switch to change the point and two LEDs, one of which lights up when the point is set to ‘ahead’ and the other lights up when the point is set to ‘branch.’ Let’s also assume the point is set to ‘ahead’ initially.
The CBUS sequence of events to change the point goes as follows. The operator changes the switch to the branch setting. This causes an ‘on’ message announcing this change to be sent over the twisted pair. The module driving the point recognises that it can do something with this message from that particular switch: so it changes the point to the branch position. If the switch is flicked back, then the resulting ‘off’ message causes the point to switch the other way. The CANACC5 module used for stall motors has eight outputs and each motor needs one pair, so the module will control four motors in total. The training of the module is used to set each pair to +/- for an ‘on’ event and -/+ for an ‘off event. Thus the current reverses but always continues to flow, just what a stall motor needs.
But what about those LEDS, to show the direction of the point? The simplest solution is to wire them to the switch but then the LEDS just emphasise which way the switch is set. They don’t tell us that the point has changed. Luckily, both Tortoise and Cobalt motors have an integral two pole, two way switch which changes breakbefore- make. One pole of these is typically used to perform electrical switching of the frog but the other now comes into its own. Suppose the ‘ahead’ LED was the one lit before we threw the mimic panel switch. The point motor starts to move and the point switch pole breaks contact with its ‘ahead’ contact. This break can be used to send a message. So if we also have our two LEDS driven by an output module, this output module can be trained to turn the ‘ahead’ LED off when this break message appears. At this time, neither LED will be lit because the point is mid travel. A second later our point motor has moved enough that the switch now ‘makes’ with its second, ‘branch’ contact. So we arrange that a different message is sent to indicate this and that the output module will now turn on the ‘branch’ LED. If we flick the panel switch back again, everything happens in the reverse sense and the LEDS change in the opposite order, to get the LEDS back where we started. This arrangement means that the LEDS are responding to feedback from the point motor, reassuring us that the point has moved. Of course the point blades might not be fully home even though they have moved. If that matters to you, then you can use a separate sensor rather than the switch on the motor but the messages needed will be identical.
Notice in particular that the mimic panel switch and the point motor switch are equal partners in all of this. Neither is in charge and both can output messages. Equally, the LEDS can be trained to respond to either but we chose to make them respond to the point switch.
In case this seems a complicated way of getting a switch to change a point, it’s worth identifying some advantages. Most obvious is that there is less wiring involved. All the messages travel on one bus consisting of a twisted pair, whether there is one switch and one point or a hundred switches and a hundred points. The message speed is 125 kB/s, at the low end of the CANBUS ISO specification but plenty for railway model purposes. This also allows the bus to be really long, up to 500m, long enough for even an ambitious garden railway. It still only needs the two data wires and an AC supply to each module.
Let’s also consider what happens if our point is replaced with a cross-over. There are two points which need to operate together. Nothing changes at the mimic panel end. A single switch sends the same message when it wants the points to change. However, both point motors are trained, via the module driving them, to recognise that same message and respond. That’s it. No new wiring, no new switches.
My layout has two groups of three points offscene (photo 5). These allow twin tracks to become three, with the new central track accessible from either of the other two, as in the photo. With three points, each triple has eight possible combinations of settings but some of these would cause derailments because they contradict each other. In fact there are only three viable configurations: the twin tracks both set for straight ahead and the central line point set either way; one of the twin tracks connected to the central track and the other twin set straight ahead; the other twin track connected to the central track and the first twin set straight ahead. I can use one centre-off switch to provide these three options, by connecting it to two inputs on the MERG switch board. Put the switch to one to use the central track from one main line; put it in the middle for both main lines to be straight ahead; put the switch the other way for the other main line to use the central track. Combined with judicious track isolation around the points, this gives fully safe operation.
So let’s push that much further. Suppose you want a single switch to set an end-to-end route, with multiple points needing to be set. Each point is trained to recognise that switch’s message and put itself in the correct position. Should we be changing some signals as well? We can use the same message to do just that. So no changes at all to the control panel, no need to replan and no additional control wires.
Various things went unsaid in that description. Note for example that there is no expectation that a given message has the same effect on every point. Some points might interpret it as move to the branch position. Others might move to the straight ahead position. Points which are already in the correct position will not change. Other points not on the route will ignore the message, whichever way they are set. There is also no concept of one point, one message. A given point might respond to many messages, perhaps because it lies on several routes. Signals can also be responding to some of these messages. Perhaps you have relays to decide which rails are powered? These too can respond accordingly.
Let’s see how this works in practice with specific MERG modules. We will need three of their kits. The CANACC5 is suitable for driving Tortoise or Cobalt motors or similar. It has eight outputs and so can drive up to four motors, each using two of the outputs. The module rectifies the incoming AC supply and delivers a suitable voltage to each output. The module can be tweaked to set the actual voltage, depending on the device you are driving. The key feature we want is that each output pair will continuously output either +/- or -/+ in order to drive the point motor one way or the other. At just under £15.74 to drive four point motors, this is very economical.
It is possible to train the modules using a set of on-board DIL switches (photo 6) . I did that for my first board, to understand how training worked. his approach is referred to as the Small Layout Model, or “Slim” because you would not want to do it this way with a large layout and many boards. It’s fiddly and quite slow when each board has eight outputs to programme one by one. A better way, even for small layouts in my view, is to buy the USB board which provides access to the data bus from your laptop or PC. At no cost you can download MERG’s flimutility software, which gives you a graphical view of any board’s configuration. “Flim” is the Full Layout Model, simply meaning that you use this utility software to configure the boards and ignore the switches. It allows you to change the configuration via a simple graphical interface on your PC or laptop screen. You can quickly train the board until every output you are using responds correctly to any incoming messages you want it to.
You can also send test messages directly from the software, which is useful if you aren’t sure the hardware is working correctly. The key nice feature is that you can save the file describing everything you have done; and of course you can reload it and use it to retrain the modules automatically.
You may be starting to think you need a PC to set up the modules every time you want to play trains. Absolutely not. Each board retains its settings even with power off. So you turn the power on and start playing without a computer in sight.
The advantages of having a saved configuration file are several. For example, I prefer to train the modules progressively, saving in between. If you later realise that you need to change something you did earlier, then you can load the file, modify it accordingly and then push the new configuration onto the modules. Similarly, if you add a new module or need to replace an existing one, it is reassuring to start from a known-to-be-working configuration file.
Slightly less obvious is that you might find it useful to have several configuration files for the same layout. For example, I wanted to be able to drive each point separately while building my layout, to be sure each point worked reliably. A sensible next step is a configuration file which ensures that the two points at a cross-over work both simultaneously and in harmony rather than against each other. It’s worth noting that which way the point moves can be set through the configuration file, without rewiring the point motor. A third step might be to configure for route control. If a point fault develops later, then I can reinstall the first configuration file while I debug the problem. If your layout goes to exhibitions, you might have a configuration file which better suits that particular need, perhaps because you have more than one operator, but revert to a standard one for single operator at home.
Much of the flexibility of the CBUS system comes from the fact that this relationship between message and output is not hard-wired in the modules. Instead, you set it to work how you want it to. One message can affect any, none or all of the various gubbins attached to a module. Indeed it can affect any selection of gubbins attached to multiple modules.
All prices are correct at the time of writing. MERG kits are only available to MERG members. MERG readily admit that most people join in order to buy the kits. There is a joining fee of £5 and an annual UK subscription of £16. For this you also get a good magazine with lots of practical articles centred on MERG equipment, CBUS and much more. You also gain access to the members-only part of their web site
A full price list appears on the website but here are some examples. The CANPAN module is a mimic panel interface, capable of driving 32 LEDs and reading 32 switches. It costs £12.67. The CANACC5 to control four point motors costs £15.74 and the CANUSB module costs £9. The CANACE8C provides flexible feedback for eight channels, at a cost of £10. The cost per channel of these kits is very low. For example, each point motor costs around £4. to drive, each feedback switch can be connected for £1.25 and control panel switches and LEDS cost pennies to connect.
MERG are a long-established group of volunteers with a shared interest, not a commercial organisation so please don’t expect to order these kits by the hundred for your local club’s mega-project. I suspect the people picking and packing would be likely to turn a shade of purple. If you really do need lots then they will supply the excellent printed circuit boards, for you to obtain components yourself. You can also buy spares, in case you blow the odd chip or voltage regulator. There is a lot of detailed documentation on their web site, including the construction sheets supplied with each kit. There are many wellwritten Technical Bulletins on specific topics, including for the modules. Circuit diagrams are openly available too. You might like to download a free book, Electronics for Model Railways by Davy Dick, which covers a lot of ground. It has a chapter on CBUS but much else besides. You will find it linked from the MERG home page given earlier. CBUS is far from being all they do and in fact is a relatively recent addition. If you still want to use DCC to drive your locos then MERG have kits which support DCC control over the CBUS network: you don’t need any further wiring to get the best of both worlds.kits of low cost. Take a look for yourself, you might be pleasantly surprised.
Since writing this article and the one in the November Gazette, Philip had been in touch with some further progress which is described below
As any layout builder knows, things are likely to change as the layout develops. Something that has been decided which was not in the original article pertains to the wiring shown in Photo 1 of this article where I said:
‘The picture shows one end of my own network, tucked under the baseboard. At various convenient points around the layout, typically where there are groups of points, I have fixed 6-way tag strips. To these are soldered two 2-way power cables, which are in fact grey domestic lighting cable. The upper one provides the 16 VAC supply needed for the control boards. The lower one is reserved for a later low-voltage DC supply and is not in use at the moment’.
What is now true is that the lower cable is used to take the DC supply from two of the controllers around the circuit as a whole.
Photo 7 shows an example of a MERG board driving relays in order to select which controller connects to which section. Remember that I’m using analogue control.
Finally, Photo 8 gives a wider view of the layout as a whole. You can see that there is no scenery as yet but all the track work is down now and, though there are still plenty of tools in evidence, there is only the control panel to complete and full running will begin.
Photo 7
Photo 8