•   
  • Talking T Gauge Shop
    Your online shop for T gauge locomotives, rolling stock and scenery items. Buy for your layout...and support the forum at the same time!

Board index Talking T Gauge Forum T Gauge General Discussions

The place for general discussions and requests for help on all matters relating to T gauge.

Automation......

Postby dkightley » Mon Aug 01, 2016 10:09 pm

With reference to my "Anybody in??" post.....I'm "putting my money where my mouth is" by raising something that I would like to add the The Bridge....which is a simple and inexpensive automation of running two or possibly three different trains round and round the dog-bone track layout I have.

What I have at present is effectively two parallel straights, each powered by it's own PWM controller so I can run trains in opposite directions at differing speeds. At each end, I have a run-around loop that is electrically isolated from the straights that has the capability of being switched to either straight, or left isolated. I also have the option of powering both straights from the same controller so I can set one train running round the loop on its own.

What I'm looking at adding is some form of automation to control two...or possibly three trains....running in sequence round the "loop", ideally with each train being run off a dedicated controller with individual PWMs being switched in and out of each section of track as the train progresses round. I'd also want the trains to be timed so they pass reliably at a pre-determined part of the bridge.

Is there anyone who has had any experience with this sort of automation. I'd prefer to draw on the experience of others rather than learn how not to do things the hard way!!

I do have one major limitation.....it's not feasible to have any detection sensors on the bridge structure, so any detectors would need to be built into the very ends of the straights...or even within the run-around loops themselves.
Doug Kightley
Webmaster here and volunteer at the National Tramway Museum http://www.tramway.co.uk
User avatar
dkightley
 
Posts: 872
Joined: Wed Nov 13, 2013 9:43 pm
Location: Nottingham, UK

Re: Automation......

Postby martink » Tue Aug 02, 2016 10:51 am

Doug,

I've been thinking about that particular issue since you first started showing pics with the controllers & reversing loops many months ago. From a functional/operational perspective, what you have there is pretty much identical to what I did for Sarum bridge - a dogbone divided into four sections set up to run as a three train tailchaser. Alas, the Sarum Bridge electronics are a bit of a dog's breakfast (more canine analogies), having been completely rebuilt twice to get to where it is now and with all sorts of redundant bits hanging off it.

I am currently doing the planning and initial R&D for next year's layout, and I have pretty much (90%) settled on Edinburgh Waverley implemented as 4 automatic sub-layouts: two shuttles with a couple of sidings and two ovals with passing loops. I will be doing the electronics as 4 identical, general-purpose modules that can handle one of several specific automatic layout designs and operating patterns - the Sarum Bridge dogbone included - and was already intending to offer you one if and when I got that far.

The basic set of features would be similar to what I have now: 4 sections, complete replacement of the standard controller (which can always be plugged in as an emergency backup!), acceleration/deceleration and individual speed control of each train (they certainly vary a lot more than I had expected), 8 optical sensors peering through the sleepers, servo operation of 2 or 4 points, and LEDs for a number of fiber optic signals. Cost would be around AUD $100 or GBP 50 on a non-commercial basis, plus probably about the same again for UK VAT & duty, shipping, and a suitable UK plugpack power supply.

No promises, but I am looking to get that bit of kit done by year's end. Alas, real life threatens to intervene and slow things down - that persistent and annoying need to earn a living!

Martin K.
martink
 
Posts: 174
Joined: Sun Feb 09, 2014 3:13 am
Location: Melbourne, Australia

Re: Automation......

Postby dkightley » Tue Aug 02, 2016 11:59 am

What you're planning sounds exactly what I'm looking at building into The Bridge. Once I get my commitments at Crich for the next couple of weeks out of the way, I'll get in touch so I can get an idea of what preparations I need to look at, etc.


Doug
Doug Kightley
Webmaster here and volunteer at the National Tramway Museum http://www.tramway.co.uk
User avatar
dkightley
 
Posts: 872
Joined: Wed Nov 13, 2013 9:43 pm
Location: Nottingham, UK

Re: Automation......

Postby dkightley » Fri Dec 23, 2016 2:34 am

I thought it was time I brought the story of this thread up to date....and to document an absolutely awesome control system that Martin has designed.

As can be seen from the first two posts, both Sarum Bridge and The Bridge have a very similar basic track layout.....a two track bridge in the centre of the layout with stations at either end. Outboard of the stations, the track loops round in a dog bone fashion forming a continuous loop of track.

The simple way of operating such a layout is to have a single train running round and round in an unattended mode.......which is exactly as I have had to do so far with The Bridge....unattended being the operative word! What I need....and what Martin needed and set out to design and build....was a means of automating this single loop so the running could be a little more interesting.

The first step is to slow the train down and stop it at one or more of the stations....and for this to be done automatically. This is done by using a microprocessor control to control the speed of the train by varying the width of the pulse in a simple PWM control. Plant a sensor a couple of feet in advance of the platform and use this to trigger a progressive slow down to a crawling speed. A second sensor to indicate the stopping point triggers a rapid deceleration to a halt. The microprocessor can then give a predetermined wait period and then start the train, progressively increasing the speed up to the running speed. This can be repeated on all four station platforms, so the train starts to react in a lifelike way!

Now with the train stopping in a station, there is now scope to add a second train running round the loop chasing the first train, and also slowing down and stopping at the stations in exactly the same way. For this to happen, however, the loop now needs to be broken up into separately controlled sections...one section for each stopping point. This is required to allow each train to be run by a separate PWM controller. So....four stopping points, four separately programmable controllers sensing a train approaching a stopping point, and slowing the train down to a halt, and starting it up again.

Sounds good.....but a couple of problems. Firstly, having two trains running together, one will want to run faster than the other, so if the four "running speeds" are set the same, the actual speeds of the trains will differ....and eventually one will catch up with the other. Secondly, as a consequence of the first issue, you'll end up with one train pushing the other! And this is only with two trains. Some more design refinements needed!!

Now microprocessors can work very fast, and can be programmed to control lots of different things at the same time. Now let's take the four section loop idea to the next step....starting by controlling one train. For cruising, the PWM controller will have a speed setting, and will have a second preset speed for crawling. The train is in section one of the four sections and the PWM is powering that section. The train hits the "slow down" sensor and slows the train down and stops it. After a short delay, if section two is sensed as being empty, the PWM output is put on section two as well as section one and the train is accelerated up to cruise speed. A short time after section two is powered up....enough time for the train to leave section one...the PWM output is taken off section one, and section one is declared "free". The train is now running in section two.....and repeat the described sequence, this time for sections two and three. Do the same twice more....and you have one train running round the loop.

Now add a second PWM control....this time with the train starting off by running in section four. What happens now is that the two trains follow each other round, the trailing train never being allowed to catch up because of the check on the next section being free or not. And note that the second PWM controller has its own set of preset speeds for cruising and crawling! Now add a third PWM controller doing exactly the same thing......you now have three trains chasing in a loop, all running at their own speeds....actually running like 1:1 trains do, using the block method!

Just to finish the design of to the point where Martin has taken development.....add outputs from the controller for advance and stop signals. And this is what Martin has installed on Sarum Bridge.....and what I will be fitting on The Bridge in time for the 2017 show season that kicks off in February.

I'll post a scematic diagram to help explain how things are laid out......
Doug Kightley
Webmaster here and volunteer at the National Tramway Museum http://www.tramway.co.uk
User avatar
dkightley
 
Posts: 872
Joined: Wed Nov 13, 2013 9:43 pm
Location: Nottingham, UK

Re: Automation......

Postby dkightley » Fri Dec 23, 2016 10:57 am

After such a long post.....here's the schematic:
FirstImpression.jpg
FirstImpression.jpg (49.78 KiB) Viewed 1089 times
Doug Kightley
Webmaster here and volunteer at the National Tramway Museum http://www.tramway.co.uk
User avatar
dkightley
 
Posts: 872
Joined: Wed Nov 13, 2013 9:43 pm
Location: Nottingham, UK

Re: Automation......

Postby Reith01 » Sun Dec 25, 2016 9:15 pm

Some interesting electronic challenges there. The bit I don't quite grasp is when trains run at different speeds for the same control pulse-width, how do you detect which train is under scrutiny and thus alter its speed?

I'm unsure even what "separate controllers" per section could mean. I'd planned to have sections separately powered**, but modulated by the control voltage of whatever's assigned as controller 1 (and of course, using the master pulse generator at c 200Hz). The PWM control voltage (of slave controllers) however would pass through an opamp (or something) that could be altered by an additional input (e.g. upon detection the train could be slowed, accelerated, stopped or just the speed altered).

I don't know how to detect the speed of particular trains though. Timing them between sensors would be one way on which the speed could be adjusted and the information passed to the next slave controller. One wouldn't want the next controller to adjust speed until the train arrives and on relinquishing a section the speed would be restored to that of the master controller. As I have no intention of using any microprocessors (I saw a lovely example of why not at a recent exhibition earlier this year!) I was thinking of triggering a counter attached to an A-D converter to derive a modifying control voltage. It gets a bit more complicated as the start count would be related to the value of the master controller voltage. This may prove irrelevant depending on how a new layout pans out. It may be a simple double-track end-to-end...haven't decided yet but it needs thinking about.

Doug, I'm really interested in keeping up with developments on your scheme.

**More because of the precarious electro-mechanical connections through the track itself.

Cheers. And merry Christmas all!

ps. Given today I'm a little inebriated so I hope this makes sense.
.
Reith01
 
Posts: 132
Joined: Thu Jul 30, 2015 3:34 pm
Location: Sussex.

Re: Automation......

Postby dkightley » Mon Dec 26, 2016 12:01 am

. Given today I'm a little inebriated so I hope this makes sense.


Under the alfluence of incahol?? Tut! Tut! Drunk in charge of a keyboard!

I know it's kind of hard to describe how things work.....but take one controller. It has pots to control both running and crawling speed, and when in operation, it's say first connected to just section 1. It's slowed down after it trips the sensors in that section. After the stop, the controller is connected to both sections 1 and 2 so the train can smoothly accelerate up to speed, passing over the joint between the sections. After a few seconds the connection to track section 1 is cut and the controller is just connected to section 2. This process is then repeated with sections 2 & 3....and so on through section 4 and then back to section 1.

There are three controllers, and the clever bit is ..lets pick an instant in time....each controller is connected to a separate section (sections 1, 3 and 4) and one section (section 2) is "free" and unpowered. The train in section 1 is stopped at the stop point and the pause timer is ticking....and trains are either running, slowing to stop or are already stopped in sections 3 and 4. The timer on the train in section 1 times out. With section 2 free, it is connected to the controller and the train accelerates away....and after a few seconds, section 1 is freed. The train then sitting in the stop point in section 4 (controlled by a second controller, which has its own preset pots, etc) can then be started as previously described.....and then the train in section 3 (on the third controller)....and then its back to the first train, which by this time is waiting at section 2's stop point.

Its a concept that is sort of magic!! And its all controlled by a couple of microprocessors that Martin has written the control software for. Which will account for the system's capability of the power output of each of the controllers being switched from section to section. Well its either that or there's four controllers and their control inputs are rotated round. Either way, I'm quite excited about getting Martin's system installed and running!

I'm actually part way there. I have almost all of the power circuits wired up...four feeds and a neutral return, and I'm currently working on making the breaks in the sections ...in one rail only! I'm also working on the wiring for the sensors.....all eight of them....which are mounted on four of the layout sections, so there needs to be cable connections between the boards. And the same will go for the feeds to the signals....which I've yet to make!

Let me get Boxing Day over....and I'll start posting some photos of progress.....
Doug Kightley
Webmaster here and volunteer at the National Tramway Museum http://www.tramway.co.uk
User avatar
dkightley
 
Posts: 872
Joined: Wed Nov 13, 2013 9:43 pm
Location: Nottingham, UK

Re: Automation......

Postby martink » Thu Dec 29, 2016 2:05 pm

I thought that I had better toss in my 5 cents worth. Doug's description is accurate, but my point of view as the designer is a little different (looking out from inside, so to speak).

Probably the easiest way to think about it is to imagine how you could do this all manually, with a human driving instead of the computer. The long dogbone is divided into 4 sections, each with its own PWM controller. When a train has a clear section ahead, the operator simply sets the speed in the that section to match that train's current speed. While a train is crossing a section gap, you have to adjust both speed controls simultaneously. When the train clears the old section, it becomes available for the next train following to advance.

The key concept is that each train has its own set of ideal speeds, chosen by the operator, and these are passed from one section's PWM controller to the next as the train moves along. Back at the beginning, I had assumed that since all the locos had the same Eishindo mechanism then they would all behave similarly, and so a simpler approach would serve. Alas, I very quickly found that that wasn't the case, so each update to Sarum's control system has centred on giving more independant control of the speeds.

I use two separate micro computers simply because the one I standardised on some years back only has a limited number of pins, and I need too many inputs and outputs to fit on one. One computer handles the blocks, signalling and control panel; the other does the speed control and overload protection.

This (4th) upgrade to the Sarum Bridge control system has the following goals:
- reduce the number of circuit boards from 3 to 1 (the previous versions each added bits while leaving obsolete parts still wired into the system)
- finally give each train its own completely separate speed settings
- add a reversing option for testing and setup (the earlier ones omitted this to simplify the circuitry), and for more complex automation in the future
- make provision for a 5th section and operation of a handful of points using servos or Cobalts for my next layout, allowing simple loops or siding-to-siding shuttles
- make provision for adapting the circuit to N gauge (with its higher voltages and currents) for future layouts.
martink
 
Posts: 174
Joined: Sun Feb 09, 2014 3:13 am
Location: Melbourne, Australia

Re: Automation......

Postby Reith01 » Mon Jan 09, 2017 12:32 pm

I get the idea, was caught up with a simpler way. Ok with blocking, I was thinking of each block separately powered but fed from a master controller, the local element switched in and out by relays (or some equivalent) so two trains couldn’t enter the same block. It would take 4 detectors per section to run bi-directionally. The snag is stopping a train (at a station, meaning everything would stop) – which is where separate independent controllers per block wins.

What bothered me was when a train enters a switched out block it would stop dead which isn’t nice! So if the master controller’s control voltage (that sets the PW) is fed to all block controllers, a slow- down / stop / start up sequence could be initiated locally as the train enters a prohibited block. The electronic challenge is achieving this in a simple way. The slow-down/start up circuit is easy enough, tying it in with a controller has to be thought about.

Not quite martink’s more realistic scheme – but I haven’t yet got a working layout going anyway. I doubt I’ll get involved with route setting because there won’t be enough points to make it viable unless I do something entirely automatic.

I’m playing with it on a current diorama-sized layout using CMOS logic rather than a microcontroller/computer. It’s meant transistorising point machines. What I have learned is, for the purpose of installation, boards that can be manhandled easily (particularly turned upside down) win the day. I’d hate to try putting this stuff in from beneath a layout. Here’s a picture of work in progress - the point controls, CDUs and frog polarity relays. The isolating relays and train detection have yet to be installed. The board is 16” wide X 6 ft and has 7 points. Route setting will happen under the mimic panel, not on the diorama.

Image
Reith01
 
Posts: 132
Joined: Thu Jul 30, 2015 3:34 pm
Location: Sussex.

Re: Automation......

Postby PetrOs » Wed Mar 01, 2017 3:09 pm

Hi,

I am going to try to adapt the automation which I have running on my TT-Gauge railway, to T-Gauge one. I use DCC for train running (that should work with the micro decoder from D&H in T-Gauge), Rocrail software for controlling and automation(server on Raspberry Pi, over USB-to-Serial adapter from Arduino toolkit and self-soldered DCC adapter from serial, over Roco Booster, monitor/control on PC or Tablet), and selfmade Loconet modules for feedback. Alternatively a pair of Roco Lokmouse controllers for manual driving.
PetrOs
 
Posts: 16
Joined: Tue Feb 28, 2017 4:24 pm

Next

Return to T Gauge General Discussions

Who is online

Users browsing this forum: Bing [Bot] and 1 guest