Showing posts with label wiring. Show all posts
Showing posts with label wiring. Show all posts

Tuesday, 6 February 2024

New Year Update

It's been a busy few weeks on the railway front. First it was the SWOONs open day on the Saturday where I had my sales stand for STModels and then it was the annual committee meeting on the Sunday for the 009 Society which, in my role as 009 News Editor, I attend. The following weekend was the regular Wiltshire 009 Group meeting. Then it was the 2 day Southampton show where I was exhibiting Melin Dolrhyd as well as having the STModels sales stand. Last weekend it was the Alton show where I helped operate Garreg Wen for Matt Kean.

All set up and ready for customers at Southampton

STmodels continues to grow and I have done 3 commissions in the past month. The first was for some tank wheels, the second was for some Vale of Rheidol lattice fencing and lastly a request for Southern Railways 8 Wire Concrete fence posts. The last two are available to be bought on STModels.

Southern Railways 8 Wire Concrete posts


The layout with no name has also progressed. It now has the track down, it's wired up and a small amount of scenery has been created. The points are planned to be operated by wire in tube and that has been installed but doesn't show up in the photo. 

Adding the backscene former

The track plan is roughly what was on the initial sketches on the notice board. In the end the actual positioning of the points was dictated by my stock. The points are positioned such that I can have a Bachmann Baldwin and one WD bogie in the headshunt whilst also having 3 WD bogies in the loop and being able to run round them. The section of track between the loop and the running line is long enough to hold a Baldwin without fouling the running line.

The most recent job has been to add the backscene former. This was created with a piece of timber across the back, down the sides and along the bottom to which a piece of 5mm ply was glued. It's added some much needed rigidity to the board. 

The trouble is that it has given me a headache I hadn't envisaged. The layout was planned as something to take to shows that was simple, more easily transportable and more light hearted than Melin Dolrhyd. Keeping it simple was the mantra. The problem is that with it in the railway room against the wall I can't easily reach the point switches. The electrical section switches don't matter as they will always be on. I can just reach the point switches but have a habit of knocking trains off the track. I know I will want to 'play' with the layout and use it to test stock running through the points so it really needs to be useable in the railway room.

The only sensible thing to do is to change the point operation so that it can be operated from the front as well as the back. If I want to extend the mechanical operation in some way then I will have to break up that lovely curved front of the layout, that is if I could work out how to do it!

In the end I have to go back to point motors but I have decided to try servos - this layout was aimed at trying new things, after all. I am currently looking at an Arduino to drive the servos. I had already planned an Arduino Uno to operate a couple of working signals. All this means is I have to extend the system to handle the points as well.

In the stash I have an Arduino Mega, some Dingo servo mounts and some 9g servos. Time for a little experimentation!

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.

Sunday, 10 September 2017

Now it runs

Well it ran for a while, all of probably 10 minutes before the gremlins started appearing. On the right hand bend trains were slowing far more than the tightness of the curve should have caused. A quick check of the cables underneath and one of them was getting warm, a sure sign of overloading. I had thought this might happen so wasn't particularly surprised. I decided I need to increase from 3.5mm plugs to 6.25mm plugs. When I took the 3.5mm plastic plugs off, nearly all of them had cracked. The just weren't up to it. It could have been my soldering of them but I'm fairly proficient at that so probably not the cause for all of them. Suffice to say we now have metal connectors and plugs and it all works fine. I took advantage of dismantling it all to trim some excess timber and to tidy the wiring.

Time to progress the scenery. I'd read a discussion online about the use of Celotex as an alternative to polystyrene. I'd also seen a discussion about whether it contained fibreglass or not and one poster assured everyone that if you bought the proper branded Celotex then it did not contain fibreglass. I can report he was wrong. Mine says Celotex on the outside and fingers tell me it contains fibreglass.


It may or may not be clear but I've put in the stone wall at the back of the mill race and glued down and carved the first piece of Celotex. I'm struggling to know what to do about the backscene. In my minds eye I saw the embankment behind the mill rising steeply up to the road and out of sight. The reality is that the mill is quite large - it's the white cutout on the right and the layout needs to be another 12 inches deep to get a good embankment. There are a variety of subterfuges I can use but nearly all backscenes portray an impression into he distance, the exact opposite of what I need to do here. Something to think about as I build up the contours.

As a separate exercise I've rejuvenated my website at www.goingloco.org.uk. I'll be adding to that as and when I feel the muse!

Sunday, 3 September 2017

It runs

The electrics got completed this morning and as I type this up there is a train running round in the background. I had to fettle one piece of track at a join but otherwise it all worked first time.

So how have I wired it up? Firstly, this is DC and not DCC. I've experimented with DCC but it is more than is needed for this type of layout. I want automation but I believe I can do it in a simpler manner.

Having used a cheap PWM controller off ebay and using LED strips for the lighting it means all I need is 12V DC. The best way to provide that is with off the shelf supplies of the sort that come with all sorts of electrical kit. I'm temporarily using a couple that powered a BT router. Eventually there will be 3 of these powering the layout:
  1. The overhead lights will have their own supply. They don't take anywhere near 2 Amps but it seems to be wise to keep this separate.
  2. The track will have it's own supply.
  3. The servos will also have their own supply. These aren't fitted yet but reading the internet you can find plenty of reports of interference so, again, keeping it separate is a sensible precaution.
I've ordered 4 supplies off ebay. I suspect they are coming from China but that's fine. They will be double insulated and acceptable to exhibition electrician approvers who seem to be often nervous of anything home grown. I've noticed that when they see off the shelf kit they sign it off because there's nothing for them to check. I like having a spare available, hence the 4th supply. By having 4 identical supplies they have identical connectors so are all interchangeable.

The layout is on 4 boards. The fiddle yard has most of the wiring so that's where power goes in and where the track feed comes from. I wanted robustness yet flexible connections between the boards. In the end I settled on 3.5mm jack sockets on each board and purchased some 1m cables ready made. They are a very low price on the internet. Again, I need 3 cables so I bought 4, all interchangeable and a spare.

I was initially concerned that the cables would not carry the track current but with modern motors it is so low I am not seeing any obvious problems, no drops in speed except where the track is tight at the bends and that is down to friction and not power distribution. I shall leave it running a long time and see what gets warm.

The sockets are all bolted into aluminium brackets. I had some long runs of aluminium angle and it took all of 30 minutes to cut and drill the brackets.

At some point in the future I'll wire up the servos but for now I am going to progress the scenery.

Monday, 29 May 2017

Wiring

The long term aim of the layout is that it will run by itself with a simple computer system knowing which of the fiddle yard lanes are occupied and running round one engine after another. Ideally it would know what direction each train is facing and propel it in the correct direction.

However, the layout needs to be able to operate manually should automation fail. Note that I am writing this as British Airways is into day 3 of it's disastrous computer issues which grounded all their flights from Heathrow and Gatwick. I'm not in their league but I know it can go wrong.

Here is the fiddle yard from above:


The only difference to the usual method of wiring is that insulating fishplates have been used at both ends of each road. I know I don't need the extra isolation right now but I figured it would be easier to fit them now than dismantle it in the future should the extra isolation be needed.

Below are the components that will be used to control the layout:


Bottom left is one of those cheap PWM controllers available off Ebay for under £4. It only needs the addition of a DPDT switch to change direction and that is traction sorted.

Automation is much easier with servos rather than the traditional solenoid point motors so I have chosen the ubiquitous SG90 fitted to David Ingoldby brackets as shown top right. David is a MERG member and makes these folding metal brackets that can be fitted with end of travel switches and are very robust.

Top left is the Servo4 board, also available from MERG. It took me less than an hour to put this one together this afternoon. The Servo4 board drives 4 servos (so I will need 2 boards) and will remember the endpoints of travel which can be set by a control box or by a laptop. I chose the laptop option as I had the necessary USB to serial lead from a previous foray into DCC.

What is not showing is the power supply. All this runs off a standard 12V power supply that you can get from around £7 from Amazon. The intention is to have one supply drive the LED strips and one to drive this circuitry. The servos can be run from an independent supply but I'll take that route should I get the dreaded twitching or interference that can affect layouts with servos.

So those are the pieces that will be fitted over the next week or two in-between the day job. I know how I will adjust it for computer control but for now I'll put this lot in place to get something running.

Saturday, 13 February 2010

Wiring Woes

After the last (and first) outing of Mospick Halt I decided I should put a power LED visible somewhere along with the short LED. The controller has a short LED on it so all I needed to do was unsolder it and run wires up to the control panel area.

The power LED was equally easy, find an LED, use good old Ohms Law to determine a suitable resistor, wire them to the power feed, a quick test and put the layout away.

The completion of the next engine meant a quick run was in order. Unfortunately what I discovered was the power LED flashes when the engine is running in one direction and is completely off when the engine runs in the other direction. Not only does the LED flash but the engine slows down gently instead of suddenly when the controller was turned off. I had done something seriously wrong.

In the end it was quite simple. I had wired one side of the LED to the power bus on the layout but the other side got wired to one of the track output wires. I had used confusing terminology under the layout. All the wires go to tag strips that are labeled but my choice of names was not good!

I took the opportunity to separate out the lights on the layout onto their own switch. Previously they were on all the time but they will be hardly noticed at exhibitions so it made sense to be able to turn them off and save carbon emissions somewhere.

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...