200 likes | 393 Views
Udacity lesson 5: Robot Motion. Agenda. Path Smoothing PID. Motivation. In motion planning, we learned to plan a path But how do we turn that discrete path into an actual continuous path, that the robot can follow efficiently?
E N D
Agenda • Path Smoothing • PID
Motivation • In motion planning, we learned to plan a path • But how do we turn that discrete path into an actual continuous path, that the robot can follow efficiently? • Additionally, how do we get the robot to follow the path – how do we control its motion?
Path Smoothing • Until now, all paths have been straight and discrete, divided into grids, like this:
Path Smoothing • We’d rather have a line that a robot can follow at a constant speed, and as short as possible. A bit like this:
Path Smoothing • The first criterion minimizes distance between original and smooth -> favors the original path • The second criterion minimizes distance within the smoothed path -> favors a pile of points in one place
Path Smoothing • Weighing these terms can yield a smooth path:
Path Smoothing • We can use gradient descent optimization with the following update rules for each iteration: • Where they each correspond to one of the previously stated terms
Path Smoothing • Finally, we might want to add a term that avoids obstacles to our system:
Path Smoothing • Demo: • Pathsmooth.m
PID control • Control theory is about how to adjust our system to interact with the real world. • In the case of a robot, it will mostly be connected to moving around. • We use sensor input as the robots “senses”. The controller is then the brain that takes this input and converts it to the correct motion.
PID Control • The most common type of controller is the PID:
PID Control • P: Proportional control. Drives the system based on the current error. • I: Integral control. Drives the system based on an integral of past errors. Removes steady state error. • D: Derivative control. Drives the system based on a derivative of past errors
PID Control • So how to implement this? • Or maybe in code:
PID Tuning • We need values for Kp, Ki and Kd. • These must fit the physical properties of the system we control. Motor speed, robot weight, turn radius etc.
PID Tuning • There are a lot of methods for finding these parameters. Two examples: • Twiddle • Ziegler-Nichols
Ziegler-Nichols • All gains are set to zero • P is increased until the system oscillates with a constant amplitude. The gains can then be found as:
PID Control • Demo: • PIDSmooth.py