# Who here has a "computer-controlled" layout



## jonmyrlebailey (Sep 3, 2011)

or knows of anybody that has one?

What scale is it?

I believe computer-controlled allows trains to do a bunch of things by themselves (autonomously): run according to pre-programmed commands on a schedule while following signal logic, stop at stations for set amounts of time, operate switches and couplers, operate according to rules and speed limits on the line and in the yard.


----------



## Mark VerMurlen (Aug 15, 2015)

I planned my HO scale layout from the very beginning to have full automated computer control. I have a thread that documents its build. You can see where computer control starts coming into the layout on page 5 of the thread (http://www.modeltrainforum.com/showthread.php?t=53721&page=5).

All of the items you mentioned are indeed part of a full automated system. The most popular train control software applications are JMRI and TrainController. JMRI is an open source system that's no cost. TrainController is quite expensive, but its fairly easy to understand and it works very well. I believe that most of the others on this board with automated systems use TrainController like I do. I originally intended to use JMRI, but it was just too complicated for me. I still use JMRI for DCC decoder programming, but not for running my layout.

If you have specific questions, let us know.

Mark


----------



## fcwilt (Sep 27, 2013)

Hi,

My HO layout is completely computer controlled.

The software is a program called TrainController.

http://www.freiwald.com/pages/index.html

The hardware for sensing and control is primarily Simple Serial Bus devices from RR-CirKits.

http://www.rr-cirkits.com/

There is a lot of additional wiring required for computer automation of a layout, wiring that is mostly optional for a manually controlled layout.

See attached picture from 2013 which shows just some of the wiring required:

At this point in time:

- many of the 199 occupancy sensors have been installed and wired.

- many of the 114 turnouts motors have been installed and wired.

- all of the 39 electromagnetic uncouplers have been installed but have not been wired up. The yellow wires you can see are leading to the uncouplers.

- none of the 81 4-aspect signals have not been installed

Since then all of the uncouplers have been wired, all of the signals have been installed and wired.

Current projects include:

- install and wire the main level computer controlled turntable

- finish the lower level staging yard. Some track has been laid and wired. Trains can run from the main level, down the helix, to the turnout ladder leading to the five tracks of the yard.

Frederick


----------



## Shdwdrgn (Dec 23, 2014)

I'm still in the early stages but my plan is to use ESP32 computers onboard each loco. I'm currently running DCC++ on another ESP32 as the controller and getting started setting up an arduino to run servos for the turnouts. The goal is that while under manual control each loco can receive standard DCC commands, but each loco will also have the ability to run autonomously, picking up jobs from a central raspberry pi and completing those tasks on its own while honoring track signals to avoid collisions.

@Mark - thanks for the link, will definitely have to check your build thread for ideas!

@fcwilt - wow that's an impressive amount of wiring under the board! I see the motors/servos which probably run your turnouts, but what are all the other boards with the bundles of ribbon cable going to them?


----------



## Lee Willis (Jan 1, 2014)

It is a slight deviation form this thread but cool. In Season 1, Episode 14 of the TV Detective Series Ellery Queen, titled The Eccentric Engineer, the whole plot and the final clue revolves around a very early computer-controlled O-Gauge model railroad, which is featured a lot in the movie. Ed McMahan played the eccentric engineer. It is one of my favorite model-train themed TV shows. The show actually explains how the system works, too.


----------



## fcwilt (Sep 27, 2013)

Shdwdrgn said:


> @fcwilt - wow that's an impressive amount of wiring under the board! I see the motors/servos which probably run your turnouts, but what are all the other boards with the bundles of ribbon cable going to them?


In the early stages of wiring before I became aware of the Simple Serial Bus devices I was using another RR-CirKits product called the Tower Controller 64, which was recommended to me by another user of TrainController.

The Tower Controller family of products perform essentially the same functions as the Simple Serial Bus products but the form factor is different. A central unit with eight 8 bit digital input/output ports connect (via 10 conductor flat cables) to small I/O boards which adapt the 8 bit port to a specific task.

The Tower Controller uses LocoNet to connect to the computer via any LocoNet compatible DCC command station or via a RR-CirKits LocoBuffer USB device.


The Simple Serial Bus products dispensed with the central unit and each board connects directly to the Simple Serial Bus which is basically LocoNet using 3 wires rather than 6. 

The Simple Serial Bus boards connect to the computer via a RR-CirKits Gateway which "converts" the Simple Serial Bus to/from LocoNet. 

The Gateway connects to the computer in the same way the Tower Controller connects.


As to the I/O boards I used:

There are boards there to sense block occupancy. These boards use small current sensing coils that you slip over one of the feeders to a block. The nice thing about this approach is that the block power wiring is completely separate from the occupancy sensing wiring.

There are boards to drive the Tortoise turnout motors.

There are boards to drive the DPDT relays which are used to switch either DCC or DC power to each block. The reason for this is that TrainController can support what is termed a stationary decoder (one per block) which allows TrainController to run a mix of DCC and DC trains. 


Once I became aware of the newer Simple Serial Bus devices I switched over to using them exclusively but I saw no need to remove the older Tower Controller devices which were working fine.

In the future if a Tower Controller were to fail I would simply replace it with a suitable set of Simple Serial Bus devices performing the required functions.


Frederick


----------



## Shdwdrgn (Dec 23, 2014)

It's amazing how fast technology can change. I'm playing with a new servo driver board I picked up for about $2 which drives 16 servos directly. It connects to an arduino with two control wires plus power and ground, and it can be daisy-chained (I think the upper limit was around 692 servos?). So there's hardly any wiring involved, and the arduino will be getting power and DCC commands directly from the track so no need to wire back to a central controller.

I've seen those current-sensing coils but have never used one. I think I want to put a 10k resistor across one set of wheel in each truck for all my cars, would the coils be sensitive enough to pick that up? Otherwise I also have some small current-sensing board which output a corresponding voltage and read up to +/- 5A that could also do the trick.

Because of all the electronics I plan to incorporate, my main buss under the layout will include a 5VDC line. I would still need to run at least a single wire from each block sensor back to a computer chip to read them all.


----------



## fcwilt (Sep 27, 2013)

Shdwdrgn said:


> I've seen those current-sensing coils but have never used one. I think I want to put a 10k resistor across one set of wheel in each truck for all my cars, would the coils be sensitive enough to pick that up?


When the coils are used with RR-CirKits WatchMan they are more than sensitive enough.

I use 10K resistors myself and have no problems.

Frederick


----------



## Elderberry (Dec 9, 2016)

That is some exceptionally good wiring! Wish mine was that neatly done.


----------



## Shdwdrgn (Dec 23, 2014)

Cool thanks for the info. It's a shame there isn't some central repository of information for people to see all the options for different pieces of an electronic setup. Loco control, track signals, even building lights -- there are multiple solutions for every aspect but there's no good resource that compares the aspects of each solution and provides a quick run-down. Half the electronics I've bought over the past few years sit in a box because I read a couple web sites that recommended doing things one way, and then later I ran across more articles detailing why another way is better.


----------



## fcwilt (Sep 27, 2013)

Shdwdrgn said:


> Cool thanks for the info. It's a shame there isn't some central repository of information for people to see all the options for different pieces of an electronic setup. Loco control, track signals, even building lights -- there are multiple solutions for every aspect but there's no good resource that compares the aspects of each solution and provides a quick run-down. Half the electronics I've bought over the past few years sit in a box because I read a couple web sites that recommended doing things one way, and then later I ran across more articles detailing why another way is better.


I always recommend RR-CirKits Simple Serial Bus devices for many reasons.

- they have a device for every need - occupancy sensing, turnout control, signal control, relay control, etc
- the system is LocoNet compatible
- the system uses a simple 3 wire "bus" (power, ground, signal)
- all the devices share the same basic design
- no soldering required, all connections are screw terminals, compression fittings, IDC flat cable connectors, etc.
- they all can be configured via DecoderPro
- the configuration options tend to be extensive - for instance the signal control device (SignalMan) will handle 16 LEDs. You can configure the LEDs as eight 2-aspect signals, five 3-aspect signals, four 4-aspect signals or combinations thereof.
- the prices are good
- the support is top notch

Frederick


----------



## dinwitty (Oct 29, 2015)

I will not be computer controlling my trains, I am all about interactivity with the humans. But most everything else will have a computer touch or link thru the digitrax system whatever to control signals, turnouts etc but try to keep a prototypical sense.
I am using JMRI, getting it to work takes a little logic savvy, but if you can get past that you are on your way. Controlling a signal is about if this is that but not that set signal this way. My target signals are perfect.


----------



## jonmyrlebailey (Sep 3, 2011)

*I envision a totally WIRELESS computer-control system.*

The system, in theory, would actually know the exact grid position of every rolling stock vehicle on the layout as well as its heading, precise speed and direction it is facing: each locomotive and car would have something like a micro transponder or tiny GPS-like device on board to determine its exact longitude and latitude on the layout: the map. It would, in my theory, use a technology similar to GPS. The 'satellites' would be several radio devices positioned precisely about the train room. Perhaps, it could track the position of each vehicle to the nearest millimeter or smaller. 

Railroad switches and signals could be controlled and identified by such wireless means as well. They might only need wires for supplying electric power to operate. 

Predefined points (grid positions) would have to be determined on the layout and programmed into the system as to where to park rail cars in the yard, at station platforms, at water stops and at customer sidings or where to park locomotives at their home spots as in roundhouse stalls and position them precisely on the turntable. Is this a wireless form of occupancy sensing? Each position or parking spot would be a defined WAYPOINT. If two coupled flatcars are parked at a loading dock at Johnson Sawmill on your pike, for instance, that loading dock might be called the JOHNSON SAWMILL waypoint. The stall for your UP Big Boy at the roundhouse might be called the BIG BOY waypoint and so on. You could make train schedules and routes up in the computer interface by issuing commands to navigate from one waypoint to another. A passenger stop at a station would be just another waypoint. 

The on-board mini positioning/tracking devises (receivers/transmitters) could either be powered from track current or from batteries. They could auto switch themselves on and off as well. 

One could also establish speed limits or speed zones on the layout for this system to also regulate train speeds according to the rules you define and punch into the system. You make the traffic rules for the layout as its division superintendent. The system then enforces them. You may have a 10 mph (scale) speed limit in your yard, for example. You may also have a speed limit for crossovers on your mainline. The system, I envision, could control every aspect of train operation as sounding locomotive bells in the yard as matter of a set rule and blowing the whistle automatically approaching grade crossings. I suppose the grade crossings could be controlled by wireless as well. 

Just think of your train board as a map with tiny grid squares. One millimeter or smaller. 

I envision model trains as becoming so advanced most messy wiring and bulky panels would be eliminated. You would walk around the whole layout with a tablet in your hand as the system's entire control panel. 

Yes, a highly digitally-connected scale railroad world! 

Trains would navigate by this technology. 

Imagine a special kind of GPS (global positioning system) in "micro-mini scale" controlling your HO or garden trains' every move.

Yes, I am thinking about this hobby's truly entering the digital age.


----------



## JerryH (Nov 18, 2012)

duplicate


----------



## JerryH (Nov 18, 2012)

Most of what you envision is within the capabilities of RR&Co Traincontroller software. An item that is not, is an extreme precision, local GPS hardware for models and associated 2 way communication and computer interface. That you will have to invent and make yourself. There are wireless control hardware systems available, but getting all of identification on all of the rolling stock maybe pricey. You might want to look at what most of us are already using. I suspect that less than a fraction of 1% of modellers, actually computer automate their RR. From concept, build, and automation, you should take a look at this thread. It shows a lot of issues that need to be planned for. It is a long thread. I am currently rebuilding it based on desires that the first could not meet.

http://www.modeltrainforum.com/showthread.php?t=14852


----------



## fcwilt (Sep 27, 2013)

dinwitty said:


> I will not be computer controlling my trains, I am all about interactivity with the humans.


I agree that being able to interact with your layout is a good thing.

That's one thing I like about Train Controller software.

I can have Train Controller running one or more trains while I manually control, say, a way freight.

Train Controller insures that there are no problems assuming I pay attention to the signals.

Frederick


----------



## ebtnut (Mar 9, 2017)

Automatic control of model railroads actually goes back a long way. Back in the '50's people used relays operated by mechanical track sensors to control the system. This type of control was essentially a rudimentary computer.


----------



## jonmyrlebailey (Sep 3, 2011)

fcwilt said:


> I agree that being able to interact with your layout is a good thing.
> 
> That's one thing I like about Train Controller software.
> 
> ...


In my theoretical GPS system, a train could be run by human hands as well while autonomous vehicles run passively according to programmed commands. I can do that in TRAINZ already. Have AI trains running on a given route and drive my own train in the cab. 

Of course, I want GPS-controlled PHYSICAL moving scenery road vehicles as well like the Carz on the roads in Trainz. I mean free-steering scale RC/GPS-navigated cars and trucks. No slot-guided jazz. Yes, those robotic cars have to stop at stop signs and at active grade crossings according to strict traffic rules. 

My computer interface would have a single software program operate every aspect of the layout:

-railroad trains
-yard marshalling
-cutting at customer sidings
-loading/unloading of freight cars
-loco roundhouse
-sound effects
-dispatching
-turnouts
-signals
-lighting
-grade crossing traffic management
-road vehicles
-autonomous tractor-trailer trucks that professionally back up to loading docks, drop and hook trailers as well
-motorboats on bodies of real water
-the pumps that create artificial current for the scale river
-perhaps, disappearing people figures at station platforms to give the illusion of getting on and off the train 
-robotic arms that replace rechargeable batteries in vehicles as needed to simulate refueling at stations 

Think of the film "Westworld" in miniature with a railroading theme.


----------



## fcwilt (Sep 27, 2013)

When you dream you dream big.

My system has one significant advantage over your "dream" system - mine exists.

Frederick


----------



## highvoltage (Apr 6, 2014)

Micro-precision rails, everything computer controlled, everything runs like a Swiss watch. What could you do if you had a billion dollars. Yes indeed sir, you are a dreamer.

I suspect however that you won't be fascinated by model railroading where the fun is in building the layout and then running everything.


----------



## jonmyrlebailey (Sep 3, 2011)

fcwilt said:


> When you dream you dream big.
> 
> My system has one significant advantage over your "dream" system - mine exists.
> 
> Frederick


I am glad you have the privilege to own your own model RR regardless of its level of sophistication and precision. If this makes your life enjoyable, then God bless it just the same.


The best thing I have that's within my budget right now is Trainz a New Era as well as Trainz Railroad Simulator 2012 on my PC. It is not perfect either but provides me some cheap enjoyment.


----------



## fcwilt (Sep 27, 2013)

jonmyrlebailey said:


> I am glad you have the privilege to own your own model RR regardless of its level of sophistication and precision. If this makes your life enjoyable, then God bless it just the same.
> 
> 
> The best thing I have that's within my budget right now is Trainz a New Era as well as Trainz Railroad Simulator 2012 on my PC. It is not perfect either but provides me some cheap enjoyment.


I wasn't talking about my layout "existing", I was talking about the technology. 

The hardware and software to implement a layout using that level of technology is already on the market - that is what I meant when I said it "exists".

Frederick


----------



## jonmyrlebailey (Sep 3, 2011)

fcwilt said:


> I wasn't talking about my layout "existing", I was talking about the technology.
> 
> 
> The hardware and software to implement a layout using that level of technology is already on the market - that is what I meant when I said it "exists".
> ...


You are saying GPS navigation, or any similar technology, for model trains is already on the market? 

But to what extent your system, whatever it is, has the same features of my envisioned "dream" system, I hope it makes you happy. I say this sincerely. 

I don't feel any American company will ever manufacture what I dream of on American soil by American hands and preferably with master craftsmen imported from Europe. 

Historically, the finest American products, model trains included, ever made were by the hands of European immigrants 100+ years ago. Unfortunately, in more recent history, American union factory workers were not as particular about product excellence. The Germans and Swiss brought the utmost in precision to former American industry. Italians brought fine arts and cuisine. The Irish and Chinese did the horrible non-glamorous labor of building our first Transcontinental Railroad. 

Model train product excellence is dead. This hobby will most likely die along with us baby boomers. Trains, in terms of passion among the younger generations, however forlorn, are out. Dreams of sophisticated space ships' hauling man to Mars, Jupiter and beyond are in. 

I seriously doubt I will ever own a physical model train layout. 

I don't think I will ever be rich enough to own one that makes me 100% happy. I could never be proud to own any China made trains anyway. There are other things in this world that I can do for fun within my means as go dove hunting proudly with my Italian-made shotgun and my American-whelped bird dogs in my American-built Toyota truck.


----------



## Old_Hobo (Feb 20, 2014)

Wow....are you on the wrong forum! hwell:

Get some sun block for that red neck.....


----------



## jonmyrlebailey (Sep 3, 2011)

Old_Hobo said:


> Wow....are you on the wrong forum! hwell:
> 
> Get some sun block for that red neck.....


I never knew there was right forum for anything but I do wear a straw hat with a big brim to shade my neck in the sun on dove hunts.


----------



## fcwilt (Sep 27, 2013)

jonmyrlebailey said:


> I never knew there was right forum for anything but I do wear a straw hat with a big brim to shade my neck in the sun on dove hunts.


Dove hunts? I didn't know folks hunted doves?

What do you do with them?

Frederick


----------



## jonmyrlebailey (Sep 3, 2011)

fcwilt said:


> Dove hunts? I didn't know folks hunted doves?
> 
> What do you do with them?
> 
> Frederick


Well, if "hunt" means "kill birds with a gun for sport or meat" then there are folks who do such thing. 

What do I _do_ with them?

I breast the birds, cook the breasts and eat them for dinner! 

The rest of the dove is good for nothing except taxidermy which I am not a bird stuffer for room decoration.


----------



## fcwilt (Sep 27, 2013)

jonmyrlebailey said:


> I breast the birds, cook the breasts and eat them for dinner!


I've never held a dove but I wouldn't think there was that much meat on them.

How many does it take to make a meal?

Frederick


----------



## jonmyrlebailey (Sep 3, 2011)

fcwilt said:


> I've never held a dove but I wouldn't think there was that much meat on them.
> 
> How many does it take to make a meal?
> 
> Frederick


About 7 or 8 breasts to make a man-size meal: half the daily limit 
here in Idaho during dove season. If you can limit out doves with just one
box of shells (25 per box) you are a crackerjack shooter.

Anyway, dove shooting is more exciting to me than watching China-made trains
wobble around the track. The "real" trains coming through my town are more
of a joy to hear and watch.


----------



## fcwilt (Sep 27, 2013)

jonmyrlebailey said:


> Anyway, dove shooting is more exciting to me than watching China-made trains
> wobble around the track.


Thanks for the info on the doves as a meal.

Regards trains...

I've got three of these and I find them to be excellent runners and very good looking as well:

I have two that are weathered and one that is "fresh from the factory".

http://eurekamodels.com.au/Garratt.html

Frederick


----------



## Shdwdrgn (Dec 23, 2014)

There's not much meat on squirrels either, but they're still decent to eat. Then again you gotta be really bored to go out hunting squirrel when you can go pick up a pack of chicken for about the same price as the ammo but without the effort...

Back to the computer-controlled layout discussion, I'm working on servos today. Finally got power to them and can see these cheap little $1 servos easily have enough strength to run my HO turnouts. Now to load up some code that works with DCC and see if I can toggle them.


----------



## fcwilt (Sep 27, 2013)

Shdwdrgn said:


> Back to the computer-controlled layout discussion, I'm working on servos today. Finally got power to them and can see these cheap little $1 servos easily have enough strength to run my HO turnouts. Now to load up some code that works with DCC and see if I can toggle them.


Servos can work well for controlling turnouts. 

However some servos will "chatter" a good deal when they are supposed to be stable at a fixed position.

Depending on the servo this noise can be audible.

I tried some cheap ones and they simply made too much noise.

Some better ones solved the problem.

But ultimately I went with Tortoise units.

Frederick


----------



## Shdwdrgn (Dec 23, 2014)

For only being a buck each, these are pretty decent. I can feel a little vibration if I hold it in my hand, which might be amplified if it were mounted directly the the plywood, but the only time I heard any audible sound from it was when I tried to rotate it by hand and it kept trying to reset back to the original position. When the operation was unhindered, it was nice and smooth and fairly quiet.

Still fighting on the DCC front though. It looks like I'll have to put together some code myself. Surprisingly I have only been able to find one project that actually makes use of this servo driver board, and it was receiving commands over a serial port instead of from the rails. Now I'm trying to get together some test code to flash tonight and see just exactly what kind of info I get from the rails.


----------



## fcwilt (Sep 27, 2013)

Shdwdrgn said:


> Surprisingly I have only been able to find one project that actually makes use of this servo driver board


Refresh my memory - what server driver board are you using?

Frederick


----------



## Shdwdrgn (Dec 23, 2014)

It's the PCA9685... identical in function to a unit sold by Adafruit, but mine came from ebay. I confirmed over the weekend that my arduino micro can talk to the board and have a little sketch that runs all the servos through a 180-degree range so hardware-wise I'm in good shape. Just gotta figure out the software. I found someone on TrainBoard who is using this board, but in their setup they are getting the commands over the serial port directly from their base station instead of reading from the rails. So now I'm digging through NmraDcc but they don't have just a basic example that reads commands from the rails and spits out the info over a serial monitor so you can see what is going on. I'm trying to figure out their code but I think I'll have better luck actually setting up the hardware tonight and see if I can read anything at all from the rails.


----------



## gregc (Apr 25, 2015)

fcwilt said:


> My system has one significant advantage over your "dream" system - mine exists.


Frederick

i sincerely applaud your accomplishment.

i tried sending a private message. How automated is your railroad. I assume it can run multiple trains from source to destination.

i assume it does automatically switch cars? (i would think positioning and uncoupling are issues).


----------



## fcwilt (Sep 27, 2013)

gregc said:


> Frederick
> 
> i sincerely applaud your accomplishment.
> 
> ...


The TrainController (TC) software supports running trains manually with a handheld or on-screen throttle.

If also supports running trains on a Schedule. A Schedule defines that route (or routes) that a train may take. Schedules can be run manually or under computer control.

I have numerous Schedules defined to handle both Passenger and Freight trains.

The Passenger Schedules take advantage of TC's ability to use the computers audio system in "surround" mode (4 speakers at the corners of the layout and a sub-woofer) to play "Station Announcements" as the Passenger trains leave/arrive.

The most trains I have ever had running at one time, under Schedules, is five but that is a limit of the size of my layout, not TC.

TC does support automated coupling/uncoupling but that is a fairly tricky operation as you have to provide a means to accurately position the desired pair of couplers over the electromagnetic uncoupler.

I have done this at four sidings that are positioned near the front of the layout so the action is easily observed.

I chose NOT to do all of my sidings simply because of the wiring involved - TC could easily handle them all.

Frederick


----------



## gregc (Apr 25, 2015)

fcwilt said:


> TC does support automated coupling/uncoupling but that is a fairly tricky operation as you have to provide a means to accurately position the desired pair of couplers over the electromagnetic uncoupler.
> 
> I have done this at four sidings that are positioned near the front of the layout so the action is easily observed.
> 
> I chose NOT to do all of my sidings simply because of the wiring involved - TC could easily handle them all.


thanks. can you provide more detail for above?

i assume one or more position sensors would be required at a spur to know when a pick-up has been coupled and a drop-off is in position.

it's not clear me about a position sensor over an uncoupler because it is the coupler, not the car that needs to be positioned and it may not be the last car that needs to be uncoupled?

the above is conceivable but I wonder about both the configuration and software to specify what would like to be done, as well as the configuration and reliable SW to implement it.


----------



## fcwilt (Sep 27, 2013)

gregc said:


> thanks. can you provide more detail for above?
> 
> i assume one or more position sensors would be required at a spur to know when a pick-up has been coupled and a drop-off is in position.
> 
> ...


My approach was to install small magnetic reed switches between the ties at 3, 3-1/2, 4 and 4/12 inches from the center of the uncoupler.

This only needs to be done at one end of the uncoupler.

Then on those cars that I wished to be able to use for automatic uncoupling I installed small neodymium magnets at the center of the car.

The spacing of the reed switches and the sizes of the cars allows positioning the couplers at (or very near) the center of the uncoupler.

Which reed switch is monitored depends on the length of the car which will be triggering the reed switch.

The process of uncoupling involves the physical act and the "logical act".

The physical act requires the creating of sequences of TrainController (TC) commands which move the train into place at a very slow speed until the correct reed switch is activated the correct number of times to get the correct car into position over the reed switch - which results in the correct couplers being over the uncoupler.

Once the car is in position another sequence of commands is used to perform what folks call the "kadee shuffle" which simply involves moving the train back and forth a very short distance a few times to put some slack into the couplers.

Once that is done another sequence of commands activates the correct relay to feed power to the correct uncoupler and then activates the uncoupler power supply which automatically applies a sequence of high power and no power a few times, ending with medium power. The purpose of changing the power is to help "jiggle" the couplers open.

During the application of medium power the sequence of commands moves the train away from uncoupler and the power is turned off.

Now the physical uncoupling is complete.


There are also a set of commands that need to be issued to inform TC that the train has been broken into two parts - which is the "logical" part.


While all that may sound complicated it really is not.

The same basic sequence of commands can be reused at any of the uncouplers equipped with the reed switches.

You only need variations of the sequence to account for the selecting the correct reed switch and counting the correct number of activations.

Fortunately TC supports variables you can use for counting things so by setting a variable to, say, 3 and having the reed switch activation decrement the variable, once it reaches zero you know the reed switch had been activated the correct number of times.


Of course you generally have two uncouplings to spot a car on a spur. The first breaks the train into two so the desired car is at the end of the train and then the second to drop the car on the spur.


The act of joining the train back into one piece is simpler because the uncoupler is not involved, just moving the train.

And naturally you may have to throw turnouts during the process but that is handled easily by TC.


Setting up TC to do this does take some work but it is great fun to watch the whole operation proceed automatically.

Frederick


----------



## gregc (Apr 25, 2015)

fcwilt said:


> Setting up TC to do this does take some work but it is great fun to watch the whole operation proceed automatically.


amazing. again, i sincerely applaud effort.

thanks for explanation


----------



## Shdwdrgn (Dec 23, 2014)

I was thinking of using IR to detect when a coupler is over the uncoupling section. Shine the light across the track, and when the light is received then you most likely have the gap between cars centered over the uncoupler. Of course this would require a precise height adjustment so you can also detect flatbeds. The idea is to wait for the first 'blink' on the IR detector, indicating that the first car is now traveling over the uncoupler. Now as the train continues to back up, you can count the pulses between cars and then perform your uncoupling at the correct spot.

An alternative if you have a resistor on at least one pair of wheels on each truck... make a very short occupancy block (probably no longer than a single truck) centered on your uncoupler. Again you can count the cars as they pass, you just need to back up another inch or two past the target truck before beginning the uncoupling operation.

I really like that idea of 'jiggling' the couplers with the electromagnet. Unfortunately not possible with regular magnets but it would certainly increase the chances of a successful operation. I'll have to keep that in mind.


----------



## fcwilt (Sep 27, 2013)

Shdwdrgn said:


> I was thinking of using IR to detect when a coupler is over the uncoupling section.


That was my first approach.

However two problems arose. One was to find a height that worked for all cars. Two was mounting the IR emitter and IR emitter on either side of the track in a way that didn't look terrible and wasn't going to interfere with passing traffic.

Because the idea of automated uncoupling came to me AFTER I had installed the uncouplers at locations that were good for non-automated uncoupling it was not possible to mount the IR devices in some of the desired locations because of interference issues.

In the long run the reed switches had fewer issues despite requiring a bit more wiring.

Frederick


----------



## Shdwdrgn (Dec 23, 2014)

Hmm I think I've actually thought about this issue before, and it occurred to me that instead of trying to send the IR signal straight across the tracks, go diagonally at such an angle that you can always hit the bed of the car but not the couplers. Then you should only need one tall IR device on one side of the track, and the other one can be buried in the ground (or even between the rails). Hmm maybe an IR floodlight literally placed inside the yard lights to light up a whole area at once? Ah well, I'll get to that stage some day...

I'm actually going to have magnets in several cars for remote unloading, but didn't plan to put them on every car, and some wouldn't allow for placement in the exact center anyway, which would throw off the timing. However the resistor-based occupancy detection WILL be in every car, so there's a good chance I can make that work.


----------



## gregc (Apr 25, 2015)

fcwilt said:


> Because the idea of automated uncoupling came to me AFTER I had installed the uncouplers at locations that were good for non-automated uncoupling it was not possible to mount the IR devices in some of the desired locations because of interference issues.


how would have located them differently?

and what made you decide to "jiggle" the couplers?


----------



## fcwilt (Sep 27, 2013)

gregc said:


> how would have located them differently?


I would have given thought to any thing I might need to install for automated uncoupling - such as clearance for IR devices.



gregc said:


> and what made you decide to "jiggle" the couplers?


Experience. 

Sometimes simply applying the suggested power to the uncoupler didn't do the trick. 

By pulsing the uncoupler with brief bursts of power I can apply more power than the manufacture suggests without risk of overheating.

Once the couplers are uncoupled it takes less power to hold them that way so I can drop down the applied power which provides more time to complete the entire process without risk of overheating.

Frederick


----------



## Shdwdrgn (Dec 23, 2014)

@fcwilt - have you ever run across similar suggestions for uncoupling over permanent magnets? Seems like the only thing that could be jiggled there is the train itself, which becomes progressively harder as the train gets longer.


----------



## fcwilt (Sep 27, 2013)

Shdwdrgn said:


> @fcwilt - have you ever run across similar suggestions for uncoupling over permanent magnets? Seems like the only thing that could be jiggled there is the train itself, which becomes progressively harder as the train gets longer.


I cannot think of anyway easy to alter the magnetic field of a permanent magnet uncoupler - unless you could raise it up and down quickly.

I never considered using anything other than electromagnetic uncouplers.

Frederick


----------



## Shdwdrgn (Dec 23, 2014)

I'll be using electromagnets where I need to do uncoupling on the main lines, but permanent magnets on the sidings would be a lot cheaper in the long run. Once I finish my DCC conversion my next project will be adding detectors and trying to get uncoupling working autonomously.


----------



## fcwilt (Sep 27, 2013)

Shdwdrgn said:


> I'll be using electromagnets where I need to do uncoupling on the main lines, but permanent magnets on the sidings would be a lot cheaper in the long run. Once I finish my DCC conversion my next project will be adding detectors and trying to get uncoupling working autonomously.


True electromagnetic uncouplers are relatively expensive but they are, in my experience, more reliable and, naturally, you have no issues with unintended uncoupling.

Besides I have so much money in my hobby already what's a few more uncouplers. 

Frederick


----------



## gregc (Apr 25, 2015)

frederick

have you considered slowly pushing the cars to be uncoupled over an uncoupler and stopping/reversing the train when the couple uncouples over the ramp?


----------



## Shdwdrgn (Dec 23, 2014)

@gregc -- that's assuming everything works just right. Even playing with them on my desk, moving the cars by hand, I can't always get a reliable uncoupling. I had just planned on watching the sensors to see if cars get pulled back over the uncoupler after an operation, and if so have the loco try decoupling once more.

It just occurred to me that uncoupling failures could actually be useful, in that it's one of the few things which could cause a train to run late on its schedule. I like the idea of random issues throwing off the timing, it will be more like the real world.


----------



## fcwilt (Sep 27, 2013)

gregc said:


> frederick
> 
> have you considered slowly pushing the cars to be uncoupled over an uncoupler and stopping/reversing the train when the couple uncouples over the ramp?


How would I detect that condition? 

Frederick


----------



## Shdwdrgn (Dec 23, 2014)

fcwilt said:


> How would I detect that condition?
> 
> Frederick


Mount a camera on your tracks, and then ask Alexa if your cars are uncoupled.


----------



## gregc (Apr 25, 2015)

so you have considered this?

is the condition that the couplers have uncoupled (can't imagine how) or that the couplers are in the uncoupling position above the uncoupler?

have you considered a horizontal detector just above the rails to detect the wheels?

wondering about all the possibilities you considered before using the reed relay approach


----------



## fcwilt (Sep 27, 2013)

gregc said:


> is the condition that the couplers have uncoupled (can't imagine how) or that the couplers are in the uncoupling position above the uncoupler?


The condition to be detected is that the couplers are over the uncoupler.



gregc said:


> have you considered a horizontal detector just above the rails to detect the wheels?


I tried a IR beam break device and that did work BUT because I didn't allow for automated uncoupling when placing the uncoupler I did not have room for mounting the emitter/detector in the required position for certain uncouplers.



gregc said:


> wondering about all the possibilities you considered before using the reed relay approach


I spent a good deal of time trying the IR approach. I switched to the reed switch approach because I knew it would work and there would be no clearance issues. 

Also the reed switches are very hard to see so there is no visual issue as there was going to be with the IR emitter/detector pair.

It would be possible to use a camera to analyse the image looking for the correct coupler position but this would have required finding a tiny camera that could be placed to the side of the uncoupler and not have clearance issues.

And it would have been more work to write the code for a device to process the camera output and signal TrainController when the cars were in the desired position.

The reed switches are cheap, easy to install as are the magnets needed for the cars.

Frederick


----------



## gregc (Apr 25, 2015)

it sounds like you wouldn't have considered the reed-relay approach if the IR detector would have fit.

i hope you will comment on an IR detection thread i'm about to post under the technology forum

(i'm surprised you would seriously consider processing a camera image. This was suggested when I did some holography research in college.)


----------



## fcwilt (Sep 27, 2013)

gregc said:


> it sounds like you wouldn't have considered the reed-relay approach if the IR detector would have fit.


Had they fit I likely would have stopped there. 

But I was not very happy with the visual aspect of having these two things sticking up on each side of the uncoupler.

The IR approach did have the advantage of not having to worry about the length of the cars and the relationship of the coupler to the magnet as the IR emitter/detector were positioned at the center of the uncoupler and you only had to worry about counting gaps between cars to get to the correct gap.



gregc said:


> (i'm surprised you would seriously consider processing a camera image. This was suggested when I did some holography research in college.)


I said it could be done. I didn't really think about it very long as I knew writing the code for the camera would be a lot of work.

Frederick


----------



## Shdwdrgn (Dec 23, 2014)

I really hope you guys know I was joking about the camera suggestion. 

Have you ever played with Hall-effect sensors? Easy to use and the good ones can put out an analog signal showing the relative intensity of the magnetic field. Handy if you want to use different size magnets to signify different types of cars. You just have to really check over the data sheets on them, as many styles are only sensitive within a few millimeters. For HO work I need something that can detect the field from at least an inch away. When I was in school for electronics our final class project involved building a system that shredded paper and fed it into a line of hoppers. The Hall-effect sensor we used for that was able to detect an HO train moving at full speed.


----------



## fcwilt (Sep 27, 2013)

Shdwdrgn said:


> Have you ever played with Hall-effect sensors?


I know about them but never have used them in any project.

Do you have a favorite part number(s)?

Frederick


----------



## Colorado1445 (Nov 11, 2017)

I always thought the concept was neat, however I am a computer illiterate 21 year old.


----------



## Shdwdrgn (Dec 23, 2014)

fcwilt said:


> I know about them but never have used them in any project.
> 
> Do you have a favorite part number(s)?
> 
> Frederick


I have some A1302 parts that I was planning to test out. Most of the parts you find are only rated for a few millimeters at most but this one had a better range with small magnets. I need to try and figure out what the part number is of this one mounted to the track (I still have it from our project) since it worked so well. I know it worked well enough that it only tripped on the magnets, but not on the loco traveling past it. And they are small enough to embed between the track ties.

Also of note is that they provide an analog signal rather than a simple on/off. Since my coal hoppers have four magnets on the dump doors, I thought it would be a neat way to tell the difference between types of cars by using a different number of magnets. Polarity is important though since the sensors only respond to one side of the magnet.


----------

