Welcome to the forum   
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Share
Options
View
Go to last post in this topic Go to first unread post in this topic
Offline einotuominen  
#1 Posted : 29 July 2023 17:16:30(UTC)
einotuominen

Finland   
Joined: 19/09/2022(UTC)
Posts: 382
Location: Kaarina
Hi,

believe it or not, I tried to google this, in german also, but no luck. Must be my german skills.

I'm configuring an mSD3 decoder to be used in F7. I'm planning on using output 1 & 2 to create the ditch lights. No what I wish to accomplish is either:

A)
- Ditch lights that have a master on/off
- When horn is sounded, they should blink alternately and then return to constant on (if turned on).

OR

B)
If it is not possible to have them constantly on and when horn is sounded, have them blink, just have them blink when horn is sounded...

For solution A I think this could be solved by using a total of 3 outputs. So that the constant on could be output 3 which is soldered to left and right LED cathodes and then outputs 1 & 2 respectively to left or righ. So output 3 on would cause the "constant on" and then outputs 1 & 2 would be the blinkers. When horn is sounded, it would turn off output 3 and turn on outputs 1 & 2... But how would the output 3 (constant on) turn back on, when the horn ends?

So in the outputs configuration I see there are a couple of options there:

Single flashing light and Dual flashing light... What is the difference between these two?

I guess the "Period" input determines the flashing rate?

So with period of 1 sec in output 1 & 2 and then have start delay of 1 sec in output two would make these blink alternately? But this could be achieved fith single flashing light, so what's the dual one then?

The reason why I'm asking instead of doing heavy testin is because I do not have CS3. I'm depending on the USB Decoder programmer and "trial and error" approach would mean that I'd have to move the decoder between the programmer and loco many times, which will cause a pin to break at some point.

Thanks again for your help!

-Eino
Offline clapcott  
#2 Posted : 30 July 2023 10:07:35(UTC)
clapcott

New Zealand   
Joined: 12/12/2005(UTC)
Posts: 2,435
Location: Wellington, New_Zealand
Not sure how much detail you require.
And there are bound to be other possible solutions

In the first instance, a particular output "Aux(x)" of the decoder can only be set (configured) for one function.
If you wish it to "behave" differently you need to abstract some logic in between a button/Fx and the Aux(x)
(in which case the Aux(x) output configuration is set to Dimmer(100%) and the intermediate logic affects whether it is on or not)

The mxD/3 decoders have a couple of internal programing features that may be deployed
- Timers (there are 4)
- Logic functions (AND, OR etc)

In the case you describe I would set up
a) a pair of timers that retrigger themselves at the frequency you desire
- Timer1

TIMER1 would have actions
-- AND4 Pos. Level
-- Timer2 Neg. Edge

TIMER2 would have actions
-- AND3 Pos. Level
-- Timer1 Neg. Edge

b) The "normal lights on" Fx button would be a set ...
- AND2 function (Pos. Level)

AND2 would have actions
-- Aux(Y) Pos. level
-- Aux(Z) Pos. level

c) The "Ditch Light Mode" would set ...
- AND2 function (Neg. Level) .... This disableds the above"all on"
- AND3 Pos Level
- AND4 Pos. Level
- TIMER1 Pos. Edge

AND3 would have actions
-- Aux(Y) Pos. level
AND4 would have actions
-- Aux(Z) Pos. level

Of note is that the timer (in the decoder) does need to be started, but in the given case will never stop (until poweroff)
If you do have a power failure some logic is needed to kickstart the timer.

It is possible to add TIMER1 to the ditch light mode Fx (as above with Pos. Edge),
If however you are in "Ditch Light mode" when the power fails, you may need to toggle the Fx button off and on to restart the timer.

To cover off...
"When horn is sounded, they should blink alternately and then return to constant on (if turned on)."
you may either incorporate the sound with the "Ditch Light Mode" Fx button or introduce another Fx button (this is for the case where you may wish to operate the Ditch Lights without the sound.

You also have the option to set the Fx button to Mom so that it turns on and starts the sequence ,
or leave as "Stitching Function" where you can manually toggle on to start and of off to stop.

Given the "should blink alternately and then return to constant on"
I would ...
- SET the Fx button to momentary
- introduce a 3rd time which is started by the "Ditch Light / Sound Mode" button in a similar way to Kicking of Timer1
TIMER3 would be set to what you think is reasonable (? 10 seconds) with Pos. Edge

TIMER3 would then be added to the ...
-- AND2 Neg. Level
-- AND3 Pos. Level
-- AND4 Pos. Level

REMOVE AND2/3/4 from the "Ditch Mode / Sound Fx" so it just looks like
- TIMER1 Pos. Edge
- TIMER3 Pos. Edge
Peter
thanks 3 users liked this useful post by clapcott
Offline dickinsonj  
#3 Posted : 31 July 2023 01:38:34(UTC)
dickinsonj

United States   
Joined: 05/12/2008(UTC)
Posts: 1,684
Location: Crozet, Virginia
Nice post Peter - you are good at this!

It might however be drinking from a firehose for a newer user, but the answer is there and the process will lead @einotuominen to some very useful knowledge.

Mentorship as it should be. ThumpUp
Regards,
Jim

I have almost all Märklin and mostly HO, although I do have a small number of Z gauge trains!
So many trains and so little time.
thanks 2 users liked this useful post by dickinsonj
Offline einotuominen  
#4 Posted : 31 July 2023 07:00:41(UTC)
einotuominen

Finland   
Joined: 19/09/2022(UTC)
Posts: 382
Location: Kaarina
Thanks!

Can you please explain the meaning of the attributes pos level, neg level ans edge?

BR,
Eino
Offline bph  
#5 Posted : 31 July 2023 11:58:30(UTC)
bph

Norway   
Joined: 04/08/2018(UTC)
Posts: 996
Originally Posted by: einotuominen Go to Quoted Post

The reason why I'm asking instead of doing heavy testin is because I do not have CS3. I'm depending on the USB Decoder programmer and "trial and error" approach would mean that I'd have to move the decoder between the programmer and loco many times, which will cause a pin to break at some point.
-Eino


I recommend that you consider buying the Märklin 60970 decoder tester.
with that one connected to your pc, you can program and test your decoder projects from mDecodtool directly, and all without removing the decoder.
That way you can also slowly build up your logic projects and make sure each step works before you add more.
thanks 2 users liked this useful post by bph
Offline clapcott  
#6 Posted : 31 July 2023 12:30:01(UTC)
clapcott

New Zealand   
Joined: 12/12/2005(UTC)
Posts: 2,435
Location: Wellington, New_Zealand
Originally Posted by: einotuominen Go to Quoted Post
Can you please explain the meaning of the attributes pos level, neg level ans edge?


when mapping an Action (right side) to a function (left side = Fx button, Timers, LogicalFunction, sound etc) you may define the state of the function that will result in the action actually happening.

In its simplest (default) mode these start as Pos. Level meaning for e.g. that when the Fx button is ON (POSITIVE LEVEL) the Light is ON

When I suggest ...
the "Ditch Mode / Sound Fx" actions looks like ...
- TIMER1 Pos. Edge
- TIMER3 Pos. Edge


it means the TIMER1 and TIMER3 with "action" (start their timers) when the Fx button changes from OFF to ON.
This is referred to as a rising edge (or positive going edge)

In the case of TIMER1 the timer starts (GOES ON/POSITIVE) and runs for a short time as defined (say 0.5 seconds) and finish/timeout (GO OFF/NEGATIVE)

By setting TIMER2 as an action of TIMER1 and setting its attributes for Neg. Edge , this timer will START when TIMER1 finishes (GOES NEGATIVE) and run for a short time as defined (say 0.5 seconds) and finish/timeout (GO OFF/NEGATIVE)

By similarly setting TIMER1 as an action of TIMER2 , TIMER1 will (re)START when TIMER2 finishes (GOES NEGATIVE)
Thus we have a perpetual/continuous loop with TIMER1 running (ON/POSITIVE), then TIMER2 running (ON/POSITIVE) , then T1 then T2 then T1 etc..

WHILE this is happening we can also set ACTIONS to occur and stay active for duration of TIMER1 by configuring those actions for Pos. Level
with TIMER1 and TIMER2 cycling on and off it is easy to assign
- one of your ditch lights to TIMER1 Pos. Level
- and the other to Timer2 Pos.Level.
because the TIMERS are the same duration you could have
- one of your ditch lights to TIMER1 Pos. Level
- and the other to TIMER1 Neg.Level.

The reason I outline the use of an AND along with another Control is because, once the timers a looping, you would always have one light on and one off, with no way to turn BOTH OFF.
By using TIMER3 (set for 10 seconds with NO looping retrigger) as another input for both AND3 and AND4 it means that the ditch lights will toggle happily until TIMER3 times out and then stop (Both turn off)

In the image below you may observe
- 1) Using F3 as my "Ditch Light" function button
- 2) A Timer (TIMER1) has been added as an action
- 3) Its conditions for being active/being triggered are "Pos. Edge"
UserPostedImage


Peter
thanks 2 users liked this useful post by clapcott
Offline clapcott  
#7 Posted : 31 July 2023 13:24:48(UTC)
clapcott

New Zealand   
Joined: 12/12/2005(UTC)
Posts: 2,435
Location: Wellington, New_Zealand
FWIW, 1 possible set of screens
transcribed to the mDT
any actions not specifically exploded are Pos. Level

UserPostedImage

Edited by user 01 August 2023 00:18:24(UTC)  | Reason: Not specified

Peter
thanks 2 users liked this useful post by clapcott
Offline clapcott  
#8 Posted : 01 August 2023 00:19:20(UTC)
clapcott

New Zealand   
Joined: 12/12/2005(UTC)
Posts: 2,435
Location: Wellington, New_Zealand
corrections made to above screen images of the mDT3
Peter
Offline einotuominen  
#9 Posted : 01 August 2023 09:16:56(UTC)
einotuominen

Finland   
Joined: 19/09/2022(UTC)
Posts: 382
Location: Kaarina
Originally Posted by: clapcott Go to Quoted Post
FWIW, 1 possible set of screens
transcribed to the mDT
any actions not specifically exploded are Pos. Level



Wow! Thank you so much! Great example.

-Eino

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

| Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.567 seconds.