# Program for keeping the robot straight with the Gyro Sensor (Proportional compensation)

Proportional implementation for keeping the LEGO Mindstorms robot straight. The program will take the value of the Mindstorms Gyro sensor and will apply this value to the steering block. This will make the robot steer in a direction that would put the robot in a straight position again.

### How to open?

Programs with extension *.ev3 could be opened EV3 Lab Software sometimes referred to as EV3-G. It could be found throught the EV3 Lab Software section on the LEGO Website.

• #mnxqf9
• 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.

### Keep the LEGO robot orientation straight. Proportional Part. Coefficients.

We should multiply the error by a certain number and then add it to the steering of the LEGO Mindstorms Steering block. In this way, by changing the coefficient we change how much/fast should the proportional part influence the steering of the robot.

### Keep the LEGO Mindstorms robot orientation straight by using the Gyro Sensor. Proportional Part.

The first part of making the robot move straight is to keep it oriented straight. While it moves it could make an error and turn slightly to the right and then the program should turn in back to the left to make its orientation straight. In this video tutorial, we would discuss how to implement a program to keep the robot orientation straight even when we are pushing or pulling it to either side and in the same time it has different wheels.

## Courses and lessons with this Program

This Program is used in the following courses and lessons

• 24
• 102:09
• 3
• 5
• 0
• 0
• 3d_rotation 1
• 24
• 102:09
• 3
• 1
• 0
• 0
• 3d_rotation 0