Current Shunt, options, sizing
This is a discussion of the shunt resistor used to measure the current in the VIDEO GAME ONLY - you would not waste battery energy like this in a working installation.
The battery shunt for the battery to the motor is a bit problematic. The hall effect current sensors I salvaged from a VFD are not the right range to measure 2 amps. The smallest I have are rated for 50A, as far as I can make out from the downloaded data sheets, even though that VFD was rated at 5 HP, 208V or 22A. I can measure 0 - 10V with a PLC input directly, but that would waste a LOT of the battery power as heat across a resistor to measure the current.
But this IS a VIDEO GAME, so wasting power should not be the issue. I need to get the formulas right. And I need to be as accurate as I can manage. If I need to use 3 batteries in series and 36V so that I can waste 10V on measuring current ... what's the problem with that?
So my 'shunt' needs to take about 1 amp continuous, 5 amps for a few seconds to spin up the grinder. My input is 10V, it should measure a maximum of 5.5A, that's just under 2 ohms. 2 ohms at maybe 2 amps continuous (I measured 1 amp, but that's without the encoder as a load). I have 10 Ohm, 0.25W resistors. 4 resistors in parallel would be ... 2.5 ohms and 1.0 W. Maybe I should check through my junk and see if I have anything that is rated a bit higher.
Success! The pre-charge resistors for some of the failed VFDs that I have salvaged are 8 ohms, at an unspecified wattage but they are ceramic and large. Significantly over 1 watt. To get 2 ohms, I need 4 in parallel. No problem, I seem to have about a dozen.
How large should I make the resistor? What are the trade-offs ... for a simulation?
There are 4096 counts of the analog to digital converter in the PLC input. So the PLC can measure 4096 different values. With a 10V range, that is 10.0V / 4096 counts = 2.44 mv per count. So if the count was 1, the voltage would be 2.44 mV. If it was 15, then the voltage would be 36.6 mV. Actually, 36.6 mV is the middle of where it could be. It could be as low as 35.16 mV and as high as 38.04 mV and still show as 15 counts ... but that's getting into fine details.
If I assume that my measured 1A is the minimum I'm going to see, that is 1.25V for the 10 ohm resistors and 2.00V for 4 of the 8 ohm resistors in parallel. 1.25V measured / 2.44 mv per count = 512 counts. At the other end of the range, 5.5 amps peak would be 5.5 * 1.25V = 6.875V Divide that by 2.44 mV and you get 2818 counts. That's over half scale, with a bit of room to make sure that the PLC input is not damaged by having the voltage too high. Repeating this for the 2 ohms (4 of the 8 ohm resistors in parallel) gives 1A * 2.0 ohms = 2.0V / 2.44mv per count = 820 counts for the minimum. 5.5A maximum * 2.0 ohms = 11V ... but 10.0V is as high as the input will measure. That's not going to work.
With 5 of the 8 ohm resistors in parallel, the resistance will be 1.6 ohms. Run through the numbers again. 1 A * 1.6 ohms = 1.6V measured / 2.44 mv per count = 656 counts. At the other end of the range, 5.5 amps peak would be 5.5 * 1.6V = 8.8V Divide that by 2.44 mV and you get 3607 counts.
512 counts per 1 amp load give me 1.95 ma or just under 2 mA per count. 656 counts gives me 1.52 ma, or just over 1.5 mA per count. I'll use 5 of the 8 ohm resistors for the better accuracy and because I have them. They could likely take 5A each ... they are 3.5 inches long (each) and .75 inches wide and .75 inches high.
I guess I have some wiring to do.
|