Recent Topics      
YMR logo

You are here:  Your Model Railway Club > Getting You Started. > Electrics - DCC > Fiddling with Functions To bottom of page
                 

 Moderated by: Spurno
Start New Topic Reply Printer Friendly

Fiddling with Functions - Electrics - DCC - Getting You Started. - Your Model Railway Club
AuthorPost
 Posted: Wed Dec 1st, 2010 04:04 pm
PMQuoteReply
link to this 1st post
Ian Morton
Former Member
 

Joined: 
Location:  
Posts: 
Status: 
Offline

My photos:
view photos in Gallery
view photos as slides

Fiddling With Functions

Once you start looking at locomotive lights you realise that the simple ‘white at the front, red at the back’ system used on commercial models is not really representative of how the real railway works.

For a start if a locomotive is hauling a train it won’t have a red tail light, that will be on the back of the train; Similarly, if it is pushing the train then it won’t have a white headlight. If a multiple unit is parked up between duties it may well show red lights at both ends. Modern diesel locomotives show different headlight arrangements for day and night, and so the list goes on.

DCC provides the technology to mimic this, but we need to change the decoder functions to do it.


Taking a simple example to start with. I have a narrow gauge steam locomotive that has headlights fitted at each end. In reality the fireman would put the light on the front of the train and leave it there not only whilst the train was running but also whilst it was shunting. He would only move it to the other end if the locomotive ran round its train ready to travel in the opposite direction. So rather than directional lighting I need to be able to turn on either lamp, regardless of which way the locomotive is currently running.


The locomotive is fitted with a Digitrax DZ125 which has two function outputs set up for F0 forwards and F0 reverse. By changing the CVs the functions can be set to respond to F0 and F1 and stay on (or off) regardless of direction.

Function F0 forwards is fine – we don’t need to change that but F0 reverse needs to be changed so that it operates the forward headlight (white wire). To achieve this the value 1 is written to CV 34. To make F1 operate the rear headlight (yellow wire) the value 2 is written to CV35. That’s it, the front light can now be turned on and off by pressing F0 and the rear light by pressing F1.


What is even more clever is that you can turn more than one output on for each function and you can turn an output on with more than one function. If I wished I could program F2 to turn both the front and rear headlight on.

So how does this work?

CVs 33 through to 46 each control the outputs assigned to one particular function. CV 33 is F0 forward, CV 34 is F0 reverse, CV 35 is F1 and so on through to CV 46 for F12.

The outputs that each function controls are defined by the value written to each CV. Output 0 forward, the white wire, has a value of 1; output 0 reverse, the yellow wire, has a value of 2; output 2, green, is 4; output 3 violet, is 8 and output 4, brown, is 16. There are 14 possible outputs that can be assigned, but I haven’t come across a decoder with 14 outputs yet!

By writing a value to the CV that controls a specific function you can define which outputs switch on. So, for example, if you wrote 5 to CV 38 this would turn on outputs 1 (green) and 0 (white), with values of 4 and 1 respectively, when you pressed F4.

As the maximum value you can write to a CV is 255 you are limited as to which outputs can be controlled by which function – each function can control a maximum of 8 outputs, and each output can be controlled by a maximum of 8 functions – but that is more flexibility than you are likely to need.


The table below shows the default values for each function, CV and output.

Function          CV     Default output      Default value

F0 forwards     33    0 forward (white)   1

F0 reverse       34    0 reverse (yellow)  2

F1                  35    1 (green)              4

F2                   36   2 (violet)              8

F3                   37   3 (brown)             16

F4                   38   4                        4

F5                   39   5                        8

F6                   40   6                        16

F7                   41   7                        32

F8                   42   8                        64

F9                   43   9                        16

F10                 44   10                       32

F11                 45   11                       64

F12                 46   12                      128


The first block of CVs, from 33 to 37 can control outputs 0 through to 6. In practice this is where you will make your changes.

Function
      F0 Forward      F0 Reverse      F1      F2      F3
CV            33                       34                       35      36      37

Add up the values of the outputs that you wish to control and write them to the appropriate CV. A value of 0 indicates that no output is controlled.

Output      0 Forward (white)   0 Reverse (yellow)   1 (green)   2 (violet)   3 (brown)   4   5   6
Value       1                          2                          4              8              16             32  64 128
 
For example, to operate outputs 2 (violet) and 0 reverse (yellow) using F3 you would add 8 and 2, to give 10 and write 10 to CV.37.

The second block of CVs covers F4 to F8:
Function
     F4    F5    F6    F7    F8
CV              38    39    40    41   42
 
Output    2 (violet)   3 (brown)    4    5    6    7    8    9
Value      1              2                4    8    16  32  64   128

The final block of CVs covers F9 to F12:
Function    F9    F10    F11    F12
CV            43    44     45      46
 
Output    5    6    7    8    9    10    11    12
Value      1    2     4   8    16   32    64    128
 
Taking a more complex example, a multiple unit has head and tail lights. These light may need to be turned off if it is coupled to another unit. When parked up it should show red lights to both ends.

We need four function outputs, one each for End A headlight, End B headlight, End A tail light and End B taillight.


End A Headlight
       Output 0 Fwd – White

End A Tail light      Output 0 Rev – Yellow

End B Headlight     Output 1 – Green

End B Tail light      Output 2 - Violet

 

We will use F0 for normal directional lighting. F1 to turn the A end headlight on, F2 to turn the B end headlight on, F3 for the A end tail light and F4 for the B end tail light. This will give us normal lighting when the unit is running on its own along with the ability to control the lights individually when it is running coupled to another unit or parked up.

F0 Fwd    A Headlight (white), B Tail light (violet)
F0 Rev    A Tail light (yellow), B Headlight (green)
F1          A Headlight (white)
F2          B Headlight (green)
F3          A Tail light (yellow)
F4          B Tail light (violet)
 
So we need to write the following values to the decoder:

CV 33 – F0 Forward      Output 0 Fwd (white) = 1 Output 2 (violet) = 8     8+1 = 9
CV 34 – F0 Reverse      Output 0 Rev (yellow) = 2 Output 1 (green) = 4    2+4 = 6
CV 35 – F1                  Output 0 Fwd (white) = 1                                   1
CV 36 – F2                  Output 1 (green) = 4                                         4
CV 37 – F3                  Output 0 Rev (yellow) = 2                                  2
CV 38 – F4                  Output 2 (violet) = 1                                         1
 
Many decoders come with special lighting effects for flickering, flashing or dimming lights. These are controlled by other CVs and are unique to each manufacturer.

(PS It looks better in the original manuscript where the tables have lines and align nicely)

Back To Top PMQuoteReply

 Posted: Wed Dec 1st, 2010 04:23 pm
PMQuoteReply
link to this 2nd post
henryparrot
Former Member
 

Joined: 
Location:  
Posts: 
Status: 
Offline

My photos:
view photos in Gallery
view photos as slides

Thats really good Ian im sure you have been sitting down working all that out for some time.

Something im sure many here could play with if they have dcc system and a loco with lights.

Brian

Back To Top PMQuoteReply

 Posted: Wed Dec 1st, 2010 04:27 pm
PMQuoteReply
link to this 3rd post
Ian Morton
Former Member
 

Joined: 
Location:  
Posts: 
Status: 
Offline

My photos:
view photos in Gallery
view photos as slides

Another extract from that forthcoming book.

Remember - you saw it here first :cool:

Back To Top PMQuoteReply

 Posted: Wed Dec 1st, 2010 04:31 pm
PMQuoteReply
link to this 4th post
henryparrot
Former Member
 

Joined: 
Location:  
Posts: 
Status: 
Offline

My photos:
view photos in Gallery
view photos as slides

Ian

Are you doing a section in the book on motor control fiddling with cv`s?

Brian

Back To Top PMQuoteReply

 Posted: Wed Dec 1st, 2010 05:11 pm
PMQuoteReply
link to this 5th post
Ian Morton
Former Member
 

Joined: 
Location:  
Posts: 
Status: 
Offline

My photos:
view photos in Gallery
view photos as slides

Unfortunately they are different for each manufacturer once you get past the min/max/speed curve stuff, so tweaking back emf isn't really feasible as a general instructional.

Back To Top PMQuoteReply

 Posted: Fri Dec 3rd, 2010 12:26 pm
PMQuoteReply
link to this 6th post
Diesel
Member


Joined: Sun Oct 14th, 2007
Location: West Rainton Co Durham, United Kingdom
Posts: 815
Status: 
Offline

My photos:
view photos in Gallery
view photos as slides

Now this is an interesting subject i,m using the Bachmann dynamis and i,m slowly getting the hang of it but changing CVs is a little mysterious at the moment :???:got a Bachmann grafar class 42 warship fitted with Bachmann six pin decoder can I switch the red light off using the dynamis? the decoder has two functions for the lights on/off and dim and according to the decoder instructions a flicker function I assume for the red tail light on loco but dont know how that works .



____________________

Brian(G)
Back To Top PMQuoteReply

 Posted: Sat Dec 4th, 2010 06:05 am
PMQuoteReply
link to this 7th post
Ian Morton
Former Member
 

Joined: 
Location:  
Posts: 
Status: 
Offline

My photos:
view photos in Gallery
view photos as slides

The six-pin decoder is only a two function decoder - as supplied set for F0 forward and F0 reverse giving directional lighting.

On the loco the headlight at one end and tail light at the other are wired via the same output and so always work together.

If you were to disable the tail lights in some way (painting over them with black would be easiest) then you could make the headlights controllable as per my narrow gauge loco.

To make all the lights individually controllable you would need to get each LED connected to a separate output which would, in practice, mean throwing away the circuit board from the loco and hard-wiring in a 4 function decoder. 

Back To Top PMQuoteReply

This is topic ID = 7752     Current time is 11:26 am  
You are here:  Your Model Railway Club > Getting You Started. > Electrics - DCC > Fiddling with Functions
You can type a quick reply to this topic here. Click in the box below to begin.

Or to reply to an individual post, or to include images, attachments and formatted text,
click the Quote or Reply buttons on each post above.

To start a new topic in this forum, click the Start New Topic button below.
To start a new topic in a different forum, click the Forum Jump drop-down list below.
Start New Topic

Back to top of page

           
15 Most Recent Topic

Problems with this web site? Please contact the Webmaster.

All material submitted to this web site is the responsibility of the respective contributor. By submitting material to this web site you acknowledge that you accept full responsibility for the material submitted.
Unless stated otherwise, all the material displayed on this web site, including all text, photographs, drawings and other images, is copyright and the property of the respective contributor. Registered members are welcome to use it for their own personal non-commercial modelmaking purposes. It must not be reproduced or re-published elsewhere in any form, or used commercially, without first obtaining the owner's express permission.
The owner of this web site may edit, modify or remove any content at any time without giving notice or reason.    © 2008

                 

Recent Topics Back to top of page

Powered by UltraBB 1.15 Copyright © 2007-2011 by Jim Hale and Data 1 Systems. Page design copyright © 2008-2013 Martin Wynne. Photo gallery copyright © 2009 David Williams.