|
ADC code effecting motor outs???
Our robot's motors seem to be receiving some sort of signal even when all pwm outs are hardcoded to zero. We systematically turned off sensors and bits of code, until we isolated the problem with the adc software. Unless we disable the adc code, (by commenting out the adc initialization or the adc/timer interrupt routines) the drive wheels act as if they are set to 10 or 20 above neutral, instead of 127. If we enable the joystick and pull it back about 10 or so, the wheels stop. If we set one wheel to be mapped as (255-p2_y) then ten forward or so stops one wheel and speeds up the other, and vice versa. If we change the sampling rate from 200Hz that we were using to 800Hz, then the wheels spin much faster, but in the same manner.
If anyone has any clue what's going on, I would be very grateful for insight. I realize that both ways that we have found to stop the motor movement have the net effect of not causing any adc interrupts, but I don't see what could be going wrong. The dashboard viewer continues to read neutral pwm values for all RC pwm outs. The gyro is on analog in 1, and the motors are on pwms 13 and 15. We have patched in Kevin Watson's gyro and adc code, version 0.4. Once again, if any one can help, we'd all appreciate it.
KLW,
Controls Software Lead,
Team 1014, Dublin Robotics (Bad Robots)
|