Line Following, All Over Again!

Well it’s been quite a long time since I wrote a blog entry, because December was so busy with other things that we really didn’t make much progress with Glitterator. The only chance I had really was the December Manchester Raspberry Jam, but as I mentioned in my last blog post that didn’t go to plan.

I finally had a chance to work on Glitterator in the week between Christmas and New Year, when I was off work. And it had been so long since I’d worked on it, that the first thing I wanted to do was test the line following. So I pulled out our simple test track (the big O provided with the CamJam Robotics EduKit) and set the robot running. Last time I ran it, it seemed to follow the straights quite happily, but tended to overshoot on the turns. This time… nothing! đŸ˜¦

My first thought was that we’d somehow damaged the hardware – either the line followers themselves, or the connections. Some simple testing did reveal one damaged wire, but the other two line followers seemed to be operational, they just weren’t seeing the line. Over the paper, they seemed to not see black, whatever was underneath them, but lift them up a certain distance above the paper and they would see black (and only black). I went through all sorts of tests, thinking that maybe they were way more sensitive to height above surface or something. After a day and a half of solid work on this, my husband finally realised that the problem was something else entirely, when the line followers picked up my (shiny black) phone case and a black Lego brick quite happily. The black ink on our course was too matt, even where I’d gone over it with a felt tip. We laid out the course with black electrical tape and hey presto! we were back where we started.

Which is to say, with the line following working on the straight, but not handling curves – not good enough! Now, I knew it wasn’t working. We’d changed from a busy loop to an event-driven model for the line following (discussed in a previous post), and while I was happy I had the low-level code (detecting line changes and registering/deregistering handlers) working, I hadn’t put much work into the handler functions themselves. We finally had a chance to work on this at this month’s Manchester Raspberry Jam, when we had the whole family in attendance together for the first time.

I love the Manchester Raspberry Jam community, with its mix of new and familiar faces, and its friendly, helpful feeling. There are a few others there who are or have been involved in PiWars, and some really helpful advice and support. We started the day by adding some wrapper code to our line following, allowing us to enable/disable it with the press of a button. Angus really appreciated this, because the robot nearly drove off the table a couple of times before we added it. Never underestimate the value of a kill switch! đŸ™‚

As the day progressed, I worked more with Erin, who at 6 is just learning to use her raspberry pi. Rather than Raspbian, she has the Kano OS on her pi, which is full on child-friendly help and tutorials. She was working her way through a challenge called Terminal Quest which teaches about the computer hardware, the bash command line, and more. She’s getting very keen about it and will soon be helping me to program the motes that we plan to attach to Glitterator.

Peter (my husband) and Angus worked on the line following. As I said, the handler functions I had put in place were very basic (to the extent of being little more than printing “line change detected under left sensor”), so there was quite a bit of work to do there. By the end of the day they were doing quite a good job of following a gently curving line, and had realised that reasoning in terms of a truth table (states being the values of the three sensors) was the way to go. There are still problems with tighter curves, but I suspect that the issue here is Angus’s desire to drive the bot at max speed whenever he can. As I type this, a new course is being set up on the kitchen floor, so I’ll go down to check progress in a minute.

The sad thing is that we were so busy and enjoying the Jam so much that I didn’t take a single picture! So you’re stuck with an entirely text-based blog post this time.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s