Analyzing gain constants

In the previous chapter, we discussed proportional and PID control algorithms. When it was time to determine the best gain, derivative, and integral constants, we largely left things up to trial and error. Patient use of data logging would allow us to quantitatively analyze the quality of various values of these constants. This would be particularly useful in line tracking as we can graph the error function and corrections as a function of time, and compare this to the location along the line being tracked (and the degree of curvature at that point).

In the following program, we are going to analyze the performance of a simple proportional line tracker similar to the one we used in Chapter 8, Advanced Programming and Control. After resetting the motor rotation sensors, we use a Data Logging block to record values from the Color Sensor and the Motor Rotation sensors. We are recording the Reflected Light Intensity of the Color Sensor, which is plugged into port 3. Instead of recording the positions of the Motor Rotation sensors, we are measuring the current power values of the Motor sensors. The reason for this is we are curious as to how hard the motors are working to correct the errors. We want to monitor these values because they are the output of the PID controller.

Analyzing gain constants

The graph in the following screenshot is an example of data from the preceding program. The Light Sensor values are marked with crosses. The motor current and power values are marked with circles and squares respectively. As you can see, the values of the motor currents are always opposite of a constant value of about -20 percent. In the following screenshot, the rate of data acquisition is at 10 Hz, but by increasing the data rate, you will have smoother curves. I won't spend much time analyzing this particular graph, but I present this as an example of how you could quantitatively observe the affects of changing gain parameters as opposed to qualitatively observing the affects of changing gain parameters on the motion of the robot.

With full PID control, this type of analysis would be even more valuable.

Analyzing gain constants
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.183.1