*OS-DBTC* The 2nd Generation Open-Source-DBTC Thread

RT_Coker Feb 26, 2016

  1. RT_Coker

    RT_Coker TrainBoard Supporter

    516
    33
    13
    This thread is for general public announcements from the “Open-Source-Direct-Bluetooth-Train-Control” (OS-DBTC) Group (to be).

    The OS-DBTC group is developing 2nd generation (2G) Direct-Bluetooth-Train-Control (hardware, embedded-firmware, and iThing Applications).

    It is also a place for open general discussions of this group’s “2G” activities and interests.

    2G-DBTC will initially use hardware consisting of two existing boards (with battery-power for the mobile-decoders). [This way the development effort will not be short-circuited by the unavailability of suitable hardware for demonstration locomotives and stationary-decoders.] The 1st generation BlueTrain firmware will be ported to the new processor.

    Bob
     
    Simon Mitchell likes this.
  2. RT_Coker

    RT_Coker TrainBoard Supporter

    516
    33
    13
    Looks like I might have found an off-the-shelf board for HO-scale open-source DBTC (Romeo BLE Mini Microcontroller). Board information here: https://www.dfrobot.com/wiki/index.php/Romeo_BLE_mini_SKU:DFR0351.

    I pick up 2 boards for ~$30 each on eBay, and I am considering porting my PIC18 C code back to the Atmega328P.

    Bob
     
  3. wvgca

    wvgca TrainBoard Member

    499
    305
    21
    I'm assuming 9V battery power to keep within the 10v limit of the romeo mini?
     
  4. RT_Coker

    RT_Coker TrainBoard Supporter

    516
    33
    13
    Yes (to start with), defiantly not ideal for the typical HO loco; will not be getting maximum power. I found an early schematic that show the DRV8833PWR being used for motor control. Its limit is 10.8 volts, so the board limit is probably a little conservative. There is just not enough interest in DBTC to justify H/W development yet.

    Bob
     
  5. wvgca

    wvgca TrainBoard Member

    499
    305
    21
    First.. I checked that Romeo board on eBay, price wasn't bad, but only one source shown .. not ideal supply..
    Secondly.. 9V _may_ be enough.. should be able to get just over 8V to the motor, and that should be enough for most higher speed operations, more should not be required for realistic operation .. :)
     
  6. RT_Coker

    RT_Coker TrainBoard Supporter

    516
    33
    13
    Looks like a good supply of DFR0351 boards here: http://www.robotshop.com/en/romeo-ble-mini-microcontroller.html.

    My code uses the T1 16-bit-counter which is not available on this board because the two T1-input-Atmega-pin-options are used for a PWM output. But a redesign of the distance-&-motor-speed-control for T0 8-bit-counter looks doable.

    Bob
     
  7. wvgca

    wvgca TrainBoard Member

    499
    305
    21
    For what it's worth, I feel that this would be a viable project ...
    For those who prefer 'dead rail', or rail for battery charging, the end cost would be substantially less than current commercial decoder products, and even a new tablet for control is in most cases less than a conventional hand held wired controller, and much less than a wireless commercial offering?
     
  8. RT_Coker

    RT_Coker TrainBoard Supporter

    516
    33
    13
    I don’t recommend buying any DFR0351 boards for this project yet. I am having some problems setting up a baseline test that demonstrates that these boards are basically working.

    Also this is definitely not “my day” my laptop when down suddenly as I was responding here. I got it back up, but it appears I lost something on my WiFI board.

    Bob
     
  9. RT_Coker

    RT_Coker TrainBoard Supporter

    516
    33
    13
    Unless “lighting strikes”, I am giving up on the DFR0531 boards.

    The Arduino IDE would not compile on my Vista laptop. It gave the infamous (“avr-g++: error: CreateProcess: No such file or directory”) error for which there appears to be no real solution. As I planned to use Atmega IDE this was not a big issue.

    The DFR0531 board’s Bluetooth would not “pair” with my Window’s 10 laptop (or Bluetooth-dongle Vista-PC), and it would not take the Bluetooth-firmware-upload. So I can only conclude the board’s Bluetooth does not work.

    Some or all of these problems may be something I am doing wrong. But without being able to get a baseline-board-setup, there is no point in going any father with this board.

    Bob
     
  10. RT_Coker

    RT_Coker TrainBoard Supporter

    516
    33
    13
    It turns out that the DFR0351 boards Bluetooth F/W only connects with boards from the same company, and apparently there are no plans to upgrade the F/W. … [The rest has been censored by me!]

    Bob
     
  11. RT_Coker

    RT_Coker TrainBoard Supporter

    516
    33
    13
    I had to put the Arduino IDE (just used for DFR0351-baseline-board-tests) on window’s 10 to get it to work. Also got the latest version Atmega IDE (used to build my BlueTrain atmega328p-firmware) installed.

    There is supposedly a special-USB-dongle (delivery expected in the first week of December) that will allow a Bluetooth-PC-serial connection to the DFR0351 (needed for my win32-test-program, BlueCmd). Apparently Android & IOS Apps (for user-versions of BlueCmd) are doable without this special-USB-dongle.

    Bob
     
  12. RT_Coker

    RT_Coker TrainBoard Supporter

    516
    33
    13
    Got the DFR-Dongle in and it works for me. I am able to wirelessly download and control the DFR0351 board form the Arduino IDE. This means that I can proceed with my BlueTrain OS-DBTC firmware transition for a PIC to the Atmega328p on the DRF0351 board using Atmel Studio.

    However, my initial effort to wirelessly connect and control the DRF0351 from an android-tablet was not successful. I will keep working this issue, because eventually my win32-BlueCmd program should be ported to an App for Bluetooth-iThings. This may take awhile for this App development is new to me and will be only a sideline as necessary to my BlueTrain OS-DBTC work. My Interface Manual and BlueCmd package can be downloaded here: https://sourceforge.net/projects/dbtc/files/BlueTrain/

    Bob

    LINKS for those that are interested or just want to play with an OS-DBTC setup of their own:

    Initial Reference: https://www.dfrobot.com/wiki/index.php/Romeo_BLE_mini_SKU:DFR0351

    Free Arduino IDE here: https://www.arduino.cc/en/Main/Software

    DFR0351 on eBay here: http://www.ebay.com/itm/Romeo-BLE-M...687722?hash=item1a1e9bf7ea:g:qI4AAOSwnbZYEOKG

    DFR-Dongle on eBay here: http://www.ebay.com/itm/182114342135?_trksid=p2060353.m2749.l2649&ssPageName=STRK:MEBIDX:IT

    If related threads titles start with “*OS-DBTC* “ (on this and other forums), they will be easier to find and follow (just a suggestion).
     
  13. RT_Coker

    RT_Coker TrainBoard Supporter

    516
    33
    13
    *** The OS-DBTC baseline is now complete!!! ***

    The door is now open for the development of Open-Source-Direct-Bluetooth-Train-Control.

    The DFR0351 board is being controlled by the “Bluno Basic Demo” App on my android phone. The problem was my “?good deal?” Android tablet! I should not have assumed that it had bluetooth-4.x just because it had android 4.x.x.

    I will be working on the BlueTrain F/W for the DFR0351 board.

    And looking for somebody(s) that can/will do the initial BlueCmd Android App(s).

    It should also be possible for you H/W types to turn the DFR03151 board into a plug replaceable unit for DCC decoders.

    Bob
     
  14. RT_Coker

    RT_Coker TrainBoard Supporter

    516
    33
    13
    Tested wireless firmware update (PC-Dongle to DFR0351). It took less than one minute.

    Also tested wireless range. No problem with units at opposite ends of ~70 foot house and with the DFR0351 in separate room with two Wi-Fi-routers.

    Bob
     
  15. RT_Coker

    RT_Coker TrainBoard Supporter

    516
    33
    13
    The BlueTrain3-Test-Breadboard is complete with an Adriano Sketch that tests/demonstrates the DRF0351 as a DBTC-control-board. The motor and tachometer are from the old (and worn out)) BlueTran1 & 2.

    There is (1.5 amp) + - Motor-Control, 4 (20 ma ground) light type outputs (F0, F1, F2, & F3) and 2 ~1.5 amp Motor-Voltage outputs (F4 or F5) {both will not provide voltage at the same time}. There is also a (future F/W upgrade) Back-EMF input, Tachometer input, Mark-Interrupt input, and (future F/W upgrade) IC2 interface. F0 (normally front-loco-light) is also feed by the Atmega328p-SCK signal. So the F0-light will show boot-up, F/W download, and connection activity of the DRF0351 board.

    I also have the DRF0267 and motor-shield boards for a Bluetooth-version of DCC++ (BTDCC++). I have future plans on using BTDCC++ to control a DCC-turnout(s) by command(s) from the execution-stack in BlueTrain3. This would allow a demonstration of BlueTrain3 autonomous automation capabilities. I have keep enough track for a simple oval with one DCC-turnout siding. I plan on putting this track on a board that can be titled up and down so that I can test/debug/verify the tachometer and future Bemf motor control under normal to extreme conditions.

    Bob
     
  16. RT_Coker

    RT_Coker TrainBoard Supporter

    516
    33
    13
    I will be using the IDE from Processing.org and its Android extension for a new version of BlueCmd (for Windows-PCs and android iThings). Many thanks to “Gregg” and his fine work with DCC++.

    Bob
     
  17. RT_Coker

    RT_Coker TrainBoard Supporter

    516
    33
    13
    Although the IDE from Processing.org appears to be good chose for BlueCmd. I just found Visual Studio 2015 Community, and will be using it for the time being. My Windows 98 BlueCmd program builds and runs directly in this new Visual Studio. This will allow me to spend more time and effort on the BlueTrain F/W, and to finally say good by to my old Windows 98 PC and Visual Studio 6.1.

    Bob
     
  18. RT_Coker

    RT_Coker TrainBoard Supporter

    516
    33
    13
    IMG_4192.JPG The BlueTrain3-Test-Locomotive is complete. The locomotive part is an analog-Bachmann-FTB with an added tachometer-wheel on the motor-shaft, IR-source/detector with mounting-bracket, and a magnetic-reed-switch on the bottom. The DRF0351 I/O used is +-motor-control-output, F0-frount-light-ground-output, tachometer-tick-input, 5-volt-mark-interrupt-input, and 5-volt-power. The back-emf-circuit will be added to the DRF0351 board after testing of the tachometer-motor-speed-control in the firmware. (No need for a separate loco speed measuring system!)

    Now that Christmas is complete and the grandkids are back in school, it is time to get to the intense work of porting the firmware from a PIC18 target to the atmega328p of the DFR0351. The titling-test-track will also be completed with the firmware porting, and will provide breaks from the occasional frustrations of firmware development.

    I also install and check out Android Studio for development of a BlueCmd App for Android iThings, and bough a cheap Andriod-10”-tablet that supports Bluetooth-4.0. The “BlunoBasic Demo” app on the tablet runs the BlueTrain3-Test-Locomotive with my Adriano-Studio-DFR0351-demo-stetch.

    Bob
     
  19. RT_Coker

    RT_Coker TrainBoard Supporter

    516
    33
    13
    I started porting the firmware today. In trying to find a design using the DFR0351 board to control the motor and also leave a usable counter/input for the tachometer, I managed to confuse myself into thinking I had a workable solution. What I have is a working DBTC solution without a working tachometer counter/input (a “dumb” DBTC-locomotive solution). The only possible solution that I see is to tack a wire on the DFR0351’s DRV8833PWR-pin-15 to get a T1-counter-input; something that is beyond my hardware capabilities. Apparently I have put in a lot of work and expense only to encounter another hardware-dead-end.

    Bob
     
  20. RT_Coker

    RT_Coker TrainBoard Supporter

    516
    33
    13
    Looks like BlueRail Train’s US patent application “WIRELESS MODEL RAILROAD CONTROL SYSTEM” has been rejected with a “Status: Final Rejection Mailed” and “Status Date: 07-01-2016”.

    Bob
     

Share This Page