Continue to Site

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.

  • 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

Status
Not open for further replies.

granddad

Well-Known Member
Most Helpful 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
 
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..
 
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 ...
 
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..
 
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?
 
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:
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 !
https://www.minidcc.com/

000074.jpg
000075.jpg
 
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 ... ..
 
! 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?
 
The locos just take power from the track.. packets are variable length serial over Bluetooth..
 
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 )..
 
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 ..
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top