by Harshal
After becoming proficient programmers, we realized that the turns we used using distance based strategies were just not accurate. We realized the motors were not going at the same time. After performing several experiments and researching, we realized that the motors were lagging. In other words, one moving motor was getting a head start and another motor was “lagging”. . .
To try and stop the lag we tried using different sensors and we settled down to the gyro sensor which comes with the EV3 kit. It helped us measure the angle of the robot while we were turning. When we turned, we double-checked with the gyro sensor to make sure that the robot angle degree was the desired angle and that no lags had happened. This precision really helped us turn.
Perhaps the most annoying part of programming is when there is something wrong with an algorithm used repeatedly. Why? Because when you want to fix it, you have to go through the program and every part that has the defect and fix it. That is the reason why we used myblocks to do most of our complex algorithms for: turning with gyro sensor, going forward/back using gyro sensor, following the edge of the line and perpendicular alignment to a line. These are the advantages with using myblocks:
To try and stop the lag we tried using different sensors and we settled down to the gyro sensor which comes with the EV3 kit. It helped us measure the angle of the robot while we were turning. When we turned, we double-checked with the gyro sensor to make sure that the robot angle degree was the desired angle and that no lags had happened. This precision really helped us turn.
Perhaps the most annoying part of programming is when there is something wrong with an algorithm used repeatedly. Why? Because when you want to fix it, you have to go through the program and every part that has the defect and fix it. That is the reason why we used myblocks to do most of our complex algorithms for: turning with gyro sensor, going forward/back using gyro sensor, following the edge of the line and perpendicular alignment to a line. These are the advantages with using myblocks:
- Readability - A program that is about fifteen blocks long can be shortened into just one. Whereas before, when it used to take five minutes to find the flaw in the program, the myblock makes our program much easier.
- Reusability - Instead of having to remember the algorithm and blocks used for the actions, the myblocks are reusable. So each time you want to use the turning logic again, just drag the block from the bottom, change the parameters if necessary, and the myblock is ready to be used.
- Maintainability - As said earlier, myblocks help when you want to change a common part of your program. For example, if our team wanted to see what happen if we changed our wheels, we could just adjust the myblock and the same programs should work for the wheels. If there was an issue with the going straight or any other myblock, we could easily change just the myblock and the problem would be solved.