Forums Power and Sound Power and Sound DCC
  • Topic: Bob's Adventures in DCC

    Back To Topics
    (0 rates)
    • December 13, 2018 2:47 PM EST
      • Maryville, Tennessee
         
      • Posts
        557
      • Thanks
        28
      • Thanked
        23

      If you want to make your DCC++ command station wireless, here is a good possibility.

      I have used these EPS-01 units and they are fast and have good range. You can pick them up for at:

      https://www.addicore.com/ESP8266-ESP-01-p/130.htm

      Be aware there are some ESP-01 modules from other vendors that have the small IC chip with "PUYA" stamped on it. This chip is not in the esp2866 library yet officially. The above vendor has been confirmed to have the good working chips installed on the ESP-01.

      Problem is the manufacturers code is not in the library to adjust the timing on how to program the chip (Spiffs).

      Symptoms is it will work upon programming, but remove power and restart the ESP-01 and the program is gone.

       

       

       

       

      This post was edited by Dennis Cherry at December 13, 2018 4:06 PM EST
      ____________________________________

      Dennis in East Tennessee

       

    • December 17, 2018 9:14 PM EST
    • (Moderator)
      • Your Host in Littleton, MA
         
      • Posts
        7,677
      • Thanks
        455
      • Thanked
        947

      In the last few days, I have most of the hardware and the code working as I want. I'm still waiting on the display to finish it up. 

      I've modified Dave's code to use buttons for speed up/speed down/e-stop. 

      Here's the keypad and the STM32 board I have it running on.  The STM32 board gives me much more memory to play with.  With the sketch loaded, the Arduino IDE reports:

      Sketch uses 39000 bytes (14%) of program storage space. Maximum is 262144 bytes.
      Global variables use 6576 bytes (20%) of dynamic memory, leaving 26192 bytes for local variables. Maximum is 32768 bytes.

       

       

      And a shot of the debug console

       

      ____________________________________

      Bob, your Site Host and Benevolent Dictator.

    • January 12, 2019 3:21 PM EST
    • (Moderator)
      • Your Host in Littleton, MA
         
      • Posts
        7,677
      • Thanks
        455
      • Thanked
        947

      I have things mostly working right now.  I have the display and keypad doing what I want.  I'll need to do some code changes to support the Nucleo L432KC, but it runs fine on an Arduino Uno.

       

      The A and B key are speed up/slow down.  Every click changes the speed by 1.  If you hold the button down, it changes it by 5 every half second or so.  The C key changes direction.  # switches between the stored locomotives, and * sets the currently selected 'slot' and allows you to enter a decoder number.  The base of this code is from Dave Bodnar's throttle, I just tidied up the code some and changed from a rotary to buttons for speed.  If anyone is interested in taking a look at the code, Ill zip it up and attach it to the thread.

       

       

      ____________________________________

      Bob, your Site Host and Benevolent Dictator.

    • January 12, 2019 8:52 PM EST
      • Charlottesville, Virginia
         
      • Posts
        384
      • Thanks
        6
      • Thanked
        59

      I'm interested.  You should archive it on github.  Its a great place to share code and libraries.

       

    • January 12, 2019 9:19 PM EST
    • (Moderator)
      • Your Host in Littleton, MA
         
      • Posts
        7,677
      • Thanks
        455
      • Thanked
        947

      Martin Sant said:

      I'm interested.  You should archive it on github.  Its a great place to share code and libraries.

       

      Yea, I put all my stuff on my Gitlab account.  I just dropped the throttle up there.

       

      https://gitlab.com/Rmccown/newthrottle

       

      Should get you there.

      ____________________________________

      Bob, your Site Host and Benevolent Dictator.

    • January 13, 2019 8:01 AM EST
      • Maryville, Tennessee
         
      • Posts
        557
      • Thanks
        28
      • Thanked
        23

      Is there any difference between using GITHUB and GITLAB?

       

      ____________________________________

      Dennis in East Tennessee

       

    • January 13, 2019 8:40 AM EST
    • (Moderator)
      • Your Host in Littleton, MA
         
      • Posts
        7,677
      • Thanks
        455
      • Thanked
        947

      Gitlab offers free private repos.  Github they cost $, or at least used to.  I use both.

      ____________________________________

      Bob, your Site Host and Benevolent Dictator.

    • January 13, 2019 8:41 AM EST
      • Rooster Works "Area 69" ,
         
      • Posts
        13,965
      • Thanks
        2,027
      • Thanked
        1,213

      Dennis Cherry said:

      Is there any difference between using GITHUB and GITLAB?

       

      I'm not sure but I know they are both lyrics from a James Brown album.

    • January 13, 2019 5:16 PM EST
    • (Moderator)
      • Your Host in Littleton, MA
         
      • Posts
        7,677
      • Thanks
        455
      • Thanked
        947

      Spent some time today and got it working on both the Arduino Uno and the Nucleo-32 L432KC. 

       

      Next up is getting it to work wirelessly via XBee

      ____________________________________

      Bob, your Site Host and Benevolent Dictator.

    • January 13, 2019 7:58 PM EST
      • Charlottesville, Virginia
         
      • Posts
        384
      • Thanks
        6
      • Thanked
        59

      What sort of data are you going to send over xbee?  Perhaps we could speak the same set of packet payloads.

    • January 13, 2019 8:22 PM EST
    • (Moderator)
      • Your Host in Littleton, MA
         
      • Posts
        7,677
      • Thanks
        455
      • Thanked
        947

      Martin Sant said:

      What sort of data are you going to send over xbee?  Perhaps we could speak the same set of packet payloads.

      The DCC throttle protocol is a VERY simple text-based protocol over the serial pins.  For example, here's me throttling from 0-5, then back down again, for locomotive 50:

       

      <1><t1 50 1 1><1><t1 50 2 1><1><t1 50 3 1><1><t1 50 4 1><1><t1 50 5 1><1><t1 50 4 1><1><t1 50 3 1><1><t1 50 2 1><1><t1 50 1 1><1><t1 50 0 1>

       

      and the same for locomotive 3

       

      <1><t1 3 1 1><1><t1 3 2 1><1><t1 3 3 1><1><t1 3 4 1><1><t1 3 5 1><1><t1 3 4 1><1><t1 3 3 1><1><t1 3 2 1><1><t1 3 1 1><1><t1 3 0 1>

       

      The commands are listed here

       

      https://github.com/DccPlusPlus/BaseStation/wiki/Commands-for-DCCpp-BaseStation

       

      At least for this, I dont really need any kind of fancy packets or anything, it just accepts the data on the RX pin, and I can send them out via the TX pin. 

      ____________________________________

      Bob, your Site Host and Benevolent Dictator.

    • January 13, 2019 9:15 PM EST
      • Charlottesville, Virginia
         
      • Posts
        384
      • Thanks
        6
      • Thanked
        59

      Hmm, ok.  I see.  Basically a radio usart.  API mode off.  Bytes in on the one side, bytes out on the other.   But it is the same concept, right?  Send a small 'packet' to the destination device, it builds the DCC stream?

    • January 13, 2019 10:01 PM EST
    • (Moderator)
      • Your Host in Littleton, MA
         
      • Posts
        7,677
      • Thanks
        455
      • Thanked
        947

      Martin Sant said:

      Hmm, ok.  I see.  Basically a radio usart.  API mode off.  Bytes in on the one side, bytes out on the other.   But it is the same concept, right?  Send a small 'packet' to the destination device, it builds the DCC stream?

       

      Pretty much.  This would be an ideal job for the HC12's that Ive been playing with, since they're basically a wireless text widget, but Ive had less than stellar results with range.  Still may try, since I have a handful of them.   But I also want to get more familiar with the XBee, because they'd be a better fit for my signaling mesh Ive been playing with.

       

      Decisions decisions.

      ____________________________________

      Bob, your Site Host and Benevolent Dictator.

    • January 19, 2019 1:00 PM EST
    • (Moderator)
      • Your Host in Littleton, MA
         
      • Posts
        7,677
      • Thanks
        455
      • Thanked
        947

      Video update on where I am

       

      ____________________________________

      Bob, your Site Host and Benevolent Dictator.

    • January 19, 2019 7:20 PM EST
    • (Moderator)
      • Your Host in Littleton, MA
         
      • Posts
        7,677
      • Thanks
        455
      • Thanked
        947

      In digging around for high-amp solutions, I found out Pololu has a 12A motor shield, the Pololu Dual VNH5019.

       

      https://www.pololu.com/product/2507

       

      Might be worth a try to see if it will work for DCC++

      ____________________________________

      Bob, your Site Host and Benevolent Dictator.

    • January 19, 2019 8:54 PM EST
      • Annapolis, MD
         
      • Posts
        11
      • Thanks
        0
      • Thanked
        1

      " Rooster " said:
      Dennis Cherry said:

      Is there any difference between using GITHUB and GITLAB?

       

      I'm not sure but I know they are both lyrics from a James Brown album.

       

       

      This post was edited by Victor P Spear at January 19, 2019 8:54 PM EST
    • January 19, 2019 8:55 PM EST
      • Annapolis, MD
         
      • Posts
        11
      • Thanks
        0
      • Thanked
        1

      They both provide very similar feature sets from the same core, GitHub is owned by Microsoft now and thereby are the  de-facto owners of the world's largest Open Source repository ;)

    • January 19, 2019 8:58 PM EST
      • Annapolis, MD
         
      • Posts
        11
      • Thanks
        0
      • Thanked
        1

      Bob McCown said:

      In digging around for high-amp solutions, I found out Pololu has a 12A motor shield, the Pololu Dual VNH5019.

       

      https://www.pololu.com/product/2507

       

      Might be worth a try to see if it will work for DCC++

       

    • January 19, 2019 9:03 PM EST
      • Annapolis, MD
         
      • Posts
        11
      • Thanks
        0
      • Thanked
        1

      Pololu Dual VNH5019 - It's an excellent driver with fine grain control capability and doesn't need a heat sink at high amperage runs but I still place one on it anyway. Been using it for years, with the built-in current sense features. The directional LEDs built in are another useful item.

      This post was edited by Victor P Spear at January 19, 2019 9:06 PM EST
    • January 19, 2019 10:10 PM EST
      • Charlottesville, Virginia
         
      • Posts
        384
      • Thanks
        6
      • Thanked
        59

      Fifty Bucks?  Ouch.  Are you driving motors or 'amplifying' DCC logic level outs?

Forums Power and Sound Power and Sound DCC

    Icon Legend

  • Topic has replies
    Hot topic
    Topic unread
    Topic doesn't have any replies
    Closed topic
    BBCode  is enabled
    HTML  is enabled

Add Reputation

Do you want to add reputation for this user by this post?

or cancel

Ads by Google