{"id":13750,"date":"2019-08-15T14:37:51","date_gmt":"2019-08-15T04:37:51","guid":{"rendered":"http:\/\/legoeng.local\/?p=13750"},"modified":"2020-09-21T15:55:56","modified_gmt":"2020-09-21T05:55:56","slug":"line-following-and-proportional-controls-ev3","status":"publish","type":"post","link":"http:\/\/legoeng.local\/line-following-and-proportional-controls-ev3\/","title":{"rendered":"Line Following and Proportional Controls (EV3)"},"content":{"rendered":"

The aim of this challenge is to create a robot vehicle that follows a line and avoids collisions with obstacles – including other vehicles!<\/p>\n

Robot design<\/h2>\n
\"\"<\/a>
A simple EV3 line follower<\/figcaption><\/figure>\n

All you need for the most basic version of this challenge is a simple two-wheel robot, such as the Robot Educator Model with a Colour Sensor (referred to, and used as, a Light Sensor throughout this post), positioned at the front of the robot, pointing down.<\/p>\n

Instructions for the Robot Educator Model are in the booklet that comes with the core set and in the EV3 Software.<\/p>\n

Control theory<\/h2>\n

Control theory<\/em> is a branch of engineering and mathematics that is particularly important in robotics. It deals with how a dynamic system with inputs (e.g. a robot) responds to feedback to modify its behaviour.<\/p>\n

This challenge provides a very basic introduction to controls<\/em>, including simple bang-bang <\/em>controls and proportional<\/em> controls.<\/p>\n

Challenge ideas<\/h2>\n

Here is a selection of challenge ideas and sample solutions\u2026<\/p>\n

1. A gentle stop<\/h3>\n

Can you create a robot that slows to a gentle stop when it sees an obstacle?<\/em><\/p>\n

\"\"<\/a>
Gentle stop sample solution<\/figcaption><\/figure>\n

2. Safe following distance<\/h3>\n

What if you want the robot to stop short of the obstacle (or follow another vehicle at a safe distance)?<\/em><\/p>\n

\"\"<\/a>
Safe following distance – sample solution<\/figcaption><\/figure>\n

Note: The multiplier of \u201c2\u201d in this example is the proportional gain. You will need to experiment with this value. If it is set too small, the robot will not consistently reach the target distance (because of friction and\/or stalling of the motors at low power). Too high and the robot will overshoot the target and may end up oscillating around the target distance.<\/p>\n

Once you get this working, it’s fun to have a line of robots following each other…<\/p>\n