build details

# Assignment: PID Theory

Modified 2020-09-24 by Seiji Shaw

## The True Value and Error Curves

Modified 2020-09-15 by NishanthJKumar

The figure below shows a true value curve for a PID controller. Draw the corresponding error curve for this graph. You can draw by hand and upload the picture. (Hint: refer to the error definition equation from before)

## Explain an Effect

Modified 2020-09-23 by NishanthJKumar

1. Answer the following questions (3-5 sentences each):
1. What will happen when the absolute value of is very large? What will happen when the absolute value of is very small?
2. Can be tuned such that the term stops oscillations? Why or why not?
3. Can the process variable stabilize at the setpoint (i.e. zero steady-state error) with only the term and the term? Why or why not?
2. Explain the following effects caused by , and (3-5 sentences each). For example, here is a sample answer (though you do not need to follow the pattern):
• [Q:] *The rise time decreases when increases.*
• [A:] *When increases, the error at time step decreases. This is because larger and larger results in larger and larger control signals at time step . This drives the system to achieve a lower error at time step . As the error at time step decreases, the slope of the true value curve increases. Since the slope increases, the rising time towards the setpoint should decrease (slightly).*
1. The rise time decreases when increases.
2. The settling time increases when increases.
3. The overshoot decreases when increases.

## Start Tuning

Modified 2020-09-23 by NishanthJKumar

When designing a PID controller, it is important to choose a good set of , , and ; poor choices can result in undesirable behavior. The graphs in the figure below illustrate behavior resulting from unknown sets of , , and . In each graph, the orange dot line indicates the setpoint and the black line is the true value curve. For each graph, answer the following (1-2 sentences each):

1. Which term(s) went wrong, if any? In other words, which term(s) are too high or too low?
2. How can you correct the behavior?

## PID on the PiDrone

Modified 2020-09-15 by NishanthJKumar

Sometimes a PID controller will have an extra offset/bias term in the control function (see the equation below). For the drone, this is the base throttle needed to get the drone off the ground.

### Altitude Control

Modified 2020-09-23 by NishanthJKumar

Suppose you are implementing an altitude PID controller for your drone (i.e. up/down movement).

1. If the setpoint is the desired height of the drone, then what is the process variable, the error and the control variable for the altitude PID controller?
2. What could happen if is set too high?

Note: We are looking only for a higher level description to demonstrate understanding of the PID controllers.

### Velocity Control

Modified 2020-10-05 by sageshoyu

Suppose you are implementing a velocity PID controller for your drone. In this case, the drone only moves forward/backward and left/right. Your (hypothetical) controller is implemented so that when ‘L’ is pressed, the drone moves left at a constant velocity, and when ‘L’ is released, the drone stops moving.

1. What is the setpoint, process variable, error and control variable for the velocity PID controller?
2. How do these key terms change to cause the drone to move when you press ‘L’?

Note: We are looking only for a higher level description to demonstrate understanding of the PID controllers.

## Handin

Modified 2020-09-24 by Seiji Shaw

Use this link to access the assignment on Github classroom. Commit the files to hand in, as you did in the Introduction assignment. You’ll find a template ‘answers.tex’ files for your answers.

Your handin should contain the following files: