Proportional coding: Difference between revisions
Line 13: | Line 13: | ||
=== Sensors === | === Sensors === | ||
The line follower uses color sensor and the gyroscope code uses gyroscope to drive straight. | |||
== Example Video == | == Example Video == |
Revision as of 20:36, 16 October 2020
Introduction
Very often proportionality is used in robotics programming. Proportionality is an important topic on mathematics curriculum. The proportionality means a straight line (with slope, or gradient, ) passing through the origin. In robotics, the slope is first translated to pass the origin.
Aim
Slope, straight line. Multiplication.
Robot
Almost any robot will do, we use here Asimov 2/ Verne robot.
Sensors
The line follower uses color sensor and the gyroscope code uses gyroscope to drive straight.
Example Video
We use proportionality in two examples, following a line and driving according to a given angle.
Theory
The line follower follows the line, or actually the border of the line. If the light sensor reads too small values (dark), the robot will turn to other side. If the values are higher (lighter), the robot turns to other side. The proportionality constant determines how fast the robot will steer.
Exactly the same approach is used in the gyroscope example. If the robot's direction angle differs from the decided direction, it will steer. The proportionality constant defines how fast the robot will steer.
-
The red and green lines do not pass origin, but show proportional relation.
-
The linefollowing robot uses proportionality
-
The proportionality is very important while driving to a given angle with the gyroscope.
Exercises
See exercises at line follower or gyroscope page.
Back to Mahtavaa Matematiikkaa 2020