Is the Arduino motor shield a original or a clone? Some of the clones do not have the amp sense wires hooked up. Have you confirmed the Loco works ok by testing the loco you put the decoder in on a track hooked to a old dc power supply and ran it back and forth?
Thanks for the reply. Both Arduino Mega and motor shield are authentic ones purchased from a local distributor. Loco runs, it's actually disassembled at this point with a multimeter on the leads going to the motor and there's no voltage there getting there. Dave
You'll need to do the test using the Track A outputs. The programming track is only configured for CV reading/writing (similar to most commercial controllers). If it's a new DCC decoder in your loco the address is usually defaulted to 3. Issuing a <1> followed by <t 1 3 50 1> with the loco on Track A outputs should get it moving if all is configured correctly. Also, can you confirm the laptop supply is providing DC (not AC). -Gregg
Gregg, On Controller-master, my system is 100% functional. Thanks! I am anxious for a customized GUI.
I asked about the Pololu MC33926 short circuit protection over in their forum. It cannot be adjusted or disabled. The response from the tech is that it is in "10's of microseconds". A PSX-AR is digital not mechanical so there is a slight chance it might catch the short faster, but I wouldn't bet on it.
Hi Kevin, I might be barking up the wrong tree, certainly no expert here ! Have you seen this on your search....? https://blog.arduino.cc/2013/09/02/arduino-yun-hardware-review/ From....Connectivity The Yún has two separate network interfaces, a 10/100 Mbit/s Fast Ethernet port and a IEEE 802.11 b/g/n standard compliant 2.4GHz WiFi interface, supporting WEP, WPA and WPA2 encryption. The WiFi interface can also operate as an access point (AP). In AP mode any WiFi enabled device can connect directly to the network created on the Yún. While a Yún in this mode can’t connect to the internet, it could act as a hub for a group of WiFi enabled sensors. Getting it to work with an Uno or Mega http://forum.arduino.cc/index.php?topic=248693.0 Pricey !!!! though there are derivatives....and unofficial shield versions
This is disappointing but good to know for sure. As I update the web-site docs I'll make sure to note that the Pololu may not be ideal if you plan on utilizing AR circuits. Of course you can always reverse manually .
Hi UK Steve, The Yun could very well be a fit for a DCC++ Access Point wireless platform I remember seeing the Yun last Sept at a local MicroAge store and at the time I decided to pass because I had zero Linux experience. It was before I came across this DCC++ project group and at that time I was building a Infrared UNO based DCC Controller proto typed by Dave Bondar. In the past few days with DCC++ I was focusing on Gregg's development platforms, UNO and MEGA Shield and frankly did not look up the Yun to see about its AP feature. When I came across the TL-WR702n I thought of it as a inexpensive test board and because its small enough to possibly fit a shield board be a prove of concept possibility. Thanks for the heads up. I'll Leave it to Gregg to determine if either Yun or the TL-WR702n have viability. Cheers, Kevin Of Northumberland County, UK - Heritage
How would the Arduino motor shield handle short circuit timing with an adjacent AR block? Can one side of the Arduino motor shield do the phase reversing?
I currently use autoreversers from Lenz. They work well and the Arduino does not seem to mind - don't even get a noticeable current spike. Using a standalone Arduino as an autoreverser, especially if it was part of more generic "block district" module, could be possible. On a standalone basis, having the Arduino change the phase of the DCC signal is actually trivial. In the counter-timer configuration used by DCC+, you can set whether the output pin (e.g. pins 10 or 5 on the Uno / 12 and 2 on the Mega) is driven HIGH at the top of the count and LOW on the intermediate match, or driven LOW at the top of the count and HIGH on the intermediate match. For a DCC signal, the choice is arbitrary and I just picked one. Changing it on the fly is a single line of code. But...we need to also synchronize the signal with the master signal controlling the main track (or at least the adjoining district). As you've shown, we can piggyback the DIR input from a second motor shield to the DCC signal output from a master motor shield. But this bypasses the generation of the DCC signal on the second Arduino, meaning the flipping the phase within that Arduino would have no effect. There are a number of ways we might address this. One way would be to bring the DCC signal from the master into an interrupt pin on the second Arduino, and then have that pin (through software), control the direction of the second motor shield. The logic within the interrupt routine could be set to either follow the direction of the master signal (i.e. go HIGH when the master signal is HIGH, and go LOW when the master signal is LOW), or reverse the phase (i.e. go HIGH when the master signal is LOW, and go... well, you get the idea). Another possibility that is risky but "neat" would be to have a master signal drive the DIR pins for both the A output and B output of a second motor shield. Then we connect BOTH the outputs to the same block of track, but where we reverse the leads. The risky part is that you never want to enable both outputs at the same time. If you enable output A, the phase is in one direction. Enable output B and the phase is in the opposite direction. Enable both...well, probably don't want to do that. The other thing we need to do is determine when to trigger the AR. This is also not too bad --- we would use the same short-circuit logic and current sensing mechanism on the second motor shield, but set the trigger threshold lower and increase the response time. As long as this shield trips before the master in the adjacent block, we should be okay. And instead of the shield disabling the outputs, it would be programmed to "autoreverse" using one of the methods above. I'll review the specs of the Atmel micro controllers on the Arduino to see if there are any hardware methods within the chip that may be applicable. This is a really interesting idea.
Jason, you bring up some really good points. I forgot that there may be serious constraints on the length of an I2C/TWI bus. I probably will give it a try anyway (just for fun) and perform some tests just to see how reliable it is over 1 foot, 2 feet, 50 feet, etc. But I'm guessing after a foot or two I may be in trouble. In that case, the built-in I2C bus would not be a good option. Are their ready-to-go RS485 shields and associated libraries? -Gregg
RS485 modules are available in the @1.50-2.50 price range. eBay And some really good info including sketch available here. Dave
Yes, laptop power supply is 15V DC, and it doesn't have a ground on the plug. Okay so the main track is the only one that should cause train movement, that's good to know. Should I not be able to read the CV's from the decoder on the programming track, though? The R command always comes back as -1, ie: <R 8 0 0> comes back as <0|0|8 -1> or whatever the exact format is. Dave
Update: I connected the track to channel A and was able to get train movement with the t command! Haven't played with it too much but direction, speed, etc look good Still need to do some more playing around to see what's up with the programming track, though. Is there a command for reading CV's on the main track (like something along the lines of the R command plus adding a cab ID) or can they only be read on the programming track? Dave
Note - I edited this post while Dave was quoting it below. Regarding the connection of Boosters - there is an NMRA standard for this (S-9.1.2). If I interpret it correctly, you output exactly the same signal that is going to the main track (but at a lower voltage?). I've started arguing with myself the pros/cons of the DCC++ base station conforming to this. If it did then in theory any existing booster (or at least DIY booster) could be used. Initially I thought "why not just stack on another motor shield?" but I'm not sure what that does to the current sensing. It could also be that all we need to do is just "y" the Main output from the Base Station and put it on a cable to run to a Booster. The Booster would need to echo that signal out to its motor shield and monitor the current sense pins.
Which is what Digitrax does with thieir LocoNet RailSync. RailSync is a logic level mirror of the DCC signal on pins 1&6 at 7 vdc, used to send the DCC signal to boosters ( and required on BDL168 for Transponding to work). Pins 2&5 are ground. Pins 3&4 carry the data at 14.5 vdc. Dave