proportional
if you are running behind your friend and trying to maintain 10 feet distance from your friend.
if they are twice as far away (distance is twice), you have to run twice as fast (speed).
but this is at a moment of time. the speed will change as the distance changes
the smaller the distance, the slower you have to go. the larger the distance, the faster you have to go
if they are only 5 feet away (distance), you can run half as fast (speed)
change your speed depending on how far away you are.
simple multiplication
if you want to be 10 ft away, but if you are 5 feet away, the error is 5 ft
if you want to be 20 ft away, but you want to be 10 feet away, error is 10 ft
error is difference between what you want and what you have
speed is the output in this case
only go twice as fast if the distance is twice as far away.
as the distance decreases, then your speed decreases
derivative
rate of change - acceleration
how much you are changing over time.
mph is a rate of change
if the error is changing quickly, then you do one thing. if your error is changing slowly, you do a different thing.
proportional
if you are trying to maintain 10 feet distance from your friend.
if they are twice as far away, you have to run twice as fast.
if they are only 5 feet away, you can run half as fast.
change your speed depending on how far away you are.
simple multiplication
if you want to be 10 ft away, but if you are 5 feet away, the error is 5 ft
if you want to be 20 ft away, but you want to be 10 feet away, error is 10 ft
error is difference between what you want and what you have
speed is the output in this case
only go twice as fast if the distance is twice as far away.
as the distance decreases, then your speed decreases
---------
derivative
rate of change - acceleration
how much you are changing over time.
mph is a rate of change
if the error is changing quickly, then you do one thing. if your error is changing slowly, you do a different thing.
if you are going faster towards them, then you have to slow down faster
if you are going slower towards them, then you can slow down slower
if the distance is growing faster, then you have to increase speed faster
if the distance is growing slower, then you have to increase speed, but not as fast
how fast is the error growing or shrinking over time.
the faster the error is growing, the faster you have to increase the speed.
so for derivative it is important how quickly the error is changing.
without proportional, you don't know how big you have to change the output compared to your error.
if you have a big error, you don't know you need a big response versus a smaller error, which needs a smaller response
integral
if you want to go up the hill 10 mph, but you're actually going 8 mph, then you
need to speed up more to get 10 mph
robot, everything robot does takes a picture in time.
robot can takes 10 pictures a second.
can only observe things at certian moments in time
robot moving towards goal
at 1 sec it is 5 ft away (from goal) at next sec it is still 5 ft (error) away. if the error is the same
from 1 sec to 2 sec. then you need to increase motor power, so you can decrease the error.
i is the sum of the error over time. it is the cumulative error over time.
i doesn't care how bit the error or how fast the error is changing.
it is trying to minimize error.
if have small error over long time (0.5 * 10 = 5), versus a large error at a short time. (5 * 1 = 5)
in both these cases, you still have to increase the speed to reduce the error.
without integral, wouldn't know over time, if have a slow error or a fast error and how fast you have to respond
as you get closer, you don't have to change speed as much, therefore, it becomes less important.
so the smaller the error,
proportional corrects for how bit the error is
derivative corrects for how fast the error is changing
the integrative corrects for error over time.
integral corrects for long term drift.
if my oscillator for sclk is drifting over time and is impact
if you don't have the integral, then you would overshoot and then undershoot over and over
----
run opmode and robot is going too slowly to get to where you want to get to.
if robot is not going as fast as we expect it to go.
need to increase the speed. proportional
if it increases to higher speed, you overshoot.
need to go so fast, but doing overshoot, derivative, so it slows down.
or you could undershoot
give an example where you need to change intgral, it didn't make it to the goal, the longer it goes
=========
=========
gain - volume of change
P part looks at any given instance, what is the difference between where i am vrsus where i want to be.
the difference is the error. the greater
P only knows about a moment in time, it doesn't know what happened in past or in the future.
Derivative control doesn't care wher eyou are. itcare about how quickly you get from one point to another
proportional error will grow over time then stop.
derivative error will take a step up.
both proportional and derivative have no memory
one look at where am i the other is how fast am i go
integral i don't care where we are, or how fast we're going. where have we been over this course of time
if it is getting worse over time, then it will get louder and stop listening to P and D.
-------
drive from 0 to 1 meter and stop, but if only had proportional controller.
if change proportional gain and make p too low, then will miss the target position, but will overshoot less.
if proportional and driving at speed,
dash line is command of what we want it to drive,
black line is where it should be
difference between black line and dash line. try to get the error down.
proporitonal controller says slow down and go backwards.
i went to far, and