I've been remiss with this topic, and just now saw your work........don't know when I'll be able to test it, but I will definitely dopwload and use it...... It works on a standard NANO, right? I don't need a MEGA, do I???
Just saw your updates.....should have been monitoring the thread, but I screwed up...... Went to your github, don't know what to download.......also, t'll work on a NANO, right?
I figured out whick code is correct, but I have no idea how to download it......I tried to use github before, and found it impossible......HELP!
Changed my mind.....not sure which code to download, IF I could figure out how tyo download it.......there's got to be a better/easier way.
it was designed on a MEGA 2560. as for what to download... https://github.com/travisfarmer/DCCpp/archive/master.zip ...should zip up and download a complete copy for you (may want to keep it separate from the regular DCC++ code on your computer, just in case). it has been a while, but the ReadMe describes my hardware used. the PDF file is the schematic of the connections i used. i wasn't saying you had to use it i was really just wondering it it ever got used. ~Travis
sorry, the better copy is in the development branch: https://github.com/travisfarmer/DCCpp/archive/Development.zip ~Travis
Got it.....I'll go through the code to see where it needs to change pin assignments for the NANO vs MEGA......I have a MEGA, but don't use it for DCC++. I was designing a PCB with multiple connectors for use with IBT_2 (BTS7960) motor drivers (6 of them), all controlled by one NANO. I plan on releasing the necessary files for PCB manufacture to anyone who wants it.......
I used some of it in my updated base station code, I will be pushing a more extensive rewrite of the CurrentMonitor code to support as many power districts as the Arudino has analog pins.
Just looked and the code is up on github already. It will work with both any Arduino board. I don't have accurate numbers for the BTS board (yet) since I need to adjust things a bit but send me a diff if you adjust it to work for you. I am looking to have it cut out at ~5A and ~10A by default.
personally, i have my over-current cutouts set to the limit of my power supply. my plan was to use automotive style fuses at the track feeders. though in thinking about it, that would be a pain in the ***, finding the correct fuse that had blown. though, an indicator for the fuse could be fashioned with a correct-valued current limiting resistor, and an LED that shunts over the fuse. when the fuse is good, it shorts the LED, so it won't light. when the fuse blows, it will allow a small current through the limiting resistor, and light the LED. though the LED will allow power to the track, the current will be very small. ~Travis
Atani, just curious, was the auto reset on track short used? i didn't find it in the source, that i noticed anyway. I was rather fond of that feature. Still studying the code, trying to figure it all out. to use an analogy, i kind of feel like a designed a car, but it was later converted to a sports car. just trying to find my legacy. ~Travis
It should be there. It should be brought back if it is missing and we can add per power monitor a reset timeout. Sent from my ONE E1005 using Tapatalk
Sorry for my late response, i have been neck deep in DIY CNC machine research (trying to branch out my knowledge). I haven't fully digested the code yet, but as i suspect i will have a few days off from work for some minor surgery (nothing life threatening), i will have plenty of time to finish digestion. As i am still interested in drafting up a all-inclusive DCC++ documentation, it will be helpful to have fully read through the code. ~Travis
Hey guys it's been awhile for me too.. I have been working on my own version of the multiple power districts each with its own current sensing, shutdown, and auto-restart.. For the life of me I cannot find in the code though is how the total current (for both the PROG and MAIN) is calculated. I see the routine in CurrentMonitor.cpp where it calculates each current, but are they added together somewhere before being sent to JMRI? My setup is using 3 Arduino shields stacked for a total of 6 zones (including the PROG). I am cutting some of the leads on each shield and using jumpers for the A0-A5 inputs (current sense) and also using 4 extra outputs from the Mega as Enable pins (3&11) on the other 2 shields..
DCC++ does not add up the power districts today. Each one is reported individually to JMRI. There is an update to JMRI in the works to support interpretation of this as well.
Just to get this correct......there are several sets of code around for multiple power district use, and I'd like to know some details of the current state of things. Concerning MD boards, what needs to be configured in order to adjust the Arduino to correctly sense over-current? Also, what Arduyino modules are used? How many power districts are supported? Is there an easy way for someone (me!!??) to configure it all? I have a decent history in C code, but nothing in C++. I don't require anything beyond train control. Has the number of registers(?) been increased beyond the original design of 12 in order to now control more trains now that the system would logically be connected to a larger layout that you'd expect to run more trains? There were 2 different proposals on how to respond to over-current detection......one was to delay restoring power, and looping several times, and then leaving power off until manually commanded to restore it. The other was to loop forever, and not 'give up'. Because of the way JMRI operates, it'd make more sense to me for the second implementation. Ideally, what would be perfect would be a relatively simple table that could be edited before compiling the sketch that could set the number of locos allowed, the number of power districts, and the sense parameters for each MD attached to the system. That's what I'd do if I could program in C++....... Can we coordinate this effort some??