Before nodding off in the early AM, I was rolling around the connection I proposed to measure the motor current using for the Current 6 Click sensor. Even when this challenge was in it's infancy, I made posts that reflected my uncertainty of how to connect the device to take measurements. Misza offered some suggestions but I still was not convinced I had a configuration that would work. As slumber was about to overtake me, I realized my connection proposal was wrong and would work once but then never again:( Sleep would have to wait!
The problem is the power bus voltage, the polarity reverses when the direction of the locomotive changes. That same voltage is the reference for the Current 6 Click device. When the locomotive is travelling forward Vin would be connected to the positive rail and GND connected to the negative. When the locomotive is made to travel backwards the voltage would reverse. Most devices I have used do not play well when the supply voltage or in this case the reference voltage is reversed! I suspect, the ground pin on the device being connected to a voltage was the nagging electronics at fault that invaded my sleep.
To put the connection demons haunting my shut-eye to rest, I got out of bed and sat at the desk trying to napkin design a solution. Something in the recesses of my mind suggested a bridge rectifier would solve this. Typically a bridge rectifier is used in a circuit to convert AC voltage to DC voltage. I recall seeing it used to prevent polarity reversal on power a connection, but how?
Please electronics aficionado's if I am in error tell me! I have yet to wire the device to a circuit. I need to get it right the first time or this challenge for me goes up in smoke. The two voltage polarities that can be reversed on the left are constantly translated to the right. The left would be connected to the power bus and the right to the Current 6 Click device. Voltage reversal problem solved (I think?).
I appreciate the power bus voltage will be reduced by the voltage drop across the two diodes before arriving at the Current 6 Click device. That voltage would vary as the speed of the locomotive is changed, so a voltage variance issue was anticipated.
I suspect this might impact the detection when the locomotive is moving at a slow speed. I have indicated in my first post speed testing voltages would be established as part of testing. That is one of the tests to determine if the circuit will still detect the locomotive motor.
I'm going to let this idea soak for a few days. No actual power connections during this soak period. I could really use a few thumbs up from the guru's to boost my confidence, if you happened to be reading by.
BACK TO NAPKIN FOR MORE EVALUATION
The bridge rectifier to adjust for polarity reversal suggested above will create a directional issue for the locomotive on the block of track the sensor is monitoring. That calls for another napkin.
This MAX40080 chip schematic shows the load hookup. I just found a best practice recommendation that a DC current shunt should be connected on the grounded side of the load to minimize voltage present at the shunt and metering. I'm not sure how important that is for this circuit. I'm going to use the recommendation for my configuration.
The hookup I've planned without the bridge will work for the locomotive moving in one direction but creates an issue when the power bus polarity reverses for travel in the opposite direction. That indicates I can do testing in the forward direction for the DC system but not in the opposite direction. I have to remember to prevent a polarity reversal in my DC tests or I may damage the device.
The circuit should work for the DCC system since it doesn't use polarity on the rails to determine direction.