Ops Manager Extension: PD Controller
Site: | GoLabs |
Course: | Robotic Challenges with Python and GoPiGo |
Book: | Ops Manager Extension: PD Controller |
Printed by: | Guest user |
Date: | Thursday, 21 November 2024, 12:55 PM |
Description
This is the fourth challenge within the Robotics with GoPiGo and Python Curriculum.
Your task is to design a robot program that increases the volume of products that Amazing.com can ship out to its customers on a daily basis without increasing the number of robot pickers it employs.
Learn how to program and calibrate the Line Follower while they try to design an efficient system.
1. Replace position_val() with distance_from_line()
The position_val() function returns integer values only. Putting all black (20) and all white (30) values aside, there are 11 different values that this function can return to represent the position of the line (0-10). This limits you to 11 steering levels in your response.
We have provided you with a template function in the notebook called distance_from_line(). This uses the line follower’s read() function to return a higher precision range of values for line position. This allows you to build a finer-grained response into your proportional controller (more steering levels) to make it more accurate at keeping the line centered.
Read the notes provided in the notebook alongside this template function to understand the range and meaning of values that it can return and make use of this function in your proportional controller code instead of the position_val() function.
Experiment with your new controller code to see if you can improve on your best time.
2. Include speed of line drift in the controller alg
With a proportional controller, your stock picker determines the extent of turning based on the line’s distance relative to the central position as follows:
response = multiplier x distance
Try to improve the performance of your stock picker by adjusting your controller code to also take into account the speed with which the line is drifting towards or away from the central position. i.e. program your response value as follows:
response = (multiplier_1 x distance) + (multiplier_2 x speed)
The distance term considers the current situation (where we are now) and the speed term considers the future (where we might end up if we don’t change course). The faster we are drifting from the line, the quicker we may need to correct our course.
3. Congratulations!
You have successfully completed the Ops Manager mission. Your warehouse is functioning at top speed and your clients are happy!
If you haven't done so yet, you can investigate the line follower in greater details with Line Follower Explained extension.