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 marklinist5999  
#1 Posted : 23 September 2024 20:21:19(UTC)
marklinist5999

United States   
Joined: 10/02/2021(UTC)
Posts: 3,865
Location: Michigan, Troy
I put my Intercity mfx cab control car on my bench track with my 6021 control. It wouldn't light up with the factory mm address 29. So I booted the CS 3 to check the address and it is 10. It didn't work with that address on the 6021 either. After looking on the rear of the 6021, 3 of the 4 dip switches were on. After I set the 4th switch on, it worked with address 29. I guess the expanded format wasn't set on.
Offline owidgie  
#2 Posted : 23 September 2024 22:10:19(UTC)
owidgie

United States   
Joined: 03/06/2007(UTC)
Posts: 167
The address that shows on a CS2/CS3 in the locomotive edit pages is just a "marker" so to say. The CS assigns this marker for indexing purposes so it can sort in a search like sorting the locomotives by address.

To see or edit the actual MM (default) address you need to get into the configuration screen and look in the "Formats". There it will give you the "MM2" address, which is what a 6021 uses.

Rick
thanks 3 users liked this useful post by owidgie
Offline JohnjeanB  
#3 Posted : 23 September 2024 23:14:53(UTC)
JohnjeanB

France   
Joined: 04/02/2011(UTC)
Posts: 3,550
Location: Paris, France
Hi
Originally Posted by: marklinist5999 Go to Quoted Post
I put my Intercity mfx cab control car on my bench track with my 6021 control. It wouldn't light up with the factory mm address 29. So I booted the CS 3 to check the address and it is 10. It didn't work with that address on the 6021 either. After looking on the rear of the 6021, 3 of the 4 dip switches were on. After I set the 4th switch on, it worked with address 29. I guess the expanded format wasn't set on.


Why not use the CS3, disable the DCC and MFX protocols and then ask the CS3 to find the address?
Here is how the CS3 can extract the address of a loco installed on the programming track

Sans titre.png

Cheers
Jean

thanks 2 users liked this useful post by JohnjeanB
Offline marklinist5999  
#4 Posted : 24 September 2024 13:31:45(UTC)
marklinist5999

United States   
Joined: 10/02/2021(UTC)
Posts: 3,865
Location: Michigan, Troy
Thank you both 😊
Offline revmox  
#5 Posted : 28 September 2024 12:57:45(UTC)
revmox

Australia   
Joined: 26/05/2021(UTC)
Posts: 198
Location: Australia, East Maitland, NSW
It seems like mfx is now 20 years old but there a still lots of really basic questions. This may all be ancient history to most forum members but I'm relatively new to the mfx world and have been struggling to understand some of the weird things it does. I particularly hate it when I turn the layout on and a lok that I know has connectivity ignores all commands for several minutes then suddenly launches off down the track without warning. Here's a post by someone else with similar issues -

http://blog.mailez.de/eb...-frustrating-experience/

Mucking around looking at what might be behind these problems I created an Arduino based sampler that gives me readout of the mfx communications packages. Can store and display about 40 seconds of track communications.

MFX_SAMPLER.jpg

And also a carriage I can plonk on the tracks to see what addresses the controller is talking to. It's a bit cumbersome but I can identify a lok address by switching directions and watching the display.

MFX_THING.jpg

PXL_20240924_223723680.jpg

I'd made some progress myself but found a great document on Stefan Krauss's website where a team really dug into the workings of mfx. In German but easily translated online. https://www.skrauss.de/

Anyway, what I have so far is all in development and unfit for sharing. I'm really limited in how far I can dig into and test things as I only have dual MS2's, about 10 loks and everything else is good, sensible, old-fashioned analogue.

I've tried searching online but anything that looks promising usually turns out be either a dead link or about the previous MM protocol.

I think I understand the steps of the mfx registration process but would really appreciate it if someone else can point me to further details on how mfx works.

Cheers, Mark.

thanks 3 users liked this useful post by revmox
Offline RCH  
#6 Posted : 19 December 2024 09:29:23(UTC)
RCH

Netherlands   
Joined: 19/12/2024(UTC)
Posts: 12
Location: Zuid-Holland, Delft
Hi Mark,

I took upon me the challenge to make a MFX controller by myself. So no Gleisbox and/or Central Station, really build it yourself. I'm using an ESP32 and a DFRobot motor driver board (https://www.dfrobot.com/product-1512.html) to drive the decoders. Since I don't have any digital trains, only old analog trains, I bought a DHG700 MFX lokomotive and a LokPilot 5 decoder board. Based on the document of Stefan Krauss I managed to create the power/driving signal, sending commands including the CRC and detecting a 1 bit feedback. When doing a Decoder Search on broadcast address 0 only the LokPilot 5 decoder board responds with a 1-bit feedback as descripted on the article of Stefan Krauss. The DHG700 does not respond. It simple is standing on the track with a blinking roof LED. I'm clueless why the DHG700 doesn't respond. Since I don't own a Centrale Station could you send me some oscilloscope images of the first communication with a MFX decoder? I'm specially interested in the broadcast communication.
Sorry to 'dive bomb' in a few lines what I'm doing but I've to start somewhere... And it's like you said, it's almost impossible to find people with this 'low level' interest.

Greetings, Roland
thanks 1 user liked this useful post by RCH
Offline revmox  
#7 Posted : 19 December 2024 21:30:48(UTC)
revmox

Australia   
Joined: 26/05/2021(UTC)
Posts: 198
Location: Australia, East Maitland, NSW
Originally Posted by: RCH Go to Quoted Post
Hi Mark,

I took upon me the challenge to make a MFX controller by myself. So no Gleisbox and/or Central Station, really build it yourself. I'm using an ESP32 and a DFRobot motor driver board (https://www.dfrobot.com/product-1512.html) to drive the decoders. Since I don't have any digital trains, only old analog trains, I bought a DHG700 MFX lokomotive and a LokPilot 5 decoder board. Based on the document of Stefan Krauss I managed to create the power/driving signal, sending commands including the CRC and detecting a 1 bit feedback. When doing a Decoder Search on broadcast address 0 only the LokPilot 5 decoder board responds with a 1-bit feedback as descripted on the article of Stefan Krauss. The DHG700 does not respond. It simple is standing on the track with a blinking roof LED. I'm clueless why the DHG700 doesn't respond. Since I don't own a Centrale Station could you send me some oscilloscope images of the first communication with a MFX decoder? I'm specially interested in the broadcast communication.
Sorry to 'dive bomb' in a few lines what I'm doing but I've to start somewhere... And it's like you said, it's almost impossible to find people with this 'low level' interest.

Greetings, Roland



Hello Roland,

You've taken on quite a challenge - good luck - you'll probably need some serious therapy by the time you finish.

I'm sorry I can't provide an oscilloscope image of the interaction you want because that process is spread over many bits and would (certainly to me) be largely unintelligible on a screen capture - additionally I only have a couple of basic oscilloscopes, and they don't have the ability to trigger off any particular data sequence in the mfx data stream. What I do recommend as probably more useful is replicating my mfx sampler which, with a board like the Arduino Giga with megabytes of memory, can capture a few minutes of the track signal you are trying to create. The decoding of all possible mfx commands is incomplete - I stopped when I had the all the information I needed to prove that mfx occasionally loses the plot - but you can watch the registration process and also see what happens at start up. Note that there are no loco specific commands at start up - nothing specific gets sent to a registered loco until you do something like tell it to move or turn the lights on or off. There might be some enabling general broadcast before that and I think there was some suggestion of that in the CAN documentation - BTW I have a CAN logger set up with a track box on my workbench at the moment, it all works but I'm not sure I have the energy or desire to write a decoder for it too.

I wish I knew how to add a link to other topics but somehow I can't seem to get that to work.

My other bits and pieces and a link to get to the mfx sampler stuff can be found in the following posts in the digital section.

Marklin mfx feedback (using RDS)
MFX sniffer carriage
Marklin locos -MFX or DCC?

Cheers




thanks 1 user liked this useful post by revmox
Offline revmox  
#8 Posted : 20 December 2024 01:02:38(UTC)
revmox

Australia   
Joined: 26/05/2021(UTC)
Posts: 198
Location: Australia, East Maitland, NSW
Hi again Roland,

Thinking a bit more about your problem - if you don't have ready access to another Marklin user to get information from, I could try to capture the serial output from my sampler to a file using puTTY or something similar and make that accessible on my Mega account.

I have an ML 00610 loco from a discarded Aldi set that is probably of similar complexity to your loco. I could try to capture both a regular start up and drive as well as a new registration.

Let me know if you want me to attempt that - but be aware that, due to some serious health issues, it could take me a while ...

Cheers, Mark
thanks 1 user liked this useful post by revmox
Offline RCH  
#9 Posted : 20 December 2024 09:44:56(UTC)
RCH

Netherlands   
Joined: 19/12/2024(UTC)
Posts: 12
Location: Zuid-Holland, Delft
Hi Mark,

serious health issues doesn't sound good. I hope the way up is visible and that picking up the MFX interest is a good distraction. In the mean time I'll make sure to stay away from therapyBlink.
Also thanks for replying. Sometimes an unintended word or observation by someone else can lead to a solution.
I do have a oscilloscope image. This image shows the part of a 1-bit feedback signal I created so far just before the decoder responds (see paragraph 2.2.7 of the article of Stefan Krauss). The decoder responds is a 52.63kHz signal (see paragraph 2.3.2).

Decoder 1-bit feedback.png

The 1-bit response of the, in this case LokPilot 5 decoder, is prove for me that the rail signal I created and send to the decoder is correct. And to be clear the rail signal consists out of a Sync signal, 7/9/11 or 14 bit address being 0, Decoder Search command using the broadcast address 0, 8 bit CRC, 11 sync signals and the marker 0011 (shown in the attached image). Followed by a 6.4 ms pause were the decoder responds. Sending one bit wrong and the decoder stops responding.
If I change the LokPilot 5 decoder for a Marklin MFX loko their is no response. And for the life I can't figure out why the loko is not responding. And yes, I'm sure the loko is in good order.

The broadcast signal should be send by a CS or MS or whatever a few times every second. A controlling station checks if a none registered decoder is added to the track or lost it's address. At least that's what I understand. The frame I send looks like this:
111100000000000000 11101000000000000000000000000000000000000000 11101100 were

111100000000000000 = 14 bit broadcast
11101000000000000000000000000000000000000000 = Decoder Search command C=0 and U=0
11101100 = Checksum

The 14 bit address can easily be changed for a 7, 9 or 11 bit address. Of course the checksum will be different but the LokPilot keeps responding.

What I would like is confirmation if you see the same with your DIY decoder and additional preferably for the following three situations (please with each bit detected):
1. rail signal without *any* decoder
2. first communication with a decoder
3. communication between only one decoder when giving a drive signal

Hope to hear from you soon.

Greetings,
Roland
thanks 1 user liked this useful post by RCH
Offline RCH  
#10 Posted : 20 December 2024 20:30:23(UTC)
RCH

Netherlands   
Joined: 19/12/2024(UTC)
Posts: 12
Location: Zuid-Holland, Delft
Hi Mark
Based on the logging picture you placed some posts ago and a reply from Stefan Krauss it could be I have an answer (fingers crossed). Will try tomorrow and keep you posted.
Greetings,
Roland
Offline revmox  
#11 Posted : 20 December 2024 20:49:28(UTC)
revmox

Australia   
Joined: 26/05/2021(UTC)
Posts: 198
Location: Australia, East Maitland, NSW
Hi Roland,

I'll see what I can record.

Meanwhile, two items jump to mind from what I've seen from my MS2s - extreme red herrings though ...

I don't recall any HQ commands coming out in anything but 7 bit format?

You don't mention what HQ identifying command you are transmitting. Nothing seems to go right for mfx decoders without periodic reception of a valid HQ command for the decoders to know "where" they are (whatever the unknown criteria are for that - 111 101 para 3.2.6 in Stefan's pdf). Suggest you copy the bit pattern from one of my MS2's a few posts back as a known working combo.

Cheers.
Offline RCH  
#12 Posted : 20 December 2024 21:20:43(UTC)
RCH

Netherlands   
Joined: 19/12/2024(UTC)
Posts: 12
Location: Zuid-Holland, Delft
Yes, this might be the reason, no HQ id. Already changed the code. Need to compile and test. But bed is calling on this side of the globe....
Offline revmox  
#13 Posted : 21 December 2024 04:39:29(UTC)
revmox

Australia   
Joined: 26/05/2021(UTC)
Posts: 198
Location: Australia, East Maitland, NSW
Hi Roland,

2:40 pm here - 36C outside - a good time to hide in the shed with some engineering fluid (red wine).

Three mfx recordings for you -

Record 1.docx (14kb) downloaded 29 time(s).
Record 3.docx (31kb) downloaded 20 time(s).
Record 2.docx (30kb) downloaded 22 time(s).

Record 1 - 56000 data points. MS2 after release of controller STOP button with no registered locos and nothing on the track (search mode).
Record 2 - 200000 data points. MS2 after release of controller STOP button and the full mfx registration process for an 81 class loco.
Record 3 - 56000. Some 81 class action - lights on/off - bit of driving.

Sorry, the data format isn't pretty after going through Arduino serial, puTTY and Word.

Enjoy?
thanks 1 user liked this useful post by revmox
Offline RCH  
#14 Posted : 21 December 2024 15:54:20(UTC)
RCH

Netherlands   
Joined: 19/12/2024(UTC)
Posts: 12
Location: Zuid-Holland, Delft
Oh boy, oh boy, oh boy.... Am I enjoying myself? Very much so!
These three files are very insightful. Thanks a million.
I've spend already some hours in studying your files and I've learned a lot. I added to my code a HeadQuarters function that sends out continuously, with a certain interval, on broadcast address 0 a control center UID with a registration counter number. I used your control center UID so we could exchange loks with each other....
I'm now writing code to be able to extract the lok decoder UID.

You enjoy your engineering fluid and the Gravy song.

Keep you posted.

Greetings,
Roland

PS Stefan Krauss also responded pointing me in the correct direction.


thanks 1 user liked this useful post by RCH
Offline revmox  
#15 Posted : 21 December 2024 19:58:29(UTC)
revmox

Australia   
Joined: 26/05/2021(UTC)
Posts: 198
Location: Australia, East Maitland, NSW
Glad to hear you're having some fun and making some progress.

Also glad to hear you're getting some use from the recordings. It's an unfinished project - I got all the information I needed about mfx's lost loco registrations "feature" and stopped.

I did develop a working PLL based RDS decoder and would have liked to decode and display the feedback but didn't push on. Care to share or PM what you are using for the feedback path?

Cheers, Mark.
thanks 1 user liked this useful post by revmox
Offline RCH  
#16 Posted : 22 December 2024 16:44:25(UTC)
RCH

Netherlands   
Joined: 19/12/2024(UTC)
Posts: 12
Location: Zuid-Holland, Delft
Hi Mark,
Finally success! With the help of your log files and some pointers of Stefan I managed the DHG700 lok to respond. Studying your log files I noticed your station constantly repeated the Headquarter UID and registration number. Being a novice with the MFX prorocol I didn't include this headuarter broadcast in my code. This left the DHG700 in its last state being roof LED and forward lights switch on and with a stored unknown Headquarters UID.
When including the Headquarters command the DHG700 responded by switching off the roof LED and forward lights. And, most importantly, the DHG700 responded on a decoder search command on broadcast address 0.
I extended my code to be able to find the decoder UID. I managed to find the first bit of the 32 bits of the decoder UID with the help of an oscilloscope. I need an oscilloscope since I don't have as of yet build the electronics to detect the decoder response. This wil be my next mission. This also answers your question about the feedback path, at this moment there is hardly none.
When the electronics and code is more or less showable I will share with you and the community. But give me some slack. Sitting hour on hours in my man cave comes with a cost. I must not forget my family....

Keep you posted.

Greetings,

Roland
thanks 1 user liked this useful post by RCH
Offline revmox  
#17 Posted : 23 December 2024 20:47:18(UTC)
revmox

Australia   
Joined: 26/05/2021(UTC)
Posts: 198
Location: Australia, East Maitland, NSW
Congratulations Roland,

Great progress - it is a shame there isn't a central location to record all the bits and pieces that people have unraveled about mfx.

Generating an RDS test signal is easy enough with an Arduino or ESP. Unfortunately, RDS decoding is not so easy and dedicated chips for this older technology aren't so easy to come by. Down below is what I came up with using readily available basic chips - worked fine on the bench but real life is always something different.

Merry Christmas and good luck for your project ...

RDS detector.jpg

thanks 1 user liked this useful post by revmox
Offline RCH  
#18 Posted : 24 December 2024 09:32:34(UTC)
RCH

Netherlands   
Joined: 19/12/2024(UTC)
Posts: 12
Location: Zuid-Holland, Delft
Hi Mark,

About the bits and pieces, I hear what you say and I'm planning to report this adventure on my website. But understanding MFX took some time, making the electronics, writing code and setting up a website will take some time too and I'm not retired yet.... So I've to divide my time.
I studied your coding work and alternative RDS decoding circuit. Kudo's! Your way of coding resembles my way of coding which made life much easier...
But I want to think out of the box and make decoding simple by trying to lose the RDS chip(s) and solve the decoding in software. Decoding from a controller standpoint is easier because you know whenever a decoder start talking. This means that (all) available resources in your processor can be used to decode. BTW I use a Wrover ESP32 but I'm thinking of switching to a ATOM Lite M5 to make everything nice and compact.
Coming back to the signal decoding. To be able to measure the signals which I generate with the software and the ESP32 I placed a resistor in between the driver and the track. The resistor value is too high to drive multiple loks but good enough to drive one lok and to measure signals going back and forth with an oscilloscope. Now the decoder uses a current source to talk back. The current from my DHG700 lok is 100mA. If I would change the resistor value to 0.2 ohm the voltage over the resistor, containing the feedback data, would be 20mV. Yesterday evening I was playing around with LTSpice, a free electronics simulator, and came up with the following circuit:

Edge2Pulse.png

This circuit I created detects edges of digital pulses and outputs them to a 3.3V level suited for the ESP32. The simulation result looks like this:

Edge2Pulse_Graph.png

The green signal is one side of the +/-18V signal on the track. After 250us I start to simulate a 1 bit feedback signal (should be 20mV and not visible in the simulation plot). The blue signal is the output signal on the collector of Q2 that should be used as a signal to the ESP32 for decoding. Simulation shows it should work but I'm not happy yet. First of all the feedback signal, when using a 0.2 ohm resistor, is very low and therefor sensitive for interference. Secondly the power in the series resistor, when pushing 10A, is 20W, which is a lot. Thirdly there would be a voltage drop of 2V.
So my thinking cap is still on how to improve on this.


U2 a Merry Christmas and keep you posted.

Greetings,
Roland
thanks 1 user liked this useful post by RCH
Offline Goofy  
#19 Posted : 24 December 2024 09:48:20(UTC)
Goofy


Joined: 12/08/2006(UTC)
Posts: 9,273
This is what we call it as binary code by use 0 and 1.
To remember is that quality of small electronic components must be good if you want decoder work without troubles.
H0
DCC = Digital Command Control
Offline kiwiAlan  
#20 Posted : 24 December 2024 14:35:57(UTC)
kiwiAlan

United Kingdom   
Joined: 23/07/2014(UTC)
Posts: 8,455
Location: ENGLAND, Didcot
Originally Posted by: RCH Go to Quoted Post
First of all the feedback signal, when using a 0.2 ohm resistor, is very low and therefor sensitive for interference. Secondly the power in the series resistor, when pushing 10A, is 20W, which is a lot. Thirdly there would be a voltage drop of 2V.
So my thinking cap is still on how to improve on this.


IIRC on the ms1 they use a transformer to pick up the return message. This should give you significantly less than 0.2 ohm for the primary, and you can then get a significant voltage step up on the secondary. I haven't tried to deduce the schematic on any other controllers as yet.

thanks 1 user liked this useful post by kiwiAlan
Offline revmox  
#21 Posted : 25 December 2024 11:32:38(UTC)
revmox

Australia   
Joined: 26/05/2021(UTC)
Posts: 198
Location: Australia, East Maitland, NSW
Originally Posted by: revmox Go to Quoted Post
Hi Roland,

2:40 pm here - 36C outside - a good time to hide in the shed with some engineering fluid (red wine).

Three mfx recordings for you -

Record 1.docx (14kb) downloaded 29 time(s).
Record 3.docx (31kb) downloaded 20 time(s).
Record 2.docx (30kb) downloaded 22 time(s).

Record 1 - 56000 data points. MS2 after release of controller STOP button with no registered locos and nothing on the track (search mode).
Record 2 - 200000 data points. MS2 after release of controller STOP button and the full mfx registration process for an 81 class loco.
Record 3 - 56000. Some 81 class action - lights on/off - bit of driving.

Sorry, the data format isn't pretty after going through Arduino serial, puTTY and Word.

Enjoy?



I had a request to make my mfx recordings a little easier to read -

The letters in the recordings below mean -
W - wait - a pulse of 1mS or greater
P - pause - a pulse of 116uS to 1mS
0 - logic 0 - 74us to 116uS - a logic 0 is nominally 100uS
S - short pulse - 36uS to 74uS - nominally 50uS - BUT TWO short pulses together as a pair is a logic 1 - program sorts this for you
* - very short pulse - less than 36uS - not sure what these are needed for or if they carry any information, but they turn up in the mfx signal all the time
. - a full stop/period - used to represent the idle signal that mfx sends out to keep the track powered when the controller is idle, the pattern is WP**PP**PP**PP**P*P*PP**PP**PP**PP** (wtf were they thinking?)

Simplified files -
Record 3a.docx (36kb) downloaded 16 time(s).
Record 1a.docx (14kb) downloaded 21 time(s).
Record 2a.docx (33kb) downloaded 21 time(s).






thanks 1 user liked this useful post by revmox
Offline RCH  
#22 Posted : 29 December 2024 16:02:41(UTC)
RCH

Netherlands   
Joined: 19/12/2024(UTC)
Posts: 12
Location: Zuid-Holland, Delft
Hi Mark et al.
Progress... I've been busy in between Christmas festivities and the project starts to show some lift off. Ready? Here we go:

1. I call the electronics and software I'm working on "The ATC", short for "The Alternative Train Controller" (you need to call it something).
2. Exchanged the ESP32 Lolin32 dev.controller board for an Atom Lite ESP32. This makes the footprint of the ATC 100x 70 mm.
All pins of the Atom Lite are used but spared two pins for an I2C interface (for future expansion).
3. Finished, build and tested the Feedback electronics.
4. Included Bitstuffing


In a previous post I showed a Feedback circuit that worked but was component critical and potentially could absorb a lot of power. Like kiwiAlan mentioned I also thought of a solution with a transformer. After some designing and simulating I came up with the following solution:

Edge2Pulse v2.png

According to the simulator it should give the following result:

Edge2Pulse_Graph v2.png

The green trace is one side of the +/- 18V track signal. The blue trace is the signal on the collector of Q1. Please note that for visualisation purposes I decreased the 18V to 5V and pause time for a 1-bit feedback from 6.4ms to approx.0.5ms.
Mind you the 28uH coil still gives an high inductive resistance for the frequencies used in a MFX signal (period times 50us, 100us and 19us). But that's something to solve/improve upon later.
After building the circuit I included an interrupt function in the ATC software capable of capturing the 52.63kHz signal from a decoder when respoding on a 1-bit feedback. On an oscilloscope (In Real Life) it looks like this:

Decoder 1-bit feedback.png


In the top window you see a 'Decoder Search command with 1-bit feedback' frame. The signals are the trigger signals (Purple) showing the start of certain events within a 'Decoder Search command with 1-bit feedback' on broadcast address 0. Yellow, signal on the track. Blue the output of my circuit. Bottom window, a zoomed in view of the beginning of the pause period.

When giving a Decoder Search command my software responds with:

Write frame in array bitArray to track: 10 0000000 111010 000000 00000000.00000000.00000000.00000000 01110010
1-bit response confirmed. Number of pulses counted: 337

10 0000000: 7 bit format address 0
111010: Decoder Search command
000000: counter
00000000.00000000.00000000.00000000: 32-bit decoder address 0
01110010: CRC

The number of 19us pulses I expect within the 6.4ms response windows is 336. The software counts 337. Good enough for me to deside for a positive 1-bit response.


The Bitstuffing, include a zero after transmitting eight ones, looks like this:

BitStuffing.PNG


Next stop finding out the decoder address (UID).

Greetings,

Roland
thanks 2 users liked this useful post by RCH
Offline revmox  
#23 Posted : 29 December 2024 23:39:21(UTC)
revmox

Australia   
Joined: 26/05/2021(UTC)
Posts: 198
Location: Australia, East Maitland, NSW
Hi Roland - and any others keeping an eye on this thread,

Fantastic work - that's a lot of progress in a few days - I'm very impressed. Thanks for sharing your ideas and circuit.

I guess it's a bit of a different approach when you are in control and generating the track signal and know what is coming as opposed to trying to interpret an unknown stream that's coming at you.

Can you please share any further details and source of the ferrite core you used - my local suppliers only have much larger items - they do work but smaller would be much better.

Please keep us up to date with your developments.

BTW - I rather like the ATC name - before retirement in 2011 I was the ATC Design Engineer (Air Traffic Control) with the Australian Air Force.

Cheers and well done, Mark.
thanks 1 user liked this useful post by revmox
Offline RCH  
#24 Posted : 30 December 2024 17:21:04(UTC)
RCH

Netherlands   
Joined: 19/12/2024(UTC)
Posts: 12
Location: Zuid-Holland, Delft
Hi Mark,

the ferrite core looks like this:

Edge2Pulse circuit.jpg

The actual dimensions can be found in the schematic in the previous post. It was a core that I had laying around. I didn't any specs on it. I determined the induction by adding a parallel capacitor and applying a sine wave. Based on the resonance frequency I could calculate the inductance of the coil. Then plugging in core dimensions and inductance in a 'ferrite core calculation program' I found on the internet I could make an assumption of the ferrite core specifics.

BTW I managed to retrieve the ID of the DHG700 lok, being 7df8dd24 and from the LokPilot5 module f9ee151c.
I can also successfully ping to the lok.

I'm getting close now.....

Greetings,

Roland
thanks 2 users liked this useful post by RCH
Offline revmox  
#25 Posted : 31 December 2024 03:57:48(UTC)
revmox

Australia   
Joined: 26/05/2021(UTC)
Posts: 198
Location: Australia, East Maitland, NSW
Thanks Roland,

I had a lot of toroids from various transmitters and receivers I designed but I thought I'd never use them again - they all went out in a clean-up earlier this year - typical.

I'm slightly puzzled by the resistor values around Q1 in your feedback detector - are you getting enough input signal to pull it out of saturation?

Cheers again, Mark.
Offline RCH  
#26 Posted : 31 December 2024 16:26:12(UTC)
RCH

Netherlands   
Joined: 19/12/2024(UTC)
Posts: 12
Location: Zuid-Holland, Delft
Hi Mark,

bummer that you threw away a these life necessities... I know the feeling when you throw something away that you haven't used for years and the next day you need it.

About your question, the transformer has a ratio of 1:1. In the primairy side a current of 100mA will flow generated by the decoder. So you can expect this current also in the secundairy side. Together with the 10 ohm resistor this will give 1V. You can see this also in the simulation (green trace). The signal on the secundairy side is high enough to saturate the transistor.
For the number of windings on the ferrite core I used my gut feeling, since I didn't knew the specifics of the ferrite core. I would like to see less windings hence reducing the inductance but I don't know how many windings I can reduce.
Also the 1-bit feedback signal has a higher frequency than the regular data feedback from the decoder. I don't know this for sure yet because data feedback is another challenge to figure out.

Hope this helps.

Greetings,

Roland
thanks 2 users liked this useful post by RCH
Offline kiwiAlan  
#27 Posted : 01 January 2025 13:11:52(UTC)
kiwiAlan

United Kingdom   
Joined: 23/07/2014(UTC)
Posts: 8,455
Location: ENGLAND, Didcot
Originally Posted by: RCH Go to Quoted Post
Hi Mark,

bummer that you threw away a these life necessities... I know the feeling when you throw something away that you haven't used for years and the next day you need it.

About your question, the transformer has a ratio of 1:1. In the primairy side a current of 100mA will flow generated by the decoder. So you can expect this current also in the secundairy side. Together with the 10 ohm resistor this will give 1V. You can see this also in the simulation (green trace). The signal on the secundairy side is high enough to saturate the transistor.
For the number of windings on the ferrite core I used my gut feeling, since I didn't knew the specifics of the ferrite core. I would like to see less windings hence reducing the inductance but I don't know how many windings I can reduce.
Also the 1-bit feedback signal has a higher frequency than the regular data feedback from the decoder. I don't know this for sure yet because data feedback is another challenge to figure out.

Hope this helps.

Greetings,

Roland


I would reduce the windings on the primary side. The 10 ohm on the secondary will be reflected back as a 10 ohm series resistance in the primary, and that is far too much. I would reduce the primary to about a quarter of the turns you currently have, then after the 10 ohm load resistor put about a 1k series resistor to the base of the transistor, and a 1N4148 or similar small signal diode in reverse across the base-emitter of the transistor to protect it from the higher voltage it is going to see.

You could probably reduce the 10 ohm to somewhere around 3 to 5 ohms as well without affecting the secondary side operation, but will reduce the effective voltage drop on the primary side. I would do this as a second step after making sure the change in winding ratio works first.
Offline RCH  
#28 Posted : 01 January 2025 14:53:58(UTC)
RCH

Netherlands   
Joined: 19/12/2024(UTC)
Posts: 12
Location: Zuid-Holland, Delft
Thanks for chipping in. You said I could reduce the number of windings of the primairy side to a quarter of the current number. Why not one winding? What would be the penalty?
And you did not mention the secundairy side. Do you think I should also reduce the secundairy side to the same number and keep the 1:1 ratio?

About the 10 ohms, I agree this value reflects back to the primairy side but keep in mind that during normal driving operation (=read when power is needed to drive the trains) the lowest frequency is 10kHz (100us). With a given current inductance of 28uH this means an inductive resistance of 1.8 ohms. The 10 ohm will be not dominant. And bear in mind that when reading out the decoder the track driver electronics is placed into a special state. The highest current is comming from the decoders giving feedback.
However I would like to see this the inductance value lower resulting in less losses, less windings and a smaller ferrit core. But, again, how many winding would still be feasible?

At this moment it's working (but could be improved) and made big steps in understanding the MFX protocol. Perhaps even more then I show...Drool .

I'm looking forward to your answer.
thanks 1 user liked this useful post by RCH
Offline ChrisKenna  
#29 Posted : 05 January 2025 11:15:37(UTC)
ChrisKenna

Australia   
Joined: 10/10/2024(UTC)
Posts: 28
Location: NSW Australia
Originally Posted by: revmox Go to Quoted Post
It seems like mfx is now 20 years old but there a still lots of really basic questions. This may all be ancient history to most forum members but I'm relatively new to the mfx world and have been struggling to understand some of the weird things it does. I particularly hate it when I turn the layout on and a lok that I know has connectivity ignores all commands for several minutes then suddenly launches off down the track without warning. Here's a post by someone else with similar issues -

http://blog.mailez.de/eb...-frustrating-experience/

Mucking around looking at what might be behind these problems I created an Arduino based sampler that gives me readout of the mfx communications packages. Can store and display about 40 seconds of track communications.

MFX_SAMPLER.jpg

And also a carriage I can plonk on the tracks to see what addresses the controller is talking to. It's a bit cumbersome but I can identify a lok address by switching directions and watching the display.

MFX_THING.jpg

PXL_20240924_223723680.jpg

I'd made some progress myself but found a great document on Stefan Krauss's website where a team really dug into the workings of mfx. In German but easily translated online. https://www.skrauss.de/

Anyway, what I have so far is all in development and unfit for sharing. I'm really limited in how far I can dig into and test things as I only have dual MS2's, about 10 loks and everything else is good, sensible, old-fashioned analogue.

I've tried searching online but anything that looks promising usually turns out be either a dead link or about the previous MM protocol.

I think I understand the steps of the mfx registration process but would really appreciate it if someone else can point me to further details on how mfx works.

Cheers, Mark.


Wow, impressive tech expertise shared here - all the best for fixing the problem.
Note to self: analogue seems simpler?


With respect and thanks to Ngannawal, Ngambri and all First Nations people
thanks 1 user liked this useful post by ChrisKenna
Offline rhfil  
#30 Posted : 05 January 2025 17:02:01(UTC)
rhfil

United States   
Joined: 05/09/2014(UTC)
Posts: 674
Location: NEW HAMPSHIRE, Somersworth
ChrisKenna is your controller a CS3?
thanks 1 user liked this useful post by rhfil
Offline bobyAndCo  
#31 Posted : 20 March 2025 23:02:46(UTC)
bobyAndCo

France   
Joined: 20/02/2024(UTC)
Posts: 20
Location: France - Bretagne
Hello everyone,

I'm just discovering this thread. You have all done a great job.

Roland, I've seen that you're working on an ESP32 MFX control unit. How far along are you?

For my part, I've also made such a station, which I've presented here https://www.marklin-user...es-without-CS-2-3-or-MS2 before I discovered this thread.

UserPostedImage

I'm using an L6203 booster which allows about 5A https://docs.rs-online.c...bee/0900766b814f5846.pdf

On ESP32, the use of timers is not a good solution and I used the RMT which gives a perfect signal (on the oscilloscope) and on the rails.

Mark, I've seen what you've done. Very impressive. I see we have the same source Stefan Skrauss.

Have you sorted out the RDS feedback as I understand it ? That's what I'm struggling with to finalize my power plant. I'll be watching your work with interest.

It's late now and I won't be able to continue exploring this work today, but I'll be looking at it with great interest in the days ahead.

On your side, do not hesitate if you want to exchange and why not advance in common on these projects.

Best regards

Christophe
thanks 1 user liked this useful post by bobyAndCo
Offline bobyAndCo  
#32 Posted : 20 March 2025 23:29:09(UTC)
bobyAndCo

France   
Joined: 20/02/2024(UTC)
Posts: 20
Location: France - Bretagne
Originally Posted by: RCH Go to Quoted Post

Next stop finding out the decoder address (UID).


Roland,

If you're still looking, this program (on ESP32) does the job : https://github.com/BOBILLEChristophe/MFX_discovery

Christophe



Offline RCH  
#33 Posted : 24 March 2025 11:18:27(UTC)
RCH

Netherlands   
Joined: 19/12/2024(UTC)
Posts: 12
Location: Zuid-Holland, Delft
Hi Christophe,

I'm almost done with the ATC. I found an alternative method for reading the decoder feedback. I managed to resolve the feedback issue with the ESP32 and some very basic electronic parts (see some posts ago). No RDS chip. It's however not bulletproof but it's a start one which the community can work on. At this moment I'm writing text for my website and Revmox is correcting my English. Revmox is trying yet another way the read the decoder feedback.
Writing the text is however a time consuming effort. And time is, well you known, a hard to come by commodity.

When I have something to present I will share.

Greetings,
Roland
Offline bobyAndCo  
#34 Posted : 25 March 2025 10:37:15(UTC)
bobyAndCo

France   
Joined: 20/02/2024(UTC)
Posts: 20
Location: France - Bretagne
Thank you Roland for this very encouraging message.

I'm very interested in this question of MFX feedback. I know how much time and effort it takes to look for DIY solutions, especially when there is little or no documentation on the subject, which is the case with the Marklin RDS. And even on forums like this one, which is global in scope, we often feel quite alone.

And also when you don't have all the skills at your disposal, as I do. I think I can classify myself as a programmer (which is what I do for a living), but unfortunately I'm not much of an electronics expert!

Don't hesitate to share your code, even if it's very incomplete, as I may still be able to help you.

I hope this project has a happy ending.

Christophe
Offline bobyAndCo  
#35 Posted : 25 March 2025 10:46:28(UTC)
bobyAndCo

France   
Joined: 20/02/2024(UTC)
Posts: 20
Location: France - Bretagne
Originally Posted by: RCH Go to Quoted Post
Hi Mark,

I took upon me the challenge to make a MFX controller by myself. So no Gleisbox and/or Central Station, really build it yourself. I'm using an ESP32 and a DFRobot motor driver board (https://www.dfrobot.com/product-1512.html) to drive the decoders.


Hi rolland

Can you publish the code of this power plant? Is it based on ESP32?

I'm very interested to see in particular the technology you used for signal processing. Timers or RMT???

Timers are very temperamental on ESP32 especially with WiFi. The DCC-Ex project uses RMT and I have copied them at this point.

For your information, I'll give you the link to my control unit. https://github.com/BOBIL...ristophe/directMFX_ESP32

Christophe
Offline bobyAndCo  
#36 Posted : 04 April 2025 09:57:50(UTC)
bobyAndCo

France   
Joined: 20/02/2024(UTC)
Posts: 20
Location: France - Bretagne
Hi Roland,

Would you be willing to share the electronic schematic and the list of components for the RDS feedback?

That's what I'm currently stuck on.

Thanks in advance.

Best regards

Christophe
thanks 1 user liked this useful post by bobyAndCo
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-2025, Yet Another Forum.NET
This page was generated in 1.352 seconds.