DCC++ Decoder CVs Reading Problem. Error 308 JMRI

Quentin Feb 24, 2018

  1. Quentin

    Quentin New Member

    3
    3
    1
    Hello everyone, i have a problem with my dcc++ base station.
    The Arduino Mega that i'm using and the power to the track seems to work
    I followed this schematics for my base station. My power supply is 12V DC 1A.[​IMG]

    I'm using the latest version of DCC++ on the github.
    I can power up the track with the Serial Monitor or with DecoderPro from JMRI software.
    When i'm trying to read CVs from the decoder all i get is either a result -1 from the serial monitor or a 308 error from JMRI.
    The only "physical" thing that's happening is the train moving just a little bit like step by step, more or less longer depending on the "length" of the CV that i'm asking. Moving a little bit forward when i'm asking CV 1 and a bit more when asking CV 95. Is that even normal ??

    Thanks in advance.
     
  2. ThomasP

    ThomasP New Member

    8
    15
    4
    Hello Quentin,
    I realize you are using the Mega with separate power stages for programming and operations track and with separate current sensing modules. Unfortunately, I am not familiar with this setup as I use an Uno with a Rev3 motor shield. But - and that is good news, the fact that your loco pulses and moves a little, means that it understands the commands and responds. The response just does not get heard by DCC++.

    I am sure the cracks in this forum will be able to help!

    Thomas
     
    Scott Eric Catalano likes this.
  3. Trusty

    Trusty TrainBoard Member

    52
    33
    6
    Hello. DCC++ uses a factor to smooth the result which can remove a lot of useful measurements (CURRENT_SAMPLE_SMOOTHING in CurrentMonitor.h). There is also a sensibility level the Max471 has to reach to detect the over current (CURRENT_SAMPLE_MAX in the same file).
    You can try to change these values to be able to get a better detection.

    When you want to read a cv from a decoder, the only way for it to send information is to consume power. And the best way to do that is to turn on the motor a very little time. A short time for a bit 1, a longer time for a bit 0. This is the reason why your loco moves. It is very normal, and better, it is necessary ! So it proves at least that your decoder is doing well... The problem is on the DCC++ side, which needs too much power to detect a bit. And some motors are too small to deliver enough power for the given time or the wanted level... Another possible problem is when the loco moves a bit duting this communication process, it looses the contact with the track and the following bits will not be sent. Try to just put your finger on the machine to force the contact during the communication. For me, it solves a lot of mistakes !
     
    Scott Eric Catalano likes this.
  4. Quentin

    Quentin New Member

    3
    3
    1
    Hello again, sorry for the late answer, thanks for your inputs, I didn't have the chance yet to retry the programming track but i'll post an update soon. I'll try to put my finger on the machine to see what happens, I managed to make it run on the main track with the default adress (3) so i hope it'll work.
     
    Scott Eric Catalano likes this.
  5. Pieter

    Pieter TrainBoard Member

    152
    46
    10
    Hi,

    If you are running HO your 12 v could be to low. See top right of your picture. You get about 1 to 2 less out than what you put in.
    In JMRI have you switch the Default pane to the connection you want to use
     
    Scott Eric Catalano likes this.
  6. Danny Moss

    Danny Moss New Member

    5
    4
    4
    I am also having a problem with my DCC++ error 308
    I am trying to use mine on my G gauge
    At the moment I can control a loco on the main track if I know its information and put it in manually but I cannot read anything on the main track or programing track.
    The loco does not pulse when trying to read the decoder, I justs getthe same error 308.
    I am using jmri so It could be something I am missing I am new to jmri
    Hardware is Arduino Uno and motor shield.

    did you work out your problem ??
    any help with this matter would be of most help
    Kind regards
    Danny
     
    Scott Eric Catalano likes this.
  7. Michel Goyard

    Michel Goyard TrainBoard Member

    37
    26
    8
    @ Danny : Do you get something other than -1 when trying to read the CV1 on the programming track with <R 1 123 123 > at 115200 bauds on the IDE serial monitor ?
    @ Quentin : as Trusty said, the communication to the locomotive is effective, but there is no reading from the MAX471 by the arduino. So could you check and recheck the cabling ? Maybe the ground return to arduino is (are) missing ?
     
    Scott Eric Catalano likes this.
  8. Danny Moss

    Danny Moss New Member

    5
    4
    4
    HI Michel,
    thank you for your reply
    If i send <R 1 123 123 >
    I see <r123|123|1 -1>
    Kind regards
    Danny
     
    Scott Eric Catalano likes this.
  9. Michel Goyard

    Michel Goyard TrainBoard Member

    37
    26
    8
    So you have the same problem as Quentin : check the cabling of the MAX471 ...

    If you have a DMM, you can look if there is a voltage change against GND on pin A1 (/ A0) when you ask for CV1.
     
    Last edited: Feb 27, 2018
    Scott Eric Catalano likes this.
  10. Trusty

    Trusty TrainBoard Member

    52
    33
    6
    @ Quentin : if your loco does not pulse, perhaps the decoder has not its communication function by current consumption activated. Some old decoders could have been created without this functionnality. Or perhaps in this kind of big scale, the weight of the loco is so important that you cant see the pulse ? You should check for the output of the loco first. If there are real pulses on the track, you will check the controller side.
     
    Scott Eric Catalano likes this.
  11. Michel Goyard

    Michel Goyard TrainBoard Member

    37
    26
    8
    [QUOTE="Michel Goyard, post: 1047727, member: 34461"
    check the cabling of the MAX471 ...[/QUOTE]

    @Danny,

    Sorry, you have no MAX471, the current sensing is made by the L298 of the motor shield, you use the underneath schema ...

    So still : If you have a DMM, you can look if there is a voltage change against GND on pin A1 when you ask for CV1 on programming track.
    If there is a voltage change the input of the arduino may be defective
    If there is no voltage change the current sense of the shield may be defective

    See Trusty answer and look if the power supply is sufficent for you motor ?
     

    Attached Files:

    Scott Eric Catalano likes this.
  12. Danny Moss

    Danny Moss New Member

    5
    4
    4
    @Danny,

    Sorry, you have no MAX471, the current sensing is made by the L298 of the motor shield, you use the underneath schema ...

    So still : If you have a DMM, you can look if there is a voltage change against GND on pin A1 when you ask for CV1 on programming track.
    If there is a voltage change the input of the arduino may be defective
    If there is no voltage change the current sense of the shield may be defective

    See Trusty answer and look if the power supply is sufficent for you motor ?[/QUOTE]


    HI Michel,
    Thank you for your reply, I am sorry for being slow to get back to you but i have been so busy I have not had time to check emails and get a chance to test things.
    Tonight I did

    I checked A1 when asking cv1 on program track it looks like about a few mV and the smallest change
    using dmm.
    Using dmm on the program track I see a small increase in voltage each time I send that command voltage on the track is 14volts

    The power supply is adjustable 0-18 volts at 30Amps I normally run this power supply on one of my HF radios at 13.8volts at 20 amp on HF radio is 100watts out so I know it has plenty of current but motor shield will only do two amps (I am building a Booster to run normal trains)
    I am running power supply at moment

    Power supply 18Volts
    Track 14volts
    on my CRO I can see a nice square wave on both tracks
    on main track I can control a LGB loco fitted with an mts 55021 decoder which was programmed up on one of my club members system and then I manually entered all CV information and I can run this loco with out a problem if I put it on the program track and try and read information from it I get the 308 error

    What should I get on A1, A0 ??

    I had a brand new still in box motor shield and uno so programmed the uno and added the shield and same thing can run loco on main but cannot read it on program track.
    Thank you
    Kind regards
    Danny
     
    Scott Eric Catalano likes this.
  13. Michel Goyard

    Michel Goyard TrainBoard Member

    37
    26
    8
    Hi Danny,
    thank you for giving me a time to think about your problem !

    depending of your motor consuption you should get more or less 0.5 V (peak) on A1 according to this page :
    https://www.allaboutcircuits.com/projects/arduino-motor-shield-tutorial/ which says :
    The current sense pins are A0 (Channel A) and A1 (Channel B).
    The Motor Shield will output 3.3v on the current sense pins when the maximum channel current (2 amps) is reached.
    (The MAX471 delivers 1V / 1A)
    You probably take into account that the Arduino supply should be 12V maximum. So its supply should not be provided by the motor shield (straps had to be cut)
    These peaks of current can be observed when the locomotive responds to the enquiry of CV.
    You should see them with your CRO by inserting a small resistance (i.e. 1 ohm to get 0.5V) on the track current.
    Have you a standard motor shield, clones are often carbon copies so are real standard.
    Perhaps check that your mts 55021 decoder is featured to give this type of response to a CV enquiry. I did not see this in the instruction manual.
    https://www.onlytrains.com/pdf/I55021.pdf
     
    Scott Eric Catalano likes this.
  14. George S

    George S New Member

    5
    5
    1
    This is what I'm running at the moment: Arduino Uno /Vellemen power shield (DCC++ sw) and JMRI. I can't read CVs from my NCE decoder either. I can run the train with the JMRI throttle and control the loco lights with the 'F' keys (4 function decoder), but no control over the CVs that came programmed into the microcontroller in the loco decoder board. I would point the finger at the JMRI software not being able to interrogate the micro's registers to read the CV information; could be a timing problem in the software.
    I got my hardware (Arduino Uno/Vellemen Power Shield) setup info from Gerards Tech Stuff website and it all worked. Also using a 12V /1Amp wall wart which is closer to 13 to 15 volts open circuit. Running n scale on a test setup main track and programming track.
     
    Scott Eric Catalano likes this.
  15. Trusty

    Trusty TrainBoard Member

    52
    33
    6
    Hello. when you ask the loco for a CV value, does your machine gently shake, or nothing moves ? The loco should have small hiccup. This is the way the decoder can return values by using small current consumption in the motor. If it does not move, you should see the decoder, perhaps the CV reading is disabled. If the loco moves, look at your shield. Some shields can disable the current measure to avoid problems. Some of them are even disabled by default !
     
    Scott Eric Catalano likes this.
  16. Danny Moss

    Danny Moss New Member

    5
    4
    4
    HI Michel,

    Thank you so much for your help
    This is take two answering, while trying to reply I dropped my laptop and killed the HDD. Anyway this made me have to reinstall everything and I got to check a few things and look up data I had from internet.

    All noted in your reply.
    I did cut the vin
    all looked good on the CRO
    the mts 55021 decoder did pulse when it was programmed on the owners mts system

    I found a test on the dcc++ Git hub that i followed using Diagnostics D Command
    my system passed all tests
    So having to many variables I decided to look at my HO trains and try and see if this would work not having a single dcc loco I ordered and bachmann gp 9 to test my system.
    It arrived today and in a few minutes I found my uno and motor shield worked.
    It read the Gp9 decoder gave me a choice of two decoder saved it in jmri.
    I can turn lights on and off drive loco forward or back so I am thinking that it has always worked just not with G gauge.
    Now to work out if the problem is voltage or Amps related.
    I am leaning towards voltage being the problem.
    kind Regards
    Danny
     
    Scott Eric Catalano likes this.
  17. George S

    George S New Member

    5
    5
    1
    Trusty,
    I am able to write to the decoder and do get the bump from the loco. I changed the address and other CVs regarding lighting, but that's another story that I'm taking up with NCE. I'm down to troubleshooting the DCC++ software without JMRI. I can power up and down the tracks but I can't READ the registers from the Serial Monitor in the Arduino IDE. Checking out the power shield pc first then moving on to the software.
     
    Scott Eric Catalano likes this.
  18. Pieter

    Pieter TrainBoard Member

    152
    46
    10
    Danny,

    For G-scale you will start at min 5 Amps and probably about 18V depending on the loco functions and accessories connected. You will find a lot of commercial CS/ boosters has a switch to switch between the 3 main gauges (n, HO, G) and thus adjust the voltage/ amp accordingly. You will have to look at you loco(s) manual for the voltage details if you want to go the DIY route. You probably will have to connect your DCC++ to s a G scale booster to work and not the usual HO/N motor shields (2 to 3 amps).

    George,

    In a recent post a similar problem was discussed and solved. If I remember correctly he started to fiddle with the read formula figure and eventually got it to read at a lower value. Maybe someone else can remember in which post. End last year there was another one and he solved it by using a different version from the original one he down loaded. he got original hold of a version that wasn't updated regularly.

    But if your NCE is also not reading, it could be that the decoder is locked like Trusty said. Last resort maybe do a reset on the decoder. Most is CV8 = 8 or 4 depending on the make.
     
    Scott Eric Catalano likes this.
  19. George S

    George S New Member

    5
    5
    1
    Pieter,

    Are you saying that the issue is with the JMRI software? I invested in a NCE PowerCab and I can read and write to the decoder no problem now. But...
    my decoder had the marker LEDs reversed so that Forward got me a red instead of a green and vice versa for the rear of the loco. Spoke to NCE and was told 6 week lead time for repair or replace. Took matters into my hands and flipped the LEDs myself, since I have the equipment and experience. Now the loco runs correctly with the markers and headlights.

    P.S. the decoder manufacture code is 127 which is for Atlas and not NEC which would be 11!! Yet the decoder came packaged from NCE.

    Would still like to fix the DCC++ / JMRI situation. Maybe if someone else reads this post they could point me in the right direction.

    Thanks for you help.
     
    Scott Eric Catalano likes this.
  20. Atani

    Atani TrainBoard Member

    1,469
    1,755
    37
    Which model of Vellemen shield do you have, ARD-A000079 or KA03/VMA03?

    If you have the KA03/VMA03 sheild, I am not sure you will be able to read CVs successfully as I can't find any references to say that the current sense pins are connected to A0 and A1. Now if these are not connected as suspected, you should be able to get this board working by soldering a resistor onto the current sense pins as a voltage divider circuit to A0/A1/GND. A diagram of adding this can be found in the DCC++ESP32 threads for a standalone motor shield that also does not have current sense.
     
    Scott Eric Catalano likes this.

Share This Page