Building a freelance diesel for push-up duty

A place for discussing battery-electric locomotives, whether they're diesel, steam or even electric outline
User avatar
gregh
Trainee Driver
Trainee Driver
Posts: 566
Joined: Sun Apr 01, 2018 5:44 am
Location: Sydney, Australia
Contact:

Building a freelance diesel for push-up duty

Post by gregh » Sat Feb 16, 2019 5:49 am

I love scratchbuilding, but have been trying to not build any more locos – I’ve run out of storage space!
But surely a rebuild is OK? Eight years ago I took a Hartland Mack and put batteries and a simple forw/off/reverse switch on it for a young grandson. Now it doesn’t get much use.
eddie1.JPG
eddie1.JPG (53.32 KiB) Viewed 6920 times
These Mack locos are a good cheap source of motor blocks

I have a need for a push-up or banking loco to help push trains up my 1:25 grade. So I thought a small loco, but with RC using a small keyfob type control would allow me to hold my larger ‘model aircraft type’ controller for the ‘train loco’ in one hand, and the keyfob in the other.
keyfob Tx.jpg
keyfob Tx.jpg (6.48 KiB) Viewed 6920 times

This is all I reused of the Mack – the motor and ‘bogie’ side plates, with a bit of additional detail added. And the cab roof.
mack bogie frame.jpg
mack bogie frame.jpg (40.28 KiB) Viewed 6920 times

But above the baseplate, it’s all scratchbuilt. I wanted something weird looking, chunky, but non-symmetrical, while ensuring space for the battery and RC, motor control and speaker and sound.
So after some Olympic grade procrastination for the last 3 months, here’s the plan…
I just use the Draw function in Libre Office Writer (= MS Word) to sketch it all up. For a small loco like this I can draw it full size on the screen. As usual, a lot of the design is in deciding how to get at the batteries and electronics, where to hide the on/off switch and the charging studs.
cream green.jpg
cream green.jpg (28.62 KiB) Viewed 6920 times

All the body is 1.5mm styrene and is really just 3 boxes – the curved front hood, the cab and the long hood. The long hood roof is a push fit so I can get the electrical stuff out. I mounted the 2” dia speaker on the side of the long hood, behind some louvres to let the sound out. The other side also has louvres for the sound to ‘leave’ after reverberating inside !
bare insides.JPG
bare insides.JPG (77.24 KiB) Viewed 6920 times

The curved part is made from a quarter of a vacuum cleaner hose, covered in 0.5mm styrene with rivets embossed.
The batteries are in the curved hood – six, NiMH 2500 mAh types. (I have always just soldered connections to these batteries.) That should give enough speed for banking – around 30kph by test. This pic also shows my wiring ‘terminals’ - pieces of copper clad board which will be hidden under the cab false floor.
batteries installed.JPG
batteries installed.JPG (62.69 KiB) Viewed 6920 times

To gain access to the batteries I decided to make the cab removeable – it just slides up from between the two hoods. ( So only the two hoods are attached to the base.)
But I had mounted the headlight on the cab, so instead of a plug, I made magnetic connectors by soldering wires to four, 5mm dia magnets. This shows one of the pair epoxied in place. The top one glued to the cab and the bottom one glued to the floor.
magnet connector (1).JPG
magnet connector (1).JPG (29.07 KiB) Viewed 6920 times

Here it is at the ‘first fit’.
2nd mockup (4) s.JPG
2nd mockup (4) s.JPG (138.54 KiB) Viewed 6920 times

Now for the electronic stuff......................
Greg from downunder.
The Sandstone & Termite's website: https://members.optusnet.com.au/satr/satr.htm

User avatar
tom_tom_go
Driver
Driver
Posts: 4824
Joined: Wed Feb 23, 2011 3:08 am
Location: Kent, UK
Contact:

Re: Building a freelance diesel for push-up duty

Post by tom_tom_go » Sat Feb 16, 2019 8:42 am

I like the body shape, very much a little workhorse with some grunt.

Magnet idea is a good one, are they neodymium type or just what was in your bits box?

User avatar
ge_rik
Administrator
Administrator
Posts: 6497
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Building a freelance diesel for push-up duty

Post by ge_rik » Sat Feb 16, 2019 9:16 am

Very handy looking loco, Greg. I like the idea of drawing full size on a photo/scan of the motor block. Neat way of making sure everything fits.

Rik
PS Are those real springs you've added to the bogie?
------------------------
Peckforton Light Railway - Blog Facebook Youtube

User avatar
gregh
Trainee Driver
Trainee Driver
Posts: 566
Joined: Sun Apr 01, 2018 5:44 am
Location: Sydney, Australia
Contact:

Re: Building a freelance diesel for push-up duty

Post by gregh » Sun Feb 17, 2019 8:17 pm

tom_tom_go wrote: Sat Feb 16, 2019 8:42 am I like the body shape, very much a little workhorse with some grunt.

Magnet idea is a good one, are they neodymium type or just what was in your bits box?
They are the super magnet neo.... (whatever) types. Bought 100 of them on ebay years ago.
Greg from downunder.
The Sandstone & Termite's website: https://members.optusnet.com.au/satr/satr.htm

User avatar
gregh
Trainee Driver
Trainee Driver
Posts: 566
Joined: Sun Apr 01, 2018 5:44 am
Location: Sydney, Australia
Contact:

Re: Building a freelance diesel for push-up duty

Post by gregh » Tue Feb 19, 2019 9:08 pm

ge_rik wrote: Sat Feb 16, 2019 9:16 am Very handy looking loco, Greg. I like the idea of drawing full size on a photo/scan of the motor block. Neat way of making sure everything fits.
Rik
PS Are those real springs you've added to the bogie?
No Rik, just copper wire wound around a suitable drill bit.
Greg from downunder.
The Sandstone & Termite's website: https://members.optusnet.com.au/satr/satr.htm

User avatar
ge_rik
Administrator
Administrator
Posts: 6497
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Building a freelance diesel for push-up duty

Post by ge_rik » Tue Feb 19, 2019 10:14 pm

gregh wrote: Tue Feb 19, 2019 9:08 pm
ge_rik wrote: Sat Feb 16, 2019 9:16 am Are those real springs you've added to the bogie?
No Rik, just copper wire wound around a suitable drill bit.
Clever!

Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

User avatar
FWLR
Driver
Driver
Posts: 4262
Joined: Sat Aug 05, 2017 9:45 am
Location: Preston, Lancashire, UK

Re: Building a freelance diesel for push-up duty

Post by FWLR » Wed Feb 20, 2019 7:16 am

Interesting Diesel Greg. Love the way it seems to look as it's going to pull anything that gets in its way.......

User avatar
gregh
Trainee Driver
Trainee Driver
Posts: 566
Joined: Sun Apr 01, 2018 5:44 am
Location: Sydney, Australia
Contact:

Re: Building a freelance diesel for push-up duty

Post by gregh » Wed Feb 20, 2019 9:14 am

FWLR wrote: Wed Feb 20, 2019 7:16 am Interesting Diesel Greg. Love the way it seems to look as it's going to pull anything that gets in its way.......
Thanks Rod. I was hoping for that Brute look.

Now it’s approaching completion.
IMG_8736.JPG
IMG_8736.JPG (92.07 KiB) Viewed 6775 times
The hoods were lined using some yellow tape to give a bit of colour.
I printed my own lettering decals – my printer doesn’t do a great job, but this is not a great loco ! (on my ‘better’ locos I get professional printing done.)

The windows are just plastic sheet. I make window ‘frames’ on the inside of the cab, so the plastic just slides in from the top and can be removed if I ever need to repaint.

The exhaust is a bit of 20mm tube and some smaller tube and wire. Nothing fancy here!

Now it was time for the electrics.
The on/off switch is hidden in an air tank on the bogie sideplate. My usual charging studs are bits of copper tube on the front buffer beam. (I use alligator clips to connect the battery charger, and there is no switching between run and charge in my circuits.)
charging stud switch.jpg
charging stud switch.jpg (64.61 KiB) Viewed 6775 times

I design all my own RC, motor control and sound electronics.
My design consists of a Picaxe 08M2 programmable programmable controller, which does both PWM speed control, and creates the diesel sound, a single chip amplifier (LM386), a MOSFET to control the motor and relay for direction control.
I enjoy the electronics side of the hobby, but I realise most of you don’t share this fetish, so I’ll refrain from a detailed description. But I am quite pleased that I managed to do motor control AND diesel sound with one single 8 pin chip.
It has just 4 discrete steps of speed when accelerating which I determined was enough for a slow speed shunter; but the braking has ‘infinite’ control for shunting. The sound has two volumes – loud when accelerating and softer when slowing and stopped. There is also an engine starting sound sequence, but I am not completely happy with it.

All the electronics for motor control and sound is on a piece of veroboard on one side of the long hood and the RC receiver is on the other, next to the speaker. The aerial ‘loops’ around the hood.
This is the keyfob 433 MHz receiver
keyfob Rx.JPG
keyfob Rx.JPG (79.6 KiB) Viewed 6775 times

And all the electronics installed in the long hood.
loco15 internals.JPG
loco15 internals.JPG (75.36 KiB) Viewed 6775 times

The long hood end has a 10mm dia white LED on the front, as a headlight – I filed the front of the LED’s usual hemisphere, flat. The curved end headlight was a compromise as I made the cab windows too close together to get a 10mm LED in. So I used two, 5mm dia ones mounted vertically and connected in series. In both cases, they run at about 10mA.


Now to get out and test it. The video will appear soon.
Greg from downunder.
The Sandstone & Termite's website: https://members.optusnet.com.au/satr/satr.htm

User avatar
Peter Butler
Driver
Driver
Posts: 5219
Joined: Sun Sep 09, 2012 10:33 pm
Location: West Wales

Re: Building a freelance diesel for push-up duty

Post by Peter Butler » Wed Feb 20, 2019 11:51 am

A locomotive with attitude if ever I saw one!
The best things in life are free.... so why am I doing this?

User avatar
tom_tom_go
Driver
Driver
Posts: 4824
Joined: Wed Feb 23, 2011 3:08 am
Location: Kent, UK
Contact:

Re: Building a freelance diesel for push-up duty

Post by tom_tom_go » Wed Feb 20, 2019 3:20 pm

Can we call it 'Donk' please!

User avatar
gregh
Trainee Driver
Trainee Driver
Posts: 566
Joined: Sun Apr 01, 2018 5:44 am
Location: Sydney, Australia
Contact:

Re: Building a freelance diesel for push-up duty

Post by gregh » Thu Feb 21, 2019 6:01 am

tom_tom_go wrote: Wed Feb 20, 2019 3:20 pm Can we call it 'Donk' please!
Only if it's THE Donk
(Have you seen Crocodile Dundee lately?)
Greg from downunder.
The Sandstone & Termite's website: https://members.optusnet.com.au/satr/satr.htm

User avatar
gregh
Trainee Driver
Trainee Driver
Posts: 566
Joined: Sun Apr 01, 2018 5:44 am
Location: Sydney, Australia
Contact:

Re: Building a freelance diesel for push-up duty

Post by gregh » Sat Feb 23, 2019 8:27 am

All finished - decals on, cab details and driver, horns.
IMG_8772.JPG
IMG_8772.JPG (415.39 KiB) Viewed 6652 times

A short video of the loco at work and a bit on the build and testing.

https://youtu.be/oR93ArTGjTk
Greg from downunder.
The Sandstone & Termite's website: https://members.optusnet.com.au/satr/satr.htm

User avatar
philipy
Moderator
Moderator
Posts: 5033
Joined: Sun Jan 30, 2011 3:00 pm
Location: South Northants

Re: Building a freelance diesel for push-up duty

Post by philipy » Sat Feb 23, 2019 10:51 am

Very nice, as always, Greg. I do like the range of sound effects. You commented earlier that you wouldn't bother to elaborate on the electronics because some aren't interested, but I for one would love to read it. My electronics abilities are strictly limited but always eager to learn a bit more from a master.
Philip

User avatar
FWLR
Driver
Driver
Posts: 4262
Joined: Sat Aug 05, 2017 9:45 am
Location: Preston, Lancashire, UK

Re: Building a freelance diesel for push-up duty

Post by FWLR » Sun Feb 24, 2019 8:30 am

Nice Greg, looks amazing now.

User avatar
gregh
Trainee Driver
Trainee Driver
Posts: 566
Joined: Sun Apr 01, 2018 5:44 am
Location: Sydney, Australia
Contact:

Re: Building a freelance diesel for push-up duty

Post by gregh » Wed Feb 27, 2019 12:18 am

philipy wrote: Sat Feb 23, 2019 10:51 am Very nice, as always, Greg. I do like the range of sound effects. You commented earlier that you wouldn't bother to elaborate on the electronics because some aren't interested, but I for one would love to read it. My electronics abilities are strictly limited but always eager to learn a bit more from a master.
Thanks for the comments everyone. And just to finish off my testing, It weighs 1020 grams and can haul wagons weighing 3.2kg up the 1:25 grade. That’s about six, 4-wheelers, so it can ‘add’ six, 4-wheelers or three bogie cars to a train it is banking.


So here's the details on the electronics.....
They are not all that complicated – most of the work is programming the Picaxe. I suppose I’m a dinosaur still using these 20 year old programmable chips -Arduino seems to dominate these days. But I believe in KISS and I don’t need USB or wifi connections and I don’t need to learn a new language.

Anyhow, long ago a I wrote a series of 6 tutorials on using Picaxe for garden railways, so this link will give you the basic info.
http://www.trainweb.org/SaTR/1%20intro% ... d%20V1.pdf


This is the circuit I came up with for this loco. You can see I have coloured the different functions with the picaxe in the centre left.
loco15 full cct boxes2.jpg
loco15 full cct boxes2.jpg (99.68 KiB) Viewed 6558 times

I used a keyfob type 433 MHz radio control. Get ‘em off eBay.
http://www.members.optusnet.com.au/satr/RC.htm


The 8 pin picaxe has six I/O pins and I needed seven, so I multiplexed the 3 outputs from the RC with diodes into the two picaxe pins 3 and 5. If both go high together, it means the ‘D’ (direction) button has been pressed. Because of the diodes, the pins 3 and 5 would be ‘floating’ when the Rx outputs are low (normal), so 33k resistors tie them down.

The motor speed (grey box) is controlled by an Z44 MOSFET using the PWM output of the picaxe (what a great Command that is!) It’s rated at 60V and 35A so no problem with it ever overloading! Direction control uses a DPDT relay with 5V coil and as I have an 8V supply it has a 100 ohm resistor in series. The relay coil is driven by any small signal transistor from picaxe pin0.
Diode D1 is most necessary!! Without it the 10kHz PWM causes so much overvoltage when the FET turns off that the motor just doesn’t respond to anything.


I have developed 2 ways of producing a diesel sound, which I call the shift register type and explosion type. I used the explosion type for the engine cranking sequence and the shift register type for the main diesel sound.

I produce a diesel throb sound using a shift register to produce a string of pseudo-random numbers at a rate determined by the speed of the loco – ie its motor voltage.
The shift register is programmed like this – the 6th and 7th bits in an 8 bit byte (called ‘seed’) are Exclusively OR-ed and the result put back into bit0. The value of ‘seed’ is then multiplied by 2 (ie shifted left one bit) and the process repeated after a time delay related to the speed of the engine. The shorter the time delay, the faster the engine seems to rev. The output from pin1 is a string of 0V or +5V pulses of random length
Here’s a pic from my oscilloscope..
pt X fast.jpg
pt X fast.jpg (306.54 KiB) Viewed 6558 times

The amplifier (green box) is a 8 pin chip LM386. It has a fixed voltage gain of 20.

I control the volume of the output using pin4. When pin4 is high, the diode is reverse biased and the output from pin 1 is passed to the voltage divider formed of the 4.7k, 100k and 10k resistors. So the 5V from the picaxe becomes about 5/11V at point ‘Y’ and this is amplified by 20 in the amp to give 9V. The various capacitors just get rid of some of the high frequencies and give the diesel a ‘deeper’ sound.
But when pin4 is taken to 0V, the voltage divider formed by 4.7k and 1.2k and diode means the voltage at point ‘X’ is only 1.25V instead of the 5V. So the voltage out of the amp is only around one quarter of the ‘loud’ volume. Volume is low when slowing or stopped (idle).

The battery supply to the amp is filtered by the 8.2 ohm and 1000uF to stop the motor 10 kHz PWM getting through.

As to the actual picaxe program, it’s pretty simple – the hard part is choosing the variables to get it to sound OK. Instead of using the 6th and 7th bits, you can try the 5th and 6th for a different ‘timbre’. And getting the time delay correct for a good sound is trial and error. The sound ‘sounds’ really different for different speakers and ‘enclosures’, so it’s difficult to bench test – it has to be mounted in the loco! This short video illustrates….




The program is just 3 parts. Part1 just reads the 2 input pins to see if any thing as been received from the RC. If it has, the motor control part (2) changes the voltage to be sent to the PWM, or the direction.
The direction is just ‘toggled’ for each press of the ‘D’ button on the transmitter, and also stops the motor, so is an emergency stop as well.
Pressing and releasing the ‘A’ button on the Tx causes a speed increase of about 1V. (I might make this smaller). And makes the volume loud.
Pressing and holding button ‘B’ causes the speed to slowly decrease at about 1V per second – ie a more continuous control than accelerate, to give better control of shunting. And causes the volume to be soft.
Battery voltage is around 8V and the motor doesn’t start to move till about 3.5V, so when starting from stopped the speed jumps to 3.5V with the first press of ‘A’. I have set the max motor volts to 7V, so there are only 4 speed steps (~4, 5 ,6 and 7V)
When braking, the voltage is reduced to zero after it goes below 3V.

And part 3 of the prog just keeps on shifting the register to make the sound!
A total of a whole 264 bytes of program.

Questions????
Greg from downunder.
The Sandstone & Termite's website: https://members.optusnet.com.au/satr/satr.htm

User avatar
philipy
Moderator
Moderator
Posts: 5033
Joined: Sun Jan 30, 2011 3:00 pm
Location: South Northants

Re: Building a freelance diesel for push-up duty

Post by philipy » Wed Feb 27, 2019 6:15 am

gregh wrote: Wed Feb 27, 2019 12:18 am


Questions????
Thanks Greg! Well, I did ask! :lol: :lol: :lol:

Questions? I'm sure there would be a million, but it's gonna take me a while to get my head around it. If/when I have any that are worth wasting your time on, I'll PM them rather than clog up the thread.
Thanks again.
Philip

User avatar
FWLR
Driver
Driver
Posts: 4262
Joined: Sat Aug 05, 2017 9:45 am
Location: Preston, Lancashire, UK

Re: Building a freelance diesel for push-up duty

Post by FWLR » Wed Feb 27, 2019 7:48 am

Brilliant post Greg. Although electronics are way over my head, you have done an excellent job with the sound card. Surprising how much deeper and better the sound is when the hood is on, 100% better to my hears.

User avatar
ge_rik
Administrator
Administrator
Posts: 6497
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Building a freelance diesel for push-up duty

Post by ge_rik » Wed Feb 27, 2019 7:59 am

Not a question, but an observation. I think it's amazing what you have managed to squeeze into one 8 pin Picaxe - motor control and sound! The start-up and wind down sequence is really effective and it is incredible what a difference putting the lid on makes to the sound.

A couple of questions

1 How much does your r/c and sound system cost overall?
2 I think you've nailed the synthesised sounds, but I know you experimented for a while with digitised real sounds. Did you get anywhere?

Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

User avatar
gregh
Trainee Driver
Trainee Driver
Posts: 566
Joined: Sun Apr 01, 2018 5:44 am
Location: Sydney, Australia
Contact:

Re: Building a freelance diesel for push-up duty

Post by gregh » Thu Feb 28, 2019 3:17 am

ge_rik wrote: Wed Feb 27, 2019 7:59 am Not a question, but an observation. I think it's amazing what you have managed to squeeze into one 8 pin Picaxe - motor control and sound! The start-up and wind down sequence is really effective and it is incredible what a difference putting the lid on makes to the sound.

A couple of questions
1 How much does your r/c and sound system cost overall?
2 I think you've nailed the synthesised sounds, but I know you experimented for a while with digitised real sounds. Did you get anywhere?
Rik
COST
In aussie dollars I spent around $33 - say 18 GBP. Not bad for radio control and sound !
But it is a bit dependent on how you buy the 'big ticket' items. Here's my breakdown...
That excludes the batteries and the items for the headlights.

On the 2nd question about digitised sound. I have never done anything except use some 20 second sound recorder cards. On them I have recorded whistles and horns and engine cranking sequences. My mate Geof, has done a lot more - see this link page 3 where he used five of them!
http://www.trainweb.org/btr/1620%20Class.pdf
Greg from downunder.
The Sandstone & Termite's website: https://members.optusnet.com.au/satr/satr.htm

User avatar
tom_tom_go
Driver
Driver
Posts: 4824
Joined: Wed Feb 23, 2011 3:08 am
Location: Kent, UK
Contact:

Re: Building a freelance diesel for push-up duty

Post by tom_tom_go » Thu Feb 28, 2019 7:49 am

Couldn't you use one MP3 player rather than multiple sound cards?

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests