I've finally completed (most of) the roadway on which the tram now runs. I have had to very tightly fit my home-made cobblestone paper to the tracks. You may recall that I had built up the roadway around the tracks using cork strips. I've now covered those with carefully cut paper.
The main issue was cutting to fit the curves. There's no way this can be done easily by hand. What to do?
Well, modern technology (and Franc Carter) to the rescue. I asked Franc to laser cut some guides to cut out the road surface curves. He kindly cut them to my spec out of MDF and I've used them to cut out curved sections from the cobblestone paper.
I reckon it looks excellent. Better than commercial tramway stuff! It fits really well and I reckon eooks pretty good even up close.
A blog about my new model railroad and all the stuff I'm learning about whilst building it.
Showing posts with label model railroad. Show all posts
Showing posts with label model railroad. Show all posts
Sunday, 22 February 2015
Sunday, 1 February 2015
Photos of the tram
I've added a few photos of the tram in front of some buildings just to show how the bprinted cobblestone paper looks with the tram on it and some buildings in the background.
I reckon it looks super!
I reckon it looks super!
A little landscaping and a tunnel portal.
The model railway is a complex layout in some ways and has a lof of tunnels running at many levels. It's also got the town sitting alongside the tram track. I've made a big effort to line all tunnels with heavy black card and I've done a light paintjob in areas inside the tunnels along the trackwork in a wash of black to get things looking more like a real railway. I have yet to ballast and will be doing light ballasting in more exposed areas "underground" and heavy ballasting everywhere else.
I've also fully levelled the area under the buldings in the town using the same thick black card.
All the tram track has been "filled" with plasticine to make it look more road like. I'll be using cobblestone paper to make the current cork look more road like at each side of the track. More on that later.
All of this has left me in a position to begin more serious landscaping. In order to dip my toe into the water in a small way I've started building the slope up to the left of the main station. In order to complete this area I've had to construct a triple track tunnel portal. I did this simply using brink paper (see here) covering a carefully cut out piece of polystyrene. I added details by covering balsa strips with brick paper and gluing it on. The tunnel arch was reinforced with individually cut out strips of card one bring high which I've arched over the mouth of the tunnel.
I've also fully levelled the area under the buldings in the town using the same thick black card.
All the tram track has been "filled" with plasticine to make it look more road like. I'll be using cobblestone paper to make the current cork look more road like at each side of the track. More on that later.
All of this has left me in a position to begin more serious landscaping. In order to dip my toe into the water in a small way I've started building the slope up to the left of the main station. In order to complete this area I've had to construct a triple track tunnel portal. I did this simply using brink paper (see here) covering a carefully cut out piece of polystyrene. I added details by covering balsa strips with brick paper and gluing it on. The tunnel arch was reinforced with individually cut out strips of card one bring high which I've arched over the mouth of the tunnel.
Making roads, bridges and tunnels...surfaces
I'm readying myself to make a bunch of stuff for the landscaping and I realised that I need decent stone surfaces for roads etc.
Buying this stuff readily in Sydney is pretty hard and when you do find it, it's quite expensive. Why not use by Canon bubblejet and some matte photo paper and just print exactly what I want?
Google to the rescue...
I did a few searches on Google for Cobblestones and so forth on the Images section and found these:
I then used them as textures to fill rectangles in MS PowerPoint and produced this sort of result (PDF).
Buying this stuff readily in Sydney is pretty hard and when you do find it, it's quite expensive. Why not use by Canon bubblejet and some matte photo paper and just print exactly what I want?
Google to the rescue...
I did a few searches on Google for Cobblestones and so forth on the Images section and found these:
I then used them as textures to fill rectangles in MS PowerPoint and produced this sort of result (PDF).
Friday, 3 January 2014
And now it's all running nicely...
I've finally wired in the Arduino Mega 2560, the Pololu servo controller, a relay board to control the track blocks and the L298 motor system to drive the trains and the tram.
It's all nicely tucked away under the layout and finally all trackwork is in place and a demo program is running which allows the train to run on every track section, exercise all the points etc.
I'll post more still shots later but for now, here's a video...
Next will have to be the 'real' software which allows for 3 engines to run on the layout at once.
It's all nicely tucked away under the layout and finally all trackwork is in place and a demo program is running which allows the train to run on every track section, exercise all the points etc.
I'll post more still shots later but for now, here's a video...
Next will have to be the 'real' software which allows for 3 engines to run on the layout at once.
Labels:
arduino,
Fleischmann,
how-to,
L298,
model railroad,
n-scale,
pololu
Sunday, 15 September 2013
Pololu Micro Serial Servo Controller
I've finally got all my Points bolted in place and I'm now driving them from a Pololu Micro Serial Servo Controller. Take a look at the Pololu web page here.
These are really nice pieces of hardware - they can drive up to 8 servos from a single tiny board.
I'm using the software serial library to communicate with the Pololu. I've found that you have to explicitly control the reset on the device otherwise it's unpredictable and often bombs out on power up.
This simple circuit drives a single servo based on reading an input from a potentiometer. I'm restricting the angle quite narrowly because the sweep between 2 n-scale rails is only 9mm or so.
Here's my rough prototype board:
And here's the source code...
//
// Pololu micro serial servo controller modes
//
// Software Serial from Arduino example by Tom Igoe
//
// Pololu code borrowed from Mike Crist...
// put() (now position_absolute) & set_speed() functions found on pololu forums & modified
// mike crist 2009-01-03
#include <SoftwareSerial.h>
#define ServoRxPin 2
#define ServoTxPin 3
#define ServoResetPin 4
// Pins for later use ;-)
#define CmdRxPin 5
#define CmdTxPin 6
int old_d;
// set up a new serial port
SoftwareSerial softSerial = SoftwareSerial(ServoRxPin, ServoTxPin);
void setup()
{
int i;
// set the data rate for the hardware serial port
Serial.begin(9600);
pinMode(ServoResetPin, OUTPUT);
digitalWrite(ServoResetPin, LOW);
delay(20);
digitalWrite(ServoResetPin, HIGH);
pinMode(ServoRxPin, INPUT);
digitalWrite(ServoTxPin, HIGH);
pinMode(ServoTxPin, OUTPUT);
// set the data rate for the SoftwareSerial port
softSerial.begin(38400);
for (i = 0 ; i < 8 ; i++ )
{
set_speed(i, 3);
//delay(100);
set_neutral(i, 3000);
//delay(100);
set_servo_parameters(i, 15);
//delay(100);
}
old_d = 0;
}
void loop()
{
int v,d;
/* Here's the bit reading the pot - commented out for now...
v = analogRead(0);
d = map(v,0,1023,70,110);
if( d != old_d )
{
old_d = d;
position_8bit(1,(byte)map(d,0,179,0,255));
Serial.print(v);
Serial.print(" , ");
Serial.println(d);
}
delay(10);
*/
//
// I'm driving a single point repeatedly now to hammer it!!
//
position_8bit(1,(byte)map(94,0,179,0,255));
delay(5000);
position_8bit(1,(byte)map(85,0,179,0,255));
delay(5000);
}
void set_servo_parameters(byte servo, byte rangeVal)
{
//this function uses pololu mode command 0 to set servo parameters
//servo is the servo number (typically 0-7)
//rangeVal of 15 gives 180 deg in 8-bit, 90 deg in 7 bit
byte temp;
byte parameters;
temp = 1 << 6; //set first two bits of parameters (on = 1, forward = 0)
temp = temp + (rangeVal & 0x1f); //put first five bits of rangeVal into temp
parameters = temp & 0x7f; //take only bottom 7 bits
//Send a Pololu Protocol command
softSerial.write(0x80); //start byte
softSerial.write(0x01); //device id
softSerial.write((byte)0x00); //command number
softSerial.write(servo); //servo number
softSerial.write(parameters); //parameters
}
void set_speed(byte servo, byte speedVal)
{
//this function uses pololu mode command 1 to set speed
//servo is the servo number (typically 0-7)
//speedVal is servo speed (1=slowest, 127=fastest, 0=full)
//set speedVal to zero to turn off speed limiting
speedVal = speedVal & 0x7f; //take only lower 7 bits of the speed
//Send a Pololu Protocol command
softSerial.write(0x80); //start byte
softSerial.write(0x01); //device id
softSerial.write(0x01); //command number
softSerial.write(servo); //servo number
softSerial.write(speedVal); //speed
}
void position_7bit(byte servo, byte posValue)
{
//this function uses pololu mode command 2 to set position
//servo is the servo number (typically 0-7)
//posValue * range (set with command 0) adjusted by neutral (set with command 5)
//determines servo position
byte pos = posValue & 0x7f; //get lower 7 bits of position
//Send a Pololu Protocol command
softSerial.write(0x80); //start byte
softSerial.write(0x01); //device id
softSerial.write(0x02); //command number
softSerial.write(servo); //servo number
softSerial.write(pos); //position
}
void position_8bit(byte servo, byte posValue)
{
//this function uses pololu mode command 3 to set position
//servo is the servo number (typically 0-7)
//posValue * range (set with command 0) adjusted by neutral (set with command 5)
//determines servo position
byte temp;
byte pos_hi,pos_low;
temp = posValue & 0x80; //get bit 8 of position
pos_hi = temp >> 7; //shift bit 8 by 7
pos_low = posValue & 0x7f; //get lower 7 bits of position
//Send a Pololu Protocol command
softSerial.write(0x80); //start byte
softSerial.write(0x01); //device id
softSerial.write(0x03); //command number
softSerial.write(servo); //servo number
softSerial.write(pos_hi); //bits 8 thru 13
softSerial.write(pos_low); //bottom 7 bits
}
void position_absolute(byte servo, int angle)
{
//this function uses pololu mode command 4 to set absolute position
//servo is the servo number (typically 0-7)
//angle is the absolute position from 500 to 5500
unsigned int temp;
byte pos_hi,pos_low;
temp = angle & 0x1f80; //get bits 8 thru 13 of position
pos_hi = temp >> 7; //shift bits 8 thru 13 by 7
pos_low = angle & 0x7f; //get lower 7 bits of position
//Send a Pololu Protocol command
softSerial.write(0x80); //start byte
softSerial.write(0x01); //device id
softSerial.write(0x04); //command number
softSerial.write(servo); //servo number
softSerial.write(pos_hi); //bits 8 thru 13
softSerial.write(pos_low); //bottom 7 bits
}
void set_neutral(byte servo, int angle)
{
//this function uses pololu mode command 5 to set neutral position
//servo is the servo number (typically 0-7)
//angle is the absolute position from 500 to 5500
unsigned int temp;
byte pos_hi,pos_low;
temp = angle & 0x1f80; //get bits 8 thru 13 of position
pos_hi = temp >> 7; //shift bits 8 thru 13 by 7
pos_low = angle & 0x7f; //get lower 7 bits of position
//Send a Pololu Protocol command
softSerial.write(0x80); //start byte
softSerial.write(0x01); //device id
softSerial.write(0x05); //command number
softSerial.write(servo); //servo number
softSerial.write(pos_hi); //bits 8 thru 13
softSerial.write(pos_low); //bottom 7 bits
}
Sunday, 24 February 2013
All Torque No Action?
...or maybe when too little torque is, well, not enough, perhaps? No, not really.
I'm trying to control 2 points with one servo and it just proved too hard.
I did an experiment today inspired by a friend of mine - Mr Merrigan. I have a number of points for switching lines which really can only move together (unless you enjoy derailment).
Chris suggested trying to make thes emove usnig a single servo. Well, I had a red hot go at this on Saturday and a good part of Sunday morning.
The idea it to mount the motor roughly in the mid-point of the meeting switches and have a beam going out across both switches with rods hooking into the cross-bars of the switches. One motor, two moving switches in synchronicity.
You can see the servo above and the spar above that with a nice mount point for the motor.
Just to make this a bit more obvious I have mounted the spar on top of the tracks so you can see how it would work. I've also put a videoon YouTube where I show the movement by hand.
I'm trying to control 2 points with one servo and it just proved too hard.
I did an experiment today inspired by a friend of mine - Mr Merrigan. I have a number of points for switching lines which really can only move together (unless you enjoy derailment).
Chris suggested trying to make thes emove usnig a single servo. Well, I had a red hot go at this on Saturday and a good part of Sunday morning.
The idea it to mount the motor roughly in the mid-point of the meeting switches and have a beam going out across both switches with rods hooking into the cross-bars of the switches. One motor, two moving switches in synchronicity.
You can see the servo above and the spar above that with a nice mount point for the motor.
Just to make this a bit more obvious I have mounted the spar on top of the tracks so you can see how it would work. I've also put a videoon YouTube where I show the movement by hand.
Now this looks like a great idea but in fact it does not work well for a lot of reasons:
- You need very careful alignment to make this work and that is not insurmountable but is hard.
- The motion of the corss bar is straight across but this is radial and so puts more strain on the motor at the extremes of the switch positions. That's not a problem - just use a big motor. But that means a $20 motor instead of 2 x $4 = $8 :-(
- The long central spar (15cm) means that even a small turn of the motor (1 deg) results in a big movement, so your points no longer switch nice and smoothly.
I tried and tried but no luck. When I thought through the logic I realise it was a dead loss really.
For all of these reasons, I'm moving back to one cheap servo per point. Sorry Chirs, nice idea though.
I've got my servo mounting system down to about 10 minutes per point.
Of course, there are other ways to do the mechanism so 1 servo will drive 2 points but it then takes more than 10 minutes per point to mount!
Sunday, 10 June 2012
Photos from the Epping Model Railroad Club Exhibition
We got there by about 9:45 and the queue was half way down the road. This year the focus was on Aussie modelling, even some NSW urban and inter-city models from the 70s. Fantastic. Also of note was Arakoola - a beautifully detailed O-gauge layout.
The second hand stall was chaos. I even had my bag searched on exit.
The next blog post will contain the videos.
| NSW 1970's suburban. Watch video in next blog post... |
| Arakoola O Gauge, Look at the detailing |
| Arakoola - Tracking the engine with my camera. |
Sunday, 6 May 2012
How about 8 points per Arduino?
So I have constructed my nice point motor controller using servo motors and an Arduino - very nice, thank you.
However, now I have a layout that needs to control 8 points, not 4. I also have limited I/O lines on the main controller so dedicating 8 to driving the point controller is just too much.
I decided to control all 8 points from a single Arduino and use the serial port to control the position and calibration of the points. I still use a pot to control the calibration process because it's just so intuitive.
This posed quite a few challenges. Firstly, don't try doing this with an Arduino Diecimila - you need a newer system than that - I used a Freetronics TwentyTen (discontinued) but the Eleven will be fine as well.
The other consideration is POWER. Yes, sorry but it's not going to work from USB and it's not even going to work well from a PC power supply without a little help. Yes, I'm talking about large capacitors and even a diode for return current.
Have a look at the photos below...
Rethinking the Baseboard
I've built my railroad on a special purpose table built in my basement. Unfortunately with all this rain the plywood I have been using has warped and I can see bulges and swellings all over the place.
I considered using Foamcore board but it is very expensive and, lo and behold, it warps as well. Check this out:
That's 5mm foamcore. Of course the thicker foamcore uses less card vs foam so it is far less inclined to warp. However, it's expensive - about $13/A2 sheet.
So I'm left with heavier plywood or...how about just plain polystyrene sheets?
I noted some on eBay for $15 each but of enormous dimension - 2400 X 1200 X 25mm.
Yes, 2 of these will just about do it. One for the baseboard and one for the scenery, ramps etc.
Friday, 6 April 2012
Some video of the new layout.
I've been running my engines using a very poor old wower unit. I got really tired of it today and did a quick hack job on an Arduino system to run 2 trains using 2 pots to control spped and direction. Nice and easy - took me 20 minutes total.
Anyway, here's some nice videos of it all running...
Tuesday, 3 April 2012
Shift Registers
I'm trying to get as much I/O out of a simple Arduino board as possible and I have previously written about shift registers and their use here.
I thin thought about designing my own PCB to use this and discovered this little beauty on the littlebirdelectronics web site.
I've bought a few and am using them to drive LEDs for signals, relays and some ULN2803s. You can get some nice right angle headers to make it easy to daisy chain these bad boys. Some photos below.
All driven by 3 pins on the Arduino.
I thin thought about designing my own PCB to use this and discovered this little beauty on the littlebirdelectronics web site.
I've bought a few and am using them to drive LEDs for signals, relays and some ULN2803s. You can get some nice right angle headers to make it easy to daisy chain these bad boys. Some photos below.
Daisy chained and plugged into a breadboard using the long headers made popular for Arduino shields.
Sunday, 25 March 2012
Saturday, 24 March 2012
A short video of my old tank engine on the layout
Looping around the innner track from the station and then up and crossing over to the middle track.
A very quick update - protoype layout ready!!
Some track is now concealed behind the rams on the inner track.
For those of you who helped by reviewing my track plans, notice I have included extra points to allow both entry and exit from the outer loop.
An HDR photo of my Fleischmann tank engine near the station in the middle of the layout.
For those of you who helped by reviewing my track plans, notice I have included extra points to allow both entry and exit from the outer loop.
An HDR photo of my Fleischmann tank engine near the station in the middle of the layout.
Thursday, 5 January 2012
Tight Curves
I thought I ought to test how tight a curve I could make for a tram track. It turns out that I can easily get a 4 wheeler to run on a 5" curve. Anything smaller and the friction on the wheels causes reliability issues.
I tried 6", 5.5" and 4". It easily runs on 5.5".
Here's a video:
I've started using foam core heavily for my test work and will probably be using this on the layout when prototyping the system. Final work will be done using cuts in the plywood base with timber supports, but maybe I'll just keep the foam core in place!
It's certainly stronger and lighter than cardboard, easier to cut and shape etc so will most certainly be used for the basis of landscaping.
I think that the track itself is about 4mm from base to rail top. I will be using an underlay under most of the track - most likely cork - but the tram will probably be different. The underlay is to absorb noise and form a good basis for ballast. With the tram tracks, I may use something like rubber matting used for lining kitchen drawers - it's a non-skid thing used to keep plates from banging about when drawers open. It's thin, absorbs vibration and is cheap.
I guess that means a 5mm foam core can be used for the road-base to line up with the rails? Anyway, that's getting a bit ahead of things.
Tuesday, 3 January 2012
Baseboard Basics
Just a quick post showing the baseboard under construction. I've built 2 frames - one 1200 x 600 and the other 800 x 1400. It's basic 19mmx75mm timber construction with a few reinforcements here and there. Some nice cutting and chisel work too!
The plywood sheets are 3mm thick and come standard in 800 x 1200 which is convenient. Note that they are not always square though! I could not be bothered straightening them - most likely I'd make them worse anyway.
I've joined the 2 parts of the L together so that they can be separated easily enough later for transport. I plan on investing heavily here and want to hang onto this if we move again.
I'll be putting some coach bolts in here tomorrow with wing nuts. These sections are screwed together for now.
Just added a little 200 x 800 plywood piece to the larger baseboard as a separate item to allow both boards to be separable (above).
And below is a picture of my desk with various bits of train and electronic detritus liberally polluting it. All the Arduino software is working, of coures, and the test layout is running smoothly.
Subscribe to:
Posts (Atom)









































