# DCC on PWM



## rva1945 (Feb 11, 2016)

Hi:

Some decoders come ready to run on conventional DC layouts. I guess those decoders detect a DC voltage and enters in "DC mode".

Now, my analog layout works on PWM (Pulse Width Modulation) to control the loco speed, instead of varying the voltage. Will a decoder work on that or will it get confused by the pulses, and worse, be damaged?


----------



## wvgca (Jan 21, 2013)

In general, you should have no problems, the DCC is also a form of PWM signal, but the width can change within each 'packet' to send control signals ..where as a DC PWM supply sends consistent pulse widths determined by throttle position

hope that makes sense to you?


----------



## rva1945 (Feb 11, 2016)

I do know what PWM is as I made my homemade PWM throttle using an Arduino board and an amplifier.

I know that analog layouts run on DC or AC current, not PWM, so I think decoders are designed to detect such types of power and act accordingly, i.e. let the current from the rails control de motor and do nothing.

I wonder if a PWM will ruin a decoder that normally expects a bipolar, coded signal (DCC).


----------



## wvgca (Jan 21, 2013)

rva1945 said:


> I wonder if a PWM will ruin a decoder that normally expects a bipolar, coded signal (DCC).


I would say no, based on that the decoder will only accept PWM signals of [first] specific length, and [second] the for DCC signals to be valid, they have to be in a specific format which involves sequential changes in the width of individual pulses contained within each 'packet , which no DC PWM supply can duplicate .
pulses not meeting those requirements are normally ignored


----------



## fcwilt (Sep 27, 2013)

Hi,

DCC decoders often don't work very well in DC mode.

YMMV.

Frederick


----------



## gregc (Apr 25, 2015)

rva1945 said:


> I know that analog layouts run on DC or AC current, not PWM,


A DC voltage turned on and off either periodically (PWM) or randomly will have some average voltage over some period of time that a DC motor will react too.

PWM is one way to generate a DC voltage. pulse density modulation PDM is another. There's no reason why you couldn't use both linear and PWM throttles on a DC layout.

I wouldn't say "my analog layout works on PWM (Pulse Width Modulation)". You're using a PWM throttle to control DC locomotives.



rva1945 said:


> so I think decoders are designed to detect such types of power and act accordingly, i.e. let the current from the rails control de motor and do nothing.


I don't know of any decoder that doesn't use an h-bridge to generate a PWM voltage across the motor.

when in DC mode, I see no way a decoder can control a motor except to measure the average DC voltage across the rails and generate a comparable PWM signal across the motor.




rva1945 said:


> I wonder if a PWM will ruin a decoder that normally expects a bipolar, coded signal (DCC).


I have a PWM throttle I use on my layout to check out new locomotives that don't have decoders. I was surprised when my DCC locomotive started moving. I was told it recognized the track voltage as DC and switched to DC mode. Performance wasn't real good but the decoder was not damaged.


----------



## time warp (Apr 28, 2016)

I am curious about what the waveform characteristics would look like from a pwm throttle. I work with 480 volt pwm controls and I know how they behave, but I was curious as to whether motor heating would be an issue with a DC motor on a pwm throttle.


----------



## fcwilt (Sep 27, 2013)

time warp said:


> I am curious about what the waveform characteristics would look like from a pwm throttle. I work with 480 volt pwm controls and I know how they behave, but I was curious as to whether motor heating would be an issue with a DC motor on a pwm throttle.


The waveform can vary greatly depending on design.

A pure PWM design will look like you would expect and heating can be a problem.

Because of this some designs increase the pulse OFF voltage as the throttle is advanced resulting in pure DC (or nearly so) at max throttle.

And I would imagine there have been other variations.

Frederick


----------



## time warp (Apr 28, 2016)

I've been thinking about it and I didn't know if you would tend to see more of a Sawtooth waveform or a zero reference Square wave. I'll shut up about it now so I don't take you off topic. Thanks


----------



## gregc (Apr 25, 2015)

time warp said:


> I've been thinking about it and I didn't know if you would tend to see more of a Sawtooth waveform or a zero reference Square wave. I'll shut up about it now so I don't take you off topic. Thanks


not sure why you would expect a saw tooth. The transistor (mosfet) in a PWM motor driver is rapidly switched on/off. So aside from rise/fall times across the load, the output is a pulse.

One advantage is little wasted power across the transistor because when it is on, there is little voltage dropped across it. This means no need for a heat sink. (typical on resistance is 0.04 ohm. At 1A, this means 0.04V and 40 mW).

Anything less than full on wastes power. At half the output voltage the wasted power across the transistor equals the power to the motor.

I was also told years ago that DC motors don't like PWM voltages. But I believe these issues are alleviated by high switching frequencies (>100 kHz or at least above audible ~20 kHz).


----------



## crusader27529 (Apr 3, 2016)

rva1945 said:


> Hi:
> 
> Some decoders come ready to run on conventional DC layouts. I guess those decoders detect a DC voltage and enters in "DC mode".
> 
> Now, my analog layout works on PWM (Pulse Width Modulation) to control the loco speed, instead of varying the voltage. Will a decoder work on that or will it get confused by the pulses, and worse, be damaged?



The way a DCC decoder 'decides' to go into DC mode is by NOT detecting a DCC signal, and interpreting a DC voltage in order to generate a signal to the motor that's an approximation of the speed the DC voltage would generate if it indeed was a DC loco.

So, depending on how the DCC logic is designed, it probably will NOT go to DC mode because it sees a signal that'd NOT DC, but still NOT DCC. The decoder will probably just not be able to decide if it's on a DCC or DC system.

My guess is that it won't work as if it was DC, but shouldn't cause any harm.

Remember, my advice is worth exactly what it's worth.....


----------



## time warp (Apr 28, 2016)

You are definitely right on the waveform.
I knew as soon as I said that it was not correct. The reason for my initial question was that in the 1980s we were experimenting with different types of controls to see what kind of results we would end up with.
This was at the time that can Motors were just coming in to the marketplace and just gaining acceptance, so most of our experimentation was with open frame 3 and 5 pole Motors.
I was comparing pure DC performance against transistor throttles and scr controls which we were breadboarding at the time.
Long story short, I lost several Motors because of overheating, and after a while living life got in the way and I just forgot about it.
Had I been performing tests with can Motors I believe my results would have been better, but this is an unknown to me. Thank you for your kind answer and being patient with a rusty brained old man.


----------



## fcwilt (Sep 27, 2013)

Hi,

Over the years folks have tried different waveforms in the quest for better performance.

I think I recall seeing a design that used a sawtooth BUT my memory is not what it used to be.

And my attention span isn't - oh look - a squirrel!

Frederick


----------

