K values
We could use the heading and distance values measured by IR 1 to directly control the steering for the tank. However, this is not ideal. Instead, we need to multiply each of these values in order to scale them so that the resulting corrections fit better with the possible range of the hardware. The factor by which a measurement is multiplied is called a k value.
Most proportional feedback loops use a k value. In this part of the program, we will use two: the first (k1) will multiply the measured beacon heading to control the magnitude of the steering, and the other (k2) will multiply the measured distance to control the speed.
The optimal value for k1 is 5. The optimal value for k2 is 10. k2 is set so that for any distance value ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access