Friday, June 9, 2017

StuntMIP

Hello blog! Longtime no see. Sorry to leave you lying fallow for so long, but it's been a busy couple years and I'm only now catching up. In the meantime, I've been to grad school, got my master's, worked a few different jobs in and out of my field, and got a couple dogs.

Leading off with the primary thing I've built in the meantime, let me introduce you to StuntMIP. Based off of the UCSD Coordinated Robotics Lab's proven MIP design, I worked to get it ready for the challenge of doing a loop-de-loop. Past getting it to balance, the primary design challenges were now to get it moving fast enough to sustain contact with a track, and to go in a straight line on its own at high speed.



In order to achieve high speed travel, I first had to find some way to make sure the robot could travel in a straight line. It seems like an easy problem, especially when you've got encoders on the wheels, but dead reckoning by wheel rotations wasn't precise enough, so it needed to be able to reference its outside environment. I opted to use line following, given that it's a pretty robust system, with plenty of work done on it over the years. While most line-following robots work on a binary principle of being either on or off the line, I needed something more granular and continuous. So I mounted 4 reflectance sensors on the base of the robot, and implemented a weighted centroid algorithm. Each of the sensors read a reflectance off the underlying surface, which after calibration was mapped between 0 & 1024.

Most line following robots work a fixed distance from the ground, which results in the algorithm moving the perceived location of the line to the middle of the robot. The algorithm works on the difference between the highest and lowest readings, with the general assumption being that the sensors not on the line will return a reading of 0. I rewrote the sensor code to subtract the lowest reading all of them before implementing the algorithm, which resulted in the algorithm returning a more accurate result.

The next major problem was getting the robot to accelerate smoothly up to a high speed. It would accelerate up to a point, and then it would wobble a bit and fall down. It turns out that the control gains for the MIP were heavily weighted to keep the robot upright, which makes sense, since falling down is a failure condition. As the MIP accelerates, it leans over, and the faster it accelerates, the more it leans. So when I was feeding in a reference to encourage it to accelerate, the controller was only willing to go so far before trying to come back upright. After playing around with the control gains, I wound up going with a significantly looser set of control gains. StuntMIP would roll back and forth a bit while trying to stay in place, but was able to achieve much higher speeds.

StuntMIP was a really fun project, and while it didn't manage to do a loop-de-loop, that journey is left to some other adventurous student.

No comments: