Program for returning to the Straight line after the Robot makes an error (Integral compensating)

This is an EV3-G project that contains two programs implementing an Integral compensation - integral part of the PID algorithm. The first program is for a Five Minute Bot and the second program is for Box Robot. The things that you should be careful when using the program for your robot are the direction of the motors in the steering block; whether the motors in the steering block are written as "B+C" or "C+B" and the coefficients in the two math blocks. The coefficients that we've chosen should work for most of the robots, but will probably not work for some of them. If they don't work, write to us, comment below in the comment section or drop us an email. 

How to open?

Download
  • #pc76d4
  • 10 Jan 2018

Implementing the final program for moving straight with the Gyro Sensor

This video tutorial contains the final 2 programs for moving straight with a LEGO Mindstorms EV3 robot. The first program is for proportional compensation that just keeps the robot orientation straight, while the second program is for Integral compensation that returns the robot to the straight line when the robot makes a mistake. 

Implementing a "WaitForTick" logic in your EV3-G program

Sometimes when we are working with sensors it is important that the time between two consecutive samples is the same. This will make each sample equally important and independent of how much time it took to take it. In this video tutorial, we would use the EV3-G timer block to make a "WaitForTick" program where the time between each sample of the EV3 Gyro takes exactly 0.02 seconds. 

Experiment with Coefficient to the Integral Part of the Gyro Sensor straight moving robot

In this video tutorial, we would do a few experiments with the coefficients for the Integral compensation. There are actually two coefficients - "c" and "b"

How to use the Integral Part of PID to make the robot move in straight line with Gyro Sensor

The integral part "remembers" the errors that the robot has made in the past and we can compensate for those errors. This will make the robot return back to the line that we would like to keep it aligned. 

Courses and lessons with this Program

This Program is used in the following courses and lessons

Image for Moving Straight with LEGO Mindstorms EV3 robots
  • 24
  • 102:09
  • 3
Image for Moving Straight with LEGO Mindstorms EV3 robots
  • 24
  • 102:09
  • 3
Image for Moving in straight line with LEGO Mindstorms EV3 robots
  • 1
  • 0
  • 0
  • 3d_rotation 0