Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

DCC CV 3,5 and 6

518 views
16 replies
1 rating 2 rating 3 rating 4 rating 5 rating
  • Member since
    February, 2017
  • 15 posts
DCC CV 3,5 and 6
Posted by originaldirtguy on Friday, March 17, 2017 11:49 PM

I am wondering what the purpose/advantage is to setting a low, mid, and top voltage using CVS 3, 5 and 6. I thought the max voltage was always sent to the motor via PWM. Can someone offer a little insight on this? Thanks. 

Moderator
  • Member since
    June, 2003
  • From: Western PA
  • 13,155 posts
Posted by tstage on Saturday, March 18, 2017 12:26 AM

It's just a quick 3-step method for setting the start voltage (CV3 CV2), maximum voltage (CV5), and mid-voltage (CV6) to any DCC-equipped locomotive.

Prototype locomotives had different top speeds.  For example, an SW1 switcher would never go as fast as a EMD E8; nor an 0-8-0 switcher as fast as a 4-6-4.  By adjusting the value of the maximum voltage (CV5) from, say - "255" to "128", you've quickly cut your top speed roughly in 1/2 so that the switcher will never exceed it's maximum prototype speed with the DCC throttle at speed step 128 (open wide).

The value for start voltage (CV3 CV2) can be raised or lowered so that the switcher just starts to crawl at speed step 001.  Mid-voltage or mid-range adjusts how quickly or slowly the speed of the locomotive increases between speed steps AND where between start voltage and maximum voltage it will increase the quickest or slowest.

The other method is to add values to what's called a speed table.  This requires you to add a value for 28 individual CVs, or CV67-CV94.  So, CV67 would be your start voltage, CV94 your maximum voltage, and CV68-C93 would increase either linearally or exponentially; depend on what values you entered for those CVs.  This method allows for more fine tuning of a locomotive's speed by adjusting the individual voltages between start voltage and maximum voltage.

Unless you use Decoder Pro, it's somewhat laborious to set up a speed table.  So, setting CVs 3 2, 6, and 5 (not all decoders offer mid-range) makes this a much easier and quicker method to accomplish the same thing.

Does that sorta make sense?

Tom

http://www.newyorkcentralmodeling.com

Time...It marches on...without ever turning around to see if anyone is even keeping in step.

  • Member since
    January, 2009
  • From: Zagreb / Croatia /Europe
  • 83 posts
Posted by Spalato68 on Saturday, March 18, 2017 1:49 AM

Tom,

just one small correction to your excellent explanation: CV 3 is not used for adjusting starting voltage, it is used for acceleration. Starting voltage is adjusted with CV 2. 

Hrvoje

  • Member since
    February, 2017
  • 15 posts
Posted by originaldirtguy on Saturday, March 18, 2017 9:51 AM

Actually, I wrote that wrong. CV2 is start voltage. 

So, what is the purpose of PWM if it is only a change in voltage that changes the motor speed?

Or, am I over thinking this?

  • Member since
    March, 2012
  • 45 posts
Posted by crusader27529 on Saturday, March 18, 2017 10:06 AM

PWM IS used to control the motor......think of setting the voltages as the AVERAGE voltage that the motor sees.

 

  • Member since
    February, 2002
  • From: Reading, PA
  • 21,635 posts
Posted by rrinker on Saturday, March 18, 2017 11:04 AM

 The CVs do not change the PWM voltage PEAK. At least for CV5, max voltage, you can think of it like a physical stop on the throttle knob - you can't turn it any higher than that.

 As you start from speed step 1, the pulse being sent to the motor is very narrow. Motors are inductive, thus they react to the average voltage, not the peak. The average of a very narrow pulse of say 15 volts is very low. As you increase the throttle, the pulse gets wider and wider. As it gets wider, the average increases, and the motor responds by speeding up. The peak is always the same 15 volts or whatever. Setting CV2 controls how wide the pulse is on speed step 1. Setting CV5 controls how wide the pulse is on the highest speed step, 28 or 127. Setting CV6 controls how wide the pulse is at the middle position, 14 or 64.

 Say you have a loco that at full throttle runs at 100 mph, but the prototype should only go 60. As you turn the throttle from stop to max, you have a range of 0-100mph. You adjust CV5 until the loco goes 60 at full throttle. Now as you turn the throttle from stop to full, you are controlling a speed range of 0-60mph. With the same number of speed steps. So each step is a smaller increment.

CV2 is alittle more tricky. This is more dependent on physical characteristics of the loco than any conformance to prototype operation. A motor will require some minimal voltage to turn. Depending on the motor, that may not be reached until you are on step 10 out of 127. This manifests as a 'dead' area in the control where you turn the knob and nothing happens. By adjusting CV2, you can set the decoder so that the motor sees the bare minimum it needs to run on the very first step of the throttle. Again this also expands the granularity of the controls - before adjusting, steps 1-9 did nothing, the loco started moving at step 10. Now, the loco starts moving at step 1, and 1-9 all control the speed.

CV6 is of more use to matching multiple locos across the entire speed range (once you have the start and maximum speeds matched). Or configuring a loco by its use. FOr example, back in first gen diesel days, a lot of railroads used the massic FM Trainmaster for commuter trains. Not because a 3 or 4 car passenger train needed 2400HP to pull it, but because commuter trains by nature stop at every station and they need to get moving after each stop. The faster they can accelerate, the tighter schedule they can keep. If you make no adjustment to CV6, the mid throttle position will result in an average voltage to the motor that is exactly in the middle of the voltage at step 1 and the voltage at the top step as set by CV5. Speed increments as you turn the knob will be in a perfectly straight line between stop and top speed. If for example CV2 is 10 and CV5 is 210, the range is 200, and CV6, if not programmed, will behave as if it is set to 100. Right in the middle. If you set CV6 to something higher than 100 in this case, then the first half of the throttle will result in a greater change in speed than the second half. Say you set it to 160. 160 is about what 3/4 of the throttle would have been (keeping with the example numbers - if it goes from 10-210, the range is 200, 75% is 150, and there is that offset of 10 for the starting voltage, this is how I am coming up with 160). SO now when the throttle is at half way, the loco will be going 75% of its top speed, not 50%. This is more like that commuter train loco, picking up speed quickly after it stops. Likewise, you can do the opposite for say a switcher. With the same settings in CV2 and CV5, it may accurately represent a 60mph top speed, but even if capable, a switcher would rarely tun that fast. so you might set CV6 to 60. 25% of 200 is 50, plus the 10 offset again. Now, when the knob is at half, the loco will only be moving at 25% of its top speed instead of 50%. You still have half the steps on the throttle to get from 0-25% speed so you have very fine control over the loco at the lower speeds, perfect for coupling to cars without smashing them down the track.

 That is about the best I can explain CV2-5-6.

                               --Randy

 


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    February, 2017
  • 15 posts
Posted by originaldirtguy on Saturday, March 18, 2017 12:38 PM

Thanks Randy. That helps alot and makes sense. I've got 5 nscale locos all responding very differently. I think this info will get me where i am going. Thanks again. 

  • Member since
    July, 2006
  • From: Southern Quebec, Canada
  • 747 posts
Posted by Guy Papillon on Saturday, March 18, 2017 2:33 PM

rrinker

 That is about the best I can explain CV2-5-6.

                               --Randy

Very good explanation here Randy.

Can someone explain me the meaning of PWM?

Guy

Modeling CNR in the 50's

Moderator
  • Member since
    June, 2003
  • From: Western PA
  • 13,155 posts
Posted by tstage on Saturday, March 18, 2017 2:45 PM

Spalato68

Tom,

just one small correction to your excellent explanation: CV 3 is not used for adjusting starting voltage, it is used for acceleration. Starting voltage is adjusted with CV 2. 

Hrvoje

You're absolutely right, Hrvoje - Thanks!  And I've corrected my response above to reflect that.  I guess that's what I get for trying to write something late at night. Tongue Tied

Tom

http://www.newyorkcentralmodeling.com

Time...It marches on...without ever turning around to see if anyone is even keeping in step.

  • Member since
    February, 2017
  • 15 posts
Posted by originaldirtguy on Saturday, March 18, 2017 5:19 PM

Okay, so, I set CV 2 to 1, and 6 to 0, and no matter WHAT I set 5 to, the loco goes to warp speed at max steps. Using a TCS decoder, no sound. What am I missing?

  • Member since
    February, 2005
  • From: Vancouver Island, BC
  • 20,584 posts
Posted by selector on Saturday, March 18, 2017 7:50 PM

Try setting CV 29 to 34.  Conventionally, that disallows the decoder from taking any signal on the track as DC voltage...which is the common culprit with runaway decoders whose owners wonder why they run away like that.

PWM is short form for pulse-width modulation.  It's the decoder's way of metering voltage in DCC form to make the motor behave more smoothly.

  • Member since
    February, 2002
  • From: Reading, PA
  • 21,635 posts
Posted by rrinker on Saturday, March 18, 2017 9:48 PM

 The neat thing about a lot of engineerign acronyms - the mean exactly what they say. Pulse Width Modulation means you vary (modulate) the width of a pulse.

 Back to the beginning - DC motor vary speed based on the voltage applied. Your traditional DC power pack varies the voltage applied to the rails and hence the motor. The problem is, no matter how you do this, a rheostat or a transistor, the voltage NOT going to the motor has to be dissipated, usually as heat. So (I will assume ideal compontns to make it understandable) if you have a 12V source, and the throttle is at full throttle, there is no voltage being cut, and no heat. But at half throttle, you have 6V going to the motor and the other 6V being dissipated as heat. This is no big deal when you consider the size of a typical DC power pack. Even those crappy train set ones are bigger than an HO loco. Try to make that circuit small enough to fit in a loco and you will have a hard time getting rid of the excess heat - the components would be too big.

 Enter PWM. With PWM, the controlling transistors are either fully on, or fully off - both cases where the transistor is most efficient and generates the least amount of heat. PWM uses a square wave and take advantage of the fact that the average voltage is dependent on both the peak (which never changes) and the width of the pulse - thus pulse width modulation. A short pulse has a low average voltage, a long pulse has a higher average voltage approaching the peak. By cnaging the pulse width you cnage the voltage the motor sees.

                                   --Randy

 


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

Moderator
  • Member since
    June, 2003
  • From: Western PA
  • 13,155 posts
Posted by tstage on Saturday, March 18, 2017 10:03 PM

Thanks for the great explanation about PWM, Randy.  That's quite helpful.

So, is it fair to say that the DCC signal mimics PWM (DC) with it being either fully on or full off and the duration of each of those square waves?

Tom

http://www.newyorkcentralmodeling.com

Time...It marches on...without ever turning around to see if anyone is even keeping in step.

  • Member since
    December, 2001
  • 1,748 posts
Posted by Stevert on Saturday, March 18, 2017 10:21 PM

tstage

So, is it fair to say that the DCC signal mimics PWM (DC) with it being either fully on or full off and the duration of each of those square waves?

Tom

Tom,

The PWM typically used in a decoder motor drive circuit is DC, because the pulses are either positive OR negative with respect to the decoder's common.  That's what gives you forward and reverse direction.  So for example, the orange motor wire will have positive pulses while the gray will be at zero potential (common or "ground").

OTOH, the DCC signal is square-wave AC, so either rail at any given point in the cycle can be either positive or negative, while the opposite rail will always be 180 degrees out of phase.  So when Rail A is at +15v, Rail B will be at -15v with respect to common or "ground".

EDIT:  Fixed typo.

  • Member since
    April, 2004
  • From: Ontario Canada
  • 2,922 posts
Posted by Mark R. on Saturday, March 18, 2017 11:05 PM

originaldirtguy

Okay, so, I set CV 2 to 1, and 6 to 0, and no matter WHAT I set 5 to, the loco goes to warp speed at max steps. Using a TCS decoder, no sound. What am I missing?

You've got you MID speed set lower than your START speed - it's probably confusing the decoder. Your mid speed CV6 should be a value around half way between CV2 (start) and CV5 (top speed).

Mark.

¡ uʍop ǝpısdn sı ǝɹnʇɐuƃıs ʎɯ 'dlǝɥ

  • Member since
    February, 2002
  • From: Reading, PA
  • 21,635 posts
Posted by rrinker on Saturday, March 18, 2017 11:15 PM

 And that's how zero stretching works to run a DC loco on DCC track. A pulse under a certain threshold is a 1 bit, anything over that threshold (plus a bit extra to allow for overshoot and so forth) is a 0. If you make the zero bits wider on one half of the DCC signal (stretching the duration), the average voltage on that rail relative to the other one goes up and a DC motor will see an applied DC voltage.

 I suppose you could call it PWM, in this case it's using the PWM to convey a digital signal, rather than drive power. One of the first components after the track pickups in a decoder is a full wave bridge rectifier, which converts the DCC signal into DC. A regulator drops the voltage to run the microcontroller, but the rectified track power is directly used by the functions and also feeds the H bridge that drives the motor. That's why a stay alive gets connected to the decoder negative common, which menas soldering to the board for those not equipped to just plug in a stay alive, and the system positive common, which is the blue wire.

H bridge? Glad you asked. AN H bridge is 4 transistors in an H shape - one on each of the 4 corners of the H. The motor (or other load) is in the middle of the crossbar of the H. Top left and top right switch to positive, bottom left and bottom right switch to negative. Turn on top left and bottom right, and the left side of the motor gets + and the right side -, and the motor spins one way. change this so the top right is on and the bottom left is on, and now the right side of the motor gets + and the left side is -, and the motor spins the other way. It's like an electronic DPDT switch with the crossed wires to make a reversing switch. Yes, switch on two on the left or two ont he right at the same time and it's a dead short. The microcontroller prevents this, unless there is a bug in the code. The transistors of the H bridge are driven with PWM, that means that even rather small (physically) transistor can switch loads like 1.5 or 2 amps and not fry.

                          --Randy

 


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    July, 2006
  • From: Southern Quebec, Canada
  • 747 posts
Posted by Guy Papillon on Sunday, March 19, 2017 7:27 AM

Randy,

Thank you for those comprehensive explanations of the more complex aspects of this wonderful hobby. Beer

Guy

Modeling CNR in the 50's

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!
Popular on ModelRailroader.com
Model Railroader Newsletter See all
Sign up for our FREE e-newsletter and get model railroad news in your inbox!
ADVERTISEMENT
ADVERTISEMENT

Search the Community

Users Online

ADVERTISEMENT
Find us on Facebook