Thursday, June 6, 2013

AVC: finally something goes right

Finally, something went right. My chances of success at AVC just went from total crap to mostly crap.

Though I couldn't get the new Venus to track satellites, I discovered why the uBlox wasn't working with my code base, fixed it, and it's now tracking lots of satellites.

The uBlox problem was due to a stupid mistake I made on my baseboard. Once I hooked it the GPS up to the good UART port, GPS data came streaming in. That's not all

Even better, Data Bus completed three runs outside my house with promising consistency, albeit poor accuracy. Hopefully the inaccuracy is due to a time shift between the uBlox reported heading and the gyro signal. For the Venus, that lag was 1000ms, for the uBlox about 600ms.

Heading based on raw gyro, time-corrected by 600ms, and GPS Course
Unfortunately estimation is a disaster. I suspect a heading value or a difference between headings that's not being clamped properly, or some similar mathematical artifact, since the issue appears to happen around north (0 degrees), whether driving manually or autonomously. Here are the results of a manual test run.

Lag estimate and updated gyro estimate are jacked
Above, the green gyro-based heading computation is actually fairly close to the GPS course data in dark blue. The light blue line is the result of running the gyro and gps through the Kalman filter. it's obviously very wrong.

The Kalman filter estimate is used to determine error of the gyro-based heading and over time, nudges the gyro estimate to generate the current heading estimate, red line, on which navigation is based. Problems come into play when adding and subtracting angles. I thought I had that pretty well settled last year but I guess I introduced the same bugs again with new code this year.

On the upside, the encoders appear to be working correctly. That spikiness is normal, believe it or not. The intermittent giant spikes I was seeing on the left channel are gone.

Left/Right Encoders and GPS Speed (m/s)
As mentioned in the last post, I may stand a tiny chance if...
  • the last critical bugs are fixed (there are still plenty of non-critical bugs),
  • I can get a working GPS,
  • the encoders are fixed once and for all,
  • I can tune the estimation well enough, 
  • I can get accurate measurements for waypoints Saturday, and
  • I resolve whatever show-stopper is lying in wait to jump out at the last possible minute

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.