Moderator: Steve
5000 mV 1Amp 1000mA
--ADC---- x ----Sensor------ x ----------- = 26.39358 mA per "reading bit"
1024 "bits" 185mV 1 Amp
mikronauts wrote:Worst case accuracy is +/- 0.5 LSB for the ADC, and +/- 7.68 bits for the ACS712, so ranges from -8.18 bits ... +8.18 bits
alanmcdonley wrote:Thanks, now I understand:
- Code: Select all
5000 mV 1Amp 1000mA
--ADC---- x ----Sensor------ x ----------- = 26.39358 mA per "reading bit"
1024 "bits" 185mV 1 Amp
zero_reading = 512 # (unless median zero reading is actually 511 or 513)
current_in_mA = (reading - zero_reading) * 26.39358
alanmcdonley wrote:I get serious cross talk from PWM pins to undesignated GPIO/"PiDA Servo" pins, and major current draw, when I have not set the servo pins to servo mode before ramping up the DC motors.
When I ramp up PWM for both motors (servo pins 6, 7), my tilt/pan servos (which do not have a mode set yet) ramp in position and the total current draw is around 1A.
Once I set the servo pins to servo mode, there is no cross talk and the current draw with both motors at no-load max-speed is less than 100 mA.
"pre-flight checklist" is a must.
Weird.
Alan
alanmcdonley wrote:mikronauts wrote:Worst case accuracy is +/- 0.5 LSB for the ADC, and +/- 7.68 bits for the ACS712, so ranges from -8.18 bits ... +8.18 bits
That is +/- 216 mA worst case - nearly half an amp. Makes me start to question bothering with a current sensor at all.
For 1000 "ten reading medians" for zero current readings:
median: 514.4
average: 514.5
minimum: 512
maximum: 517
std_dev: 0.8
Range of +/- 66mA for any "10 reading median" at zero current, and around +/- 30ma for 1000 "10 reading median" readings.
I was never good at statistics, but it seems like I should take a few thousand readings anytime I want my robot to "think" about its current draw. (Actually, I got a B in stat without understanding the theory. "I R an enganeer" that knows to apply formulas blindly. If you want to understand something, ask a scientist - or take a walk in nature and realize it doesn't matter anyway.)
Alan
alanmcdonley wrote:I started to test the wiring for the wheel encoders. The emitter leds work but it seems the detectors do not. Perhaps I killed them by reverse power during the wiring tests - headers and ribbon connectors are easy to get mixed up which side is which.
Luckily, I found a source for the tiny, tiny Hamamatsu P5587 emitter-detector chip - therobotstorehk has them. The chip has been out of production for ten years supposedly.
I really didn't want to have to redesign a new encoder mounting, so this is good. (I just have to be successful at desoldering and soldering the tiny pins without lifting a pad and without over heating the chips.)
The adventure continues.
Alan
Users browsing this forum: No registered users and 9 guests