2014 part 5 – RocRail (and a bit more about servos and turnouts)

Medio and ultimo October 2014:

New program for the PC: RocRail:

JMRI is out. For the moment at least.

It looks like RocRail is much more stable. With the new C-track, it did not take me long to get automated train control via RocRail.

However, it does not yet work with longer trains. Only with very short ones. And even then, it is very random where the locomotive stops in a block. And every now and then, I see de-railments due to RocRail dispatching a train through a turnout that is not done switching.

More turnout problems:

I am having mechanical problems with one of my three turnouts: The piano wire is jumping of.

This piano wire problem simply got to be solved. I probably have to take the servo of and bend a new piece of wire and mount it all from the beginning. That has to work.

Update: Yes – it works.

It seems to be extremely important that the “eye” on the wire in the turnout end is in line with the wire itself, as is the case with the new wire seen mounted on the turnout on the picture below. The old wire has the “eye” to one side of the wire, which made it jump of.

Processed with Snapseed.
Turnout with new wire. The old wire is on the table next to the turnout.

BUT: There is still a problem with the very same turnout. Even though the wire is no longer making trouble, the turnout does not switch perfectly. It moves a milimeter less than it should to one side. And then the train de-rails.

The problem seems to be that the mechanics is a tiny bit different in exactly that turnout. It requires a tiny bit more movement on the servo to push the mechanism to it’s endpoint. And Paco’s decoder only permits to adjust the total movement of the servo. Not the A and B end-points individually, which puts a demand on me to place the servo very precise in the middle so that the two end-points of the servo fits exactly with those of the turnout.

The problem gets worse, because my piano wire does not have any softness. It is a bit too stiff with it’s 1 mm diameter, and I have not managed to bend into a zig-zag shape. Had it been possible for the wire to bend a bit, if the servo movement was beyond the end-point of the turnout, it would have been a bit less of a problem.

Until further, I have been fiddling it to work by finetuning the length of the wire, so that the turnout just exactly functions. I need to find a better and easier solution before I go on “servofying” more turnouts.

But that will have to be later. For the time being, all my three turnouts are functional. I have in mind to use thinner wire, to bend the wire into a zig-zag shape and to use a different decoder or to modify the one, I am using. I might use this one: http://digital-bahn.de/bau_servo/sand4.htm or this: http://wiki.rocrail.net/doku.php?id=mgv136-en. I Have also been asking Paco about a modififed version of his decoder.

He is referring to this page: http://www.fucik.name/masinky/servo/. In addition, Paco has published his source code, and I think it is doable to introduce the additional configurability on my own. And I have also asked Fucik (the guy behind the other WEB site), if he is willing to publish his source code.

But as said, this is going to be later. Mr. Fucik has in the meantime answered, that his source code is here: http://usuaris.tinet.cat/fmco/colab/download/dcc4servo_v3_x.zip.

How do I get the train to stop at the same spot every time?

RocRail seems to stop the train at a random place in the block, where it is to stop.

According to the RocRail manual, it seems to require a sensor of a second type in each block. And thereby, I would have to make or buy a lot more sensors and feedback modules. That has to be considered closer. And not least: The RocRail manual has to be studied closer.

Another possible source of error is the rather primitive FX decoder in my test locomotive. Maybe, I should use a proper DCC decoder?

Ultimo october 2014:

The FX decoder has been substituted by an MFX, which is also capable of “speaking” DCC. It means that I am able to program the decoder and thus make better experiments with RocRail.

And it means that I all of a sudden has got 128 speed-steps instead of just 14. Just a small piece of advice that has cost me some time to reach: Disable the FX and MFX protocols, if you have a Märklin MFX decoder and a command station as my IB-COM, which may support several protocols, but which is natively a DCC command station.

I only succeeded to read CV values 1 out of 10 times, until I realized this.

My opinions about RocRail have become quite positive. Even if I am not entirely able to sure what is happening, I have through an evenings study of the RocRail manual, reading about blocks, routes and locomotives and by setting both brake and acceleration delay in the decoder to zero, become somewhat wiser. My locomotive is making some unnatural moves with the zero-delys. But I can now see, what happens:

RocRail uses 3 different speeds, that can be set in the locomotive property dialog box. I have configured these speeds as km/h, because I think that gives better possibilities to adjust different locomotives (once I get to have more than one on the layout) to stop exactly where I want them to stop at the platform.

After setting the speeds, it is also possible to configure which speed to use where. This is done in the block property dialog box.

I have however not yet found out how to make a locomotive start with anything else than cruising speed.

But I have reached apoint, where it is reasonably predictable where in a given block the locomotive stops. And that is still with only one sensor per block, i.e. A current sensor for the entire block length.

Speed Curve set-up:

The next thing is to adjust the speed curve in my BR216 locomotive, so that the real speed of the locomotive matches the speed RocRail thinks it runs at.

By doing the same thing with all ones locomotives and by using the same speed for all locomotives in the blocks where they are to stop, I think that I can get all locomotives to stop the on the exact same spot in a block.

The same benefit may be achievable by applying specific delays for each locomotive corresponding to the speed of the locomotives. But for now I will go with the speed curves and make all speedometers of my locomotives equal.

I Have found a description about how to do it here: http://www.dccwiki.com/Speed_Table. I am going to use it together with RocRails built-in speed measurement http://wiki.rocrail.net/doku.php?id=mvtrack-setup-en as well as my newly acquired possibility of programming the locomotive decoder as a real DCC decoder:  http://www.rjftrains.com/technical/60942_62_en.pdf and http://wiki.rocrail.net/doku.php?id=pt-en  With all this, I am sure, I will make the locomotive run reasonably acurately with the number of km/h I am asking it to – naturally converted into model size.

Data for a full-scale BR216 locomotive at DB is a max. speed of 120 km/h and a march speed of 80 km/h. So that is what my little train is going to be set up to as well.

First of all, I need to make sure that the motor regulation function in the decoder is set up correctly as described here: http://tonystrains.com/download/BEMF_PID_Intro.pdf.

At the last page, one can read the good advice that this can be controlled by letting the locomotive run at lowest speed, stop it by blocking it with a finger, making sure that the wheels spins with unchanged speed, remove the finger and controlling that the wheels are still turning with the same speed. If the speed changes at any time, something needs adjusting.

My BR216 seems to behave just as it should.

But the speed curve adjustments are not quite as easy as one should think:

The speed measurements in RocRail are working easily and gives fairly consistent values for the same speedstep- at least at lower speeds. And I decided not to spend more time on the recipe on BEMF from tonystrains.

The hint about stopping the locomotive with my finger seems to tell that the motor regulation already works reasonably well.

But a certain value in CV 67-94 does NOT seem to mean a certain speed in the corresponding speed step. That was however how I understood the text in dccwiki.

But there are more good advice on the Internet. Next up is this one: http://dcc-mueller.de/decoder/speedt_e.htm.

The speed table in my decoder (CV 67-94) is now back to default values and max. speed is adjusted to 120 km/h utilizing the trim CVs 66 and 95. A value of 60 was suitable.

The problem is however that the throttle scale is by no means linear, i.e. That half throttle should mean half speed.

I am trying with a new calculation in Excel. This time starting with the recipe form dcc-mueller, i.e. More or less the same curve as before in CV 67-94, but now scaled so that it goes all the way up to 255 (to utilize the full range), while I use VC 66 and 95 to limit the max. speed. Not that the curve in the first case gave a linear throttle, but it seems to work well with this new approach.


With the properties of the locomotive propertis in RocRail set to 128 speedsteps, max. speed 120 km/h and display in km/h, the speeds at the throttle fits within a few percent.

So I have learnt that before a locomotive enters my layout, I shall do the following:

1. Make sure the locomotive decoder has a programmable speed table.
2. Determine the real-world max. speed and march speed of the locomotive.
3. Set the throttle to 28 speedsteps and measure tthe speed of the locomotive at all speed steps up to the real-world max. speed.
4. Read the originale values for CV 67-94.
5. Adjust CV 66 and 95, so that the locomotive runs at its real-world max. speed at full throttle.
6. Use a spreadsheet to calculate which CV values that will give a linear speed curve and put these values into the speed table of the decoder.
7. Set up RocRail with as many speed steps as possible (i.e. 128 with a decent decoder) as well as with the locomotives real-world max. and march speeds. Use the same numbers for Vmid og Vlow for all lokomotives – for example 35 and 10.
8. Adjust the decoder to a small delay for both acceleration and braking. It cannot possibly be a good thing for the the mechanics of the locomotive that these settings are 0. I have set both (i.e. CV 3 and 4) to 2. Then at least it does not give a loud bang each time the locomotive starts and stops.

Update on point 5: I could not get it to work with my next locomotive. In stead I let CV 66 and 95 have a value of 0 and then I gave CV 67 – 94 correspondingly lower values.

Block timers and switch delay in RocRail:

By now I can get on with fiddling with timer values and other settings in the blocks, so that I can make all locomotives stop when it is all into the block, i.e. where the outgoing signal of the block is to be placed. I have read that it should be possible to obtain an accuracy of  +/- 2 cm. So that is my target.

A little advice: My swithes are servo-controlled and there is no feedback about when they have obtained their new position. It means that in RocRail, I have to check both “Switch time” and “Synchronize” as well as put for example 4000 ms into “Switch time” in the Interface tab in the Switch property dialog.

This makes the train wait 4 seconds so that all switches are set before the train starts.

What is next? Sounds? More automation? Equip more locomotives with decoder? RocRail can read texts out loud. What about a loadspeaker announcement?

It should be possible according to the “Speak to me” section at this page http://wiki.rocrail.net/doku.php?id=text-en&s%5B%5D=espeak. A number of additional programs must be investigated: espeak, playwav and balabolka including the Microsoft Speech Platform. Note the links to espeak and playwav.

The RocRail server can also play sounds along with actions. The player can be configured via the field “Sound Player” here: http://wiki.rocrail.net/doku.php?id=rocrailini-gen-en&s%5B%5D=mplayer

Or how about setting a locomotive to run automatically at a fixed route while others are running manually and even others utilizing the random automation in RocRail?

First of all, I have to more than the single locomotive. I have in fact bought one more and I have bought a conversion kit for the biggest and best of my very old Märklin locomotives to make it equipped with a DCC decoder and a 5-pole DC motor as opposed to the AC motor that it has originally. That was however the MFX decoder that i “borrowed” for the BR216.

In addition, I have a couple of old Lima locomotives. They are already equipped with DC motors. And one of them even has a collector shoe to make is suitable for 3-rail systems. So I am soon going to buy some decoders. But does it have to be the expensive solution with sound or should I buy the cheaper non-sound kind? I need to think.

See http://www.digital-train.com/digital_conversion.htm about conversion of locomotives. Or one of the many other recipes out there on the Internet.