Showing posts with label Trackwork. Show all posts
Showing posts with label Trackwork. Show all posts

Friday, 27 January 2023

Computers and Model Railways

No, I'm not converting the layout to DCC! The layout ran well at Maidenhead with the exception of the two oldest locomotives. My model of "Earl" and my friend's model of "Countess" were not happy with the 12" radius points. "Earl" would fight its way through the points but "Countess" would only operate on the straight track. this is due to them being 20+ years old and using wheels with deep flanges which hit the check rails on the curves. "Earl" was able to go further since it has flangeless centre drivers. Combined with the deep wheels are the outside frames which mean there is no scope for opening the back to back of them. This, hopefully, isn't the end of the world as I have replacements for "Earl" and "Countess" which are planned to be built in the coming months and they will use modern wheel sets. If that fails then I will have to resort to mainline points which are 18" radius but I hope not to go there since that will reduce the length of the sidings by 4" overall.

The only problems encountered at Maidenhead was operator error on setting the points with the occasional stutter over the frogs. The stuttering will be sorted with point motors with frog switches. In my last post I mentioned I was short of one MP1 point motor. The estimated delivery of mid December came and went and another good friend, Adrian, offered me one from his secret stash so I bought that and had enough to start.

The next issue was whether I could reduce the operator error? Get better operators would be the correct answer but that would mean I wasn't allowed to operate my own layout! Traditional operation would have a switch for each point which still leaves scope for not setting them correctly. They could be paired up so that each switch operates the corresponding point at the opposite end. That would reduce the errors but was never going to fully eliminate them. One answer was to operate the points using a push button for each track that, when pressed, would change all the necessary points to make that track the running line. It had to be done!

This is the finished result from above.


The five sidings match 5 push button switches top left. This is matched by 5 LEDs next to the switches. The LEDS flash while the points are changing and go solid green when the points are set. The location of the switches is such that when operating the layout from one side (whilst talking to visitors) I can reach them. The is a red LED below the 5 green ones which will flash if something goes wrong and blips every 5 seconds to say the system is working. 

As an aside, have a look at the photo above and tell me where the baseboard side has gone. There is clearly some trick of the light taking place but I cannot see the baseboard side on the edge at the bottom of the picture - weird!

How did I do it, you may well ask. Well let me tell you. I have previously experimented with PIC controllers and briefly considered them but I would need to build a microprocessor board to make it work and the chance of failure would be high. I decided to take a look at the Raspberry Pi and Arduino group of educational systems. These are prebuilt microcontroller boards for which there are a variety of accessory cards, meaning there would be little extra circuitry to wire up. I didn't look too closely at the Raspberry Pi as when I looked at the Arduino it seemed to be ideal for the job.


Pictured above is the Arduino Uno by Keyestudio, wired up and fixed under the fiddle yard. The standard Uno features 14 digital input/output pins and 6 analog input pins. I also picked up the next variant, the Mega, which has many more inputs and outputs. The nice thing about these microcontrollers is that they use a standard USB connector to hook up to the computer, an off the shelf  9V power supply and they are programmed in 'C'. 'C; is the programming language I used most in my career, along with assembly language, so I felt at home straight away. The reality was that writing a program to flash the light on the PCB took me all of 10 minutes. 


Once the microcontroller was decided on then I needed a way to drive the point motors. I bought a solid state relay board but then discovered that it could only switch mains AC so that went back. Instead, I bought an Elegoo 8 channel relay board, shown above. The wiring is a neat ribbon cable to the Arduino and the relays have screw terminals to drive the point motors. The photograph above shows the board with one point motor still to be wired up.

It might be at this point that those of a less nerdy disposition should skip the next few paragraphs down to the photo of the point motor.


What remained was to connect the switches and the LEDs to the Arduino. The LEDs are simply driven from the remaining digital outputs (8 are used for the relays) They need a resistor inline to limit the customer so I used a small piece of strip board shown above. At this point I had run out of the digital inputs/outputs. I could have used the Arduino Mega but as there were unused analog inputs I used those. All it took was a pullup resistor on each input and each switch forces the respective input to zero.

The program was written in Arduino's latest Interactive Development Environment. After the initialisation sequence, the program looks for switch presses and changes the points accordingly. the biggest headache was considering how swiftly to change the point motors. I've got a 2A 9V supply driving the system which is more than enough to drive all point motors at once. However, every time a point motor changes, there will be a spike on the supply as the relay switches and as the point motor kicks in. It is theoretically possible that having all point motors go at once could cause a spike on the microcontroller. Separate power supplies for the motors compared to the microcontroller would help but this is an overkill. All I did was put a 0.2 second delay between each point motor change. This will mean there is a series of smaller spikes over the time taken for all point motors to change.

In order to simplify the brain cells required to understand the program I have two constants in the program, STRAIGHT and CURVED. These apply to the point movement. I also set the standard that the normally closed contacts on the relay card drive the points to the STRAIGHT direction. 

The startup sequence is also interesting. If you configure the point motor input/outputs as outputs then the outputs are immediately driven low which causes all the relays to fire at once. I discovered that you can write the outputs high before you configure them and this value is latched internally and used on configuration so none of the relays fire on power up.

The power up issue still occurs if the points are left in random positions when you turn the power off. Thankfully there can never be all the points in the CURVED way at once. Whilst each switch only changes the minimum number of points needed to achieve the goal of a particular track, the switch for the middle track drives all the points to the STRAIGHT position so it can also serve as an end of day switch to put everything to a known state.

I did put in a 6th LED which blips every 5 seconds just to say the system is still working. It will also flash more vigorously if it gets a weird input from the switches but I realised I wrote the software in such a way that it doesn't look for anything other than the 5 individual switch presses.

 


The point motors themselves were mounted on a small square of 9mm ply using M2.5 screws as shown above. I wired in each point motor and then held it roughly in place and fired it in both directions to find the optimum place. Once satisfied, I drew round the block of ply and used the hot glue gun to stick the block to the underside of the baseboard. Once done, I felt the position wasn't optimal. The rod that drives the point was hard against the point at each face. The MP1s have an adjustable throw and I had set them all to the smallest one, 3mm, but it was still too much. Peco points have a throw of just over 2mm. I solved this by removing the point motor and using two pieces of 9mm ply instead of just the one. This meant there was some slop at each end but the point always moves. If you ever get the position wrong, the MP1 has adjustments in all 3 dimensions. It really is a clever piece of kit.

With a computer controlled system like this, you do have to ask yourself what you would do if it went wrong. If it isn't a simple wire falling out then the "at an exhibition" option is to drop out the point motors (most of them you can just drop out the control rod) and also disconnect the frog wires. At that point it reverts to the manual operation that was used at Maidenhead.

There it is. Approximately £40 of expenditure and a few extra hours to wire it up and debug the program. It gets its first outing at the Basingstoke show in March - a 2 day show that will give it a good test!

And to cap it all. I finished the fiddle yard yesterday and within an hour I got n email saying my MP1 point motors, ordered in November, have finally shipped!

Tuesday, 6 December 2022

Enginering Works Complete

Long post alert! The last few weeks have seen some significant activity to get the layout working again. Mostly it went well but there was one setback...

In my last post I said it was time to get on with the ballasting. I decided to use my usual Woodland Scenics but using the medium rather than fine versions. The more I looked at the pictures of the trackbed the more I realised I had been incorrectly using the fine size and the individual stones were larger than I had imagined. I mixed up some light grey and grey to give it tone and put it down. I stuck it down with watered down PVA with the obligatory liquid soap but I did have misgivings on how it looked. It was really too bright and I had made the mix 50:50 and it would probably be better at 80:20. I tried toning it down but that made it worse....

I was going to live with it until I went to Warley and I was perusing the Attwood Aggregates stand. I was taken by the way real stone has variety of colour built in. I took a couple of bags, one greyish one for this layout and another more sandy coloured one for the Ashover layout. I took up the fresh ballast and, needless to say, it went down a lot easier. I don't know if it is because it is natural and not fabricated but it didn't shift when I applied the PVA.

Here's a couple of shots of the ballast including some taken using the macro lens on the phone:

 




The other big change that I decided to do at the same time was to replace the traverser. The traverser is a great bit of kit but as others will testify, modifying a layout once complete is rarely a wise move which leads to compromises and bodges. My bodge was that the traverser was 48" long but it had to fit into a 51" space. This necessitated some bridging timbers which, combined with some rather mediocre track laying my yours truly, meant that reliability was often an issue with derailments at the joins. Theoretically there really should have been no derailments on a layout that has not points!

If you have followed the blog from the beginning then you'll know that the driver for the traverser was that my original 4 road fiddle yard was connected via 9" radius curves which my newly built coaching stock woudl not go round. I still had that fiddle yard with its dowels to connect to the back of the layout so I dismantled it and used it's front and rear faces along with new sides and top to create the fiddle yard below. 

The yard now 5 roads with the centre one straight. What I have discovered with this layout is that running tends to consist of running the same train round several times whilst talking to visitors and only changing the train occasionally. Hence, the desire to have a straight track to limit the chance of derailments. Last year I invested in a Morley controller which can be seen in the photo below. There is a carefully cut hoel under the controller to take the cabling.



I then had to relay the track on the end boards since the levels had all changed. I took the opportunity to take this very slowly and carefully to ensure good transitions at the baseboard joins. I've found I can put up the main board, fiddle yard and one end board in the room which is how I have been working the last couple of weeks. First is a photo of the underside with the wiring in place and tag strips ready for the necessary point motor wiring. I need one more MP1 point motor and they are in short supply currently. For now it works fine without them.


Here is the completed fiddle yard complete with test track. since Melin Dolryhd only needs one controller it seemed sensible to use the second controller as a test track. The track is wired up and the buffer stops are my own 3D designed and printed coupling height gauges. 


So the engineering works are complete and the layout is ready to go to Maidenhead Show the first week of January. Actually I need to redo the curtains but they will get sorted the week before the show when the layout gets erected in the lounge for a quick check.

Saturday, 19 November 2022

Relaying the track

After removing all the old ballast and track I then had to carefully remove any leftover impact adhesive from the old track. Once that was removed it was a case of smoothing it off with a wooden block and some medium grade sandpaper and it was ready to go.

Then it was a case of cutting up the sleepers with a razor saw. The early Cartwright and Russel book on the WLLR states that the sleepers were 6' x 9" x 4.5" at 3' spacing. That meant they should be 24mm on the model but as the track gauge is 1mm smaller than it should be, I decided to cut them to 23mm to keep the visible ratio correct. I used a razor saw and the wooden ones were easy but the fibreglas ones were hard work. Thankfully I only needed 6 - two at each end and two at the track join.


I then went over the trackbed and marked out 12mm spacing and a line of where the far rail should be. the expectation was that I would lay the far rail first and then lay the second rail spaced off that. The first rail was glued to the sleepers with impact adhesive, doing around 12 sleepers worth a time. Once glued and aligned it was weighted down with a metal block.


  After that the second rail could be glued down and spaced off the first rail using the 3 point gauges which were themselves held down with the metal block. Again, I could do about 12 sleepers at a time, and chose to leave the weight on for around an hour before moving to the next section.


Eventually, once it was all down, I just had to solder the track to the copper clad strip, reconnect the wires and run the first train.
 



The impact adhesive is a messy way of laying track and I am not sure I would continue to do it the same way for a larger layout. that said, it was all made a lot harder by being an afterthough and having to work within the fascia.

Onto the ballasting, a job that very few people like...


Wednesday, 16 November 2022

Time for a refresh

When I was exhibiting Melin Dolrhyd at the Welshpool Gala this year, I was very taken with Martyn Harrison's Castle Caereinion - see the post http://going-loco.blogspot.com/2022/09/return-to-welshpool.html What I really liked was his code 40 track and how it gave a much more light railway feel to the layout. Peco crazy track is excellent for building reliable track quickly but there is no getting away from how chunky it is.

There were really two questions to solve:

  • Would my stock run over it?
  • Was it worth the effort?

To satisfy the first question I had to first obtain some track and also obtain some track gauges. I ordered some code 40 rail from the 2mm Association and some track gauges from FastTracks in the U.S. I already had some suitable sleeper material from the 3mm Society. Once I had all the parts I built a short test track on foamboard. I already had a similar test track with Peco crazy track and was able to compare the two.


Peco on the left and scratchbuilt code 40 on the right. The difference between the two is huge! The track is simply stuck down to the wooden sleepers using impact adhesive. In real life the WLLR pinned the track down. There were no chairs. I was able to run all my stock along the track and none of them bounced on the sleepers, not even the oldest engine in the fleet.

That leaves the question of whether it is worth it. I came away from the Welshpool Gala energised by the show but dissatisfied with the operation of Melin Dolrhyd. The front of the layout was fine but the traverser was not as successful as I had expected. Much of this can be put down to having to make a 4ft traverser fit in a space which is just over 4' 3" long. There were packing pieces and packing pieces and the traverser never seemed to be level across all the tracks. Derailments were more frequent than they should have been for what is essentially a straight piece of track. The traverser is an excellent piece of kit but is overkill on Melin Dolrhyd and suffers from the curse of being a modification to an original design which didn't plan for it.

Taking on board my dissatisfaction with the running I decided it was worth the effort of replacing the track on the front along with replacing the traverser on the back. I'll cover the rear of the layout in another post.

Once the decision was made, I ordered some 1m lengths of track from C&L Finescale along with some roller gauge and they arrived on Friday. I popped across to the 3mm Society West Byfleet meeting on Saturday to pick up some deeper sleeper material which meant I had all the materials necessary to start, so start I did.



The ballast had been stuck down with the usual pva mix and the track itself was originally stuck down with impact adhesive. I used a dropper to wet the track and then worked away at the ballast with the screwdriver I use for almost every task where I don't use a scalpel. The track itself lifted relatively easily. The track bed is foamboard so I was worried that the card cover would soak and tear off, but it has stayed so far.


In fact it all came off quite easily with the exception of one of the baseboard joins where the card did tear off. In the next post I'll cover preparing it all and laying the track.




Tuesday, 28 May 2019

Fiddle Yard Wiring

One task that had been left for later is wiring the points in the fiddle yard. For it's first outing the points were operated manually and there was no frog wiring. This wasn't an issue and it was fine to operate like this. Long term I have half an idea to automate the fiddle yard which means it does need wiring fully.

At a recent 009 Wilts group meeting, Adrian turned up with a new point motor, the MP1 from MTB Models. They are available from  DCC Train Automation. They are a motorised switch with adjustable range, automatic cut-off and a single pole switch. They are also very compact with a 45mm x 45mm footprint and less than 20mm deep. They run off AC or DC.

An order was placed and they were waiting for me on my return from a business trip and a bank holiday Monday seemed an ideal time to complete, what is, a very dull job.


The picture shows the primary end of the fiddle yard with the three motors in place along with the power connections and high frequency cleaner. As an aside, the cleaner was also a post show addition and showed that one particular engine has a dead spot in its pickups somewhere. It flashes with each rotation of the wheel!

The layout has now gone back onto the units where it is stored and I can carry on with detailing the layout and building stock.

 

Monday, 30 July 2018

No going back

There is progress to report. The mill has finally been put in place and glued down. There is still work to do on the front openings and providing some chimneys but enough has been done to justify committing the building to the ground. A significant amount of multi purpose filler has been used to complete the burying and bring the ground up to the height of the front door. I always mix acrylic paint, burnt umber, into the filler so that if scraped, it doesn't show white. I could have added some black as well as this batch is drying lighter than before.

The mill wheel motor has been glued down but the housing is still loose.

Other work done includes the ballasting. The sleepers and rails were painted and then the ballast done. I've also added the stones to the right hand side of the river. Still some fettling to happen there before I can add the water on top. I do need to think how the side openings are going to be disguised!

Friday, 1 September 2017

A circuit!

The trackwork is all down, 9 months after starting the layout. This layout has really been built backwards. The typical approach to layout building has always been to get the track down first to get something running and build the scenery up afterwards. In this case it was obvious to me that the first thing I needed to do was get the embankment correct at the front of the layout. If I couldn't make that look right then it would not be worth proceeding. It is the focal point of the layout.


The track electrics on the fiddle yard were completed this last weekend and a small control panel added which you can see at the back right of the photo. In the control panel is one of those PWM controllers you can pick up off Ebay for a few pounds. Add a 12V supply and a DPDT switch and you are done. The embankment has been wired and a train has been run. Just the end curves have no electricity just yet.

I'll post about the electrics next but all the components have now arrived but not the interconnecting cables which are due this weekend. 1 week to go and I will have the first train run all the way round.

Sunday, 5 February 2017

Trackbed in place

The concept behind the layout is that there is a single line that rolls across the front of the layout. What is nice about the line is that it is on a permanent bend of varying radii and it is on a slight gradient. Nothing straight about this!

The line itself runs between the river and the mill race so it is effectively elevated for all the visible section. I had guessed on the height and it turns out I had set it all a bit high but that is not an issue as I can raise the river bed and can make the front lower fascia deeper to cover it. I knew there was a reason why I didn't glue the front fascia on!

The plan was to reproduce the curves and incline as best as could reasonably be achieved. I used foamboard and cut out some sections that had a 1 in 100 incline on them. the foamboard, I discovered, would bend sufficiently for my needs so I set about gluing it down a few inches at a time as far as each change in bend would allow. 


Eventually it was all down and I discovered it wasn't level front to back. I clearly wasn't as accurate as I should have been but a bit of card packing soon sorted that out. I added some bracing and glues the top down. As can be seen in the picture I cut the gaps where the mill race enters and leaves and where the two sluices are. The next step is to add cladding using Wills coarse stone sheets.

The lighting had to have an adjustment. Once the track bed was in place, the front row of lights were found to be just behind the leading edge in the middle of the board so created a shadow. I added a layer of foamboard to the underside of the wood sticking out on the lighting beam and added more LED strip to that. I also took the opportunity to add a run of warm light on this. Iain Rice, in his book on Cameo Layouts, says that warm lights are not suitable for British weather. However, I am hoping to create a yellowy/brown reflection off the river right beneath so I though tit worth a try. I can always just snip the wire to that strip of LEDs should it not work out.

Leek & Manifold Transport Wagons

Personal modelling has taken a big hit recently with launching a new shop for STModels along with taking the trade stand to Narrow Gauge Sou...