Exactly what I have.
I have the exact same issue… and about 15% as well. Now to be honest, some of what you guys are suggesting/bringing up is a bit over my head. I do not have an osiloscope (or access to one) and really, I am an artsie not a techie. To give you a little background: First I am a builder but in my past I was a model airplane guy and more importantly, I was a huge car-stereo guy. In terms of electronics, I picked up most there (ohm’s law and the like). For the most part, when you guys suggest something, I can test it (with clear instructions) and I figure out the lesson only after I have done it in a physical sense (any on-paper theory doesn’t do much for me).
Now, riddle me this Batman… In terms of “brush timing” and running slower --also BOA mentioned his motors were themselves “PWMing”. The only thing I can equate this to in my brain is harmonics in an engine. Without a harmonic balancer, the harmonics keep increasing on themselves untill failure. Is this even close to an analogy for the “reverberation” BOA speaks of?
In terms of my sent PWM, I am sending this:
pwmout 1,63,0
pwmout 2,63,0
main:
pwmduty 1,b5
pwmduty 2,b6
The b5 and b6 are controlled by either the auto-drive code or from the RC unit. To “straight-line” the unit, I am simply slowing the fast wheel with a b6=b6 max (X). For frequency, I used the picaxe wizard to figure out what frequency would lead to b5 and b6 going from 0 to 255. At different times I have changed this to go from 75 to 225 for obvious reasons.
As I sit now:
I have found that the pic and motor driver are happy (with no caps anywhere) when simply using RC drive code. I have done this with a pulsin (coming from the servo out on my RF RC unit) and also from another picaxe (with a joystick) spitting numbers out serial to serial. The noise issue, and this thread, started when I started to code Walters auto-drive and that’s when I noticed the issue with the sharps spitting out crap numbers. --I also noticed my SRF05 doing the same. I have taken the capacitor adviceand simply added one to each sharp across + and gnd. This seems to have solved all problems with the sharps (obviously going into ADC channels). I have yet to play with my sonar, but my assumption is I will find the same. I have not yet added diodes to my relays, although I will probably do so as more protection couldn’t hurt, and I have double checked that the flyback diodes on the motor-outs are a-ok and going the right direction per BOA schematic.
I think that is it for now, my main problem of bad ADC data has been solved, and if I find a similar issue elsewhere my standard opperating procedure will be to add a .1uf cap. If this “noise” wants to rear it’s ugly head again elsewhere, I will be sure to ask again. I am glad I am able to bring some fodder for geek brains out there to work on! Thanks for your help, folks.