I recently changed the way the line sensor is read. My previous design was to connect the three sensor pins to the Duino- left, right and middle IR sensors which output digital logic. However for the Pi to read the line follower and respond with motor commands, it takes lots of communication- the Pi asks for the sensor status, the Duino reads the query and responds with the line data in a string format, then the Pi converts it into an array of 0s or 1s (three units long) eg. [0, 1, 0] for line centred. Then FINALLY the Pi can decide what to do!
This is quite a complicated way of reading the sensor. So instead I just connected the sensor to the Pi and now Lobsang reads the sensor directly. I had it connected to the Duino because I was trying to standardise- every aspect of the robot's control went through the Duino, from motor speeds to head servo angle. The new method means the reading process is very simplified and the maximum rate you can read by has increased by a lot (no waiting for the Duino to respond).
I've also changed (again!) the setup with the rear wheel. I had a lovely Meccano trolley wheel that worked beautifully, except when you tried to reverse- then the wheel jackknifes and the robot looks like it's doing a break dance as it jumps about with the wheel getting caught on the floor and then pinging backward, over and over. Naturally, Lobsang couldn't reverse in a straight line, which will be vital for the Three Point Turn , so I have changed the wheel to a caster ball (which, as it happens, doesn't look like this UFO caster).The caster is a lot louder than my nice Meccano wheel, but Lobsang can now turn in any direction and it reverses much better.
During construction (view down the inside of the body):
Before on the left, and after on the right:
I've also had success with keyboard control, so I'll be posting a video soon!