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 Markus Schild  
#1 Posted : 29 June 2014 19:14:43(UTC)
Markus Schild

Germany   
Joined: 14/01/2006(UTC)
Posts: 1,737
Location: Wurttemberg
Hi,

Many modellers and enthusiasts still use the old – style Märklin turntable 7186 (aka 7026 / 410 N).

I was always bored by the control with the two knobs. If you want to turn from position 1 to 5 you must observe the turntable all the time and wait until it stops at every position just to start it again.

My aim was to build a replacement for the old two – knob device with a numeric control without any modification of the turntable itself. The control device only works with turntables in good condition. If the bridge has contact- problems these problems must be solved first.


Video:


http://youtu.be/OqSXKjg1Vvk


Layout:
UserPostedImage

Large scale version of the layout:

https://dl.dropbox.com/s/blw1h9knxbh7fg8/dreh300.jpg

All parts used can be bought from China for less than 25.00 EUR.

You need

Hardware (all ebay links just as a sample. I don’t have any preference for any of the sellers):





Software:


The most import part is the current sensor: It notices when the bridge has reached a position and triggers the restart.

When the sketch is installed the first time the EEPROM could contain an invalid value for the position. After installing the sketch the keys [ * ][ 0 ][ # ] must be pressed to rewrite the start-position.
At the initial start the turntable should be in the position between 0 and 7 like on the sketch below. On pressing one of the keys [ 0 ]-[ 9 ] it rides to according position. As a first test the key [ 1 ] should be pressed. If the bridge does not travel in the right direction to reach rail 1 in the shortest way, the red and green connections on the turntable must be swapped.
If the position is equal to the key pressed the loco is turned 180°.
If something is mismatched with the position of the bridge, pressing [ * ] <number of the rail> [ # ] overwrites the position in the memory according to the position chosen. In this programming mode a LED near the USB-port flashes rapidly.
If the key [ * ] is pressed by mistake, pressing [ * ] again leaves the programming mode.

Regards

Markus

Latest version 08/2016: https://dl.dropbox.com/s...sob8t/drehscheibe430.ino

Edited by user 21 December 2016 10:25:07(UTC)  | Reason: Restored lost code

thanks 21 users liked this useful post by Markus Schild
Offline Renato  
#2 Posted : 29 June 2014 20:02:26(UTC)
Renato

Italy   
Joined: 19/03/2004(UTC)
Posts: 976
Location: Gorizia, Italy
Hi Markus,

Fantastic!

I am just starting using Arduino and this is a very cool project.

Cheers

Renato
Offline matiasdc  
#3 Posted : 01 August 2016 01:35:37(UTC)
matiasdc

Argentina   
Joined: 01/08/2016(UTC)
Posts: 2
Location: Ciudad Autonoma de Buenos Aires, Buenos Aires
Hi excellent project, i am buy things to do it, but i can´t download the codification for the arduino, it isnt in the server, someone could help me please??, thanks!
Offline ixldoc  
#4 Posted : 01 August 2016 03:07:03(UTC)
ixldoc

Australia   
Joined: 18/11/2015(UTC)
Posts: 203
Location: Brisbane,Australia
Hi Markus,
Great idea! Always nice to modify an item to improve the function.
Can I ask ( as I am not able to code), does the solenoid drop in between tracks but is immediately re-energised to keep the bridge moving to the selected one? Also is that what the current sensor detects?
Regards,
Howard.
Offline Bigdaddynz  
#5 Posted : 01 August 2016 09:31:01(UTC)
Bigdaddynz

New Zealand   
Joined: 17/09/2006(UTC)
Posts: 16,560
Location: New Zealand
Originally Posted by: Markus Schild Go to Quoted Post
drehscheibe401.zip (2kb) downloaded 166 time(s).


It seems like this file has disappeared - I get a message when trying to download "Error: Resource has been moved or is unavailable. Please contact the forum admin."
Offline Markus Schild  
#6 Posted : 01 August 2016 12:03:56(UTC)
Markus Schild

Germany   
Joined: 14/01/2006(UTC)
Posts: 1,737
Location: Wurttemberg
Originally Posted by: ixldoc Go to Quoted Post

Great idea! Always nice to modify an item to improve the function.
Can I ask ( as I am not able to code), does the solenoid drop in between tracks but is immediately re-energised to keep the bridge moving to the selected one? Also is that what the current sensor detects?



Hi Howard,

Here is the latest code: https://dl.dropbox.com/s...sob8t/drehscheibe430.ino

The current sensor detects if the motor is running: If the motor stops, the next position is reached and the program decides if it needs to restart the bridge by putting on the solenoid for 500 ms. In most cases also 250 ms work fine. This must be tested with the turntable used.

Regards

Markus

Edited by user 21 December 2016 10:24:24(UTC)  | Reason: Not specified

thanks 2 users liked this useful post by Markus Schild
Offline patrick5678  
#7 Posted : 20 December 2016 21:23:40(UTC)
patrick5678

Germany   
Joined: 20/12/2016(UTC)
Posts: 1
Location: Nuremberg, Bavaria
Hi Markus,

Awesome project. Got all the material together, but my 7186 still needs a make-over.

Studying the code: What is button A's (ziel = 17) function? I do not really understand turn=0, turn=1, turn=2.

Many thanks for your help and sonnige Grüße aus Bayern.
Patrick

Code:


 if (ziel == 17) {
      turn = 1;
    }

// other code

if (turn == 0) {
            auftrag = schritte;
            Serial.println("kein turn");
          }

          if (turn == 1) {
            Serial.println("turn 1 erkannt");
            Serial.println(schritte);
            if (schritte > 0) {
              Serial.println("schritte groesser null");
              schritte = schritte - 8;
              Serial.println(schritte);
              auftrag = schritte;
              turn = 0  ;
            }
          }
          if (turn == 1) {
            Serial.println("turn 2 erkannt");
            Serial.println(schritte);
            if (schritte < 0) {
              Serial.println("schritte kleiner null");
              schritte = schritte + 8;
              Serial.println(schritte);
              auftrag = schritte;
              turn = 0  ;
            }
          }
Offline Markus Schild  
#8 Posted : 21 December 2016 10:27:44(UTC)
Markus Schild

Germany   
Joined: 14/01/2006(UTC)
Posts: 1,737
Location: Wurttemberg
Hi Patrick,

That was an error. That version was not intended to be published. I changed the links above to a valid version.

Regards

Markus
Offline JWS  
#9 Posted : 06 January 2019 10:11:24(UTC)
JWS

Netherlands   
Joined: 06/01/2019(UTC)
Posts: 3
Location: Zuid-Holland
Hi Markus,
I am new here, a dutchman in his sixties, who has started again, and found an old turrntable on ebay, and managed to copy your arduino scheme to run the turntable. Thank you for your scheme!! As I am using (the IB for) digital controle, I wonder if I could "easily" incorporate the arduino keyboard in the digital system (with turnoff decoder?) and nessesarily (?) changing of the (brown) mass connection of the turntable motor.
I just want to thank you again and will start searching this forum for the answers on my questions.
Greetings,
Jan Willem
thanks 2 users liked this useful post by JWS
Offline Markus Schild  
#10 Posted : 06 January 2019 22:47:52(UTC)
Markus Schild

Germany   
Joined: 14/01/2006(UTC)
Posts: 1,737
Location: Wurttemberg
Hi Jan,

Welcome to the forum. Yes, I thought about integrating it to a digital environment. But I have no ready to use solution so far.

Regards

Markus
Offline JWS  
#11 Posted : 11 January 2019 22:58:16(UTC)
JWS

Netherlands   
Joined: 06/01/2019(UTC)
Posts: 3
Location: Zuid-Holland
Hi Markus,
There must be a way to replace the 4x4 keyboard entries by a decodertype like k83 or a digikeys decoder? Iam no expert on this, maybe someone else on the forum?
Cheers,
Jan Willem (double first name)
Offline DaleSchultz  
#12 Posted : 12 January 2019 18:23:59(UTC)
DaleSchultz


Joined: 10/02/2006(UTC)
Posts: 2,989
Originally Posted by: JWS Go to Quoted Post
Hi Markus,
There must be a way to replace the 4x4 keyboard entries by a decodertype like k83 or a digikeys decoder? Iam no expert on this, maybe someone else on the forum?


yes, that is certainly possible to use the output of a K84 type decoder as an input to an Arduino type device. Treat the k84 as an input switch, connecting GND with an input pin.

For people who have access to the code of their layout software, I am also extending my RemoteSign syntax to drive network connected devices. I already have it at the point where I can do things such as trigger events, dim lights in the layout room, etc., from my train control software. I need to merge the documentation for the new RemoteSign commands into the SDK and also publish the RemoteSign library so that people can add it to their Arduino sketch and start calling it.

If you also use Blynk, and can issue HTTP calls from your layout software, then you can use their restful HTTP calls to trigger anything in your sketch.

Dale
Intellibox + own software, K-Track
My current layout: https://cabin-layout.mixmox.com
Arrival and Departure signs: https://remotesign.mixmox.com
thanks 2 users liked this useful post by DaleSchultz
Offline Markus Schild  
#13 Posted : 13 January 2019 08:52:40(UTC)
Markus Schild

Germany   
Joined: 14/01/2006(UTC)
Posts: 1,737
Location: Wurttemberg
Hi,

Just to describe my thoughts. This is all theoretically. It is not more than vaporware. And so far, I don't know whether I will realize it.


There is no MM-decoder with +10 functions. Using function decoders will work theoretically but will use a bunch of decoders and addresses. This will work but will be practically unusable.

I think about using an older decoder for locomotives. A MM decoder has 14 or 27 steps for the speed. These steps are realized as a pulse-wide modulation which power the motor. But these steps (the length of the pulses) could be also read by the Arduino. So, the knob on the control unit could become the control-device for the turntable.

Example: If the address of the decoder is chosen at the control-unit and the knob is turned to minimum speed for more than 3 seconds (to make the command valid), the decoder sends a pulse of X milliseconds (speed step 1) this could be interpreted as a command to turn the bridge to position A. A pulse of Y milliseconds (speed step 2) could be interpreted as a command to turn to position B. And so on. This would be at least useable also without a computer and needs only one decoder.

Foreseeable disadvantage: Due to different characteristics of different decoders this will work only with a specified decoder. Mabe only with a special decoder from one series.

Regards

Markus
thanks 2 users liked this useful post by Markus Schild
Offline Purellum  
#14 Posted : 13 January 2019 10:44:04(UTC)
Purellum

Denmark   
Joined: 08/11/2005(UTC)
Posts: 3,021
Location: Mullerup, 4200 Slagelse
Cool

Originally Posted by: Markus Schild Go to Quoted Post
There is no MM-decoder with 10 functions. Using function decoders will work theoretically but will use a bunch of decoders and addresses. This will work but will be practically unusable.


If you use a M83 decoder, you can use 7 of the outputs to count binary to 127, and use the 8th. output
to tell the Arduino when to read the binary number, to be sure you're not sending a lot of numbers while the M83 switches.

Per.

Cool
If you can dream it, you can do it!

I, the copyright holder of this work, hereby release it into the public domain. This applies worldwide.

In case this is not legally possible:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.

UserPostedImage
Offline JWS  
#15 Posted : 13 January 2019 23:04:39(UTC)
JWS

Netherlands   
Joined: 06/01/2019(UTC)
Posts: 3
Location: Zuid-Holland
Thank you Daele, Markus and Per, but I am afraid this is too much for me, at least at the moment. Iam thinking more to use simpel relais to connect the wires the same way when you push the matrix board. For the time being I only use gates 4,5 and 6 for the locdepot and opposite gate 8 to enter and leave the turntable. So 4 contacts to make, like 2 turnouts on a K83 but then with minirelais.......
Greetings,
Jan Willem
thanks 1 user liked this useful post by JWS
Offline TheesW  
#16 Posted : 17 March 2019 15:22:17(UTC)
TheesW

Germany   
Joined: 17/03/2019(UTC)
Posts: 2
Location: Berlin, Berlin
Hi,

thanks for posting this. I am struggling though to get it to work. I build it using your plan and uploaded the arduino sketch. The current measurement does not seem to work. Ampere is always sampled at around 18182.00 with or without load. Do you have any hint where to start investigating?

Greetings from nothern germany Confused
Offline Markus Schild  
#17 Posted : 18 March 2019 06:53:20(UTC)
Markus Schild

Germany   
Joined: 14/01/2006(UTC)
Posts: 1,737
Location: Wurttemberg
Hi,

That value is so far out of range that my only idea is, that there is something wrong with the ACS712 module itself or with the wiring. Also the power-supply for the module should be checked. Does the value change when you disconnect the module?

Regards

Markus
Offline TheesW  
#18 Posted : 19 March 2019 19:55:48(UTC)
TheesW

Germany   
Joined: 17/03/2019(UTC)
Posts: 2
Location: Berlin, Berlin
Originally Posted by: Markus Schild Go to Quoted Post
Hi,

That value is so far out of range that my only idea is, that there is something wrong with the ACS712 module itself or with the wiring. Also the power-supply for the module should be checked. Does the value change when you disconnect the module?

Regards

Markus


Hi,

My multimeter reads 550mA when the turntable is turning.

I simplified my setup to find the error and left only the ac712 on pin A2 and made a simple test sketch. analogRead will return values between 250 and 260. If I connect the AC712 without a load attached analogRead returns 876.00 constant. Putting a load on the ac712 does not change the value. I tried two different ac712 modules from two different suppliers already. I also checked if my arduino works correct. If I connect the 5V or 3.3V pins to an analog pin anlaogRead returns the expected values.

The high value from my first post is the result of this code I copied from the sketch you posted:
Code:
            ampere = 0 ;

            for (int i = 0; i < 50; i++) {
              ampere = ampere + (abs(analogRead(A2) - 512));

              delay(1);

            }


:-(
Offline DaleSchultz  
#19 Posted : 19 March 2019 20:09:19(UTC)
DaleSchultz


Joined: 10/02/2006(UTC)
Posts: 2,989
and do you divide the result by 50?
Dale
Intellibox + own software, K-Track
My current layout: https://cabin-layout.mixmox.com
Arrival and Departure signs: https://remotesign.mixmox.com
Offline Markus Schild  
#20 Posted : 20 March 2019 18:47:55(UTC)
Markus Schild

Germany   
Joined: 14/01/2006(UTC)
Posts: 1,737
Location: Wurttemberg
Hi,

So far I have no good idea what's going wrong here. I made about eight of these circuits for other people and all work fine with the code above. I will build another one to check the issue (mine is installed unreachable in the layout) but this will take some days.

Just one other idea: Do you use real AC from a real transformer? Or current from a switching power supply?

Regards

Markus
Offline chucky1983  
#21 Posted : 26 March 2019 18:21:54(UTC)
chucky1983

Germany   
Joined: 14/03/2019(UTC)
Posts: 2
Location: Schalkholz; Dithmarschen
Guten Abend. Ich habe eine Frage bezüglich des ACS712.... Wenn ich das auf dem Bild richtig sehe, denn kommt vom Trafo das gelbe Kabel, geht an + und - vom ACS712 und zum 2-Relais-Karte auf den jeweiligen mittleren Anschluß. Ist das so korrekt? Habe mir die ganzen Teile bestellt und warte nur noch auf 2-Relais-Karte und auf ACS712...
Mit freundlichem Gruß
Torsten Janner aus Deutschland
Offline Webmaster  
#22 Posted : 26 March 2019 21:10:04(UTC)
Webmaster


Joined: 25/07/2001(UTC)
Posts: 10,810
Translated by Google for the non-Germans:

Good evening. I have a question regarding the ACS712 .... If I see that in the picture correctly, because the transformer comes from the yellow cable, goes to + and - from the ACS712 and the 2-relay card on the respective middle connection. Is this correct? I ordered all the parts and just wait for 2-relay card and on ACS712 ...
Sincerely
Torsten Janner from Germany
Juhan - "Webmaster", at your service...
He who asks a question is a fool for five minutes. He who does not ask a question remains a fool forever. [Old Chinese Proverb]
Offline chucky1983  
#23 Posted : 26 March 2019 21:18:14(UTC)
chucky1983

Germany   
Joined: 14/03/2019(UTC)
Posts: 2
Location: Schalkholz; Dithmarschen
Thanks for the translation. My Chrome Browser automatically translates English into German
thanks 1 user liked this useful post by chucky1983
Offline Markus Schild  
#24 Posted : 27 March 2019 08:07:05(UTC)
Markus Schild

Germany   
Joined: 14/01/2006(UTC)
Posts: 1,737
Location: Wurttemberg
Hi Torsten,

Only the current for the right relay is monitored by the ACS712. Look for the "bridge" in the wire. The left relay is connected directly to the transformer.

drehausschnitt.jpg

Regards

Markus
Users browsing this topic
OceanSpiders 2.0
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-2019, Yet Another Forum.NET
This page was generated in 0.498 seconds.