Let's learn together - DCC Command Station (DCC model railway with Arduino 1)

Поділитися
Вставка
  • Опубліковано 6 лис 2020
  • Let's start learning together how to control a DCC model railway with Arduino.
    In this first episode, the basics of the DCC system and the creation of a command station with Arduino Uno and the official motor shield.
    MATERIALS
    - Arduino Uno: store.arduino.cc/arduino-uno-...
    - Motor shield: store.arduino.cc/arduino-moto...
    - Male-to-male jumper cables: bit.ly/3n53znk
    DCC++ SOFTWARE
    - github.com/DccPlusPlus/BaseSt...
    LINKS
    - Official DCC specs: www.nmra.org/dcc-rps-standards
    - List of DCC manufacturers: www.nmra.org/manufacturer-links
    - Softwares to control a digital model railway: dccwiki.com/DCC_Software
    -
    Music: Brighter Days by Markvard is licensed under a Creative Commons License.
    creativecommons.org/licenses/...
    Support by RFM - NCM: bit.ly/2xGHypM
    -
  • Наука та технологія

КОМЕНТАРІ • 17

  • @EsotericArctos
    @EsotericArctos 2 роки тому +3

    I started with DCC++ a little while back as I could not justify the huge cost of commercial command stations. IT was really quite good and while the layout was small it worked really well. When I started getting more complex, I found DCC++ was slowing down, missing commands and as developement had virtually stopped the bugs were not getting fixed.
    I moved from DCC++ to the DCC++EX project recently as the DCC++ project is virtually dead and not updated for many years.
    There is fairly big efficiency and speed difference with DCC++EX with the re-write. I find the development of DCC++EX and the speed improvements mean the more complex layout doesn't cause slowdowns or missed commands.

    • @lucadentella
      @lucadentella  2 роки тому +2

      Brendan, thanks for your comment... I agree: DCC++ EX is a very interesting project, I'll cover it in a future video!

    • @EsotericArctos
      @EsotericArctos 2 роки тому +1

      @@lucadentella I'd love to see that. If you do it, could you possibly cover accessory decoders as well with DCC++EX? I have struggled a bit finding the correct way to connect accessories with DCC++ and DCC++EX

    • @lucadentella
      @lucadentella  2 роки тому +2

      @@EsotericArctos if they are standard DCC accessory decoders they should work flawlessly with DCC++ (EX), anyway I'll cover them for sure! thanks for the suggestion

  • @nanderv
    @nanderv Рік тому +1

    I would suggest everyone who wants to use this in practice to extract the main code block into a separate function. What you could do is have some struct Station, containing the sensor pin number, as well as a desired direction, and an isEndStation boolean.
    Then you loop over this array, checking if the train is in any of these stations. If so, call a separate function, with the desiredDirection and isEndStation booleans given to this function.
    Do the stopping, delay, etc as usual, but add some if statements at the end to decide the direction.
    Nice tutorial, code is a bit much copy-paste-style for my taste.

    • @lucadentella
      @lucadentella  Рік тому

      Hi, are you commenting about the dcc++ code? I didn't write it, it's a (quite old) opensource project. There are some forks and I'll post a tutorial about one of the most promising ones (dccex). Thanks

  • @posets
    @posets 7 місяців тому +1

    Hi Luca, thanks for your work It was easy for me with your explanations.

  • @DukeBambaluc
    @DukeBambaluc Рік тому

    Bravissimo! Proprio quello che mi serviva!

  • @gocslaszlo
    @gocslaszlo 5 місяців тому

    Hello! Very good video!!!
    I can turn on the lights on the locomotive, the locomotive runs and suddenly everything seems to stop...
    At JMRI, the main switch remains green and changes to yellow with the inscription "Unknown" after clicking on it. 🤷🏻‍♂️🤷🏻‍♂️ USB off and on and it gets fixed, then the above error again.
    Locomotive and decoder tested with Multimouse, the control is perfect...
    Thank you very much!

    • @lucadentella
      @lucadentella  5 місяців тому

      Hi, it seems you're facing some issues with the connection between Arduino and your computer... or the Arduino board is resetting (which could explain why the locos suddenly stop. You can test the same setup with a different arduino board or a different shield to check if it's an hardware failure.

  • @lucadoemar
    @lucadoemar Рік тому

    Thanks for the info

  • @scentgrasslakerailway
    @scentgrasslakerailway Рік тому

    Excellent!

  • @longpastit
    @longpastit 3 роки тому

    Hi Luca, I enjoyed your video and i wish there were more of this type of thing.
    However I have to disagree with your waveform showing a +15 to -15 volt peak to peak waveform on the track. You can try measuring the ac voltage across the track remembering it's not a sine wave but basically a square wave and you should really use a true rms voltmeter but I think you'll find it closer to 15 volts than 30 volts.
    If you care to examine my primitive attempt to explain DCC at ua-cam.com/video/VR0WDaPbDPk/v-deo.html you'll find a waveform at 3.30 which you're free to use if it helps your series.
    Good luck

    • @lucadentella
      @lucadentella  3 роки тому +1

      Hi! Thanks for your comment, I published a series of videos (7 so far) about controlling a DCC model railway with Arduino:
      ua-cam.com/play/PL45uNmSXju7mn3bMtVVPlFQmpD3mUI5mi.html
      Regarding your note: it really depends on what you use as reference for your measurement. Voltage is always a "difference" between two points: if you display the voltage between the two tracks with an oscilloscope (single probe, one track as reference) you'll see a square wave between -15 and +15V. I cannot attach a picture but give a look to DCCWiki: dccwiki.com/DCC_Tutorial_(Power) their screenshot says "Vpp = 29.2V". This is another screenshot that displays the DCC signal: www.researchgate.net/figure/DCC-signal-across-rails-trains-stopped_fig7_318924580
      Of course if you take an "external ground" as reference, you'll see the two tracks switching alternatively between 0 and 15V.
      So I think we're talking about the same thing, with two different point of views.

    • @EsotericArctos
      @EsotericArctos 2 роки тому

      Not sure a true RMS meter will be accurate. RMS meters are generally used primarily for measuring average power/voltage of Sine waves.
      Measuring the "RMS" of a square wave is not really RMS as such, it is a caclulation of the average voltage based on duty cycle, the percentage of off and on. This is particularly tricky on DCC as the duty cycle is always changing depending on what signals are being sent to the track as the duty cycle determines the differences between a digtial 1 and a digital 0.
      Technically DCC is NOT an AC wave form. It is switching DC from -15V to +15V to create digital signals, which are represented by the duty cycle of the waveform. You need to think of it as switching DC and not like an AC sine wave.