Contents

## Missing Parameters

Welcome to homework 5. In the first problem, you're going to build some intuition for what happens to a robot's path when one of the these parameters, either toe p, toe d, or toe i, is set equal to 0, so if we don't include that term in our steering angle equation. In each of these 4 cases on the left, the black horizontal line is the intended track for the robot, while the pink represents its actual motion. In each of these cases, the robot has a 10 degree positive drift and starts with a cross check error of 1. For each of these 4 cases, you should go through and decide which of these radio buttons is the correct selection. So for example, if you thought that this was appropriate robot motion and all the parameters were tuned correctly, you would select no problem. Keep in mind that each column should be selected exactly 1 time. Good luck!

## Missing Parameters Solution

This was actually a really tricky question. So let's, first, mark down the answers, and now we can talk about why. So these were the answers and let's think about why. We have some really interesting behavior over in some of these graphs, and it's nice to think about what's causing that behavior. So let's start with number 2. Pretty straight forward. The robot does exactly what we want. It starts off away from the track, then it approaches it, and stays right on the track. That's exactly what we want PID to do, so this is no problem. Number 3 looks similar to number 2 but not quite because now you can see the line that we're approaching is not actually the track. That's because we're reaching the steady state where the robot's upward drift is being balanced by its downward tendency caused by this term, and though we reach some sort of steady state, it's not the steady state we want, which would be right on the track. The key to understanding number 4 was realizing that the robot starts by moving upwards. This is the only case for the robot started going up, and what's happening here is the drift is dominating since the toe p is equal to 0, there is no initial term that steers the robot towards the goal, and without that, the drift is going to take over. Of course, as we accumulate error that gets corrected for and we steer down, but eventually we get into this sort of oscillating behavior. The oscillations are not as frequent, however, as they are in case number 1. If we think of this differential CTE term as a sort of smoothing term, which damps out these wild oscillations. Then we can see how, if tow d is equal to 0, we would expect these sort of growing oscillations, and this behavior is characteristic of any PID controller where the differential term is too small.

## Cyclic Smoothing

Welcome to homework assignment #5. Today I only have programming assignments. One on smoothing and one on control. In both cases, we are trying to drive a car on a racetrack as fast as we can. Okay? You'll see in a minute what I mean by this. But think of the car going on an oval just like that. So in this first exercise, you're going to go through a sequence of improvements of the code smooth.PI. I'm giving you a path that is very much a box path. It starts at 0,0, cranks up the estimation all the way to 6, then increases the y all the way to 3. It goes down on x all the way down to 0, and then uses the y all the way down to almost 0. If I draw this, the way this looks like-- we start at 0,0, all the way to 6,0, then we go up here to 6,3, and you go left to 0,3, and down to 0,1. This is a cyclic course so we're smoothing before what's for an open path. I'd now like you to modify smoothing, so it can smooth this path over here. So I want you to run the function smooth with path as an input-- the weight_data of 0.1 and the smoothing parameter of 0.1 and tolerance of 0.000001. When you run it, what it should produce is a path like this, that when you plot it, it looks a little bit like an oval. You can look at these numbers carefully. It ranks the corner points more into the interior. I want to do it in a way that is cyclic, so that the last point connects smoothly to the initial point over here. So please modify the code just to be a cyclic smoother as opposed to before it wasn't a cyclic smoother, and make it so each point get uprooted. You don't keep 2 of the points fixed.

## Cyclic Smoothing Solution

So here's my solution. I modified the code in trivial ways. I go through all the i's as opposed to leaving out the first and last node, and because we are cyclic, I now have to add the model of division by the length of the path in this smoothing parameter. That's it. So it's a very small modification. I don't have a graphical interface, but what the points look like is very much like an oval, like this, after the smoothing. It actually put all endmarks a little bit, which is a bit of a concern, which we address in a minute.