The way of doing the sharp turns

Hello,
My team has a difficulty in solving a problem in making a line follower code that tracks the line at the sharp turns , so can anyone help? We program with ev3-mindstorms.

1 Like

hope you are using a programming language other than the blockly. It will be really tough (hard to maintain) to do with the blockly for tackling all the intersections, doing the evac room. But doing the line tracking should be ok , even using a lot of reusable sub-blocks, it is rather difficult to maintain.

Many ways to tackle this:

  1. using at least 3 color sensor - create a state table (state machine for yielding deterministic states) to precisely tell “what pattern” it sees. To program it, use switch/case… not if else if (regular control expressions will make your code horrific to maintain).
  2. learning the P-I of the PID controller technique will help too. But, this takes a lot patience to tune. Probing refreshing rate needs to be high too. If you use RobotC, I know it is doable.
  3. (may be easier than (2)) using the P from a PID controller technique for regular line trace. You can all 3 sensors to clearly produce a state of a sharp left or right (assuming you have at least 3 of them mounted inline with one another).

Now, all above will not provide you robust solution unless you have :

  • high sensor refresh rate
  • protect it so that it yields consistent light source (ie. avoid ambient).
  • also keep the distance of the sensors to the floor consistent (watch out for bumpers, etc.)