• Welcome to 009 Society Members Forum.

A new PWM controller

Started by Hugh Norwood, April 18, 2013, 13:59

Previous topic - Next topic

Hugh Norwood

A PWM controller.

My fellow LAMPOONS know that I dabble in the dark arts (of electronics). Well, I recently started to think again about the subject of pulse-width modulation for motor control. One problem is to find a simple circuit that can offer as full a range of mark:space ratio as possible - ideally from fully off to fully on.

My previous idea had used two integrated circuits and a lot of faffing around finding the right resistors.

This time, my thoughts fell on the following circuit, which is the standard way of getting a 1:1 mark-space ratio from the ubiquitous 555 timer.


The device output (at pin 3) is used to both charge and discharge the capacitor through the resistor. What, I thought, would happen if I replaced the resistor with a potentiometer (variable resistor), where the device output is connected to the pot's wiper, and the pot's two ends connected to the capacitor through two diodes connected the opposite way round (see figure 2)

In this case the capacitor is charged through one side of the pot, and discharged through the other side; this would change  the mark:space ratio of the signal as the pot's shaft is rotated.


I made up a test circuit and was pleasantly surprised to see that not only did it indeed work, but the mark:space ratio could be changed from almost fully off to almost fully on. Eureka - to coin a phrase.

Figure 2 shows the complete controller. The 7812 12volt power stabiliser is an optional extra and serves to provide a nice 12V supply limited to 1amp. Since the timer I.C. works at low voltage, this could be changed for a 7805 to run at 5V for low-voltage motors. I have used the low-power 7555 timer IC. The circuit does not show the d.p.d.t. centre-off switch that controls the motor direction.

The circuit oscillates at around 20kHz - which changes remarkably little over the full range of the pot's travel. this frequency should be high enough not to cause heating in low-inductance motors.
Hugh Norwood
Angst-Lesspork

Isle of Stoner


Krizzy

.................and some say soldering a kit together is a dark art.

Hugh, are you going to bring your creation along to the AGM. i'm sure it will create a lot of interest.

Roger

Graeme Dunbar

Excellent! Good to see another dabbler in the art of Electrickery.

I've been trying something similar:
http://www.youtube.com/watch?v=kw8SCKRFH_U

It was an experimental circuit and I took a different approach. My primary concern was for slow speed running (T gauge trains race around). Also, the load that engines pull is very low, so I hoped to get away with slow pulses rather than what you have which is "true" PWM or DC chopper control. (You can hear the train buzzing.) At 20 kHz the motors should "see" an "averaged" DC but low frequencies give pulses of full voltage that can burn out coreless motors.

For me to take it further needs a more sophisticated controller I think. Perhaps a combination of pulses and high frequency PWM
Graeme Dunbar - 4441

Hugh Norwood

Quote from: Krizzy on April 18, 2013, 17:01

Hugh, are you going to bring your creation along to the AGM. i'm sure it will create a lot of interest.

Roger

Certainly, if you like, but as I'm a passenger, I can't really bring along a test track...
Hugh Norwood
Angst-Lesspork

Hugh Norwood

As I have mentioned in another place, I have tested this out on some of my locos on a section of track. (I can't easily set up Angst at home for a test run)
Hugh Norwood
Angst-Lesspork

B.Meldon

This looks interesting indeed.

I am not an electronics person myself so much of what I ask below may be nonsense but
Brian Meldon

Hugh Norwood

Q: What levels of V and A will be going through the variable resistor and as a consequence how long do you think this will last in use?

A: Nothing to worry about. Max voltage across the pot will be 12V, Current flowing through will be small considering the capacitor is only 2nF. The pot is likely to fail mechanically first, I would suggest.

Q: Have you given any thought as to short circuit protection? Or if two are used on a layout these become connected by accident when a loco runs over a section joint.

A: The 7812 provides short circuit protection. No idea what may happen if you put two together either by accident or on purpose.

Q: One issue with some pulse type controllers relates to high current levels over the pulse cycle at low speeds for long periods. In other words a loco running very slowly for a few minutes. This does not show up on a normal amp meter but can be seen using an oscilloscope.

A: I have no idea what you mean by this statement.

Q: From what I understand the heat generated is a result of the physical design of the motor and its relative impedance to the frequency used. Some motors are fine where others will overheat.

A: Yes indeed. This runs at 20kHz

Hugh Norwood
Angst-Lesspork

Tigger

Hugh -very simply - I'm bloomin' impressed!!  Well done and many thanks for sharing!!
:)

B.Meldon

Quote from: hughn on April 19, 2013, 11:20

Q: Have you given any thought as to short circuit protection? Or if two are used on a layout these become connected by accident when a loco runs over a section joint.

A: The 7812 provides short circuit protection. No idea what may happen if you put two together either by accident or on purpose.

Even with the best intentions this will happen on a sectional layout with more than one controller so it is probably important to know if it will damage the controlers.

Quote from: hughn on April 19, 2013, 11:20

Q: One issue with some pulse type controllers relates to high current levels over the pulse cycle at low speeds for long periods. In other words a loco running very slowly for a few minutes. This does not show up on a normal amp meter but can be seen using an oscilloscope.

A: I have no idea what you mean by this statement.


As I said this is not my field at all so perhaps I have got it all wrong or I am describing it in the wrong terms. However I think with some controllers the time of the pulse is longer at slower speeds. In other words there are fewer pulses but the pulses that there are last for longer. This obviously the loco will run slower. But if you work out the total power in the motor over the pulse cycle it can be quite high, but it is dependant on the impedance of the motor as to how much of this will be dissipated as heat in the motor. Basically the motor will see more of the pulse or less depending on its physical design and the frequency of the pulse.

Some examples are the Arnold motors and the plastic Bachmann motors (as used in the 0-4-0) that get very worm, yet the motors used in Roco locos do not get hot at all.

As I said this is not my subject so I could have this all wrong, but what I have seen is that some motors get hot on pulse controllers and some do not.

Brian Meldon
Brian Meldon

gtmspyder

Thirty years or so ago, I was invited to take a 4x2ft 009 rabbit layout I had made my daughter, (Or at least, that was my excuse for the exercise) to the York exhibition by Mike Cook.

The layout did not have it's own controller as I was using the controller from my then EM gauge layout of Ballquider junction on the Callendar and Oban layout, so I decided to experiment with the then newish lighting dimmers.

I fitted a fused 240/12v transformer and rectifier into a box with the supply controlled with a Crabtree lighting dimmer.

The loco stock I was using was the Lilliput 060's, and under this control, the motors literally ticked over and barely perceptively moved. I was able to run four locos tail chasing round the layout with only an occasional section off switch being used off scene to stop a faster running loco from catching it's predecessor.

Regards,

BrianT.
Glen Ogle 009.
Knottworthy Magna 0-16.5
Burrowby Underwood 009 Rabbit layout
Wuhlen Unterwald HOe loan layout.
New 009 layout Knott Mine Colliery and Gas works.

Hugh Norwood

Quote from: gtmspyder on April 21, 2013, 10:08
I fitted a fused 240/12v transformer and rectifier into a box with the supply controlled with a Crabtree lighting dimmer.

BrianT.

Well! That's an interesting way to do it. Wouldn't recommend recommend it...
Hugh Norwood
Angst-Lesspork

Hugh Norwood

Brian M,
I'm still not quiet sure what you mean. My unit keeps the pulse repitition frequency pretty constant over the entire range. Because it operates at 20kHz (50 microsecond repititon time), it should be OK with small motors and corelss ones (i.e. those with low inductance)

Before pronouncing on older commercial PWM units, I would prefer to investigate how they operate, so if anyone wishes to lend me one, I could have a look. Generally speaking, those that operat at 100Hz (i.e. tiwce mains frequeny would, I suspect, be unsuitable for low-inudctnace motors.
Hugh Norwood
Angst-Lesspork

Hugh Norwood

I took my controllers to the Rainford meeting (Excellent day, chaps - well done)

The PWM uint worked fine, except that I found it drove Roger's Graham Farish chassis slowly along even when at "zero". I don't myself have one of these new chassis to playwith, so I can olny guess that it has a very good motor in it that is sensitive to the tiny pulses the PWM controller puts out at zero (it can't switch off entirely)

What was very ecouraging was that my feedback controller ran this same chassis very smoothly. - Apparently "commercial" feedback controllers cause this type of chassis to go erractically! I'l create a new thread about this controller.
Hugh Norwood
Angst-Lesspork

Graeme Dunbar

#14
To the best of my knowledge what you say is correct Hugh (edit: last message but one). Some time ago a member of MERG (Model Electronic Railway Group) did the analysis that showed how low frequency PWM cause heating problems in low inductance motors (e.g. coreless motors) where dc and high frequency PWM (e.g. 20 kHz as you use) do not.

With low frequency pulses, it is operation at slow to moderate speeds that causes problems (short ON to OFF time ratio). At very low speeds (very short ON pulses and long gaps) the average power and heating is low. At high speeds (long ON to OFF ratio) the motor is spinning and generating a sizable back emf that limits the motor current.

Of course if you stall the motor (lock the shaft) and apply full voltage the motor will probably burn out no matter whether you use high frequency PWM, low frequency PWM or dc, unless you limit the current. However if the current limit cuts in too quickly then it prevents the controller giving the initial "kick" to get the motor turning which negates part of the reason for using PWM in the first place**.

I have considered, but not yet tried using a "polyfuse", a positive temperature coefficient thermistor or other system to act as a thermal cutout to take effect after short delay.

** Edit: if using low frequency pwm.  At high frequency the motor inductance limits the time the current has to build up and decay, smoothing it to a ripply dc.

Graeme Dunbar - 4441