Jump to content
 

Penmouth


B954673

Recommended Posts

  • 3 weeks later...

post-9949-0-01231100-1335817728_thumb.jpg

 

ok a few weeks have passed, and I still haven't done the station signs, or the buffer stops. I have however, managed to finish off the retaining wall behind the signal box (this one is just here until I get round to making a more fitting box) and grass the verge between the gully and the wall. I'm pleased with the results, mainly because I managed to borrow my dads static grass machine, which is an excellent piece of kit. I made a couple of modifications to it as I couldn't get the results that I wanted, Watching videos on youtube of how it should be done made it look so easy, so I copied the idea of having a sieve to sprinkle the fibres through, this made the fibres land where I wanted them to rather than all over the place, loads easier to tidy up, (as I still not allowed to use the hoover for model railway porpoises)

post-9949-0-41282700-1335818454_thumb.jpg

by the way I did ask my dad before I soldered bits onto his £100 gizmo, and another thing don't turn it on, whilst holding the crocodile clip in one hand and the sieve in the other...

 

A couple more shots of the bridge area, defiantly getting there.

 

post-9949-0-23838300-1335818769_thumb.jpg

 

post-9949-0-22067100-1335818919_thumb.jpg

Link to post
Share on other sites

  • 1 year later...

ok it really has been along time since the last update. scenically nothing has changed, apart from the addition of this stunning signal box built by my dad, its based on Penzance box, and although its not "seated" yet it looks like its always been there. thanks so much, very much appreciated. the other changes are to do with point and signal control, I won't go into this yet as its not complete yet, but another major milestone was passed today, more detail to come, anyway, a couple of pictures of the box:post-9949-0-99119300-1384644768_thumb.jpgpost-9949-0-48176400-1384644773_thumb.jpg

Link to post
Share on other sites

  • 3 months later...

ok, it has suddenly got real.

 

http://www.haylemrc.org.uk/exhibition_may.htm

 

So, time for a little update.

Over the last six months or so ,I have been putting together the signalling system for Penmouth. looking at the signals on offer in 00 it was quite clear that it was going to cost a lot of money to buy off the shelf units, so the cheaper solution was to make them myself, they are after all just lights on sticks, so out came the soldering iron, and we now have 4 signals, the most expensive components where the posts, as the ladders where borrowed from my father :) . The control system was going to be normal switches, however there are four signals, each with three aspects, and the common, which would make 13 connections to the control panel, I only had eight, nine at a push so another solution was needed. Mark two used 555 timers and relays to drastically reduce the wiring, however this was far to complicated, and never got past the breadboard stage. Mark 3 and the current system uses a Raspberry PI under the baseboard, you might be wandering how this would work as the R-PI only has 17 or so Gpio's, the solution was to use mcp23017 chips (four of them) giving me 64 individually addressable Gpio's, (16 for the signal outputs on the base board, 6 for point setting, on two chips, and the other two chips in the control panel, with inputs for the signals, and outputs for the signals, and route selection) This system would in theory allow just four wires between the control panel and the baseboard, as the mcp23017's use the i2c bus, however the data and control lines refused to work through the D connector (probably to do with interference) so an external bus link had to be used. anyway its done, an it all works. I anyone wants more info on this system then please ask.

 

just a quick snap showing how it is at the moment

post-9949-0-71941000-1392674504_thumb.jpg

Link to post
Share on other sites

Ok Raspberry pi' s to those unfamiliar, are basically a small computer, about the size of a Guagemaster controller (but flattish), are powered by 5v, this can be from a usb charger, another computer, or battery etc. They come in two types, model B, have 512mb ran, a quite fast arm processor, HDMI, audio jack, rj45 nic, and two usb ports, along with the GPIO port, (the model a has no network, and only 256mb of ram, but the price difference is not that much, so don’t bother). The best part is they cost about £30. For this you get a nearly complete computer, (for storage they use sd cards but most people will have one spare, only needs 2gb), The run Linux, and are easy to program and very cheap to run.

 

A small disclaimer, if you play around with the gpio pins and accidentally short it out, it will reboot instantly, (you might need to leave it a bit) if you put 5v onto the wrong pin you might seriously damage the whole thing, and if you let 12v touch any pin, even for a split second, you’ll have to get a new one, as the likeliness is it will be fried, also you could (and I have) written a program which will kill MCP23017's by mistake, so be careful what you right to the registers.

 

Some basics, ill assume that you have installed raspian and are logged in either remotely, or locally, the first thing you need is the smbus library, (sudo apt-get install python-smbus i2c-tools) then change (/etc/modules) adding at the end :

i2c-bcm2708

i2c-dev

 

Then you need to edit the modules blacklist file (/etc/modprobe.d/raspi-blacklist.conf) from :

blacklist spi-bcm2708

blacklist i2c-bcm2708

 

to this:

 

#blacklist spi-bcm2708

#blacklist i2c-bcm2708

 

After this you need to reboot, and you should be good to go.

 

wire the mcp23017's follows

 

pin 1-8 is bank B input/output (in this example use 1k resistors linked to the 3.3v line on all of the inputs bank, to generate a 'on' signal,

pin 9 to the 3.3 volt output from the raspberry pi gpio header

pin 10 to earth

pin 11 not used

pin 12 to the scl port(on the raspberry pi)

pin 13 to the sda port

pin 14 not used

pin 15-17 to grownd (after the first chip use 3.3, 0,0, and so on in a binary sequence)

pin 18 to 3.3v

pin 19-20 not used

pin 21-28 is the bank A input output ( again use 1k resistors connected to the 3.3v rail to generate the on signal)

 

Then write this to a new file:

 

 

 

import os

import smbus

import sys

import getopt

import time

 

bus = smbus.SMBus(1)

bus.write_byte_data(0x20,0x01,0xff) # Set all of bank A and B input

bus.write_byte_data(0x20,0x00,0xff) # to set output change the last ff, to 00

 

 

def main():

#the main loop

while True:

cp_in = bus.read_byte_data(0x22, 0x12)

print bin(cp_in)[2:].zfill( 8)

cp_in2 = bus.read_byte_data(0x22, 0x13)

print bin(cp_in2)[2:].zfill( 8)

time.sleep(0.2)

os.system('clear')

if __name__ == "__main__":

main()

 

#end of copying

save it as io_test.py or something

navigate to the location

and to run it type:

sudo python io_test3.py

 

the pi will ask you for your password, and should run a loop giving you the state of each pin on both banks, to set the pin to off, short it out with a wire to the ground.

 

to set-up outputs, ie leds for the signals, use "bus.write_byte_data(0x20,0x00,0x00)" for the desired chip, then, via a resistor (i used 1k) link the led to the ground, set 1 for on and 0 for off

 

 

to do this copy this bit to the to of the file, after the bus write bits:

 

def set_output( value, possition, current_input ):

"this bit makes up a new output string from old, value and position"

if value == ((current_input >> possition) & 0x01):

new_output = current_input

else:

if value == 0:

new_output = (current_input - ( 0x01 << possition ))

else:

new_output = current_input + ( 0x01 << possition )

return ( new_output )

 

 

#end of stuff to copy

to set an led, use

 

set_output((desired output 1=on, or 0=off),(which led to set 0-7),(current input int)

 

 

ie :

sig_output_1 = set_output(1,3,bank1_output)

bus.write_byte_data(0x21,0x12,sig_output_1)

 

 

hope this helps, give me a nudge if not, and i'll try to give you a help

Link to post
Share on other sites

you dont have to use the mcp23017's they just mean you have loads more inputs and outputs. another thing you can do is to controle loco speed directly from the raspberry pi. You can use transistors for this but darlington arrays are very cheap about 30p, I have used a uln2003a chip, tis is essential to seperate the 12v from the pi. the code is:

 

# requires the output from pin 25 to connect to the input of the darlington array

 

 

import RPi.GPIO as GPIO # always needed with RPi.GPIO

from time import sleep # pull in the sleep function from time module

 

GPIO.setmode(GPIO.BCM) # choose BCM or BOARD numbering schemes. I use BCM

GPIO.setup(25, GPIO.OUT)# set GPIO 25 as output for white led

white = GPIO.PWM(25, 100) # create object white for PWM on port 25 at 100 Hertz

white.start(0) # start white led on 0 percent duty cycle (off)

pause_time = 0.05 # you can change this to slow down/speed up acceleration

a= 0

b=0

try:

while True:

a = input("Enter new speed: ")

if a <= 10:

a = 0

print "too small"

elif a >= 100:

a = 100

print "too big"

 

if a >= b:

print "new is bigger than old move to new value"

for i in range(b,a):

white.ChangeDutyCycle(i)

sleep(pause_time)

print i

b = a

elif a <= b:

print "new is smaller than old move to new value"

for i in range(b,a,-1):

white.ChangeDutyCycle(i)

sleep(pause_time)

print i

b = a

else:

b = a

print b

white.ChangeDutyCycle( B)

 

except KeyboardInterrupt:

white.stop() # stop the white PWM output

GPIO.cleanup() # clean up GPIO on CTRL+C exit

 

 

#end of code

Once again you will have to add the tabs to the lines as they will probably be lost on the forum, just ask if you need help with this. This set-up will only increase and decrease the speed of a loco (works much better with a flywheel drive loco like a 47, or a 50) to change direction you will need to make the changes, ie use a H-bridge, or relay to alter which rails get positive and negative voltage.

 

This system is the same as how dcc works but much cheaper, as locos need not have a chip, but will crawl along the track, as they will not stall.

 

Give it a go. the worst you can do is fry a R-PI

Link to post
Share on other sites

just a bit of playing trains this afternoon, also to show that the signals work

 

post-9949-0-25219600-1392836698_thumb.jpg

 

post-9949-0-47371200-1392836714_thumb.jpg

 

post-9949-0-88114900-1392836732_thumb.jpg

 

Ps, the green led, is propping up the signal, as its not secured in yet, also I’ve just noticed that the signal for platform 2 is not plugged in either. The blue and gray BG is special, ill go into this another time when I have borrowed my fathers coupling height gauge

Link to post
Share on other sites

  • 3 months later...

well, Im very happy with how penmouth went today, I had a short on a point and a solder joint came apart, but happily both were found and fixed before the show opened. the kadee couplers performed well, the only isue with them where not uncoupling very well under the station roof. The Raspberry pi, controlling the signals, and the announcements, worked rearly well. Tomorrow morning I will be adding another isolation switch on the fiddle yard, to make operation easier, and hopefully, well have another fun day playing trains. I didn’t take any pictures today, but will take my camera with me tomorrow.

Link to post
Share on other sites

Hi

 

Penmouth made it's debut at Hayle show today...

All went well after a 'minor' hiccup.....

I'm sure more anon......

 

A few pics....Sadly my photography skills don't match the quality of the layout......

Hopefully you can get an idea from these......More I'm sure to follow tomorrow.....

 

First a general view......

 

post-7844-0-56362500-1400962147_thumb.jpg

 

Then some general pics......As I said sadly not very good  I'm afraid....

 

post-7844-0-29891200-1400961649_thumb.jpg

 

post-7844-0-07994200-1400961677_thumb.jpg

 

post-7844-0-57949900-1400961700_thumb.jpg

 

post-7844-0-89116900-1400961737_thumb.jpg

 

post-7844-0-23745900-1400961816_thumb.jpg

 

post-7844-0-85479900-1400961843_thumb.jpg

 

post-7844-0-33090300-1400961914_thumb.jpg

 

post-7844-0-99654800-1400961963_thumb.jpg

 

A very enjoyable but busy day today.....Look forward to tomorrow & hopefully some decent pics from someone........

 

Cheers Bill

 

 

Link to post
Share on other sites

thanks Mickey, quite a few people during the day, said that they recognised the station.

 

and thanks for posting the pictures treggyman, on a side note that signal rearlly stickes out in the pictures, but at least the trains can pass underneath it

Link to post
Share on other sites

didn’t take too meant pictures today, as it was busy most of the day, no new faults emerged during the day, apart from the battery running out on the bg, The new isolation switch on the fiddle yard, worked well, and I came away with a very nice tpo, A big thank you must go out to Treggyman for helping with the operation for most of the two days, and even my wife had a go at controlling the layout. Thanks also to Hayle model railway club for looking after us so well.

 

post-9949-0-58018700-1401042368_thumb.jpg

 

post-9949-0-75368400-1401042825_thumb.jpg

 

post-9949-0-71227000-1401042880_thumb.jpg

 

post-9949-0-73916600-1401042920_thumb.jpg

post-9949-0-44091300-1401043107_thumb.jpg

post-9949-0-47476900-1401042969_thumb.jpg

 

post-9949-0-70894400-1401043012_thumb.jpg

 

post-9949-0-24092500-1401043060_thumb.jpg

 

 

 

Link to post
Share on other sites

Hi All

 

Great set of pics above.....I forgot my camera today so no pics from me.....

 

May I echo the above thanks to Hayle club for making us most welcome at their show which seemed quite busy & seemed to be a success.....

 

The layout seemed well received by the punters & was fun to operate......

It ran well with most errors being caused by the operators rather than the layout which practice will put right !!!!!

 

There are plenty of different options available as regards operation so even operating it for two days it never got boring to operate......

Fortunately even though I managed to tip a cup of coffee over the computer that controlled the signalling no harm seemed to be done...

 

Thanks again to the Hayle club for their hospitality & to B954673 for asking me to assist

 

Cheers Bill

Link to post
Share on other sites

lol are the cannons to tie in with pirate day in penzance today?

 

there seems to be only one glairing mismatch with the backsceen, and its right next to the name boards, so it getts in most of the pictures :(

Link to post
Share on other sites

The cannons were in tribute to Treggyman's fascination with them, as he explained on Sunday...

 

haha, I managed to get out of that one too :)

during the course of the show some operational notes where taken.

 

The radio controlled bg worked well for the first day and a half, however it chewed through two 9v battery, during the cause of the weekend, and picked up interference over the length of the layout, some serious work will need to be done, however it was more reliable than the kadee couplers, and looked much more realistic, i.e. no driving the train forwards and backwards over the magnet, uncoupling the thing, and then accidentally recoupling the loco with the shunter as it collected the coaches forcing the forwards and backwards shenanigans. I have a couple of ideas how to sort most of the issues out.

 

there needs to be constant communication between the station operator and the stageing yard operator, over the weekend this was mostly verbal, and got simplified to things like "37 on a parcels from main", "is one free?", "what do you want next?" but the most common was "light on one please" this being a request for a light engine to remove a train from a platform. This was made worse by most of the locos on the first day only having couplings on one end, for the second day more locos had couplings at both ends, but it was still a constant struggle for light engines, and with four platforms filled with trains operations slowed down.

 

the stageing yard side worked well, better on the second day, as I fitted an isolation switch on the main, so a train could be set-up and switched out until required. the cassettes worked well, the only slight issues where with minor warping of the wood, however, as long as they where aligned properly all was well, I will probably make most of the cassettes full length, as apart from the dmu's there was no point in having shorter assets. I have an idea in my head for a multi road cassette, for dmu's but that is not a priority.

 

The announcements worked really well, if anything a little bit quiet, but there was enough variation for it not to get boring.

 

The track seemed to work ok, every so often something would randomly derail, but it certainly wasn't just one point or one loco, and this will only get smother, with time and minor alterations.

 

The signals worked well, if the computer controlling them encountered an error, they default to reds, I need to completely rewire the points as when I put the relays in I didn’t put reverse diodes in, and the switching on and off multiple relays causes a spike voltage to build up and this seems to track back down the common, T solve this I had to use a completely separate power supply unit for the raspberry pi, which meant more complexity in the wiring. The next version will be computer controlled, and also computer control of the isolation sections, allowing a lot more automation.

 

I have a few ideas to mull over, the biggest will be weather or not to expand the layout forwards by ten centemeters to match the bridge board, and if so the track plan which would need to increase local loco storagebut but be flexable, and not take too much length from platform 4.

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...