• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PWM and small 12 v and '00' gauge model train

granddad

Active Member
I am experimenting with a small model train trying to produce realistic movement , I'm using a MAX14870 driver. and a PIC .. getting movement is not a problem , but as I expected , slow speed is rather random (and whistles) with a short PWM value.. It is just a square signal at the moment , any ideas what can be done to obtain better results..... perhaps a ramp. a bias voltage or different signal ..
loco.jpg
 

Ian Rogers

User Extraordinaire
Forum Supporter
Most Helpful Member
Are you using DCC?

DCC has a whole host of parameters to make a train behave "train like" I have a list of ancillary commands.. If you dont use DCC but want to, I have firmware for the train, and all the protocols..
 

granddad

Active Member
Hi Ian I looked at DCC ... Mmm .. felt it rather complex for a loco ..all it can do is .. Go to (Speed) and direction.. where Speed will be Zero = stop and up to its maximum ( sound and lights could be additions ) so thought was to build a profile for each loco.. as I posted the minimum speed is a bit flaky ...
 

Ian Rogers

User Extraordinaire
Forum Supporter
Most Helpful Member
Most folk send trains going at 100's of MPH.. In reality 40 MPH n this scale is quite slow.. But if you video and watch it back it is more realistic.

DCC isn't very complex... It gives you total control over all the aspects… Several loco's on the same line and all the points and other stuff controlled by the same controller... I have been watching several video's and it is awesome..
 

alec_t

Well-Known Member
Most Helpful Member
any ideas what can be done to obtain better results
Have you tried varying both the PWM pulse width and the PWM pulse frequency to get a smooth start?
 

granddad

Active Member
Thanks for the input.. As i understand it DCC , modulates the drive power to the rails with the serial data , this has to be rectified then smoothed , then switched by the DCC decoder, at all stages power is lost . idealy you have to start at a higher voltage. The DCC message strings seem over complex and was probably designed for other systems ? several locos on a singgle track.. OK I have already taken into account, points and track devices also ... Alec I have not tried to changed freqency, I have a fixed 100 hz time base .. will give it a go thanks.. It is the starting from a standstill that is a bit random ..could be I need a block of power for the first pulse ...

EDIT I just checked my time base its 3 khz probably too high..don't know why it was 100 hz..
EDIT 2 .. Now running time base at 1 . 95khz and loco low speed much improved...
 
Last edited:

Wp100

Well-Known Member
Have you seen this very old Maplin project which seems to offer what you need.

We did build it many, many years ago, it did work, but cannot remember how good the low speed was, but it was not that bad otherwise we would have scrapped it.

Operates on a PWM, though the text does not mention what frequency.

DCC can be a revelation, but also as complex or simple as you want it to be.
We use this simple diy rotary control system ; you can even get diy ones that use your mobile phone as the controller !
http://www.minidcc.com/

000074.jpg000075.jpg
 

granddad

Active Member
Many thanks WP100 .. I have the 4 channel controller built and being developed. Each train has its own command decoder, driver, address and name to identify itself to the controller, projected system will not be limited to the number of locos, signals, points etc ...Currently I am trying to get a realistic motion , both to accelerate and decelerate and save this to a profile for that engine in the controller memory (dsPIC33EP512GM304 and 24LC256);
Think need more track I only have 1 yard length and one engine ! wish i had kept all my Hornby stuff from 50 years ago ... ..
 

Ian Rogers

User Extraordinaire
Forum Supporter
Most Helpful Member
! wish i had kept all my Hornby stuff from 50 years ago ... ..
It was Triang back then... The rails were deeper and the loco's running on Hornby had to have the wheels turned to suit.. I still have a load of Triang gear.. Big heavy stuff, Hornby tracks break too easy.. If I may ask?? How are you modulating your data packets? Similar to DCC?
 

Ian Rogers

User Extraordinaire
Forum Supporter
Most Helpful Member
Oh okay... Pretty good idea... I could get HC06 boards into the engines especially my tender engines.. I have ported several engines to DCC but I need a good place to lay down a decent sized layout.. I have little servo motors operating signals and points ( turnouts )..
 

granddad

Active Member
Im using HC06 - HC05 at the moment.. but investigating JDY-10 module .. my prototype is way too big at the moment.. JDY-10 seems to have a PWM on an output pin ..
 

EE World Online Articles

Loading

 
Top