Skip to main content

Professor Chaos asked the following question (essentially) in 2012 and nobody knew the answer -- how about now?

 

I'm writing code for an Arduino microcontroller to autonomously control my layout, and I'm trying to understand how to control engines and trains when momentum is a factor.  Using an SER2 and my Legacy remote, I wrote Arduino code to display the raw data that is being transmitted by my CAB-2 -- and I'm a little surprised.

 

When you press the Low, Medium, or High momentum buttons on the CAB-2, it sends a command to the engine or train to set momentum to that value.  Great!  So the engine or train automatically manages momentum, correct?  Not so fast...(ha ha good pun)

 

The CAB-2 *also* sends out commands for as long as needed, about once a second, slowly increasing (or decreasing) speed and also adjusting engine labor.  Huh?

 

HERE IS THE QUESTION: I would have expected it to work one way or the other - no both.  So if the CAB-2 has to manage the details of very slowly changing the speed of an engine or train, then what is the point of sending a momentum command to that same engine or train?  Apparently the engines do *not* have the ability to manage momentum themselves, so what do they do with the momentum command?

 

ONE POSSIBLE ANSWER: If you have more than one CAB-2 (or other means of control), is it possible to "hand over" control of a specific engine or train to another cab?  If so, is the other cab "aware" of the current settings, such as the engine or train's current momentum setting?  Perhaps a CAB-2, in addition to sending control commands, will monitor the data bus looking to see what other controllers are doing, and (assuming it has a particular engine or train in its database) actually updating its own settings to match what is being done by the other controller???????

 

Why else would a CAB-2 send a momentum command out the data bus, despite managing momentum by itself?

 

P.S. This is off topic, but my little experiment also revealed that the CAB-2 is acting as a state machine.  So if you have two different engines, each with high momentum for example, you can have one speeding up and the other slowing down at the same time.  That's not a bit surprising, but it was interesting to see in light of me trying to duplicate some of its functionality -- all of this is being managed by the CAB-2, and not by the engines themselves.  Which is kind of a bummer because it means I'm going to have to write my own control code as a state machine.

 

Original Post

Replies sorted oldest to newest

This looks to be another fun and enlightening topic, Randy.  

 

My only hands on experimentation is with the original TMCC/cab1 system, but I wonder if it is not also the case in Legacy.  In the TMCC system every command issued is repeated back on the serial, so even if the engines do nothing with it, the serial will spit it out.  I'm unsure if cab2's can talk to each other, but it would be useful if you have a computer hooked up and want to display all the settings.  

I believe the command base can manage up to five locomotives as far as momentum changes.  I have two remotes, and I have three Legacy engines programmed and I can have all of them slowly accelerating and the current state is reflected when I select the locomotive from the second remote.  There is a delay of a second or two if you don't activate any control before the current state shows up when you select a new engine number.  The CAB2 doesn't talk to another CAB2, but both are talking to the base, and I'm sure this is managed in the base.  Since when you select a locomotive that is underway with another CAB2 you get the current status, it seems logical that the current status of momentum would be part of the mix, and that is the case.

 

As far as what the engines do with the momentum command, I think that's a question for Jon Z. or Rudy.  I tend to think that John Galt's reasoning is probably correct.  You see pretty much every command to the locomotive going out the serial data line to the audio card as well, even though many of them have no effect.

It was my understanding (I thought I read it somewhere in a manual.) that the momentum setting stayed with the engine, so yes, it can manage it's own.  But in the Legacy environment, when you have the locomotive selected with the Cab-2, the base does better/finer control of the locomotive.  But when you reach that max number (Which GRJ says is 5.) then the locomotive will handle the speed change on it's own, but it won't be as 'clean/neat/smooth' as when the base is controlling it.  Remember, Legacy is TMCC2, so they have to work in TMCC as well, which is why the locomotive keeps the momentum internally as well, so that it still is running at that setting in a TMCC environment.

Thanks for the input, John and Sinclair.  I'm a little confused about what you're saying, Sinclair -- what does #5 refer to?

 

I did a little experiment, because John got me thinking about the CAB-2 versus the base.  I had never really thought about what job each is doing, and I'm still totally unclear.  But my experiment reveals that the CAB-2 is handling the momentum.

 

Here is what I tried this morning: I set momentum to medium and got a loco running at high speed on my test stand.  Then I dialed the CAB-2 red dial all the way down, and the loco started slowing down slowly.  I quickly pulled a battery out of the CAB-2, taking it out of the equation, but leaving the loco and base powered up.  What happens is the loco continues to run at a constant speed, and making occasional noises, but does not slow down.  So it seems apparent that the commands to gradually reduce speed are coming from the CAB-2 and not from the base.

 

That's kind of disappointing, because I was excited that maybe it was the BASE and not the CAB-2 that was actually spitting out all those commands -- and thus my Arduino could simply send a "medium momentum" followed by "set absolute speed to zero" and the base would handle the details.  But not so.

 

Anyway, with this in mind, Sinclair would you be kind enough to expand a bit on your comments, considering I was not able to find the conversation you referenced about "max number"?  If you can think of another experiment I can try to test your idea about fine versus less-fine control depending on if the loco itself is managing something...it seems apparent to me that the loco isn't doing anything at all.  I'd love to test your theory that there is some condition where the loco might have some logic built-in with regards to momentum or anything else other than blindly executing discrete commands but not really using any built-in logic.

 

Thanks!


Randy

Originally Posted by Randy P.:

Thanks for the input, John and Sinclair.  I'm a little confused about what you're saying, Sinclair -- what does #5 refer to?

 

Anyway, with this in mind, Sinclair would you be kind enough to expand a bit on your comments, considering I was not able to find the conversation you referenced about "max number"?  If you can think of another experiment I can try to test your idea about fine versus less-fine control depending on if the loco itself is managing something...it seems apparent to me that the loco isn't doing anything at all.  I'd love to test your theory that there is some condition where the loco might have some logic built-in with regards to momentum or anything else other than blindly executing discrete commands but not really using any built-in logic.

 

Thanks!


Randy

Here is where John said it, the very 1st line of his comment:

 

Originally Posted by gunrunnerjohn:

I believe the command base can manage up to five locomotives as far as momentum changes...

So, in order to test it, you'd need 6 locomotives running.  Set them all at high momentum, then drop them all to zero, one locomotive at a time.  When you get to the 6th locomotive, you'll have to see what the 1st locomotive is doing.  Is it still slowing down, or is it now going at a constant speed like when you pulled the batteries out?

From what Randy says, apparently the CAB2 is actually transmitting the momentum.  Since it shows up on another remote and updates at the same time, I was kinda' figuring that the base was doing it.

 

I'm a little confused on saying the CAB2 is handling the momentum however.  I did the same experiment with a wrinkle.

 

I started a locomotive with momentum and cranked up the throttle.  Then I selected the same locomotive on a second remote, and as I previously observed, the command was still running and the speed was increasing, just as I thought.

 

I added a wrinkle to the test.  I turned off the second remote.  I started the locomotive with high momentum, and after it got going, I pulled the battery.  After that remote was dead, I turned on the other remote and selected the locomotive.  The momentum command was still running. 

 

I repeated the test and waiting for a long enough period to see if the command is continuing even though no remote is powered on.  It appears the momentum stops when the remote powers off until someone picks up the ball.  The base apparently remembers all the settings, but the CAB2 actually sends the commands.

 

 

I did think of one thing that the individual engines do by themselves -- they can behave as part of a Train.  Thus, once a Train has been defined in the CAB-2 remote, you need only issue Train commands, and not individual Engine commands.  Each engine in the train responds appropriately as though it "knows" it is part of that train, and in what position and facing which direction.  I.e. the appropriate engine opens the correct coupler when you send an "open front coupler" command, for example.  So that's something!

NEWS FLASH!  Legacy (and possibly also TMCC) locomotives DO seem to have built-in logic to handle momentum.  I was experimenting with various commands, sending raw hex data out of my microcontroller (via my laptop and an SER-2) into the command base, testing functions like engine RPM, boost, train brake, etc.

 

Just for fun, I set momentum at medium and sent a command to set absolute speed at 199 (max speed.)  Much to my surprise (and delight!), the engine accelerated slowly and smoothly.  What!?!?  So I tried it again, this time pulling the batteries out of my CAB-2 to be sure that it wasn't somehow influencing things -- and sure enough, the locomotive (and F3 diesel) sped up and slowed down (as I fed it raw "absolute speed" commands of 0 and 199) gradually -- all by itself.

 

The only other factor I can think of that I can't eliminate is if the Command Base might be playing some role.  I don't know how to test for certain if the momentum logic is actually built-in to the engine or if it's in the command base.

 

So: if the locos (or base) have built-in momentum logic, then why the heck is the CAB-2 going to so much trouble to issue huge strings of gradually changing speed?  My only guess is that it's because CAB-2 can do it "better" than the loco, in the sense that the CAB-2 is also issuing Brake Level, Engine Labor, and Engine RPM commands interspersed with the absolute speed commands.  I.e., the CAB-2 is adding special effects.

 

That's my best guess -- but I wish I could know for sure.

 

Randy

This had me confused as well, John.  But what was happening in my case was that although I had the velocity dial cranked all the way to full speed, at the time I pulled the batteries out of my CAB-2, it was in the midst of steadily spitting out absolute speed commands which were building their way up to 199.  But at that point, they would have been at, say, 100 or so.  So there would have been no reason for the loco to continue accelerating because it never saw a command that said go to 199.  Even though I cranked the throttle all the way up, the CAB-2 was issuing much lower speed commands and gradually building up.  So it makes sense that it just held steady when I pulled the batteries.

 

It was only after I set momentum and then injected an "absolute speed 199" into the serial port that I saw the speed gradually increase -- whether the CAB-2 was powered on or not.  Because in that case, the loco was managing momentum and knew it needed to get all the way to 199.

 

That makes sense now that we think about it, doesn't it?

Add Reply

Post

OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
Link copied to your clipboard.
×
×