Three works fine. Try having one that is perpendicular to the three so you can be straight on the crossing lines. I use easyc so I don’t think I can help you with programming.
Three works fine but the more sensors you have, the more sensitive you can make your tracking. I think the general idea of line following is to use the outside two sensors (or four if you have five total) to tell you when you’re going off the line. This gives line following robots their distinct zig-zag following. By tweaking the numbers for how much your robot corrects you can smooth out the zig-zag.
Here is a well-written guide from 2921 Free Range Robotics (all credit to them/George).
I don’t think there’s any advantage to setting the line sensors up like that. When your crossing a line, I would assume all 3 would read a line being present, no matter the setup. From what I’ve seen, the “typical” way of setting line followers up are |||
It could, however it’s not necessary. It’ll probably just make it a little bit more robust from losing the line.
That was written by our former programming genius, Michael, so I better not take the credit for that
Line following should be fine with 3 sensors, but just like SweetMochi said, the more you have the more sensitivity you will have (or so I’m told anyway). I personally haven’t spent too much time with line following (I haven’t used it once for competition), but here are a few things that Michael did/I learn’t from him:
Have the sensors as far forward as possible from the centre of turning. It will make it much easier to control. We had tried with a robot from Round Up that had the sensors merely an inch in front of the centre of turning and it was hopeless.
Michael never had a limit on the number of sensors. He generally had about 8/9 on his robot. 3 should be fine (we won the [world programming skills challenge in Elevation with just 3). On his later robots however he had 5 along the front, 1 in the very centre of turning, 2 “wing” sensors, and 1 grey scale sensor).
Grey scale sensor. He had this mounted somewhere on the robot that was unlikely to ever be near a line (for example, in one of the back corners). This would provide feedback on what the sensor reading was for the grey tile, since the values can often change depending on the lighting conditions.
If I remember more, I will mention them. But to answer your question quickly, 3 will be fine. It worked for us Also, if you want, I will have a browse on my computer and send you the files that we had for our line following on the elevation robot.
We have ordered colored tiles for our field mats (Green, Red, Yellow, Blue), will those still work for programming Line Trackers? We got the tiles REALLY cheap.
Also, if you could send me Line Tracking code, that would be awesome! I learn SO much better by looking at things, then figuring out what they do.
How many line trackers you use depends entirely on how you plan to track a line. If you only plan to follow straight lines (i.e. ignore turns and corners), even 1 tracker can be enough for a very simple routine. Generally tracking sharp corners requires a more extensive algorithm, but this can be accomplished with 3 trackers. As others have pointed out, more trackers = more sensitivity = better accuracy, but by no means do you absolutely need more than 3.
If you are just starting out with line tracking and haven’t done it before, the best way to start is by practicing making a simple proportional drive algorithm. This is actually a simplified version of the more complex PID algorithm, but it is quite simple to learn and program. It just means your motor corrections is proportional to the value returned by the line tracker. There are many ways to implement such an algorithm, some easier than others. But again, the theory is simple to learn, we taught a class of middle schoolers about it and they got it within an hour
We used to have colored tiles as well before we got our full field and I have to say they’re not the best for line sensing. I’d suggest you buy just 4-6 grey tiles so that you can test your line sensing on a short course that could be straight or even turn a corner.
That stinks… Could I paint the tiles? All we are doing is going straight until we hit the white tape, then we are following the tape until another sensor is used.
I beleive that the coloured tiles used in VRC (so red and blue) return similar values to the white line, so it would be very hard to have the robot detect the difference between the tiles and the tape. Also multicoloured tiles are likely to be hard to program for, since there will be lots of different values, for the differerent colours.
I’ll upload the code later today
You could try painting the coloured tiles, but I have no idea how well it would work. It’s best just to use what you’ll be using in competition (or as close to it as possible), that way you can be certain it will work.
I’ve also heard that for tracking straight lines, 3 is fine, but for sharp corners 5 or so is better. Since the VRC lines are straight (except for where they cross over each other), 3 will be perfectly fine. If you wanted to turn on a line (I.E. at a junction), instead of only using the line trackers I would use encoders to do a fairly accurate 90 degree turn (or whatever degree turn you need), and then use the line followers to correct the robot perfectly onto the line.
OK, we have our tiles (Blue, Red, Yellow, Green). Could I put Grey Duck tape over the tiles where the white lines would be? That way it’s grey instead of random colors.
Would this work better than the odd colored tiles?
Sounds like it might work. The duct tape isn’t exactly one color either though. In the end, if you don’t use the competition elements, you never know exactly how your robot may react in the actual game situation.