Dave Bodnar wired throttle problems

jamescoleman1960 Aug 23, 2019

  1. jamescoleman1960

    jamescoleman1960 TrainBoard Member

    42
    15
    6
    Hello Everyone
    I have built the Dcc++ base station and have it working with JMRI. I found Daves wired throttle and thought it would be great for my 4-5 year old grandkids to run trains with. I have built one using a Nano instead of the pro mini that Dave used and a 3d printed control box to fit the components into. The throttle acts like it is working correctly and sends the commands to the base station of <1><t1 3 0 0> thru <1><t1 3 126 0> for reverse and <1><t1 3 0 1> thru <1><t1 3 126 1> for forward shown in the serial command monitor as you turn the pot each way but the power lights on the MD do not come on like when you turm power on with JMRI and no movement of the loco. Is there some lines of code in Dcc++ that need to be added or changed to get the base station to accept the throttle commands?
     
    Last edited: Aug 23, 2019
  2. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    Hi,
    I'm not sure exactly how you've wired the throttle into the DCC++ basestation at the same time as JMRI?

    The <1> at the start of each throttle command should certainly switch the track power on. However if you have a PC connected to the same serial port on the DCC++ basestation as the throttle, you may well have a conflict and the commands may not get through correctly?

    I do not use JMRI but I believe JMRI should be physically disconnected when Dave's throttle is used.

    Jim
     
  3. jamescoleman1960

    jamescoleman1960 TrainBoard Member

    42
    15
    6
    I dont have JMRI running when I`m trying to use the hand throttle. I have the throttle wired up +5,Grd,and the TX from throttle to RX1 on base station. I have tried changing the Throttle signal wire to the other RX pins on the mega2560 base station and get no feedback from it. If i manually type in the command <1><t1 3 126 1> or <1><t1 3 126 0> in the serial monitor the loco goes full throttle in forwards or backwards respectively. When the throttle is hooked up i see the commands <1><t1 3 126 1> appear in the serial monitor but nothing happens. I just noticed your comment about conflicts with my laptop and the base station and the hand throttle and hooked up a separate 5V power source and disconnected the laptop still wont work i even tried hooking up to the other RX pins but no luck! At this point I dont know what to do other than to try setting up the wifi system in JMRI and some old tablets or phones I have with an android throttle app for the grandkids.
     
  4. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    The throttle or jmri tx pin should be connected to the bastation rx pin and throttle or jmri rx pin connected to the bs tx pin. If when you had jmri connected at the same time as the throttle you could see the throttle commands then you must of had the tthrottle pins reversed becauuse for jmri to see the throttle commands you would need ti have the jmri tx connected to the throttle rx and rx to throttle tx. In other words you should not be able to see the throttle's commands with jmri unless you reverse jmri connections.
     
    Last edited: Aug 25, 2019
  5. jamescoleman1960

    jamescoleman1960 TrainBoard Member

    42
    15
    6
    I dont use JMRI when trying to test the throttle.I have tried with and without my laptop hooked up to the base station. I have verified that the base station works correctly. When the throttle is hooked up to the base station it sends commands but nothing happens if I manually send the command <1><t1 3 126 1 or 0> the loco moves. Even tho the throttle send`s the exact same command the loco doesnt move. I have tried every RX pin on the mega no luck with the throttle.So i dont know what to do now.
     
  6. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    Im sorry I'm not explaining it very well. If you have jmri connected to the basestation and it it all works, then you connect the throttle as well to the same port. If before you disconnect the pc you can see the wired throttle commands using jmri or a serial monitor, it means that you have the wired throttle tx and tx pins reversed.
     
  7. jamescoleman1960

    jamescoleman1960 TrainBoard Member

    42
    15
    6
    I have verified that the wire coming from the throttle is hooked up to the arduino TX in throttle, and RX on the base station per daves schematic one thing i had hooked up wrong was 5V from base station to 5V on throttle arduino which i changed to Vin per the schematic but it made no difference . I see the throttle sending commands to the base station in the Arduino IDE serial monitor window. I have tried the throttle with the laptop connected to base station and with the laptop not connected so I would think there would be no conflict between the two when unhooked from the laptop.
     
  8. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    " I see the throttle sending commands to the base station in the Arduino IDE serial monitor window"

    This is the thing though; If you can see the throttle commands in the serial monitor (eg <1><t1 3 0 0>) it means that your throttle is wired incorrectly. The serial monitor should only show the return data from the basestation, which won't be <1><t1 3 0 0>. You should not be able to see the throttle commands in that format in the serial monitor.


    JMRI or Serial monitor PC connection;

    PC............................................Basestation

    Tx----------------->-----------------------Rx
    Rx-------------------<---------------------Tx


    Wired throttle connection;

    Throttle.......................................Basestation
    Tx------------------->-----------------------Rx
    Rx--------------------<---------------------Tx





    This (below) is how I think you have it connected if you can see the commands on the PC, The basestation will never 'hear' the throttle commands, because the Throttle Tx is connected to basestation Tx.


    Throttle........ Basestation................. PC

    Tx--------->------Tx---------->----------Rx (PC shows the throttle commands because throttle Tx is connected to PC Rx)


    Rx---------< ------Rx---------<----------Tx
     
  9. jamescoleman1960

    jamescoleman1960 TrainBoard Member

    42
    15
    6
    There is no return signal from the Base Station to the throttle
    I have it hooked up like this

    throttle ....... base station
    TX----->----------RX1 this is the only RX that shows in serial monitor I have tried RX0-RX3 when not hooked to PC thinking PC was causing a conflict.
    VCC----<---------5V
    Grn-----<--------Grn
    per daves schematic

    When I have my laptop connected its

    Throttle...............Base Station............via usb...<>...Laptop
    TX------->-----------RX
    VCC-----<-----------5V
    Grn-----<-----------Grn
    so I can see where there could possibly be a conflict between the throttle and laptop when connected that way

    I have also hooked the throttle directly up to my laptop and PC with the USB programming cord and opened the Arduino serial monitor to see if it is sending signals. the only thing I can say is the throttle sends a constant string of commands of <1><t1 3 0 1> until the pot is turned, once at full throttle in forward or reverse it sends <1><t1 3 126 1or0> depending on direction, or you hit the loco change button or enter loco address change button
    then the last thing in the command strings is the last command you have sent from the throttle.

    in the serial monitor when first turned on with Pot in the 0 speed position I will see
    <1><t1 3 0 1><1><t1 3 0 1> over and over until a throttle speed change is made I assume this is some monitoring done by the code

    Once speed change or loco change has been done then the last command will be <1><t1 3 0-126 0-1> in the string
    depending on which way you turn forward or reverse and how fast you set the speed.
    so I dont know what could be the problem.

    I understand there could be a conflict between JMRI and the throttle so I never try to use it with JMRI on.
     
  10. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    I don't have a Mega, but looking at the spec the USB port is paralleled up with serial port 0 (this is the port DCC++ uses by default) so I'm sure you need to connect your throttle Tx to Mega pin Rx0 (and of course have the USB data lead disconnected).

    I do use the return data on my modified Dave Bodnar throttle, hence me mentioning the extra connection - sorry!
     
  11. jamescoleman1960

    jamescoleman1960 TrainBoard Member

    42
    15
    6
    I got it working the RX0 pin from the motor driver into the mega had bent and i didnt find it until i had to remove the MD to hook up track wires. Thanks for the help Jimbo! I would like to hear more about your modified throttle when you have time
    James
     
  12. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    Pleased to hear you got it working James. My layout and electronics hobby has been put on hold at the moment due to a house move, and now building work. I'm hoping to start up again before the end of the year though!

    Here are a couple of videos I made of my small n-gauge setup.





    Jim
     
  13. jamescoleman1960

    jamescoleman1960 TrainBoard Member

    42
    15
    6
    Hello Jim
    Nice work on the throttle and very nice layout!!
     
    Jimbo20 likes this.

Share This Page