I got my manual driving code working pretty well, and it was time to move on to IR tracking. I hooked up beacons and made IR servo trackers, loaded Kevin’s tracker code, and it worked! Yay.
So I merged the code from the tracker codebase into my code for non-autonomous driving, including dropping Kevin’s user_routines_fast.c in place of the default one, and things got weird. No navigation code at all, just tracker code. The trackers would run okay, but the motors, connected to pwm13 and pwm15, started running and stopping, jerking on and off. The manual joystick driving still worked, sort of.
So I started removing bits of Kevin’s code to see what was messing me up. I turned off all the code in Process_Data_From_Local_IO(). That didn’t help. Then I turned off the call to Initialize_Tracker() that I had added in User_Initialization(), and that stopped the erratic behavior. And the trackers, too, of course.
I thought the code was running too long, so I measured the code duration by hooking up a scope to a digital out, and in main.c set it to ‘1’ just before the call to Process_Data_From_Master_uP() and to ‘0’ just after the call to Process_Data_From_Local_IO. My code runs in about 4 ms.
Today I found Kevin had a new version of tracker.zip posted on kevin.org. I merged that code with mine. No improvement. Darn.
Finally, sensing that there is something “different” about pwms 13, 14, 15, 16, I connected my motors to pwm10 and pwm11, turned all the tracking code back on, and everything worked nicely! That was at the end of the day, so I didn’t get a chance to try any navigation…
So, can someone tell me why changing the motors from 13 and 15 to 10 and 11 changed the behavior from erratic to normal??? What’s going on here?
-Norm