Thursday, 25 July 2013

My First Dabble With 3D Printing

Freshwater station only has one platform, but it was extended at various times over the years. The first section by the buffers where the locomotive would stand is very low with plain brick facing. It then ramps up to a more normal height. The next section is typical Southern Railway concrete panels from the Exmouth Junction concrete works, while the latest extension used the Southern Railway lightweight concrete trestles, more standard components from Exmouth Junction.

Modelling the brick faced platform should be fairly simple using plastic and printed paper. I bought some Peco concrete platform facing for the next section, but it needed cutting down to the correct height, and it appears to be absolutely nothing like typical Southern Railway platforms. It might be based on a foreign prototype, or possibly just the imagination of somebody at Peco. I added some Milliput to fill the vertical channels and add the curved supports at the top of each column. It might have been better to completely scratchbuild some instead.

That leaves the trestle platforms. Nobody manufactures it in 2mm scale, so I had to make it myself. I could have formed each pair of legs separately, but would probably have given up through boredom before completing them all. Also, I knew they would vary too much and would not produce the neat, regimented rows that are such a feature of this type of platform. I had dabbled with resin moulding some years ago, so I filed a trestle from perspex and formed Plasticine moulds with it, and filled them with epoxy resin glue. This experiment was not a great success, the results being too fragile and varying in quality. I decided it was not worth trying with rubber moulds and polyurethane resin.

My next option was to try etching in fairly thick brass. This would still have required sweating two layers together to get the right thickness, but would produce a very strong result. However, I decided to try my third option - 3D printing - instead. Many people have been trying out 3D printing with varying success. However, the technology seems to be improving daily, and I figured a simple scenic item might turn out better than some of the more ambitious projects some people were attempting.

I had previously done quite a bit of 3D modelling on the computer, producing models for use in Microsoft Train Simulator that I made available on uktrainsim.com, so creating the 3D models for printing did not seem too daunting. However, the software I used to use appears to be no longer supported, and did not create files of the required format, so I downloaded the free 3D model editing software called Blender. I know some people swear by Google Sketchup, but I had tinkered with it once and found it confusingly different to what I had used before. Blender is open source, supported by lots of programmers and contributors, and there are lots of tutorials available for it on the Internet.

A 3D model is made up from a series of points, each of which has an X, Y and Z coordinate specifying its position in 3D space. A pair of points can be joined by a line, or an 'edge' and the edges joining three or more points can form a 'face'. A face can be double-sided, but usually only has one side. It cannot be seen from the other side. A simple cube has six faces and eight points - one at each corner - and twelve edges. Spheres, cylinders and circles are not actually possible to create faithfully in this type of 3D model. Instead, a circle is formed from a large number of points, each linked by a straight edge. With enough points, the resulting polygon can start to resemble a circle. Similarly, cylinders and spheres can be portrayed using lots of small, flat faces.

This is where creating models for use in a real-time computer game differs from creating models for 3D printing. In order for a computer to create the displayed images of the game fast enough for smooth, realistic animated motion, the models need the minimum number of points and faces possible. You can play with things called 'normals' on the faces to create the illusion of curved faces, but you would also leave out any unnecessary faces, such as the underside of vehicles which would not normally be seen. However, for 3D printing, we want lots of faces to produce fine curved surfaces, and most important, the models must be 'watertight'. That is, there should be no missing faces, or inward facing surfaces. So, a cube must have all six faces, and all must face outward.

Having grasped these basic premises, model making is rather like modelling in clay. You can grab a bit and pull it out (called extrusion) or you can add more bits of clay. Most software allows you add cubes, cylinders, spheres or toroids (ring donuts). You then deform these objects, divide faces and edges, and extrude parts to get to the required shape. There are other useful tools that can be employed, such as the lathing tool. This can be used to transform a set of lines drawing the outline of one side of, say, a vase, for example, and spin it round to create a 3D vase shape. It is also possible to merge shapes, and use logical unions, intersections or differences to add or subtract shapes from each other. Subtracting a small cylinder from a large cube is like drilling a hole in the cube, for instance.

For my first 3D print model, I used the drawings of Southern Railway trestle platform components from the useful book 'Southern Nouveau - an essay in Concrete'. I converted all the measurements from inches to millimeters, and divided by 152 for the correct scale. Blender uses unspecified measurement units, so I chose to use 1 unit = 1mm in Blender. I then created models of a pair of legs, and a platform section, starting each from a cube, deforming, dividing and extruding until the correct shape and dimensions were achieved. I also 'drilled' holes in the rear posts for the hand rail and fence wires.


 I then duplicated these shapes thirty or so times, stacked up close to each other, but not touching, and then exported the complete set to a single .stl format file.

3D printers are improving in quality, and the cost is falling rapidly, but the affordable ones are still limited in quality and ability. Although they may be fun to experiment with, for now, it makes more economic sense to make use of online 3D printing services, such as Shapeways, to do the 3D printing. Having registered as a user, I uploaded the .stl file, specifying that 1 measurement unit represents 1mm. Some automated checks are carried out on the file, and a few minutes later, I received an email telling me that my file should probably print OK. I was then able to choose what material should be used for the printing, and the price for printing my model in each material could then be seen. Shapeways have a simple pricing scheme, you pay for the volume of material used, each material type having a cost per cubic measure. Therefore, a hollow model will cost less than a solid model of the same size.

Frosted Ultra Detail (FUD) is the plastic most modellers use as it has the finest resolution (0.2mm) but it is far from the cheapest material. My model, enough components for about 12 inches length of platform, cost €23 plus postage. So, not as cheap as a mass produced kit would be (if available), but not prohibitively expensive. I uploaded the file on the Monday evening, and a box with the components in came through my letterbox on the Friday. I was very impressed.


The FUD material is quite transparent, so you can see the surface irregularities on both sides and an initial look gives the impression that they are a bit rough. The legs with the taller rear post will be used to form a lamp post, with a swan neck formed from .3mm wire. This swan neck would have been too fine for 3D printing.

I cleaned the components, removing traces of the wax used in the printing process, most of which has already been removed before delivery. I was not surprised that the .3mm holes for the handrail were not properly formed, but there was enough to guide a drill through in the correct position. I used superglue to fix the components to each other and roughly painted them with a concrete-ish colour and fitted it to a small board with a length of track to see how it looked. The hand rail is formed from 0.3mm nickel silver straight wire.






I have also added some static grass and some bushes, and formed a wire swan-neck lamp. The lamp head was also 3D printed, making good use of the transparency of the FUD for the bowl of the lamp.

I was quite pleased with the results, but gluing all the components together was quite fiddly, and there is quite some uneveness in the platform surface as a result. I therefore went back to the 3D model and started to combine the components so that they would be printed in units of two or three pairs of legs with platforms. I also created the end ramps as single units, and a single unit to include the station nameboard. I kept to smallish units because the platform for Freshwater is curved, not straight. Below you see the duplicated sections in Blender. You can also see some lamp heads underneath the platforms.






And again, a week later, the new components came through my letterbox:

So, now I have no excuse not to get on and create the platform for Freshwater.



Sunday, 2 June 2013

Right back where I started from

It is over 12 months since my last posting on this blog. A quick recap of the project so far is in order.

Way back in July 2010, the 2mm Scale Association celebrated its Golden Jubilee with a special Expo in Oxford. Prior to this, a layout building challenge was issued for layouts up to 9.42 square feet to be exhibited at the Expo. I built Freshwater for this challenge. As a change from my normal use of relays to operate points, I decided to try servos for the new layout. I joined Merg to get access to their Servo4 kits. After some teething problems, I managed to get the layout working just in time for the Expo with a temporary control panel with a switch for each point. Although the layout operated nicely all weekend, there had been no time to create any scenery. It was just track on white painted baseboards.

I did want to have route selection and a proper control panel, but there was a problem with the servos that I wanted to fix first. On powering up the layout, one or more servos would decide to move rapidly to one extreme or the other, despite being restricted in their movement by the point mechanisms. Sometimes they would draw so much current, the power supply voltage to the PIC controllers would not rise high enough for the PICs to start operating and get the servos under control. I had to resort to switching the power off and on a few times until things sorted themselves out.

My last posting on this blog describes the introduction of the Merg CBus layout control bus, the introduction of DCC, and a lot of work on power supplies in an effort to resolve the servo startup problems. The problems persisted and I was beginning to lose interest in the layout.

The introduction of a new Merg kit for a servo mounting started me thinking again. I had done everything I could with the electronics - maybe the problem was with how I had mounted the servos. I had them directly driving the point mechanisms which meant they were only using a small segment of their available movement. The new servo mounts are arranged so that the servo can sweep through its entire range while the rod connecting to the point mechanism only moves a few millimeters. It would no longer matter if the servo wanted to move to an extremity on powering up. It could do so quite freely.

So, a start was made removing the existing servos and their mounting blocks and fitting the new mounting kits (with 5mm shaved off their overall height to fit within the hinged cover panels). At the same time, I decided to replace the under-board point tiebars I had originally fitted. Although they had worked OK, they did not have any way to adjust the distance between the point blades. The old ones also had a microswitch to change the frog polarity, whereas the new mounting also has microswitches nicely mounted on them. My new under-board tiebars, therefore, did not require microswitches.



All this work has now been completed with a couple of weeks to spare before this year's 2mm Scale Association Expo in Wallingford. Unfortunately, the viewing side of the baseboard is pretty much the same as it was in 2010 - ballasted trackwork sitting on plain white baseboards. But, like the duck, calm and serene on the surface but peddling like mad underneath.

Saturday, 21 April 2012

improvements, design changes, failures, successes and experiments

It has been some time since my last post. During that time there have been various improvements, design changes, failures, successes and experiments on the electrics underneath the layout. I have still not quite finished, but I do have a working system again.

The original plan was to use Merg Servo4 kits to drive micro servos controlling points and permanent magnet uncouplers. A temporary switch box connected to the 25-way connector on the layout operated the individual points and uncouplers. This was going to be replaced by a different box with Merg CBus kits allowing push buttons to create events which would be used to switch one or more points to set a route. However, I found that the CBus modules would not drive the Servo4 inputs directly, and problems with sharing a single AC power supply burnt out a couple of CANbus circuits.

Meanwhile, developments and new ideas were happening within Merg. I decided to replace the three Servo4 kits with two CANservo2 modules (modified CANACC8 kits). This would mean the connection to a control panel would only need 4 wires (CAN Bus and power supply). A 12V DC power supply bus was also decided upon at this point, rather than the previously recommended 5V power supply.

Another initial design decision was to wire up the layout so that it could be easily switched between analogue DC train control to DCC by swapping a 35 way connector. Either a DCC or conventional controller could be plugged in. However, the new Merg DCC command station kit was small enough and cheap enough to build it into the layout. It also produces a regulated 12V DC supply that can be used by other CBus modules, and uses the CBus connection for attaching the matching Merg hand-held controllers. The capability to switch to analogue control was retained.

At this stage, another problem came to light. The power-on surge caused by the servos was lowering the power supply voltage too much for the control circuits to recover. I decided to add a second power supply bus at 9V DC just to supply the servos, separate from the CBus power supply bus. This has mostly resolved the problem, but there is still a small problem with servos twitching and moving on powering up the layout. This problem is still being investigated.

Still to do is replace the 12V and 9V power supply sockets, as the simple sockets fitted allow the plugs to drop out too easily. I have some latching XLR connectors to replace these. I have also not yet built a control panel. I can use the hand-held controller to create CBus events to select routes, operate individual points or uncouplers, and I can also connect a laptop to the layout, via a USB to CBus interface, and operate the layout using JMRI, so the control panel can wait. I also have to build signals, and fit some more servos to control them.

The first photo shows the underside of the layout with the protective hinged covers closed. The aluminium panel has the DCC command station attached behind it so that the power transistors can be bolted to it to act as a heatsink, if required. At each end of the layout are pairs of CBus 4-way RJ22 sockets for connecting hand-held controllers, PC interface and/or control panel.



The next photo shows one end of the layout with the hinged cover open. The CBus connectors and a CANservo2 module are attached to the lid while the now redundant Servo4 modules are attached under the baseboard along with the servos. The redundant 25-way connector is also visible. Just by the hinge can be seen two servo 'distribution' boards, each with its own 5V power regulator and plugs for up to four servos to connect to.



The other end of the layout shows the second CANservo2 module and the CANcmd DCC command unit attached to the cover, with another pair of CBus connectors. The DCC/Analogue switchover socket can also be seen.

Saturday, 20 August 2011

A Case for DCC

In my last blog entry, I showed my recently completed Merg CAN-CMD CBus controlled DCC Command Station. The Merg kit includes the PCB and all the components to populate the PCB. For future layouts I will probably just mount the PCB directly to a baseboard and hard wire it in. However, this first one I wanted to keep as a portable and flexible unit.This meant fitting it into a case with suitable sockets, switches and Led indicators.


I found a suitable case on Ebay made from black plastic with aluminium end plates and adequate size to take the PCBs and wiring inside.Drilling, cutting and filing all the holes in the aluminium end plates took three evenings to complete. The aluminium plates were then cleaned, sprayed black and lettered with Letraset rub-down lettering, and finished with some clear spray laquer.



Inside the case is the CAN-CMD main circuit board and the CAN-TERM connector kit PCB with two RJ22 sockets. These can be used to plug in a CAN-USB computer interface, or the forthcoming CAN-CAB handheld controller, or to connect to a layout CBus as required.



The one panel has all the CBus related switches and connectors, and the two indicator LEDs. The green LED only lights up if the microcontroller program is running correctly. The Yellow LED lights up when in 'Mini-Booster' mode or flashes when programming locomotives or accessories decoders. The two RJ22 connectors previously mentioned are on this panel, along with two switches. One switches in a bus terminator resistor, required if this unit is at one end of a long Cbus, or used with just a CAN-CAB or CAN-USB. If this unit is connected to a layout CBus that already has terminators fitted then the inbuilt terminator can be switched out. The second switch allows this unit to supply 12V DC to power other CBus items, like the CAN-USB or CAN-CAB. Again, if connected to a layout Cbus that has a separate 12V DC supply, this can be switched out.



The other panel has a socket to connect the power supply, either 12V AC or 15V DC at up to 1 Amp.The screw terminals allow connection to either a programming track or a small layout if using 'Mini-Booster' mode. The mode of this output is controlled by the switch above. The 4-pin mini-Din socket will allow external DCC Boosters (another forthcoming Merg kit) to be attached if more than 1 Amp is required for a layout. The remaining switch controls 12V DC output the the external boosters if required.



Sunday, 10 July 2011

A Bus for Freshwater

Not that sort of of bus - a layout control bus. DCC is really good for controlling trains, but is less suited for controlling points and signals and the like. A separate bus for operating accessories means that a short circuit on the track does not cause points and signals to change at random. The separate bus can also use systems that are more suited to train detection and route selection.

I initially joined Merg (Model Electronic Railway Group) in order to access their servo controller kits, for controlling points and signals. Having joined, I found out about their development of a layout control system based on the CBUS two-wire command bus. The CBUS protocol has been used in all new cars for a number of years, to reduce the complexity of the wiring loom, and increase the functionality. It is a fairly simple protocol, compared with TCP/IP as used by the Internet. The bus is used to join up various devices all over the car. It allows 'producer' devices (switches, or sensors for instance) to broadcast simple numbered 'event' messages over the bus. All the 'consumer' devices attached to the bus will see these 'event' messages, but certain devices will be setup to perform specific functions when specific events are seen. Thus a switch can broadcast an event which the windscreen wiper controller will act on to start the windscreen wiper motor. A rain sensor can be set up to broadcast the same event. It might also broadcast another event which would result in the headlight controller lighting the headlights. The CBUS is equally useful for controlling a layout. Control panel switches and train detectors can become 'producer' devices, and point motors, signal motors and mimic display panels can become 'consumers'. Because of the widespread use of CBUS in the automotive industry, the basic components required are readily available and low cost.

Last year, I purchased a couple of Merg kits, an eight input 'producer', and an eight output 'consumer'. I also picked up the experimenters kit, a small board with eight switches on that plugs onto the 'producer' kit, and a board with eight LEDs on that plugs into the 'consumer' kit. The Merg kits are designed to allow them to be 'programmed' using small switches that are part of the kits. The 'producer' can be told what events to broadcast for each switch operation, and the 'consumer' kit can be taught which events to listen for, and which LEDs to light or extinguish when the event is seen. The Merg kits were designed to use a 5VDC supply distributed from a power supply regulator on one of the kits, which required a 12-16V supply. I experimented with these modules, but did not get round to using them on Freshwater as deadlines approached, and a temporary 'traditional' control panel was built. I do intend to use CBUS eventually as it will allow simple route selection and some interlocking to be implemented.



The photo shows a 'producer' board on the left, with eight yellow switches on the experimenter board plugged on the end. On the right is a 'consumer' board, with eight red LEDs on the experimenter board plugged on its end. They are connected by the 2-wire bus (blue and white wires). The orange and black wires are the power supply lines. In the centre is a C-BUS connector board, and a power supply can plug into the lead coming down from the centre. I have modified these boards to run from a 12VDC supply instead of the 5VDC supply that the kits were originally designed for.

Over the last 12 months, more kits have become available, along with interfaces to a computer to simplify the programming of the modules. The computer interface also allows computer control of a layout, using suitable software like the freely available JMRI. The latest development from Merg is a DCC command unit and a hand-held controller. The CBUS is used for communication between the controller and the command unit. JMRI can also be used as a throttle connecting to the command unit via the CBUS.

So, to prepare for the DCC system, and use of the CBUS on Freshwater, I purchased the Merg kit for a CBUS to USB interface. This was initially built as per the instructions. It is designed to take a 5VDC supply. I therefore created a simple 5VDC regulator circuit on a small piece of veroboard, and mounted everything in a small black plastic case. A 4 way cable with an RJ22 type connector at the end that can plug into a Merg CBUS connector kit, comes from the box, connecting the two bus wires and the 12VDC supply into the box. A standard USB connector protrudes from the other end of the case.



Having a working USB interface, I set to building the DCC command station kit from Merg. This has been built as per its instructions. It is already designed to take an external 16VAC power supply, and can supply 12VDC to other devices on the bus.



The photo shows the USB interface box on the left, which connects to the USB port on a PC. It also plugs into the CBUS connector board and the bus then connects to the DCC command station board on the right, the red and black wires next to the bus wires have a socket for connecting the power supply. The red and black wires to the far right attach to the test track at the top of the photo. The white round object at the bottom right is a buzzer used as a short circuit warning. This setup now works, using a JMRI software throttle on the PC. I have also played with a Wi-throttle 'app' on an iPhone using a WiFi connection to the JMRI server on the PC.

Merg will very soon have a kit available for a hand held DCC controller that will plug directly into the CBUS connector board, and do away with the need for the USB interface and PC. Watch this space.

Sunday, 6 March 2011

Bridging the Gap

Now I have taken on a new deadline for Freshwater, the 2mm Expo at Keighley, I am now motivated to get on with the scenics. First off, a bit of terra-forming. As I had some sheets of foam-board available, I thought I would use some to build up the contours. Most of the station area is flat, so it is only the river banks and the start of a small hillock behind the station that needed building up. When I have smoothed out the slopes, I intend to cover it with PVA soaked kitchen towel. I hope to avoid having to use much filler, as the board does twist and move a bit, and filler will probably crack and break up.

Only a small number of buildings are needed for the layout, so I want to avoid using kits (except for the ratio concrete platelayer's hut probably), and scratch build as much as I can. Starting with the basic civil engineering, I need a bridge over the tidal River Yar. I have not found any photos of the real bridge, so I need to freelance it. I would have liked to build a dainty little bridge with hand rails, but rail cleaning at exhibitions would probably destroy them. Therefore, I decided on a large girder type bridge, giving plenty of clearance for the tide to come in.

The main girder and end pillars were cut from a single piece of plasticard, then further layers of plasticard were added to build up the pier thickness. By using a single piece, the piers and girder will always be at right-angles to each other, and will not move when the bridge is fitted in place. Strips of thin plasticard have been added to complete the girder. In the photo, only the nearest girder is complete.



When the girders are complete and painted, they will be glued in place, and the abutments below the bridge will be completed in place. Brick paper will then be applied to finish off the abutments and piers. Hopefully, all will be complete next week. Then I can start on the platform. The original platform was brick edged, then it was extended using concrete panels, and then another extension was added with concrete pillars. Should be fun.

Thursday, 28 October 2010

Ballast (A Disaster)



It must be the season for ballast laying. With all the track laid, wired up and painted, and a successful two days operation at the GJ Expo in Oxford we just needed an opportunity to have the layout set up for a few days to allow the ballast to be laid and for the glue to dry.



We followed the method used on previous layouts, applying the ballast dry, painstakingly moving around and removing it from sleepers and flangeways, then spraying water with a couple of drops of washing up liquid through an atomiser to make everything wet, then dripping watered down glue on it. There must be a less tedious way of doing it, but this works.



Previously I have used fine granite dust from the Mendips and PVA glue. This sets like concrete. This time I used Woodland Scenics finest grey ballast and Copydex. This combination should produce a more flexible result, better suited to my thin baseboard surface, and may reduce running noise (although I am not too bothered about that). I found the Tamiya disposable paint brushes very good for final removal of individual stray peices of ballast from the sleepers.



The photos show the job in progress. In the photo below you can see the white watered down glue just after application. It dries clear and matt. I expect it will take a few weeks to clean up the track and remove all obstructions from the flangeways, and a lot of glue disappeared down the holes into the point mechanisms below which will need some sorting out. It may be some time before proper operation is resumed.



(Footnote)
Well, 24 hours later, it all looked good, but as I tried to remove a stray piece of ballast from the inside of a rail, it pulled a long string of elastic glue with pieces of ballast in from between the sleepers. A light brushing with a toothbrush lifted lots of nasty elastic clumps of ballast. There was no way it would survive exhibition use. So, the bad areas were patched with fresh ballast, and the whole layout doused in watered down PVA. I am hoping the PVA will solidify everything rather than just form a crust on the surface, but I will find out tonight. If it fails, all the ballast will have to be removed, and we will have to start again. Oh dear :-(

Ian.