I am helping to coach my son's East Haddam Lego Mindstorm Team. You can not help the students design, code, or solve the task...which is great because I wouldn't realluy know how.
I have concluded through my observations, as someone helping to facilitate their learning, that robotics provides a wonderful opportunity to build disciplinary literacies in STEM fields.
At our last practice we opened with an overview of how light and gyroscope sensors work. Both teams decided to drop time based navigation and try a light sensor. Below you see one teams early efforts at writing a program.
This program is a loop. The math these 6-8th graders solved wasn't complicated in a numerical sense but downright difficult in the logical sense of building the equation (Do not use for your own team it is not correct...see note about not being able to help).
Here was the problem as you increased the speed the robot shook left and right more and more. Students had to solve the problem.
It involved a few variables
- S-The sensor-what light reading was getting picked up
- T-The target-what sensor number did you want the robot to use
- G-the gain- how far the robot swung left after veering right
- E-The error-what tolerance of off track is allowed
- C-The speed and command (how fast and where to go)
To stop the shaking students had to do a few steps. They had to figure out the values of being on black (on track), being on white (off track), and being halfway in between.
Then they had to build the equation for the highest sensor rating (off track) and the lowest.
In the equation of above it is S*.10-E(S). That gave the error which is then multiplied by a gain of 25 and this in turn was combined with speed to give the command...
You then completed the same equation for the lowest. You then solve for range
If you wanted your robot to stay straight without shaking you needed to get the the error in each of your equations as close as possible. If not the robot would veer too much or have to make adjustments.