Skip to content

Commit e71edc7

Browse files
authored
links
1 parent 0f6bacb commit e71edc7

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Black Ice (by FTC Team #18535, Frozen Code) is a **reactive + predictive path fo
1010

1111
It drives at **high speeds** and then brakes up to **5× faster** than other libraries.
1212

13-
Black Ice achieves this by using [**quadratic-damped PIDs**](https://github.com/TeamFrozenCodeFTC/Black-Ice-Path-Follower/blob/main/TeamCode/src/main/java/org/firstinspires/ftc/blackice/docs/quadratic-damping-pid.md#our-key-innovation-the-quadratic-damped-pid), which model nonlinear friction and resistance. This lets it accurately predict stopping behavior at any speed, preventing the overshoot and undershoot common with aggressive PIDs that don't account for friction while braking. This allows much **faster**, more **accurate**, and more **responsive** control by braking to a stop rather than coasting to a stop like other libraries such as Roadrunner or Pedro Path.
13+
Black Ice achieves this by using [**quadratic-damped PIDs**](https://teamfrozencodeftc.github.io/Black-Ice-Path-Follower/quadratic-damped-pid.html), which model nonlinear friction and resistance. This lets it accurately predict stopping behavior at any speed, preventing the overshoot and undershoot common with aggressive PIDs that don't account for friction while braking. This allows much **faster**, more **accurate**, and more **responsive** control by braking to a stop rather than coasting to a stop like other libraries such as Roadrunner or Pedro Path.
1414

1515
## How much difference does the Quadratic Damping make?
1616
Other libraries (e.g. Roadrunner, Pedro Path) rely on gentle PID + coasting:

docs/path-follower-evolution.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,11 @@ Initially, the robot overshot because braking occurred only after reaching the t
4343

4444
We commonly found our coefficients to be around `a=0.001` and `b=0.07`.
4545

46-
- The `a` term accounts for friction and momentum when braking. This makes it much more accurate at high velocities when friction is more dominant than the wheels' braking force.
46+
- The `a` term accounts for the non-linear affects of friction when braking. This makes it much more accurate at high velocities when friction is more dominant than the wheels' braking force. Learn more about [why the braking distance is non-linear here.](https://teamfrozencodeftc.github.io/Black-Ice-Path-Follower/quadratic-damped-pid.html#why-is-the-braking-non-linear)
4747
- the `b` term is basically the robot's braking force from the wheels. Later on, we would realize that this term was just a more empirical version of the derivative term in PIDs.
4848

4949
In this prototype version, it would just turn on zero power brake mode if the distance was greater than the distance remaining to the target point. This worked okay, but it could not correct while it was braking. In next prototype version we would fix this issue by turning it into a simple proportional controller.
5050

51-
[Why is the Braking Distance Non-Linear?](https://github.com/TeamFrozenCodeFTC/Black-Ice-Path-Follower/blob/main/TeamCode/src/main/java/org/firstinspires/ftc/blackice/docs/quadratic-damping-pid.md#why-is-the-braking-non-linear)
52-
5351
## v3.0 - Corrective Braking Using a Quadratic-Damped PID
5452
###### Final version used in the 2024–2025 season, first called Black-Ice at our second competition, and also used at our state championship.
5553
{: .no_toc}
@@ -64,7 +62,7 @@ predictedPositionAfterBraking = current + predictedBrakingDisplacement
6462
error = target - predictedPositionAfterBraking
6563
power = error * proportionalConstant
6664
```
67-
We later would realize that this is just a more empirical version of a [PID controller with quadratic damping](https://github.com/TeamFrozenCodeFTC/Black-Ice-Path-Follower/edit/main/TeamCode/src/main/java/org/firstinspires/ftc/blackice/docs/path-follower-evolution.md#predictivebrakingcontroller--empirical-pid-controller-with-quadratic-damping). The `b` is just the derivative term, and the `a` is the quadratic damping.
65+
We later would realize that this is just a more empirical version of a [PID controller with quadratic damping](https://teamfrozencodeftc.github.io/Black-Ice-Path-Follower/path-follower-evolution.html#predictivebrakingcontroller--empirical-pid-controller-with-quadratic-damping). The `b` is just the derivative term, and the `a` is the quadratic damping.
6866

6967
**Fun Fact:** We originally thought our algorithm was falling apart here because it would be quite a few inches off from the target, so we tried adding Integral terms but eventually we figured out that one of our odometry pods was just defective.
7068

docs/quadratic-damped-pid.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ nav_order: 3
77
# Our Key Innovation, the Quadratic-Damped PID
88

99
Our key innovation about our follower is our quadratic-damped PID. We include this quadratic damping term in our translational PID, allowing it to be nearly **5x faster** at decelerating, more aggressive, and accurate while minimizing premature deceleration for faster deceleration.
10-
You can learn about how we came up with this idea with [our first empirical approach](https://github.com/TeamFrozenCodeFTC/Black-Ice-Path-Follower/blob/main/TeamCode/src/main/java/org/firstinspires/ftc/blackice/docs/path-follower-evolution.md#v30---corrective-braking-using-a-quadratic-damped-pid)
10+
You can learn about how we came up with this idea with [our first empirical approach](https://teamfrozencodeftc.github.io/Black-Ice-Path-Follower/path-follower-evolution.html#v30---corrective-braking-using-a-quadratic-damped-pid)
1111

1212
Pseudo code of PD controller with quadratic damping
1313
```
@@ -50,19 +50,27 @@ With quadratic damping + back-EMF braking:
5050
## How does -velocity = Derivative term in PID?
5151
Let the positional error be:
5252

53-
$error = target_{pos} - current_{pos}$
53+
```math
54+
error = target_{pos} - current_{pos}
55+
```
5456

5557
Taking the derivative of both sides:
5658

57-
$\frac{d}{dt}(error) = \frac{d}{dt}(target_{pos}) - \frac{d}{dt}(current_{pos})$
59+
```math
60+
\frac{d}{dt}(error) = \frac{d}{dt}(target_{pos}) - \frac{d}{dt}(current_{pos})
61+
```
5862

5963
If the target position is constant, then:
6064

61-
$\frac{d}{dt}(\text{target}_{\text{pos}}) = 0$
65+
```math
66+
\frac{d}{dt}(\text{target}_{\text{pos}}) = 0
67+
```
6268

6369
Then:
6470

65-
$\frac{d}{dt}(error) = -\frac{d}{dt}(current_{pos}) = -velocity$
71+
```math
72+
\frac{d}{dt}(error) = -\frac{d}{dt}(current_{pos}) = -velocity
73+
```
6674

6775
Therefore, when the target position is fixed, the derivative of the position error is simply the **negative of the current velocity**.
6876

0 commit comments

Comments
 (0)