Skip to content

Commit fbad473

Browse files
authored
Merge pull request #2 from Simbotics/dev
minor fixes
2 parents 46bf386 + d892bb8 commit fbad473

6 files changed

Lines changed: 28 additions & 27 deletions

File tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"label": "Advanced Stuff",
2+
"label": "Advanced Topics",
33
"position": 5,
44
"link": {
55
"type": "generated-index",
6-
"description": "What you'll need to become an FRC pro:"
6+
"description": "Explore advanced FRC programming topics."
77
}
8-
}
8+
}

‎docs/advanced-stuff/how-pid-work.mdx‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import PIDDroneAnimation from '@site/src/components/PIDDroneAnimation';
1111

1212
A **PID controller** repeatedly adjusts a mechanism until it reaches a target. On a robot, that target might be an elevator height, an arm angle, a turning angle, or a wheel speed.
1313

14-
We are going to use a drone as an example for expalaining PID:
14+
We will use a drone to explain PID:
1515

16-
**imagine that a drone starts at `0` metres and must hover at `50` metres.**
16+
**Imagine that a drone starts at `0` metres and must hover at `50` metres.**
1717

1818
The controller repeats this process many times per second:
1919

@@ -30,9 +30,9 @@ error = setpoint - measurement
3030

3131
The simulator graphs the drone's **height**, not its error. The dashed line is the setpoint at `50`, and the coloured line is the simulated response. Every graph is interactive, so move the sliders and observe what changes.
3232

33-
## P: make the drone move toward the target
33+
## P: Moving the Drone Toward the Target
3434

35-
Right now, the drone is sitting at `0` metres. We want it at `50` metres, but nothing is telling the motors of the propellers to spin.
35+
Right now, the drone is sitting at `0` metres. We want it at `50` metres, but nothing is telling the propeller motors to spin.
3636

3737
Let's start with a simple idea:
3838

@@ -56,12 +56,12 @@ The drone gets a big push when it is far away and a smaller push as it gets clos
5656

5757
<PIDDroneAnimation p={0.35} i={0} d={0} />
5858

59-
It looks like P should be enough—but if you read the graph (animation) carefully, you might find that there is a problem.
59+
It looks like P should be enough—but if you watch the graph and animation carefully, you might find a problem.
6060

61-
The drone has to **fight gravity** (and mabye air resistance). As it gets closer to `50`, P gives it less and less power. Eventually, the motor output may become just strong enough to fight gravity, but not strong enough to climb any higher. The drone gets stuck below the target.
61+
The drone has to **fight gravity** (and maybe air resistance). As it gets closer to `50`, P gives it less and less power. Eventually, the motor output may become just strong enough to fight gravity, but not strong enough to climb any higher. The drone gets stuck below the target.
6262

6363
This error is called **steady-state error**. P made the drone go up, but we need something to eliminate the constant error.
64-
## I: fix the leftover error
64+
## I: Eliminating the Remaining Error
6565

6666
Imagine the drone has been stuck at `47` metres for several seconds. The error is only `3` metres, so P is not giving it much help.
6767

@@ -90,7 +90,7 @@ While the drone was climbing, I kept storing error and adding power. That stored
9090

9191
Now we need a way to slow the drone down before it shoots past `50`.
9292

93-
## D: slow down before overshooting
93+
## D: Reducing Overshoot
9494

9595
Imagine riding in a fast car. Even if the driver stops pressing the gas at the finish line, the car will not stop instantly because of inertia, so the driver must brake **before** reaching the line.
9696

@@ -117,7 +117,7 @@ D helps with overshoot, but it cannot fix a drone that stays below the target. T
117117
A real sensor is never perfectly smooth. Because D reacts to quick changes, too much D can also make a real motor shake or jitter.
118118
:::
119119

120-
## Put the three terms together
120+
## Combining the Three Terms
121121

122122
A PID controller adds all three results:
123123

@@ -131,7 +131,7 @@ output = Kp * error
131131
- **I** remembers error that has persisted.
132132
- **D** responds to how quickly the mechanism is approaching or leaving the target.
133133

134-
and here is the official math formula:
134+
Here is the standard mathematical formula:
135135

136136
$$
137137
u(t) = K_p e(t) + K_i \int_0^t e(\tau)\,d\tau + K_d \frac{de(t)}{dt}

‎docs/advanced-stuff/limelight.mdx‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
sidebar_position: 1
33
title: Limelight
4-
description: Info & tips on how to use limelight and implement vision subsystem
4+
description: Learn how Limelight vision supports robot pose estimation.
55
---
66
A Limelight is a camera with a small computer inside it. Instead of sending every camera image to the roboRIO, the Limelight processes the images itself and sends useful results to the robot.
77

@@ -39,13 +39,13 @@ The drivetrain can estimate its position using wheel encoders and a gyro. This i
3939
Odometry is like walking with your eyes closed while counting your steps. It works well at first, but every small mistake gets added to the next one. Wheels can slip, the robot can be pushed, and sensors are never perfect. After enough driving, the estimated position slowly moves away from the robot's real position. This is called **drift**.
4040

4141
<details>
42-
<summary>If you wonder how odometry actually works and why error(caused by drift) accumulates over time, check this video 👇🏻</ summary>
42+
<summary>Watch how odometry drift accumulates over time</summary>
4343

44-
<iframe width="560" height="315" src="https://www.youtube.com/embed/GEZBYHVHmFQ?si=XPT36MprT-TR4ues" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
44+
<iframe width="560" height="315" src="https://www.youtube.com/embed/GEZBYHVHmFQ?si=XPT36MprT-TR4ues" title="How odometry drift accumulates over time" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerPolicy="strict-origin-when-cross-origin" allowFullScreen></iframe>
4545

46-
</ details>
46+
</details>
4747

48-
Therefore, the position might be wrong if our robot only ues gyro to precoess pose estimation.
48+
Therefore, the estimated position can become inaccurate if the robot relies only on wheel encoders and a gyro for pose estimation.
4949
The Limelight gives the robot another way to check its position. When it sees a known AprilTag, it can create a relatively accurate vision pose. So, a WPILib pose estimator combines both sources:
5050

5151
- odometry gives fast and smooth updates;
@@ -109,10 +109,10 @@ if (visionEstimate.tagCount > 0) {
109109
This is the main job of a vision subsystem: get the newest camera result, reject results that are obviously unusable, and pass good measurements to the drivetrain's pose estimator.
110110

111111
:::warning
112-
Do not trust every camera result automatically. Reject a result if no tags **(or less than two tags, if you want an accurate result)** were seen, and consider rejecting it while the robot is spinning extremely quickly.
112+
Do not trust every camera result automatically. Reject a result if no tags **(or fewer than two tags, if you want a more accurate result)** were seen, and consider rejecting it while the robot is spinning extremely quickly.
113113
:::
114114

115-
Read the [MegaTag2 guide](https://docs.limelightvision.io/docs/docs-limelight/pipeline-apriltag/apriltag-robot-localization-megatag2) and [Limelight APIs](https://docs.limelightvision.io/docs/docs-limelight/apis/limelight-lib) before preogramming a limelight.
115+
Read the [MegaTag2 guide](https://docs.limelightvision.io/docs/docs-limelight/pipeline-apriltag/apriltag-robot-localization-megatag2) and [Limelight APIs](https://docs.limelightvision.io/docs/docs-limelight/apis/limelight-lib) before programming a Limelight.
116116

117117
## Additional Resources
118118

‎docs/advanced-stuff/logging.mdx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
title: Logging
3+
---

‎docusaurus.config.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import rehypeKatex from 'rehype-katex';
1313
/** @type {import('@docusaurus/types').Config} */
1414
const config = {
1515
title: 'Sim Docs',
16-
tagline: 'teach you frc programming like youre 5 yrs old',
16+
tagline: "Teaching you FRC programming like you're five years old",
1717
// Keep the version query in sync when replacing the favicon. Browsers cache
1818
// favicons aggressively, so changing the URL ensures updates appear promptly.
1919
favicon: 'img/favicon.ico?v=20260727',

‎src/components/JavaPlayground/index.js‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,10 @@ export default function JavaPlayground({ initialCode }) {
133133
})
134134

135135
return () => {
136-
return () => {
137-
runner?.terminate();
138-
worker.terminate();
136+
runner?.terminate();
137+
worker.terminate();
139138

140-
compilerRef.current = null;
141-
};
139+
compilerRef.current = null;
142140
}
143141
}, [assetRoot]);
144142

@@ -207,4 +205,4 @@ export default function JavaPlayground({ initialCode }) {
207205
</pre>
208206
</section>
209207
);
210-
}
208+
}

0 commit comments

Comments
 (0)