Roco z21 with LGB "serial" system via Massoth eMotion L

Andrew_au

Registered
12 Nov 2021
27
1
48
Sydney, Australia
Country flag
After my MTS-I died, I upgraded to a Roco z21 XL which I've mostly been very happy with.
Caveat: Roco's idea of state-of-the-art home networking is still stuck about 5 years ago. The z21 ships with a companion home wireless gateway and a fixed IP address that matches the settings on the gateway. This makes things easy if you don't have an existing home network.

However, we're in 2021 now, and many people have an existing home WiFi network, including a gateway supplied by their ISP. If you want the z21 to seamlessly integrate with your home network, you'll need to assign a manual IP address to the z21 that works with the addresses used by your router/gateway. Once that's done, it works very nicely.
But...

I have an old LGB 28002 with a Massoth eMotion L. Train control & CVs & etc work fine. However, the on-board sound decoder is driven via a single output from the eMotion L. This interface assumes the old LGB "serial" protocol - pulse F1 some number of times (once per second) to simulate F1..F8. As implemented, each F1 toggles the output line A1, and the LGB sound circuit counts the number of toggles and then applies a "sound effect" 1..8 (I say "sound effect" because #3 is smoke on/off and #4 is sound on/off).

I've looked into having the decoder convert "real" F1 to F8 into a number of pulses, but I think this is beyond its capabilities.

For added complexity, some of the effects are "one-shot" (e.g. "blow the whistle"), while others are "toggles" (bell on/off, sound on/off, etc). This doesn't matter when you only have an old-style LGB handset with push-buttons, but once the interface supports (or assumes) switches it becomes tricky.

Meanwhile, on the Roco app, there are 3 settings for function keys: "switch", "push-button" and "timed". I've discovered that if I set the Roco to "switch" on F1, I can toggle the switch some number of times to trigger the appropriate effects. Two issues:
  1. "switch" mode acts like a toggle in the app. So if I tap once, I get a whistle, but the button is now set "on". Tapping again blows the whistle again, and turns the button "off".
  2. It's actually quite difficult to toggle multiple times with close-enough-to one second gaps.
I've wondered if "push-button" or "timed" mode might give better results, but I have not found any documentation on how to use them, and when I use "push-button" with a simple F1 the whistle doesn't blow.


Any suggestions or thoughts?
 

phils2um

Phil S
11 Sep 2015
1,062
382
Ann Arbor, Michigan
Country
United-States
Country flag
I'm fairly sure the "push-button" mode is momentary and is only active while the function key is held on/down. The "timed" mode turns on the function for the length of time selected when you set up the function key.

You would probably be best off using the momentary "push-button" mode if are trying to create multiple F1 pulses to trigger a serial decoder.
 

Andrew_au

Registered
12 Nov 2021
27
1
48
Sydney, Australia
Country flag
I'm fairly sure the "push-button" mode is momentary and is only active while the function key is held on/down. The "timed" mode turns on the function for the length of time selected when you set up the function key.

You would probably be best off using the momentary "push-button" mode if are trying to create multiple F1 pulses to trigger a serial decoder.
Does "push button" send pulse(on), pulse(off)? If so, that's two pulses per push of the button, which isn't what I need.
 

LGB333

Active Member
Country flag
After my MTS-I died, I upgraded to a Roco z21 XL which I've mostly been very happy with.

But...

I have an old LGB 28002 with a Massoth eMotion L. Train control & CVs & etc work fine. However, the on-board sound decoder is driven via a single output from the eMotion L. This interface assumes the old LGB "serial" protocol - pulse F1 some number of times (once per second) to simulate F1..F8. As implemented, each F1 toggles the output line A1, and the LGB sound circuit counts the number of toggles and then applies a "sound effect" 1..8 (I say "sound effect" because #3 is smoke on/off and #4 is sound on/off).

I've looked into having the decoder convert "real" F1 to F8 into a number of pulses, but I think this is beyond its capabilities.

For added complexity, some of the effects are "one-shot" (e.g. "blow the whistle"), while others are "toggles" (bell on/off, sound on/off, etc). This doesn't matter when you only have an old-style LGB handset with push-buttons, but once the interface supports (or assumes) switches it becomes tricky.

Meanwhile, on the Roco app, there are 3 settings for function keys: "switch", "push-button" and "timed". I've discovered that if I set the Roco to "switch" on F1, I can toggle the switch some number of times to trigger the appropriate effects. Two issues:
  1. "switch" mode acts like a toggle in the app. So if I tap once, I get a whistle, but the button is now set "on". Tapping again blows the whistle again, and turns the button "off".
  2. It's actually quite difficult to toggle multiple times with close-enough-to one second gaps.
I've wondered if "push-button" or "timed" mode might give better results, but I have not found any documentation on how to use them, and when I use "push-button" with a simple F1 the whistle doesn't blow.


Any suggestions or thoughts?
Andrew - If your command station has Serial Mode function control, then you can set the Massoth L decoder to respond to Serial commands which will be sent to your locomotive's old analog sound board. Here are the settings for the L decoder: CV49=11 (Bit0=1) + (Bit1=2) + (B3=8). This will set the decoder for both parallel and serial function data, digital load control on, and Terminal A1 Output with Rapid Serial Pulses. This assumes you have the L decoder wired properly.........if your locomotive has the 10-pin direct dcc interface where the L decoder pushes into the main circuit board's pins, then it's definitely wired properly. I recently installed an L decoder into the interface of an LGB 20251 Columbus Forney locomotive and set the decoder as indicated, and it works like a champ with all F0 - F8 FKeys working as specified........no pushing F1 x times for the specific sound.
 

phils2um

Phil S
11 Sep 2015
1,062
382
Ann Arbor, Michigan
Country
United-States
Country flag
Does "push button" send pulse(on), pulse(off)? If so, that's two pulses per push of the button, which isn't what I need.
Yes, so you are probably correct. In any csse it wont hurt to try it. I have never had any locos with decoders that responded only to serial commands so don't have any actual experience. I was only suggesting what may work better for you. I'm sure there are others on the forum with serial decoder experience that will pipe up.
 

muns

Moderator
Staff member
GSC Moderator
Country flag
I've looked into having the decoder convert "real" F1 to F8 into a number of pulses, but I think this is beyond its capabilities.
This is not the case. Set the Decoder to respond to Serial & Parallel commands and set A1 to use Fast Pulse Chain - this will cause the decoder to pulse A1 based on the function key provided.

To set Serial/Parallel mode and Serial Pulse Chain on A1, you need to set Bit 0 and Bit 3 on CV 49.




Ooops - didnt read Tom's (LGB333) reply.
 

LGB333

Active Member
Country flag
This is not the case. Set the Decoder to respond to Serial & Parallel commands and set A1 to use Fast Pulse Chain - this will cause the decoder to pulse A1 based on the function key provided.

To set Serial/Parallel mode and Serial Pulse Chain on A1, you need to set Bit 0 and Bit 3 on CV 49.




Ooops - didnt read Tom's (LGB333) reply.
Muns - Reiterating a good approach is not a bad thing!
 

Andrew_au

Registered
12 Nov 2021
27
1
48
Sydney, Australia
Country flag
If your command station has Serial Mode function control
I think that's the issue. The z21 does what it does really well, but I haven't found a way to make it do that. It does support 3rd party Cabs, but a big attraction of the z21 is the app interface.
 

LGB333

Active Member
Country flag
I think that's the issue. The z21 does what it does really well, but I haven't found a way to make it do that. It does support 3rd party Cabs, but a big attraction of the z21 is the app interface.
Okay, that appears to be the problem. I'm not familiar with the Zimo DCC product line but it and the Marklin CS3+ and ESU Cab Control and EcOS also don't have Serial function control capabilities. Obviously Massoth does since they made the original MTS II/III DCC command stations, decoders, and electronics and sound boards for the original LGB company which had the old analog sound boards. So when using these other DCC systems you'd need to install a new DCC sound decoder into these older LGB locomotives with the analog sound boards which require Serial activation control. It's certainly much more work than installing a DCC decoder into the locomotive's DCC Interface but, in my opinion, well worth the effort for the improved quality of the locomotive's operation and sounds. And the old electronics in an old LGB locomotive can be a potential point of failure which could also harm the DCC decoder and will require everything be removed and replaced with a DCC sound decoder. Since I'm an ESU Dealer, this will sound self-serving to some people, but I now feel the ESU 5XL DCC sound decoders for large scale locomotives are the best on the market with ESU's vast sound library and the outstanding sound quality and sound features and operating features. I have several demo videos of customers' LGB locomotives I've installed the 5XL into that you can see and hear on my Website. Again, just my opinion, and I only sell and install ESU, Massoth, Soundtraxx, LGB/Marklin MSD3, Phoenix and LGB 65000 series decoders........haven't tried the other brands.
 

muns

Moderator
Staff member
GSC Moderator
Country flag
By the way, what exactly does "fast pulse mode" do?
Upon reception of Function Command 1 to 8, the decoder will make the Output A1 switch on and off that many times effectively emulating pressing F1 the same number of times.
 

Andrew_au

Registered
12 Nov 2021
27
1
48
Sydney, Australia
Country flag
Upon reception of Function Command 1 to 8, the decoder will make the Output A1 switch on and off that many times effectively emulating pressing F1 the same number of times.
OK, that is exactly what I wanted, but when I tried it didn't work. However, I might not have set the decoder to serial/parallel. I'll try again.

It doesn't help that the documentation on this is sketchy or talks in terms of LGB's misleading serial/parallel terminology rather than DCC signalling. For example, the eMotion manual just says that CV-49 bit 3 is "False pulse string (P-update) on A1", which is accurate but cryptic.
 

Andrew_au

Registered
12 Nov 2021
27
1
48
Sydney, Australia
Country flag
Update:

Have the 28002 / eMotion L on the programming track
CV 29 = 2, CV 49 = 9 (s/p, fast pule), also set CV 59 = 9 and CV 64 = 10 as I shouldn't be able to use the default F7/F8 with fast pulse.

Testing with Decoder Pro:
* F0 triggers light
* F1 triggers horn
* F2-8 don't seem to do anything
* slow double-toggle of F1 rings bell (sound function 2)
* slow quad-toggle of F1 disables sound (sound function 4)

Oddity: enabled F7, nothing happened. Disabled F7, horn triggered.

Thought: is there some setting I need to set for "fast pulse speed"? Is it possible that A1 is being toggled too fast and the sound interface is not recognising it as pulses?

If relevant:
53 (A1+A2 dim) = 32, 54 (A1 command) = 1, 55 (A1 flash) = 0
56 (A2 command) = 2, 57 (A2 flash) = 0
113/115/117/119 (A3-A6 command) = 3/4/5/6
114/116/118/120 (A3-A6 flash) = 0

Tried changing 56 (A2 command) to 12 - no obvious difference when sending F2.


More info if useful:

CV 7 = 155, CV 8 = 123, CV 255 = 130.
When I hit "read" on CV 7 in DecoderPro, the horn sounded.
 
Last edited:

muns

Moderator
Staff member
GSC Moderator
Country flag
From what you describe, it seems that the sound board is not compatible with the "Fast Pulse String", Massoth used to offer updates to the sound modules that allowed them to work with Fast Pulse - which was called "P Update". Simplicity, the Fast Pulse stream generated by the decoder is too fast for the sound module. There is no way to "slow" the stream.
 

LGB333

Active Member
Country flag
From what you describe, it seems that the sound board is not compatible with the "Fast Pulse String", Massoth used to offer updates to the sound modules that allowed them to work with Fast Pulse - which was called "P Update". Simplicity, the Fast Pulse stream generated by the decoder is too fast for the sound module. There is no way to "slow" the stream.
Hi muns - LGB offered P updates for the MTS II and MTS III DCC system to provide Parallel control to the older Serial versions. So I don't recall any P updates from LGB or Massoth to add P to their old analog sound boards unless it was for their factory installed onboard decoders? I don't think the analog sound boards themselves could be reconfigured. LGB digitized the sound files on their old analog sound boards that required serial control, but starting producing digital sound boards for their locomotives in the 1996 timeframe. For example, according Klaus Stork's Website Blog, in 1996 LGB produced their first LGB Moguls with the new digital sound boards, the LGB 22182, 23182 and 24182 Moguls.
 

LGB333

Active Member
Country flag
Update:

Have the 28002 / eMotion L on the programming track
CV 29 = 2, CV 49 = 9 (s/p, fast pule), also set CV 59 = 9 and CV 64 = 10 as I shouldn't be able to use the default F7/F8 with fast pulse.

Testing with Decoder Pro:
* F0 triggers light
* F1 triggers horn
* F2-8 don't seem to do anything
* slow double-toggle of F1 rings bell (sound function 2)
* slow quad-toggle of F1 disables sound (sound function 4)

Oddity: enabled F7, nothing happened. Disabled F7, horn triggered.

Thought: is there some setting I need to set for "fast pulse speed"? Is it possible that A1 is being toggled too fast and the sound interface is not recognising it as pulses?

If relevant:
53 (A1+A2 dim) = 32, 54 (A1 command) = 1, 55 (A1 flash) = 0
56 (A2 command) = 2, 57 (A2 flash) = 0
113/115/117/119 (A3-A6 command) = 3/4/5/6
114/116/118/120 (A3-A6 flash) = 0

Tried changing 56 (A2 command) to 12 - no obvious difference when sending F2.


More info if useful:

CV 7 = 155, CV 8 = 123, CV 255 = 130.
When I hit "read" on CV 7 in DecoderPro, the horn sounded.
Andrew - I looked up the production year for your LGB 28002 steamer..........they were produced during 2000 - 2002. So they have the digital sound board and with the Massoth L DCC Driving/Function Decoder installed into the locomotive's DCC Interface, you should be able to control the locomotive sounds with Parallel commands, not Serial. For example, I recently sold an LGB 28002 on consignment for a hobbyist here who had installed an LGB 55021 DCC decoder into the locomotive's interface, which Massoth replaced with the L decoder with much more capabilities. I tested out the locomotive on my DCC test stand using Parallel commands, not Serial. The set up of the locomotive for address and speed steps on your Roco DCC system may need to be done again including Parallel commands in both the command station and the L decoder.

I'm not familiar with the Roco DCC system, but a quick Google search I found some Roco HO DCC systems which don't produce enough voltage for LGB trains operation that require 18 - 22 volts. Even some brand DCC systems produced for large scale don't work well with the Massoth (formerly LGB) DCC decoders, due to the lack of power, especially for programming the decoders. Massoth has a warning in all the decoder Installation Guides about this: "Other central stations may not produce the required current for programming. This may be caused by an overload protection which cuts in too early. For that reason a 470hms resistor is required in-line in the connection to the programming track when using a Lenz central station."

So, just some data points to share with you for your consideration.
 

Andrew_au

Registered
12 Nov 2021
27
1
48
Sydney, Australia
Country flag
Thanks for working with me on this.

Some clarifications:
  • Everything works great except controlling the sound commands is clunky
  • I believe (I haven't opened it up to check) that the eMotion L fits in the LGB decoder interface on the 28002 (pin compatible with LGB 55020), and wires A1 to the sound interface.
I'm getting more fascinated by how all these protocols are supposed to work.

DCC and LGB serial


DCC F-signalling explicitly sets or explicitly clears the bit. This is smart - I know from my work that it's a real pain when the behaviour of a packet depends on the state of the receiver, especially on a lossy interface.

However, this creates interesting interactions with the LGB "serial" mode protocols. The LGB serial handset is obviously sending "F1-on", "F1-off", etc and not just "F1". So pressing "F2" in serial mode while F1 is currently listed as "set" must pull it "unset" and then "set. So the handset is tracking the state of the decoder and not just pulsing.

28002 sound decoder interface


If I simply wire this to A1 (on the eMotion L), I can control it by toggling A1 using whatever F-key is assigned to A1 (in "parallel" mode). I have tested this by linking the rear lights to the same F-key (e.g. F1, F2 - eMotion CV 52) so the lights should show the same state as A1 (F-key assignment in eMotion CV 54).

Timing is a factor. If the toggle period is less than about 0.25 seconds, then the 28002 will not trigger. Tested by toggling F-key on/off rapidly. Lights change state (so the eMotion L is processing the command) but the sounds don't activate. Note that if I do one on/off cycle rapidly, the 28002 will not activate at all - it gets treated as a non-event, not just a single event. Maximum period is about 1s - then the command triggers.

I don't see any documentation about a ramp-up time for A1. I'm assuming A1 reacts "immediately", and the timing thresholds are in the 28002.

LGB 55021 vs eMotion L


Looking at the LGB 55021 interface, I found the serial / parallel mode setting. On the 55021, CV51=1 (default) enables a mode where F1-F8 trigger the "F1" output that many times. This enables P vs S compatibility for LGB. This is comparable to the CV49=8+1 setting on the eMotion L.

Debugging my module


I'm starting to think that fast-pulse mode might be broken on my eMotion L.

CV49=9, CV52=2, CV54=1
  • F1 on, F1 off. After a short delay, bell triggers (#2), lights go on.
  • F1 on, F1 off. After a short delay, bell stops (#2), lights go off.
  • F2 on. Only lights go on. F2 off. Lights go off.

  • F1 on. Horn triggers (#1).
  • F1 off, F1 on. After a short delay, bell triggers (#2), lights go on.
  • F2 on. Lights go off
  • F2 off. Lights go on
  • F1 off, F1 on. After a short delay, bell stops (#2), lights go off.

Observations:
  • F2 is toggling the lights, not setting them. This might be by design, or might not.
  • F2 is not triggering the sound module.

CV49=1, CV52=2, CV54=1
  • F1 on, F1 off. After a short delay, lights go on.
  • F1 on, F1 off. After a short delay, lights go off.
  • F1 on, F1 off. After a short delay, lights go on.
  • F2 on. Lights go off. F2 off. Lights go on.
  • F1 on, F1 off. After a short delay, lights go off.

  • F1 on. Horn triggers (#1).
  • F1 off, F1 on. After a short delay, lights go on.

Observations:
  • Dual-F1 are being mapped to F2, but not also toggling A1.

CV49=8, CV52=2, CV54=1 - technically an undefined mode
  • F2 toggles lights on/off.
  • F1 does nothing (no sound, etc).
CV49=9, CV52=2, CV54=2
  • F1 on, F1 off (very rapid). After a short delay, lights go on.
  • F1 on, F1 off (very rapid). After a short delay, lights go off.
  • F2 on. Lights go on. F2 off. Lights go off.
  • F1 on. Horn triggers (#1).
  • F1 off. Horn triggers (#1).
  • F1 on, F1 off. After a short delay, bell triggers (#2) lights go on.
  • F1 on, F1 off. After a short delay, bell stops (#2) lights go off.
Observations:
  • F2 (either normal or serial) is no longer triggering A1, despite CV54=2.
  • F2 is not pulse-triggering A1, despite CV49=9.
CV49=1, CV52=2, CV54=2
  • F1 on, F1 off (very rapid). After a short delay, horn triggers (#1), lights go on.
  • F1 on, F1 off (very rapid). After a short delay, horn triggers (#1), lights go off.
  • F2 on. Horn triggers (#1), lights go on.
  • F1 on, F1 off (very rapid). After a short delay, horn triggers (#1), lights go off.
  • F1 on, F1 off. After a short delay, horn triggers (#1), lights go off.
  • F1 on. Nothing.
  • F1 off. Nothing.
Observations:
  • F1 drives serial mode. F1 is not connected to A1. As expected.

Conclusions​

  • Serial mode (CV49=1) reliably maps F1 pulse strings to F1-8 commands. It also disables those commands from driving A1 (except as programmed for normal F-keys).
    • Quirk: seems to do this via a state-change mask applied after the actual value of Fn.
      • Proof:
        • CV49=1, CV54=2: F2 turns lights on, double-F1 turns them off
        • Set CV49=0. Lights turn on.
        • Set CV49=1. Lights turn back off.
  • Serial mode with fast pulse (CV49=9):
    • interprets multiple F1 toggles as F1..F8 (as per regular serial mode)
    • links F1 to A1. CV54 is ignored.
    • does not map F1..F8 to multiple A1 toggles (or does them way too rapidly to be useful - I don't currently have tooling to test this).
 

Andrew_au

Registered
12 Nov 2021
27
1
48
Sydney, Australia
Country flag
I was curious, so I swapped the Massoth eMotion L with a 55021 that came factory-installed in a 70255 starter kit.

I set CV51=1, which is supposed to enable parallel compatibility mode for F1 on the 55021. However, I see the same behaviour as with the eMotion - manually pulsing F1 triggers the sound/smoke unit, compatibility mode does not.

I tried setting CV52=1, which in theory should use the same logic for the forward lights as for F1. But I did not see the lights pulse when I hit F2/F3/F... . This might be because it doesn't actually work like that for the light circuit (because who would want it to?), even though the 55021 manual technically says that the forward and reverse lights use the same CV logic as F1.

I think I need to borrow a friend with an oscilloscope and see if I can make out anything interesting looking at the pins.
 

PhilP

G Scale, 7/8th's, Electronics
5 Jun 2013
29,284
3,019
Tamworth, Staffs.
Country flag
There are three ways, that the logic can work, and it will depend on how the decoder has been designed to respond:

1. A rising-edge will be detected (only) so when you switch on (say) it will cause the action, but when the signal is switched off, it will ignore this.
This is good for triggering a sound which runs for some period of time (eg. Coal shovelling) the sound will play to the end, even if the control signal ends before the sound.
A falling-edge will cause to controlled function, to do nothing.
If the control is only high whilst the button is pressed (a momentary action) nothing will happen to whatever is being controlled.
If the control signal has stayed high, then pressing the button again, would take it low, but nothing would happen at the decoder.
If the controller was set this way, a third press (to generate a second rising-edge) would be needed, to turn the function off.

2. A falling-edge would work in the opposite way.
If a momentary control went from low-to-high, then nothing would happen, until the button was released, then the falling-edge would trigger the function.

3. Edge-detection, any low-to-high, or high-to-low change, will be detected and acted on.
A momentary control, would operate the function, until the button was released. - Say a whistle sounding, only when your finger is on the button.

Another complication, is that it could be feasible for a controller to send a momentary command, but a decoder set to latch an output. - Unusual, as I understand DCC.

PhilP