It turned out (after a lot of analysis and thinking) it is actually easier than expected. "Good enough" monitoring of both, main and prog track, if joined, is absolutely possible.
Thanks for this video Hans. It has given me a much better insight into the challenges of measuring the current drawn by locomotives on DCC track. Something I have been thinking about but was not fully understanding the problem, now I do. (was always thinking it was a case of measuring the area under the signal "curve". But this video certainly gives me more to think about.)
I ran into the same issue. I even had nuisance tripping of the overload sensor as well. Ultimately I have disabled it and rely on the overload protection from the power supply used to drive the motor driver. Its nice to understand why the issue occurs. Nicely done!
Yeah, overload and short detection is quite tricky. It is a trade off between shutting down because of a single spike and risking the H-Bridge for not timely doing it. And then all that on an Arduino which is not exactly a computing superpower...
@@IoTT Yep so I also have DCC electronic circuit breakers on the other side of the HBridge protecting each zone of the layout. 9 times out of ten these trip first if there were any issues. But it would be great if the the one on the arduino was more robust. Looking forward to the next video.
I saw a DCC++EX command station with...I think a 2 line LCD display connected to it. It showed weather track power was on or off, as well as the available RAM on the second line of the display. I couldn't find any videos on how to add an LCD display to DCC++EX. Also, can more status information be displayed, like maybe the status of the CPU on the arduino?
DCC EX has built in support for I2C displays. Check the DCC EX documentation here: dcc-ex.com/reference/hardware/i2c-displays.html Of course you can display additional stuff as you wish, but you have to do some programming ;-)
Obviously, the current measurement issue is a complex one, and not easily solved because of the different decoders actually drawing power to move multiple locomotives. I doubt that there's an easy solution when you factor what you've seen into anything practical.....using a low pass filter like you suggested would make the current detection in response to programming functions difficult if not impossible. Since you can't use a low pass filter on the program output, if one was added to the main output ONLY, that would likely work, but require some simple hardware to be added to the h-bridge output, except for receiving data from the locomotive(s). That's a dead end. As a more practical solution, since the program output is minimally used, measuring the input current to the h-bridge would make the measurements much simpler and practical. Unfortunately, it would require using an extra analog input and possibly some extra components, and DCC-EX to actually define that extra analog input as being used for current measurement. I really think that it would be a practical and accurate measurement that would work with the RED Hat and DCC-EX in general. The work that you've done in this area points the way to actually measure current accurately. Thank you for your work.
One of the nice features of DCC EX is that it can use the prog track as regular track when not used for programming. So, I want to have current measurement on both outputs. And I agree adding a capacitor is not a good idea. Not only does it have an impact on the timing, it also lowers the voltage while discharging. The correct way is to increase the sampling rate to get a more detailed image of the current curve over time. Measuring before the H Bridge does not make a big difference unless you install a real good size capacitor right next the the bridge. Unfortunately, those PWM pulses look quite similar on both sides of the bridge.
Great video!! Good work!! You proved it's not just me believing the DCC++ current monitor is problematic and not very useful.
Never trust technology ;-)
Great work as usual Hans, what a wonderful easy to understand explanation of a complex topic.
Look forward to seeing your answer to the problem.
It turned out (after a lot of analysis and thinking) it is actually easier than expected. "Good enough" monitoring of both, main and prog track, if joined, is absolutely possible.
Thanks for this video Hans. It has given me a much better insight into the challenges of measuring the current drawn by locomotives on DCC track. Something I have been thinking about but was not fully understanding the problem, now I do. (was always thinking it was a case of measuring the area under the signal "curve". But this video certainly gives me more to think about.)
Glad it was helpful!
I ran into the same issue. I even had nuisance tripping of the overload sensor as well. Ultimately I have disabled it and rely on the overload protection from the power supply used to drive the motor driver. Its nice to understand why the issue occurs. Nicely done!
Yeah, overload and short detection is quite tricky. It is a trade off between shutting down because of a single spike and risking the H-Bridge for not timely doing it. And then all that on an Arduino which is not exactly a computing superpower...
@@IoTT Yep so I also have DCC electronic circuit breakers on the other side of the HBridge protecting each zone of the layout. 9 times out of ten these trip first if there were any issues. But it would be great if the the one on the arduino was more robust. Looking forward to the next video.
I saw a DCC++EX command station with...I think a 2 line LCD display connected to it. It showed weather track power was on or off, as well as the available RAM on the second line of the display.
I couldn't find any videos on how to add an LCD display to DCC++EX.
Also, can more status information be displayed, like maybe the status of the CPU on the arduino?
DCC EX has built in support for I2C displays. Check the DCC EX documentation here: dcc-ex.com/reference/hardware/i2c-displays.html
Of course you can display additional stuff as you wish, but you have to do some programming ;-)
Obviously, the current measurement issue is a complex one, and not easily solved because of the different decoders actually drawing power to move multiple locomotives. I doubt that there's an easy solution when you factor what you've seen into anything practical.....using a low pass filter like you suggested would make the current detection in response to programming functions difficult if not impossible.
Since you can't use a low pass filter on the program output, if one was added to the main output ONLY, that would likely work, but require some simple hardware to be added to the h-bridge output, except for receiving data from the locomotive(s). That's a dead end.
As a more practical solution, since the program output is minimally used, measuring the input current to the h-bridge would make the measurements much simpler and practical. Unfortunately, it would require using an extra analog input and possibly some extra components, and DCC-EX to actually define that extra analog input as being used for current measurement. I really think that it would be a practical and accurate measurement that would work with the RED Hat and DCC-EX in general.
The work that you've done in this area points the way to actually measure current accurately. Thank you for your work.
One of the nice features of DCC EX is that it can use the prog track as regular track when not used for programming. So, I want to have current measurement on both outputs. And I agree adding a capacitor is not a good idea. Not only does it have an impact on the timing, it also lowers the voltage while discharging.
The correct way is to increase the sampling rate to get a more detailed image of the current curve over time.
Measuring before the H Bridge does not make a big difference unless you install a real good size capacitor right next the the bridge. Unfortunately, those PWM pulses look quite similar on both sides of the bridge.