So I have an arduino doing some stuff in a robot. occasionally I lose partial or full responsiveness from the arduino side of things. I have yet to pinpoint a problem, since I am doing a lot of stuff at once, however one thing is certain, are perfectly functional sketch has suddenly, without mod or re-upload, ceased to function properly. powering it on and off doesn't help, it seemed re-uploading the software was the solution, but it seems to take several tries to fix. the other day this problem occurred again. I had the robot working fine. I left it alone afew days. came back, didn't work. turned it off and on a ton of times, never started working again. next day, still nothing. not having my laptop, I tried jiggling al lthe connections, nothing, but hitting the reset button on the board seemed to fix it.
QUESTION: what is the difference between hitting the reset button and powering the arduino board on and off? does it initiate some ram clear routine, is it nothing special?
As far as I know they should be the same. Usually it is the other way round - a power cycle is more thorough that a button reset.
The AVR chip should do an internal reset until power is stable and the oscillator is running. I can imagine that your board due to variance of components and your way of supplying/loading power is such that the chip "starts too early".
Bad power may also explain your other sudden stops. (and there is always the possibility that you have a real hardware fault on your board, akin to a loose connection - unlikely, though)
what is the difference between hitting the reset button and powering the arduino board on and off?
Nothing at all.
it seemed re-uploading the software was the solution,
It sounds like you have something spiking the flash memory. This can happen with high voltage spikes on the power supply. This is always a danger when you have motors involved.
The answer, like it is so many times, is to apply proper decoupling on the power supply and suppression on the motor.
I have decided to blame bad wiring and will cry myself to sleep for months, since I have atleast 40 crimp connections in my control box, and millions more on the power side of things. I have a pretty dang nice crimper too, so maybe solder connections will be the solution on the "final" revision. or add solder to the crimps. horray embrittlement!
thank you guys for giving me soul crushing answers. I feel the power is pretty safe (motors are 24 V, powered by 2 SLA in series, arduino is powered off on-board reg tapped into the center battery so it sees 12V) The motors have commercial drivers and ugghashgaln.
for the record, the last time I fixed this problem it was either
A) the reset button (20+ power cycles did not fix it) or
B) jiggling the wires
I never re-uploaded the sketch, so it could not be that. should I still put a scope on the power and put it through its paces?