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.

How To Modify Model Train Controller?

Status
Not open for further replies.
I know Inskip Sctc, or as it was Hms nightjar, it then became a Vlf receiver, now supposedly a cadet centre, you can see the lights from my house and work, its only 2 miles away.

I think maybe its time to try a prototype, there are many variables testing it out will tell you a lot, maybe you could do a lash up on breadboard.
 
I know Inskip Sctc, or as it was Hms nightjar, it then became a Vlf receiver, now supposedly a cadet centre, you can see the lights from my house and work, its only 2 miles away.

We used to frequent the pub in Inskip village at the bottom of the lane. Name excapes me. Also Great Ecclestone had 3 pubs at the time (mid seventies) The White Horse,The Black Horse and again one who's name I can't remember. Bet they are not there now.
I think maybe its time to try a prototype, there are many variables testing it out will tell you a lot, maybe you could do a lash up on breadboard.

I am begining to think alongh the same 'lines' (pun).
I can see the benefits of using a Zener on the bottom of R(v)2 . V would be a constant no?
Willy
 
All still there, the derby arms at inskip which recently has opened a chippy in the old toilet block, the white and black horse are still at Gt Ec, 'tother one is long one I think it burnt down.

Yep I htink a zener would be a good idea, put a 10u electro across it to damp the noise, voltage will be fairly constant, it will change as the supply varies but only by a 100 mV or so, probably not enough to notice, you could put a current source above the pot if it was an issue.
 
All still there, the derby arms at inskip which recently has opened a chippy in the old toilet block, the white and black horse are still at Gt Ec, 'tother one is long one I think it burnt down.

Yep I htink a zener would be a good idea, put a 10u electro across it to damp the noise, voltage will be fairly constant, it will change as the supply varies but only by a 100 mV or so, probably not enough to notice, you could put a current source above the pot if it was an issue.

Hi Dr Pepper
Arh yes the Derby Arms..........
Anyway .

it will change as the supply varies but only by a 100 mV.....

Not a problem really, values can be altered to suit.There will a slight fluctuation with the unsmoothed dc anyway.

Will give it a try.......
Willy
 
Ok, But the motor voltage is full wave rectified but not smoothed dc. To superimpose or swamp a pulsed voltage surely would be problamatical?
I see no significant issue. It's basically just a diode OR function between the two voltages.
Whichever is the higher voltage is the one seen by the track.
What problem do you see?
But again if you are suggesting as I think, that this pulseed voltage is applied additionaly to the motor drive voltage then again I have to suggest that resolution of the motor control would be reduced no? I would have to turn up the pot to a level which overcomes the onboard diode network before any movement occurs.
Not the way I conceive it.

The auxiliary circuits would have a diode bridge to rectify the pulses and/or the motor voltage to generate the DC for those circuits.

The motor would be directly connected to the track with no diodes, so its resolution would not be affected.

Or am I misunderstanding how the train motor works?
 
Last edited:
Hi Crutschow,
The auxiliary circuits would have a diode bridge to rectify the pulses and/or the motor voltage to generate the DC for those circuits.

The motor would be directly connected to the track with no diodes, so its resolution would not be affected.

Or am I misunderstanding how the train motor works?



You suggest that the additional supply for the onboard loco auxilaries is 'mixed/superimposed/riding etc' the track voltage for the dc motor. With the dc motor connected directly to the track without blocking diodes as you suggest, it would still present a resistive load to the aux supply being in parrellel with the diode bridge no? Also you do not mention what type of pulses, freq and duty cycle.

Allthough I have an understanding of PWM for dc motor control, it is not a method I favour. I will not go into electrical priniciples as I am sure you have an understanding as good if not better than my own! But I think without the blocking diodes the dc motor could be susceptable to possible heating, rattling and in extreme cases de-magnetism. The DC motor possibly pulling down the aux voltage source.

We should not forget that to change the direction of the motor and hence loco we change the polarity of the dc via the dp switch on the output. We would also have to do this with any additional aux supply voltage.

A plus for going with the original idea is its inherent simpicity. The output stage (at a guess) is capable of sourcing about 2 amps. A modern dc loco motor will consume between approx 250 - 500ma depending on load ( no of trucks). More than enough for additional circuits within carriages for lighting etc.

'If it a'int broke don't fix it'..............well thats what I think but am open to ideas.
Schematics on a fag packet please............
Willy
 
You suggest that the additional supply for the onboard loco auxilaries is 'mixed/superimposed/riding etc' the track voltage for the dc motor. With the dc motor connected directly to the track without blocking diodes as you suggest, it would still present a resistive load to the aux supply being in parrellel with the diode bridge no? Also you do not mention what type of pulses, freq and duty cycle.
I was thinking of short pulses, perhaps 0.1ms or so at perhaps a kHz, where the motor inductance would block any significant current from the pulses.
We should not forget that to change the direction of the motor and hence loco we change the polarity of the dc via the dp switch on the output. We would also have to do this with any additional aux supply voltage.
In you schematic that is done by a DPDT switch which would switch both signals.
A bridge-rectifier for the aux circuits will handle either track polarity.
'If it a'int broke don't fix it'..............well thats what I think but am open to ideas.
Yes.
Mine was just a suggestion, and certainly may not work well in practice. ;)
 
Hi Guys,

dr pepper.

I can see the benefits of having a constant current device on the bottom of R(v)1 and have used LM334z's for led drivers where the input source is variable. Would you consider this device feasible in the application? I would imagine a max of 10ma is enough?
https://www.ti.com/lit/ds/symlink/lm334.pdf

Also I would value your comments as to the use of a BDW93C as the output darlington.
https://www.farnell.com/datasheets/468331.pdf.

crutschow.
Yes.
Mine was just a suggestion, and certainly may not work well in practice.

The reason for going the simple route is for my benefit really. If I understand the workings of the circuit, it is easier for me to fault find should any probs occur. I have in the past tried to build circuits without fully appreciating how they work and have come unstuck due to a lack of understanding. However I would like to say a big thankyou to you. You have made me think but most of all given your time and comments which I really appreciate. Cheers to you both.

Willy

 
Yep that current source looks ok to me, take note of the 400mw max dissipation, calc the voltage across the device then x by 10ma.
And yep the bdw93 is an even better choice, if you have some hefty motors and long tracks you could put a 63v or so vdr across the o/p terminals, or 2 63v zeners back to back to absorb spikes, maybe a 100nf class x cap in series with a 100 ohm resistor across the o/p as well.

Funny I've talked to a few train enthusiasts that dont like the idea of pwm, its a very popular technique, I've never heard the demagnetization thing before, if the motor is protected from back emf I wouldnt expect with modern neo magnets for that to happen, maybe with old motors with alnico magnets it could be possible for the coils to generate a stronger reversed field than the magnets.
If you dont want pwm you have 2 options, the way your going or to use current control with feedback, the latter is impractical with rails so you might be on the right lines the way you are.

I have messed with scalextric, and yes I built a controller using a processor, the motors are controlled via pwm, I found that the characteristics of cars changed, for the better, newer mabuchi motors on dc tend to do nothing with increasing voltage then suddenly take off almost uncontrollably, whereas with pwm control is much better, part throttle cornering is possible and you can easily make cars crawl along the track, noise is the only thing, the cars sound a bit like my dewalt cordless drill.
 
Last edited:
Hi dr pepper,
Sorry for not getting back to you sooner. Its now Sunday routine down here...................it's raining

Yep that current source looks ok to me, take note of the 400mw max dissipation, calc the voltage across the device then x by 10ma.

Thanks for pointing that out. One other consideration is that with the device is in series with the pot and zener, there is an additional volt drop across the LM344z.
What effect this will have I am not sure but will be easy to determine when trialled on a breadboard.
Funny I've talked to a few train enthusiasts that dont like the idea of pwm, its a very popular technique, I've never heard the demagnetization thing before, if the motor is protected from back emf I wouldnt expect with modern neo magnets for that to happen, maybe with old motors with alnico magnets it could be possible for the coils to generate a stronger reversed field than the magnets.

In industry PWM is probably the most used as it can be controlled digitally.PC's, Plc's etc.

The Demagnetisim is a result of IR motor heating when PWM is used. I will try to explain ignoring any back emf self inductance issues. I will not teach you to suck eggs but it is a ohms law thingy. With a steady dc output of 6v, to get the same level of 'work' from pwm at 50% duty cycle the voltage would have to be 12v yes? The consequence being that during the pwm pulses the dc motor will dissapate 4x the wattage. If you halve this for the 50% duty cycle you end with a figure that is 2x the wattage of the motor under steady dc control.This is why pwm causes more heating and possible demagnetization.

If you dont want pwm you have 2 options, the way your going or to use current control with feedback, the latter is impractical with rails so you might be on the right lines the way you are.

Am now looking at a closed loop controller (although similar being a simple voltage follower) the back emf being sampled and the final output adjusted for a relatively constant speed motor. Well thats the idea.


I have messed with scalextric, and yes I built a controller using a processor, the motors are controlled via pwm, I found that the characteristics of cars changed, for the better, newer mabuchi motors on dc tend to do nothing with increasing voltage then suddenly take off almost uncontrollably, whereas with pwm control is much better, part throttle cornering is possible and you can easily make cars crawl along the track, noise is the only thing, the cars sound a bit like my dewalt cordless drill.

With four boys spead over 10 years I messed with scalextic too! I kept adding to it from jumble/boot sales etc.
For the 2 youngest boys I used to connect to old Triang train controllers directly to the track and adjust the speed of the cars for fastest without coming off the track. I would then give them the scalextric throttles connected to the blue 'martello tower' transformers but not pluged in! They would sit there for hours!!!

Now for the older boys I connected the scalextric throttles on indiviadual martello's which put them in parrallel with the triang units. Now you could boost the speed down the straights and if you got the timing right release the throttle on the curves and the preset triang transformers would take the cars around the bend! Boy did they shoot around that track.

...... noise is the only thing, the cars sound a bit like my dewalt cordless drill.

Yes, the reason for not using pwm also. I am aiming to install sound in the loco's.

Willy
 
Last edited:
With the resistance values you have the lm344 ought to be fine.

Pwm is easily controlled by digital methods, however it also benefits from high torque & efficiency (the latter in the controller).
The following is constructive criticism:
I dont argue with the demag situation with pwm, however theres a couple of things I'd have to argue with you mentioned, instantaneous power running a 6v motor at 50% from a 12v source would be quadruple the motors ratings yes, however average power would be similar to what the motor would be at 100% on 6v power, and heating would also be similar, possibly less as for the first part of the pwm pulse the inducatnce of the motor would create a current ramp starting low down further reducing average power.
If you tested a motor and it did run warmer on Pwm then I'd have to say its something to do with lc resonance from the higher voltage or posibly dumping energy into a flyback diode or snubber, or switching transients both from electronic commutation and the motors commutation, one thing Pwm does demand is good filtering on the motor side to prevent arcing of the brushes or oscillations at the switching fet.
Magnetic field loss as I understand it starts to happen around the curie point which is hot, over 200 degrees, unless it has a lesser effect lower down.
I wonder if either Pwm has earned a bad rep with model trains due to poor setup (manufacturers of controllers wouldnt have any control over the loco installation) or the track layout worsening some of the above.

Closed loop will compensate for voltage controls lesser torque, your only issue would be getting shut of the heat from a linear reg, how are you going to get feedback?, not much of an issue if the controler is in the loco, if not then maybe armature coil feedback will work, have a look here:
https://www.romanblack.com/encoder.htm

I too have probably spent too much time on scalextric, better than watching pants on telly though.
 
But seriously, been on this thing all day had enough. Thanks for the comments. Will sleep on them as unlike most, don't have to get up for work anymore!
Willy
 
Its not so much the telly, more the adverts.

I wish I didnt have to get up at 5 and go and attend with a load of zero watt bulbs run an alcoholic maniac.
 
Its not so much the telly, more the adverts.


Arn't the adverts the entertainment they put on between the **** programs? I normally make a cup of tea between them! But at my age could be the onset of..........err.........................................
I wish I didnt have to get up at 5 and go and attend with a load of zero watt bulbs run an alcoholic maniac.

Eh?...........................Anyway.

My last job was a fill slot for a few months sub contract. My imediate 'superior' (f'in joke) had OCD, a chip on his shoulder being of Malteese origin, a contol and power freak and had little man syndrome. Not forgetting he had only minimum qualifications.Usual sort. 'Omes law is wip yer feet etc. I went in one monday and decided enough was enough. Turned around and walked. Retired there an then.

Still, back to the future.........

With the resistance values you have the lm344 ought to be fine.


I have to ask in my ignorance, as the zener will hold the voltage constant irrespective of the current through it (thats how they work isn't it?) why do you consider I need the LM344? Just a thought.

The following is constructive criticism:
Its welcome.

With the resistance values you have the lm344 ought to be fine.

Pwm is easily controlled by digital methods, however it also benefits from high torque & efficiency (the latter in the controller).
The following is constructive criticism:
I dont argue with the demag situation with pwm, however theres a couple of things I'd have to argue with you mentioned, instantaneous power running a 6v motor at 50% from a 12v source would be quadruple the motors ratings yes, however average power would be similar to what the motor would be at 100% on 6v power, and heating would also be similar, possibly less as for the first part of the pwm pulse the inducatnce of the motor would create a current ramp starting low down further reducing average power.
If you tested a motor and it did run warmer on Pwm then I'd have to say its something to do with lc resonance from the higher voltage or posibly dumping energy into a flyback diode or snubber, or switching transients both from electronic commutation and the motors commutation, one thing Pwm does demand is good filtering on the motor side to prevent arcing of the brushes or oscillations at the switching fet.
Magnetic field loss as I understand it starts to happen around the curie point which is hot, over 200 degrees, unless it has a lesser effect lower down.
I wonder if either Pwm has earned a bad rep with model trains due to poor setup (manufacturers of controllers wouldnt have any control over the loco installation) or the track layout worsening some of the above.

Closed loop will compensate for voltage controls lesser torque, your only issue would be getting shut of the heat from a linear reg, how are you going to get feedback?



...............I dont argue with the demag situation with pwm.


I think this is more of an issue wrt to time or age of the motor used under pwm control.

...........instantaneous power running a 6v motor at 50% from a 12v source would be quadruple the motors ratings yes, however average power would be similar to what the motor would be at 100% on 6v power,

Forgive me. Surely that statement is contradictional no? Amount of work done would be equal yes, but twice the energy would be extended doing it no?

......quadruple the motors ratings yes

Which in effect is twice the pwr dissipation with a 50% duty cycle and a square wave.?

Not arguing, discussiong.

A few things not mentioned are the freq, the shape, etc of the waveform. Also I know of systems where the amplitude of the pwm is variable.

As I have stated previously, the aim is to configure a controller to source a voltage to onboard loco's for use of a sound system.
Simple PWM systems are inherently noisy mechanically. We also have to consider the fact that transmission via the track is also electrically noisy. I need the motion aspects of the toy train to be quiet! Hence my chosen method which has only been arrived at by reading online documentation etc.

one thing Pwm does demand is good filtering on the motor side to prevent arcing of the brushes or oscillations at the switching fet.

Would this be on the controller side or after transmission via the track to the motor? I do not think it feasible to filter inside a loco as you have nowhere to 'dump ' any noise accept onto the 'zero volt rail'.

I wonder if either Pwm has earned a bad rep with model trains due to poor setup (manufacturers of controllers wouldnt have any control over the loco installation) or the track layout worsening some of the above.

No manufacture's make any allowance inside a model loco for pwm control.

Closed loop will compensate for voltage controls lesser torque, your only issue would be getting shut of the heat from a linear reg, how are you going to get feedback?, not much of an issue if the controler is in the loco, if not then maybe armature coil feedback will work

At the moment I am looking at a simple controller which has a BC107 on the front of the darlington as a comparator . The voltage on its emitter ver the voltage on its base.

I have to say that one aspect not considered previously is the method of how the sound is synced to the movement of a loco. I have a simple circuit that allows me to input midi data to a pc which triggers sounds relative to this movement. With PWM some may consider it easier but the issue with mechanical noise is still there. Hence why I am up to now going the road I am. Also pse take into account that my methods are basically very simple. I am using what little knowledge I have to connect pieces from different jigsaws to hopefully achieve my aims with help from people like yourself's.

https://www.romanblack.com/encoder.htm
Took a look at this site, things of interest.

Laters...

Willy
 
Last edited:
Some 'people' I work with are when it comes to brightness zero watts, and the gaffer is a maniac boozer who's very good at amateur dramatics.

LM334 not LM344, now I have Alzheimers, sorry I meant a current source LM334, the idea is to keep current through the chain constant, and because voltage is dependant on current the voltage would also be constant which is the aim.

Pwm is the amount of energy over time, so if you push at a rate of 2 for only half the time, your actual push rate would be 1.
Also if you turn a 100w bulb on for a second then off for a second, if you measured the power used over a minute it would be 50w.
If you pulse something like a motor at a high rate you dont notice the on & offs it all blends into one reduced 'push'.

Yes noise is perfectly good argument and a good enough reason to stick with Dc, I have a clock made from a decca navigator display, I've made a few clocks from old aircraft instruments, anyway its a 3 pahse motor, I drove that from an arduino usign Pwm to make 3 phases, it was noisy, but I managed to overcome that by shifting the Pwm frequemcy up to supersonic, however this might not be a good idea with motors using brushes, as the Pwm commutation might be higher than the motors own commutation.

Noise would have to be snubbed both in the loco and at the power source, 3 caps would probably do the trick.

Yes manufacturers are at the mercy of hobbyists with Pwm, they might say use use a snubber or else, but that doesnt mean to say that the customer will, and if the motor burns out they get a bad name.

Simple is good it will probably work.

Your speed control is straight forward Dc, well I'm sure if you search google you'll find a Dc voltage to midi note converter, possibly with timbre or whatever you call it when you hit a piano key ahrder, so you'll be able to change the frequency of the 'engine' and its volume, if you go the arduino route assuming you can find something you dont even need a programmer, its built in.
 
Some 'people' I work with are when it comes to brightness zero watts, and the gaffer is a maniac boozer who's very good at amateur dramatics. OH DEAR!!

LM334 not LM344, now I have Alzheimers,
You can still spell the word? Your one of the lucky ones! We shouldn't take the **** though.

..........sorry I meant a current source LM334, the idea is to keep current through the chain constant, and because voltage is dependant on current the voltage would also be constant which is the aim.

But the voltage on the Zener is constant irrespective of current? But I do see where you are coming from.

Pwm is the amount of energy over time, so if you push at a rate of 2 for only half the time, your actual push rate would be 1.
Also if you turn a 100w bulb on for a second then off for a second, if you measured the power used over a minute it would be 50w.
If you pulse something like a motor at a high rate you dont notice the on & offs it all blends into one reduced 'push'.

With respect appreciate all this.

Yes noise is perfectly good argument and a good enough reason to stick with Dc, I have a clock made from a decca navigator display, I've made a few clocks from old aircraft instruments, anyway its a 3 pahse motor, I drove that from an arduino usign Pwm to make 3 phases, it was noisy, but I managed to overcome that by shifting the Pwm frequemcy up to supersonic, however this might not be a good idea with motors using brushes, as the Pwm commutation might be higher than the motors own commutation.

Noise would have to be snubbed both in the loco and at the power source, 3 caps would probably do the trick.

Yes manufacturers are at the mercy of hobbyists with Pwm, they might say use use a snubber or else, but that doesnt mean to say that the customer will, and if the motor burns out they get a bad name.

A lot of railway modellers 'operate' their ' layouts' with pwm. Operate = Play, Layouts = Trainsets!
It is widely used. But as I said mechanical noise is the issue for me. Arguably I believe a controller of the type I wish to use is more smoother in operation. But just my own preference.


Your speed control is straight forward Dc, well I'm sure if you search google you'll find a Dc voltage to midi note converter, possibly with timbre or whatever you call it when you hit a piano key ahrder, so you'll be able to change the frequency of the 'engine' and its volume, if you go the arduino route assuming you can find something you dont even need a programmer, its built in.


This side sorted. Midi input/output usb modules (Pic ) are easily and cheaply available. Do not use voltage to midi note convertor as it is my preference to keep DC Track voltage isolated from 5v TTL and USB , PC. With ref to timbre u mean velocity. Now if you need anyhelp with midi I am your man!


Willy
 
Good to see your getting there.

If you dont want to connect track and midi power together and you still want the 2 to work with each other you could assemble a voltage to frequency converter with its signal input from the track voltage, and then put that through an opto isolator to the pic, so the pic gets a a speed to frequency input.
The vco part of a 4046 would do the v to f, and a lm2917 would do frequency to voltage if you like analogue.

Midi from memory is optically not electrically connected in most devices anyway, more your thing than mine though.
 
Hi Doc pepper,
sorry for not coming back sooner but with what little time iv'e had been looking at v to f convertors.
But first....
I am still a little non-plussed (?) over the use of the constant current device between R(v) 1 and the zener. My concerns being around the Vd of the former device. From experience these drop about 2 volts. How would this effect the circuit? Would I still have zero volts when the pot is 'off'? If not I would possibly still have movement of the dc motor? Though mention should be made that these motors do not turn untill approx 1.5/2v. But just a thought.
Secondly your mention of v to f conversion has set me thinking of another aspect of this project which you intimated at namely that of a relative speed input.
Returning to Midi briefly, there are nominally two type of signals. Events like note on, note off and duration and CV (control variables, volume pan etc) nominally 0 - 5v. I need to represent the speed of a loco via a variable TTL frequency. I have been looking at a AD654 and think that it is now time to start a new thread nominally utilising this device or any other that may be suitable. Look out for it and hope to see you there!

Willy
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top