# Driving a DCC model railway track with +/- 15V

Discussion in 'General Electronics Discussion' started by jimutt, Jan 26, 2015.

1. ### jimutt

4
2
Jan 26, 2015
Hi!

I'm planning for a project where I will need to produce a square wave ranging from -15v to 15v. So I need a fast way to switch between a +15 and a -15 V power source.

The switching will be controlled by a microcontroller, other than that there are no other requirements. Well other than that the switching time should preferably be less than 1 - 2 μS and the circuit should work for currents <2A.

I'll be very grateful for all advice I can get. I could probably implement a working solution but I'm afraid it really would not be the best one. Just ask if you want any more information.

5,165
1,087
Dec 18, 2013
Hello
Can you just clarify something? Do you want the signal to go from 0V to +15V and then switch to 0V to -15V or go from 0V to +15V back to 0V and then to -15V.
Thanks

3. ### Gryd3

4,098
875
Jun 25, 2014
I can think of two ways currently...
Using methods found in audio amplifiers, a split rail power supply and a pair of transistors. (Class A-B or Class D... without the PWM)
Additionally, if the square wave will always be +-15 V, you could generate a 0V - 30V Square wave and make use of a virtual ground at 15V.
What are you trying to accomplish? What will you connect it to?

4. ### jimutt

4
2
Jan 26, 2015
@Arouse1973 It'll be used to create a waveform like this one: http://www.dccwiki.com/images/d/d6/WAVE1.JPG

Thank you for your feedback @Gryd3 . It will be used to create a custom control system for a DCC railroad (DCC is the standard for digital model railroads) where the voltage for both of the rails will be alternating between +15 to -15 v to produce a signal like the one in the link above.

5. ### Gryd3

4,098
875
Jun 25, 2014
I'm not too terribly familiar with DCC, will this device be providing power as well?
Or will be be coupled to a DC source?

I'm bouncing ideas around in my head to see if a 30V p-p Square wave can be coupled with a capacitor to the rails (providing a -15 to +15V square wave) , or perhaps the use of an H-bridge... but I'm certain the controller will need to be designed with a similar topology to an audio amplifier.

jimutt likes this.
6. ### KrisBlueNZSadly passed away in 2015

8,393
1,270
Nov 28, 2011
Yes, agreed. I'd use regulated +15V and -15V rails, and a half-H driver using MOSFETs.

That could generate quite a lot of interference with rising edges of 2 µs or shorter!

What is the operating frequency? Does the output stream include encoded data?

Edit: See
https://en.wikipedia.org/wiki/Digital_Command_Control
http://amakersblog.blogspot.com/2011/01/controlling-model-trains-with-arduino.html

That second link shows a representative circuit design (not complete) using an H-bridge powered from a single +12V rail. There is no need for a split supply - the H-bridge can just apply a single supply voltage to the tracks either way round.

Last edited: Jan 27, 2015
jimutt and Gryd3 like this.
7. ### jimutt

4
2
Jan 26, 2015
Thanks @KrisBlueNZ and @Gryd3 . An H-bridge will probably be the best solution for this problem. I've found some DIY projects and almost all of them are using H-bridges for the switching.

If you want to know more about what frequencies we are talking about you can look at this signal specification: http://www.nmra.org/sites/default/files/standards/sandrp/pdf/s-9.1_electrical_standards_2006.pdf
As you see we're talking about quite precise timing when it comes to representing binary 1. And yes Gryd, the locomotives get both the power needed to operate the motor as well as the control commands through the rail.

8. ### Gryd3

4,098
875
Jun 25, 2014
Thank you for the link, that helps clear up the requirements for the signalling.
If this controller is providing signalling and power to the rail, grab a 15V power supply, and an H-bridge. The limitations here will be switching speed, and current output.
You said further up that you were fine with < 2A (Less than 2 Amps?) or do you want more?

9. ### jimutt

4
2
Jan 26, 2015
@Gryd3
I'm only running a small N-gauge track so 2A will be sufficient. I went ahead and bought a LMD18200 H-bridge and it works just great I got the basic commands up and running controlled by an arduino a while ago and now I'm transfering the software part to a PSoC board instead. But the H-bridge solution works really well.

KrisBlueNZ and Gryd3 like this.
10. ### Gryd3

4,098
875
Jun 25, 2014
Good to hear. Monitor the temperature on that to ensure you won't run into issues when you begin to switch larger loads. (Simply adding a heatsink would be good.)