2018 Part 1 – Track at SVJ + Decoder Problems

January 7

Plywood bought. It ended up being 6 mm, since it is easier to work with and lighter than 9 mm.

I had it cut into strips by Bauhaus, so that the big part of SVJ (Spøttrup Station) was ready to use and so that I had two strips with a width of 12 cm for making the edge around the back of the layout.

Most of the edge is done and the jigsaw cut part for the stretch between Skive and Spøttrup is done. Still missing are the pillars etc. that shall hold it:235BF861-F843-4D79-85C8-7DE2DBC66FFDI will soon be ready to saw holes for servos / turnouts, to glue the green parquet underlay and finally to lay track.

January 13

All the plywood parts are now properly mounted. And this time, there is no adjustments of elevations. Everything has been calculated by the millimeter in AnyRail and then measured, sawed and mounted according to those calculations.

It may not be obvious from the picture. But give or take a few screws, the carpenter is done, except for making holes for servos. But that cannot be done until they are mounted on the turnouts:4E0DF3C6-BF6D-43B2-B731-154E312EE9ABIf you look closely at the picture, you may see my newest addition to the layout: A rail cleaning wagon from Märklin pulled by the Santa Fe locomotive. I hope it will be able to keep the track clean – especially at shadow stations.

To the right, you can see the reasonably large flat area where Rødding – in terms of a couple of houses – shall emerge. It is also starting to become clear what all three levels of track is going to look like.

It is also noticeable what just 6 cm of rise in elevation looks like. It is 4%, which is much, but no more than most model trains can cope with. And the reason that it looks so fierce is that the next level falls with 4%, so the difference between the two levels is actually 8%.

January 14

Once the shadow stations are being closed, I will install webcams so that I can see what happens inside. As a preparation for that, I am installing light in terms of LED strips from Jem & Fix. So far only in the front shadow station:CBE3C3F0-F890-456D-ACCE-5DBBDB23C165

January 20

I have been re-drawing the entire layout in AnyRail including division into blocks, turnout numbering etc.:Hele-banenAs can be seen, I have made room for a semaphore signal at Spøttrup Station. I have bought it as a kit from Conrad electronics. But that was the only thing I bought there. Everything seems very expensive at Conrad. My plan is to leave the kit in the drawer until further.

All electronics should be ready. I have been building the additional feedback module and I already have the additional turnout / servo decoder that is needed.

Next step is to build 3 turnouts, i.e. mount servos and lanterns.I have already built the 4th turnout earlier. It was aimed at the “paradestrecke”, but I will rather have a fresh turnout ready for drawing on the plywood where the track goes when I come to that.

Now it is time for sawing plexiglass. I know that I need to pieces, 25×28 mm and 28×10 mm, and that it is sawed by first covering the plexiglass with masking tape and then run the jigsaw at it lowest speed using a fine toothed saw blade.

Then I need to bend pieces of piano wire. I don’t have any more 0,6 mm wire, but 0,5 mm worked fine last time.

While I was at it, I made an extra piece of piano wire for the paradestrecke as well as enough plexiglass pieces for the next 5 turnouts.

And then I have made a paper template for each individual turnout, so that I can mark precisely on the plywood where the servo is placed and thereby where I shall saw a hole.

January 21

It was a good idea with the paper templates.It took 1½ hour to saw holes for the 4 servos, drill holes for wires etc. And that includes cleaning up the saw dust afterwards.

Next step is to put LED strips on the underside of Spøttrup Station, so there will be light at the shadow station underneath. And then I have attached some Velcro to hold wires etc. underneath:C0892171-4E23-4EE1-B3E4-542475E970EB5CFD9864-D946-44EE-892E-95B8031B9EC8Based on a YouTube video from “marklinofsweden” https://youtu.be/4CJ5Xe9Rm-8 I have been to IKEA to buy “Stopp” felt http://www.ikea.com/dk/da/catalog/products/90132261/. It is meant to be underlay for carpets. But I will use it as underlay for track instead of the green parquet underlay. According to the video, it should be good for dampening the noise from model trains. He has been testing it against cork.

My first test with just 1½ meter of track with Stopp felt indicates that he is absolutely right:imageI will finalize SVJ and the paradestrecke with Stopp. And then we will see if I am lifting the rest of the track to also put Stopp underneath there.

I do not intend to glue the felt into place. I will just attach it using a staple for each 10 cm.

January 27

Tracks at SVJ are done. I only need light in the lanterns at each turnout:imageI have removed the giant extension cord I had in the middle of the layout and substituted it with 4 smaller ones on the electronics board. It is amazing how many transformers etc. that are needed. I recently added two more for the light in the shadow stations. And I am now going to add another one as described below.

A new problem has arisen: With so many servos for turnouts (I think I now have 25), which all moves when the ECOS is coupling in, so much power is used, that the ECOS couples out again. Either they shall have a separate power supply or half of them need to be delayed when turned on. I will go for the first mentioned option, just as litra.dk has done:LitraDKdiagramPaco’s original diagram, which I have built according to, looks as this:PacoDiagramThe reason for the problems with servos moving when the DCC power is turned on is probably that PIC is sending out random signals while it boots. I hope to avoid that when the PIC is getting power at all times. It has been irritating me all along, but I have never given it much thought that it actually pulls a lot of power from the ECOS.

I have found a 12V / 2A DC power supply, that I will use for powering the servos. I will therefore keep the 7805 voltage regulators, but throw the bridge recifiers away. 12V is good for the 7805. According to the data sheet it can use between 7V and 25V:KJdiagramI.e, I will modify my boards that used to look like this:ServoDekoderPrint_v1To instead being built like this. The +12 volt wire has been added, the bridge rectifier removed and the DCC null wire has been moved. Nothing else:ServoDekoderPrint_v212V minus is simply connected to DCC null at the newly added power supply, so that only one extra wire need to go to the decoders.

January 28

I rebuilt 2 decoders. It seemed to work. I then rebuilt 2 more. But then all servos started to misbehave. The are moving at random while the ECOS is starting up and keep doing so even afterwards. In addition, at least the servos on one of my decoders have begun to move at their highest speed instead of the modest speed they are supposed to.

It is as if the 2A is only enough for 2 decoders each with 4 servos. According to specs., each servo can use 0,22A. So that fits. But it doesn’t fit my power supply very well.

Besides there is the complication with my solution, that I can no longer program the decoders. My whole patch panel is void, beause the 12V power supply is connected to DCC null. That means mixing the DCC signal with the programming track signal. And that makes ECOS report errors instead of doing programming.

I must find a better power supply and some connectors of a kind, so that I can change between DCC and programming track signal. And then I will make this little adapter between programming track signal and decoder:46FDEB5B-297A-49E9-A9F0-75B32F620A90I suppose the solution is vel ali-express. At least it is a lot cheaper than buying and ESU booster (1600 kroner for 4 A or 3000 for 8 A). Prices at ali:

12V or 5V 10A DC power supply 9-10 Euro. It is powerful stuff for little money.

3-poled jack connectors approx. 0,40 Euro per part, i.e. male or female. I need one of each per decoder, i.e. 0,8 Euro or 6 kroner per decoder.4E64864A-0B50-4176-BB24-336C708762A0 C5ACEE6C-C78E-4579-A7CA-BB6ADB23C908The biggest problem is that it will take a month or two to get the power supply etc. from China. So I must make an intermediate solution with either building 2 of the decoders back to the original or find another 2A power supply.

January 29

Things are not going very well with the servo decoders. I have found another power supply and there is no more trouble while the ECOS is booting.

But the one decoder is still moving servos at full speed. That can of course be a defect decoder or troubles in the wiring.

There is however also another and bigger problem, that I have just discovered, with the decoders with external power supply: When I am driving a locomotive (which I didn’t do yesterday), all servos are going a bit back and forth. It seems to be some kind of signal distortion – maybe the same root cause that makes the one decoder move it’s servos to fast.

Maybe it is not so strange, since I have changed it so that now a full DCC signal is being input directly to the PIC (through a 22 kohm resistor), whereas before it was only half the signal, since it was input via one of the diodes in the bridge rectifier. I.e. now it is +/- 18V. Before, it was 0V / +18V.

It could maybe be solved by a diode. But a better solution is probably to make a DCC driver equal to the one litra.dk has made to scale down the DCC signal to 5V, which is also the voltage driving the PIC.20F4A56D-197F-4190-A6A7-56DA9E53CAE2That will also give me the benefit of not sharing ground between DCC and the decoders / the separate power supply.

So I must build such a thing. I will however try a simpler version first. I have a lot of 4N25 optocouplers from current sensors. Note the polarization of the DCC signal. By driving the optocoupler when DCC ground (brown wire) is positive, I am avoiding the inverter on the output. The little diode need to be there because a 4N25 cannot tolerate more than 5V reverse voltage. The resistors will give 12mA (18V / 1500 ohm) through the IR diode and 5V / 100 ohm = 50 mA through collector-emitter:DCC-5V-converterBesides, I need to make a small 5V power supply for the converter. I need that as long as my power supplies are 12V or even more:5V-supplyI have bought an oscilloscope (small battery driven from China for almost no money at all).  So now I can actually test if the DCC converter works.DSO150The oscilloscope is generally being judged as unusable due to it’s very limited bandwith. But since DCC is not exactly high frequency, the oscilloscope actually fits the purpose very well.

January 31

I got the DCC driver including power supply built.

The good news is that the small oscilloscope shows that the +/- 16V square coming out of the ECOS is being converted to something similar but scaled down.

The not so good news is that the output is 2,3 / 5 volt instead of 0 / 5 volt.

Maybe the pull-up need to have a higher value. I have tried with 10 kohm instead of 100 ohm. That was to much. The squares are not becoming squares bit merely spikes. I then tried 910 ohm, 560 ohm, 1,2 kohm and 820 ohm, which gave these results:IMG_0249B53D7AC0-5D71-4C6D-94E1-027E02FA3FE9FA17DDBD-864B-4124-9BFC-4AB277B9880BE80F8433-BF60-47E2-89C3-F108FF90D842It does not seem possible to obtain a proper square. But I will try to use 820 ohm anyway.

February 1

It doesn’t work. And that is not so strange. 1-bits are the narrow squares in a DCC signal. According to the DCC standard from NMRA: “A Digital Decoder must accept bits whose first and last parts have a duration of between 52 and 64 microseconds, as a valid bit with the value of “1””. I.e. the width of the high and the low part must be almost equal. But on the oscilloscope, I can see a 3 times as wide low part compared to the high part.

I think I need to use an optocoupler equal to the one litra.dk uses to get as nice squares as the original DCC signal:674BD66C-7E7A-44A5-908E-28D264088031That shouldn’t be a problem, since I already have one. But I don’t have the inverter he is using.

On the other hand, I don’t see why he inverter is needed. The polarization of the signal should not matter. According to the NMRA standard, it must not matter since a locomotive on a two-track system must be able to point in any direction. And secondly my little trick with polarization of the DCC signal at the input of the optocoupler should work for 6N137 just as well as it does for 4N25. Finally, 6N137 has an open drain output which should do just fine in driving a good number of PIC input ports.

The output voltage as a function of current through the IR diode for 6N137 is according to the data sheet as follows:

For 4N25 there is no such chart in the data sheet. But there is one for collector-emitter current versus IR diode current. And that must somehow be expressing the same thing:4D27D593-5B85-4B94-A622-0BE7903789E0I very much hope that these charts expresses how nice squares that can be expected on the output from the two optocouplers. Otherwise a propagation delay of 20 microseconds (i.e. the same order of magnitude as the pulse width in a DCC signal) for 4N25 and rise and fall times at 65 and 10 nanoseconds for 6N137. So it is about 1000 faster, if these figures can be compared.

February 2

Now that is completely different. Now it works. And the oscilloscope shows a nice scaled down DCC signal. The low voltage is 0,08V and not 0,00V. But that doesn’t matter:2254FA2A-5093-4BA4-9731-893AC064D045I tried again to drive all 4 decoders with the one 12V / 2A power supply. It still doesn’t work. So I again added the second power supply.

I will not be doing more until the 5V / 10A power supply arrives from China. At that time, the 7805 shall be removed from the decoders and the small power supply for the DCC driver shall be removed and rebuilt as a programming interface by adding a bridge rectifier. Read more on the page about electronics.