From f2a31f71ec9bbf8059a19324fa022434a3ad10e7 Mon Sep 17 00:00:00 2001
From: Spaceman 11 <135277197+Spaceman113138@users.noreply.github.com>
Date: Tue, 30 Jun 2026 22:30:38 -0500
Subject: [PATCH 01/25] some motor control stuff
---
.../src/main/java/first/robot/Robot.java | 2 +
.../src/main/java/first/robot/Robot.java | 2 +
src/content/docs/stage1/kitbot-drivetrain.mdx | 39 +++++++++++++++++++
src/content/docs/stage1/stage1-overview.mdx | 6 +++
4 files changed, 49 insertions(+)
create mode 100644 src/content/docs/stage1/kitbot-drivetrain.mdx
create mode 100644 src/content/docs/stage1/stage1-overview.mdx
diff --git a/examples/stage1/ctre/solution/src/main/java/first/robot/Robot.java b/examples/stage1/ctre/solution/src/main/java/first/robot/Robot.java
index 73934251..dae84695 100644
--- a/examples/stage1/ctre/solution/src/main/java/first/robot/Robot.java
+++ b/examples/stage1/ctre/solution/src/main/java/first/robot/Robot.java
@@ -26,6 +26,7 @@
*/
public class Robot extends OpModeRobot {
+ // [DriveMotors]
private final int leftLeaderID = 0;
public TalonFX leftLeader = new TalonFX(leftLeaderID, CANBus.systemcore(0));
private TalonFX leftFollower = new TalonFX(1, CANBus.systemcore(0));
@@ -33,6 +34,7 @@ public class Robot extends OpModeRobot {
private final int rightLeaderID = 2;
public TalonFX rightLeader = new TalonFX(rightLeaderID, CANBus.systemcore(0));
private TalonFX rightFollower = new TalonFX(3, CANBus.systemcore(0));
+ // [/DriveMotors]
public TalonFX intakeLauncher = new TalonFX(4, CANBus.systemcore(0));
public TalonFX feeder = new TalonFX(5, CANBus.systemcore(0));
diff --git a/examples/stage1/rev/solution/src/main/java/first/robot/Robot.java b/examples/stage1/rev/solution/src/main/java/first/robot/Robot.java
index 545865d2..17f777f6 100644
--- a/examples/stage1/rev/solution/src/main/java/first/robot/Robot.java
+++ b/examples/stage1/rev/solution/src/main/java/first/robot/Robot.java
@@ -18,10 +18,12 @@
public class Robot extends OpModeRobot {
+ // [DriveMotors]
private SparkMax leftLeader = new SparkMax(0, 0, MotorType.kBrushless);
private SparkMax leftFollower = new SparkMax(0, 1, MotorType.kBrushless);
private SparkMax rightLeader = new SparkMax(0, 2, MotorType.kBrushless);
private SparkMax rightFollower = new SparkMax(0, 3, MotorType.kBrushless);
+ // [/DriveMotors]
private OnboardIMU imu = new OnboardIMU(MountOrientation.FLAT);
diff --git a/src/content/docs/stage1/kitbot-drivetrain.mdx b/src/content/docs/stage1/kitbot-drivetrain.mdx
new file mode 100644
index 00000000..6b9748d7
--- /dev/null
+++ b/src/content/docs/stage1/kitbot-drivetrain.mdx
@@ -0,0 +1,39 @@
+---
+title: Kitbot Drivetrain
+description: Programing the kitbot drivetrain
+---
+
+import { Tabs, TabItem } from '@astrojs/starlight/components';
+
+# Motor Controllers
+
+The core of frc programing is telling motors what to do by giving commands to their motor controllers.
+Vendors provide classes that can be used to both control and get sensor data from their motor controllers.
+While each individual type of motor controller has its own class, motor controllers from the same vendor are
+largely the same so this stage will only use the SparkMax for REV code and the TalonFX for CTRE code.
+
+When creating a motor controller object, the physical motor controller's CAN ID and the CAN Bus ID so the code can
+comunicate with the proper controller. For this exercise the motor controllers will have the Ids:
+- LeftLeader: CAN Bus 0, CAN ID 0
+- LeftFollower: CAN Bus 0, CAN ID 1
+- RightLeader: CAN Bus 0, CAN ID 2
+- Right Follower: CAN Bus 0, CAN ID 3
+
+
+
+ The spark max constructor takes the form of
+ ```java
+ SparkMax(int busId, int deviceId, MotorType type)
+ ```
+ Since the Spark Max can control both brushed and brushless motors it's neccesary to specify the type as
+ MotorType.Brushless for motors like a NEO and MotorType.brushed for motors like a CIM. This results in
+ the motor construction looking like this.
+
+ ```java stage1/rev/solution/src/main/java/first/robot/Robot.java#DriveMotors
+ ```
+
+
+ ```java stage1/ctre/solution/src/main/java/first/robot/Robot.java#DriveMotors
+ ```
+
+
\ No newline at end of file
diff --git a/src/content/docs/stage1/stage1-overview.mdx b/src/content/docs/stage1/stage1-overview.mdx
new file mode 100644
index 00000000..a629083b
--- /dev/null
+++ b/src/content/docs/stage1/stage1-overview.mdx
@@ -0,0 +1,6 @@
+---
+title: Stage 1 Overview
+description: An intro to the 2026 kitbot and the topics covered in this stage
+next: stage1/kitbot-drivetrain
+---
+
From 477fa0123ca36fd2e6457bce54b824a56e67b580 Mon Sep 17 00:00:00 2001
From: Spaceman 11 <135277197+Spaceman113138@users.noreply.github.com>
Date: Fri, 3 Jul 2026 23:16:07 -0500
Subject: [PATCH 02/25] some intro on the drivetrain
---
src/content/docs/stage1/kitbot-drivetrain.mdx | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/content/docs/stage1/kitbot-drivetrain.mdx b/src/content/docs/stage1/kitbot-drivetrain.mdx
index 6b9748d7..ad78b7bc 100644
--- a/src/content/docs/stage1/kitbot-drivetrain.mdx
+++ b/src/content/docs/stage1/kitbot-drivetrain.mdx
@@ -5,6 +5,14 @@ description: Programing the kitbot drivetrain
import { Tabs, TabItem } from '@astrojs/starlight/components';
+# Drivetrain
+
+The kitbot uses a 4 motor tank drive meaning the left and right sides are driven independently by 2 motors each. This allows
+the robot to move similar to a tank by driving the left and right sides at different speeds. For this stage the four drivetrain
+motors will be refered to as LeftLeader, LeftFollower, RightLeader, RightFollower. "Becasue the motion of the robot is dependent
+on the diference in the velocity of the left and the right side, we can call this a differential drivetrain." <- SUSPECT SENTANCE IMPROVE PLS
+
+
# Motor Controllers
The core of frc programing is telling motors what to do by giving commands to their motor controllers.
@@ -12,8 +20,8 @@ Vendors provide classes that can be used to both control and get sensor data fro
While each individual type of motor controller has its own class, motor controllers from the same vendor are
largely the same so this stage will only use the SparkMax for REV code and the TalonFX for CTRE code.
-When creating a motor controller object, the physical motor controller's CAN ID and the CAN Bus ID so the code can
-comunicate with the proper controller. For this exercise the motor controllers will have the Ids:
+When creating a motor controller object, the physical motor controller's CAN ID and the CAN Bus ID are given
+in the constructor so the code can comunicate with the proper controller. For this exercise the motor controllers will have the Ids:
- LeftLeader: CAN Bus 0, CAN ID 0
- LeftFollower: CAN Bus 0, CAN ID 1
- RightLeader: CAN Bus 0, CAN ID 2
@@ -35,5 +43,8 @@ comunicate with the proper controller. For this exercise the motor controllers w
```java stage1/ctre/solution/src/main/java/first/robot/Robot.java#DriveMotors
```
+ For the CTRE code the CAN ID of the leader motors are stored as a variable since they will be used latter on.
+ This helps prevent errors from occuring by ensuring that there is a single source of truth for the corrrect CAN ID.
-
\ No newline at end of file
+
+
From fe69253986908efecec2dc8cfd88d4ec5be4c5e3 Mon Sep 17 00:00:00 2001
From: Spaceman 11 <135277197+Spaceman113138@users.noreply.github.com>
Date: Sun, 5 Jul 2026 15:36:06 -0500
Subject: [PATCH 03/25] motor config
---
.../src/main/java/first/robot/Robot.java | 2 ++
.../src/main/java/first/robot/Robot.java | 3 +-
src/content/docs/stage1/kitbot-drivetrain.mdx | 30 +++++++++++++++++--
3 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/examples/stage1/ctre/solution/src/main/java/first/robot/Robot.java b/examples/stage1/ctre/solution/src/main/java/first/robot/Robot.java
index dae84695..c8c6c180 100644
--- a/examples/stage1/ctre/solution/src/main/java/first/robot/Robot.java
+++ b/examples/stage1/ctre/solution/src/main/java/first/robot/Robot.java
@@ -53,6 +53,7 @@ public class Robot extends OpModeRobot {
* initialization code.
*/
public Robot() {
+ // [MotorConfig]
var leftConfig = new TalonFXConfiguration();
leftConfig.MotorOutput.withInverted(InvertedValue.Clockwise_Positive);
leftLeader.getConfigurator().apply(leftConfig);
@@ -63,6 +64,7 @@ public Robot() {
leftFollower.setControl(new Follower(leftLeaderID, MotorAlignmentValue.Aligned));
rightFollower.setControl(new Follower(rightLeaderID, MotorAlignmentValue.Aligned));
+ // [/MotorConfig]
}
@Override
diff --git a/examples/stage1/rev/solution/src/main/java/first/robot/Robot.java b/examples/stage1/rev/solution/src/main/java/first/robot/Robot.java
index 17f777f6..08ce3020 100644
--- a/examples/stage1/rev/solution/src/main/java/first/robot/Robot.java
+++ b/examples/stage1/rev/solution/src/main/java/first/robot/Robot.java
@@ -38,7 +38,7 @@ public class Robot extends OpModeRobot {
new DifferentialDrive(leftLeader::setThrottle, rightLeader::setThrottle);
public Robot() {
-
+ // [MotorConfig]
var leftConfig = new SparkMaxConfig().inverted(true);
leftLeader.configure(leftConfig, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters);
leftFollower.configure(
@@ -48,6 +48,7 @@ public Robot() {
rightLeader.configure(rightConfig, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters);
rightFollower.configure(
rightConfig.follow(rightLeader), ResetMode.kResetSafeParameters, PersistMode.kPersistParameters);
+ // [/MotorConfig]
}
@Override
diff --git a/src/content/docs/stage1/kitbot-drivetrain.mdx b/src/content/docs/stage1/kitbot-drivetrain.mdx
index ad78b7bc..41fa515c 100644
--- a/src/content/docs/stage1/kitbot-drivetrain.mdx
+++ b/src/content/docs/stage1/kitbot-drivetrain.mdx
@@ -8,9 +8,9 @@ import { Tabs, TabItem } from '@astrojs/starlight/components';
# Drivetrain
The kitbot uses a 4 motor tank drive meaning the left and right sides are driven independently by 2 motors each. This allows
-the robot to move similar to a tank by driving the left and right sides at different speeds. For this stage the four drivetrain
-motors will be refered to as LeftLeader, LeftFollower, RightLeader, RightFollower. "Becasue the motion of the robot is dependent
-on the diference in the velocity of the left and the right side, we can call this a differential drivetrain." <- SUSPECT SENTANCE IMPROVE PLS
+the robot to move similar to a tank by driving the left and right sides at different speeds. "Becasue the motion of the robot is dependent
+on the diference in the velocity of the left and the right side, we can call this a differential drivetrain." < SUSPECT SENTANCE IMPROVE PLS
+For this stage the four drivetrain motors will be refered to as LeftLeader, LeftFollower, RightLeader, RightFollower.
# Motor Controllers
@@ -48,3 +48,27 @@ in the constructor so the code can comunicate with the proper controller. For th
+Motor Controllers have many settings that can be changed to ensure the motors are driven correctly < BAD
+Vendors provide software like REV Client and Pheonix Tuner X to run and configure their devices from a computer;
+however, it is recomended to configure devices through code to ensure that all motor controllers are properly configured.
+This is especially useful when a motor controler needs to be swaped since the new motor controller may have configurations
+that need to be removed and the proper configurations need to be added. Under time pressure it can be easy to forget all
+of the configurations that need to be added and their proper values.
+
+For this section only the motor controller's invert setting will be configured. This setting controls what direction
+the motor spins when the motor control is given a command with a positive sign.
+
+Since there are 2 motors on each side of the drivetrain, its important to ensure that the each of the motors on a side
+move in sync with eachother. This can be accomplished by telling one of the motor controllers to follow the other. This
+tells the Follower to listen to the commands given to the Leader and is why we gave one motor the name Leader and the other Follower.
+
+
+
+ ```java stage1/rev/solution/src/main/java/first/robot/Robot.java#MotorConfig
+ ```
+
+
+ ```java stage1/ctre/solution/src/main/java/first/robot/Robot.java#MotorConfig
+ ```
+
+
\ No newline at end of file
From 9fa7204690cfd52460f28b12efd5fffecb75a029 Mon Sep 17 00:00:00 2001
From: Spaceman 11 <135277197+Spaceman113138@users.noreply.github.com>
Date: Tue, 30 Jun 2026 22:30:38 -0500
Subject: [PATCH 04/25] some motor control stuff
---
.../ctre/src/main/java/first/robot/Robot.java | 2 +
.../rev/src/main/java/first/robot/Robot.java | 2 +
src/content/docs/stage1/kitbot-drivetrain.mdx | 39 +++++++++++++++++++
src/content/docs/stage1/stage1-overview.mdx | 6 +++
4 files changed, 49 insertions(+)
create mode 100644 src/content/docs/stage1/kitbot-drivetrain.mdx
create mode 100644 src/content/docs/stage1/stage1-overview.mdx
diff --git a/examples/stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java b/examples/stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java
index 8625e5c8..32576216 100644
--- a/examples/stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java
+++ b/examples/stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java
@@ -27,6 +27,7 @@
*/
public class Robot extends OpModeRobot {
+ // [DriveMotors]
private final int leftLeaderID = 0;
public TalonFX leftLeader = new TalonFX(leftLeaderID, CANBus.systemcore(0));
private TalonFX leftFollower = new TalonFX(1, CANBus.systemcore(0));
@@ -34,6 +35,7 @@ public class Robot extends OpModeRobot {
private final int rightLeaderID = 2;
public TalonFX rightLeader = new TalonFX(rightLeaderID, CANBus.systemcore(0));
private TalonFX rightFollower = new TalonFX(3, CANBus.systemcore(0));
+ // [/DriveMotors]
public TalonFX intakeLauncher = new TalonFX(4, CANBus.systemcore(0));
public TalonFX feeder = new TalonFX(5, CANBus.systemcore(0));
diff --git a/examples/stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java b/examples/stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java
index 65dcdd60..8fd94d16 100644
--- a/examples/stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java
+++ b/examples/stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java
@@ -19,10 +19,12 @@
public class Robot extends OpModeRobot {
+ // [DriveMotors]
private SparkMax leftLeader = new SparkMax(0, 0, MotorType.kBrushless);
private SparkMax leftFollower = new SparkMax(0, 1, MotorType.kBrushless);
private SparkMax rightLeader = new SparkMax(0, 2, MotorType.kBrushless);
private SparkMax rightFollower = new SparkMax(0, 3, MotorType.kBrushless);
+ // [/DriveMotors]
private OnboardIMU imu = new OnboardIMU(MountOrientation.FLAT);
diff --git a/src/content/docs/stage1/kitbot-drivetrain.mdx b/src/content/docs/stage1/kitbot-drivetrain.mdx
new file mode 100644
index 00000000..6b9748d7
--- /dev/null
+++ b/src/content/docs/stage1/kitbot-drivetrain.mdx
@@ -0,0 +1,39 @@
+---
+title: Kitbot Drivetrain
+description: Programing the kitbot drivetrain
+---
+
+import { Tabs, TabItem } from '@astrojs/starlight/components';
+
+# Motor Controllers
+
+The core of frc programing is telling motors what to do by giving commands to their motor controllers.
+Vendors provide classes that can be used to both control and get sensor data from their motor controllers.
+While each individual type of motor controller has its own class, motor controllers from the same vendor are
+largely the same so this stage will only use the SparkMax for REV code and the TalonFX for CTRE code.
+
+When creating a motor controller object, the physical motor controller's CAN ID and the CAN Bus ID so the code can
+comunicate with the proper controller. For this exercise the motor controllers will have the Ids:
+- LeftLeader: CAN Bus 0, CAN ID 0
+- LeftFollower: CAN Bus 0, CAN ID 1
+- RightLeader: CAN Bus 0, CAN ID 2
+- Right Follower: CAN Bus 0, CAN ID 3
+
+
+
+ The spark max constructor takes the form of
+ ```java
+ SparkMax(int busId, int deviceId, MotorType type)
+ ```
+ Since the Spark Max can control both brushed and brushless motors it's neccesary to specify the type as
+ MotorType.Brushless for motors like a NEO and MotorType.brushed for motors like a CIM. This results in
+ the motor construction looking like this.
+
+ ```java stage1/rev/solution/src/main/java/first/robot/Robot.java#DriveMotors
+ ```
+
+
+ ```java stage1/ctre/solution/src/main/java/first/robot/Robot.java#DriveMotors
+ ```
+
+
\ No newline at end of file
diff --git a/src/content/docs/stage1/stage1-overview.mdx b/src/content/docs/stage1/stage1-overview.mdx
new file mode 100644
index 00000000..a629083b
--- /dev/null
+++ b/src/content/docs/stage1/stage1-overview.mdx
@@ -0,0 +1,6 @@
+---
+title: Stage 1 Overview
+description: An intro to the 2026 kitbot and the topics covered in this stage
+next: stage1/kitbot-drivetrain
+---
+
From 8fed7ed121fa4a18bfae77706740bae9e7be7325 Mon Sep 17 00:00:00 2001
From: Spaceman 11 <135277197+Spaceman113138@users.noreply.github.com>
Date: Fri, 3 Jul 2026 23:16:07 -0500
Subject: [PATCH 05/25] some intro on the drivetrain
---
src/content/docs/stage1/kitbot-drivetrain.mdx | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/content/docs/stage1/kitbot-drivetrain.mdx b/src/content/docs/stage1/kitbot-drivetrain.mdx
index 6b9748d7..ad78b7bc 100644
--- a/src/content/docs/stage1/kitbot-drivetrain.mdx
+++ b/src/content/docs/stage1/kitbot-drivetrain.mdx
@@ -5,6 +5,14 @@ description: Programing the kitbot drivetrain
import { Tabs, TabItem } from '@astrojs/starlight/components';
+# Drivetrain
+
+The kitbot uses a 4 motor tank drive meaning the left and right sides are driven independently by 2 motors each. This allows
+the robot to move similar to a tank by driving the left and right sides at different speeds. For this stage the four drivetrain
+motors will be refered to as LeftLeader, LeftFollower, RightLeader, RightFollower. "Becasue the motion of the robot is dependent
+on the diference in the velocity of the left and the right side, we can call this a differential drivetrain." <- SUSPECT SENTANCE IMPROVE PLS
+
+
# Motor Controllers
The core of frc programing is telling motors what to do by giving commands to their motor controllers.
@@ -12,8 +20,8 @@ Vendors provide classes that can be used to both control and get sensor data fro
While each individual type of motor controller has its own class, motor controllers from the same vendor are
largely the same so this stage will only use the SparkMax for REV code and the TalonFX for CTRE code.
-When creating a motor controller object, the physical motor controller's CAN ID and the CAN Bus ID so the code can
-comunicate with the proper controller. For this exercise the motor controllers will have the Ids:
+When creating a motor controller object, the physical motor controller's CAN ID and the CAN Bus ID are given
+in the constructor so the code can comunicate with the proper controller. For this exercise the motor controllers will have the Ids:
- LeftLeader: CAN Bus 0, CAN ID 0
- LeftFollower: CAN Bus 0, CAN ID 1
- RightLeader: CAN Bus 0, CAN ID 2
@@ -35,5 +43,8 @@ comunicate with the proper controller. For this exercise the motor controllers w
```java stage1/ctre/solution/src/main/java/first/robot/Robot.java#DriveMotors
```
+ For the CTRE code the CAN ID of the leader motors are stored as a variable since they will be used latter on.
+ This helps prevent errors from occuring by ensuring that there is a single source of truth for the corrrect CAN ID.
-
\ No newline at end of file
+
+
From 00743e34befc37902dbcda17be0b355e8c55114f Mon Sep 17 00:00:00 2001
From: Spaceman 11 <135277197+Spaceman113138@users.noreply.github.com>
Date: Sun, 5 Jul 2026 15:36:06 -0500
Subject: [PATCH 06/25] motor config
---
.../ctre/src/main/java/first/robot/Robot.java | 2 ++
.../rev/src/main/java/first/robot/Robot.java | 3 +-
src/content/docs/stage1/kitbot-drivetrain.mdx | 30 +++++++++++++++++--
3 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/examples/stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java b/examples/stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java
index 32576216..72aa7100 100644
--- a/examples/stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java
+++ b/examples/stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java
@@ -55,6 +55,7 @@ public class Robot extends OpModeRobot {
* initialization code.
*/
public Robot() {
+ // [MotorConfig]
var leftConfig = new TalonFXConfiguration();
leftConfig.MotorOutput.withInverted(InvertedValue.Clockwise_Positive);
leftLeader.getConfigurator().apply(leftConfig);
@@ -65,6 +66,7 @@ public Robot() {
leftFollower.setControl(new Follower(leftLeaderID, MotorAlignmentValue.Aligned));
rightFollower.setControl(new Follower(rightLeaderID, MotorAlignmentValue.Aligned));
+ // [/MotorConfig]
}
@Override
diff --git a/examples/stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java b/examples/stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java
index 8fd94d16..a0e0069c 100644
--- a/examples/stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java
+++ b/examples/stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java
@@ -40,7 +40,7 @@ public class Robot extends OpModeRobot {
new DifferentialDrive(leftLeader::setThrottle, rightLeader::setThrottle);
public Robot() {
-
+ // [MotorConfig]
var leftConfig = new SparkMaxConfig().inverted(true);
leftLeader.configure(
leftConfig, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters);
@@ -56,6 +56,7 @@ public Robot() {
rightConfig.follow(rightLeader),
ResetMode.kResetSafeParameters,
PersistMode.kPersistParameters);
+ // [/MotorConfig]
}
@Override
diff --git a/src/content/docs/stage1/kitbot-drivetrain.mdx b/src/content/docs/stage1/kitbot-drivetrain.mdx
index ad78b7bc..41fa515c 100644
--- a/src/content/docs/stage1/kitbot-drivetrain.mdx
+++ b/src/content/docs/stage1/kitbot-drivetrain.mdx
@@ -8,9 +8,9 @@ import { Tabs, TabItem } from '@astrojs/starlight/components';
# Drivetrain
The kitbot uses a 4 motor tank drive meaning the left and right sides are driven independently by 2 motors each. This allows
-the robot to move similar to a tank by driving the left and right sides at different speeds. For this stage the four drivetrain
-motors will be refered to as LeftLeader, LeftFollower, RightLeader, RightFollower. "Becasue the motion of the robot is dependent
-on the diference in the velocity of the left and the right side, we can call this a differential drivetrain." <- SUSPECT SENTANCE IMPROVE PLS
+the robot to move similar to a tank by driving the left and right sides at different speeds. "Becasue the motion of the robot is dependent
+on the diference in the velocity of the left and the right side, we can call this a differential drivetrain." < SUSPECT SENTANCE IMPROVE PLS
+For this stage the four drivetrain motors will be refered to as LeftLeader, LeftFollower, RightLeader, RightFollower.
# Motor Controllers
@@ -48,3 +48,27 @@ in the constructor so the code can comunicate with the proper controller. For th
+Motor Controllers have many settings that can be changed to ensure the motors are driven correctly < BAD
+Vendors provide software like REV Client and Pheonix Tuner X to run and configure their devices from a computer;
+however, it is recomended to configure devices through code to ensure that all motor controllers are properly configured.
+This is especially useful when a motor controler needs to be swaped since the new motor controller may have configurations
+that need to be removed and the proper configurations need to be added. Under time pressure it can be easy to forget all
+of the configurations that need to be added and their proper values.
+
+For this section only the motor controller's invert setting will be configured. This setting controls what direction
+the motor spins when the motor control is given a command with a positive sign.
+
+Since there are 2 motors on each side of the drivetrain, its important to ensure that the each of the motors on a side
+move in sync with eachother. This can be accomplished by telling one of the motor controllers to follow the other. This
+tells the Follower to listen to the commands given to the Leader and is why we gave one motor the name Leader and the other Follower.
+
+
+
+ ```java stage1/rev/solution/src/main/java/first/robot/Robot.java#MotorConfig
+ ```
+
+
+ ```java stage1/ctre/solution/src/main/java/first/robot/Robot.java#MotorConfig
+ ```
+
+
\ No newline at end of file
From 643d5f0469078341f70975915ed52199afea0d8a Mon Sep 17 00:00:00 2001
From: Spaceman 11 <135277197+Spaceman113138@users.noreply.github.com>
Date: Thu, 30 Jul 2026 10:38:16 -0500
Subject: [PATCH 07/25] reorg
---
src/content/docs/stage1/stage1-overview.mdx | 6 ------
1 file changed, 6 deletions(-)
delete mode 100644 src/content/docs/stage1/stage1-overview.mdx
diff --git a/src/content/docs/stage1/stage1-overview.mdx b/src/content/docs/stage1/stage1-overview.mdx
deleted file mode 100644
index a629083b..00000000
--- a/src/content/docs/stage1/stage1-overview.mdx
+++ /dev/null
@@ -1,6 +0,0 @@
----
-title: Stage 1 Overview
-description: An intro to the 2026 kitbot and the topics covered in this stage
-next: stage1/kitbot-drivetrain
----
-
From f9035cc7042af4b835a2460451f2204abc0e51e7 Mon Sep 17 00:00:00 2001
From: Spaceman 11 <135277197+Spaceman113138@users.noreply.github.com>
Date: Thu, 30 Jul 2026 10:41:26 -0500
Subject: [PATCH 08/25] reorg part 2
---
src/content/docs/stage1/kitbot-drivetrain.mdx | 74 -------------------
1 file changed, 74 deletions(-)
delete mode 100644 src/content/docs/stage1/kitbot-drivetrain.mdx
diff --git a/src/content/docs/stage1/kitbot-drivetrain.mdx b/src/content/docs/stage1/kitbot-drivetrain.mdx
deleted file mode 100644
index 41fa515c..00000000
--- a/src/content/docs/stage1/kitbot-drivetrain.mdx
+++ /dev/null
@@ -1,74 +0,0 @@
----
-title: Kitbot Drivetrain
-description: Programing the kitbot drivetrain
----
-
-import { Tabs, TabItem } from '@astrojs/starlight/components';
-
-# Drivetrain
-
-The kitbot uses a 4 motor tank drive meaning the left and right sides are driven independently by 2 motors each. This allows
-the robot to move similar to a tank by driving the left and right sides at different speeds. "Becasue the motion of the robot is dependent
-on the diference in the velocity of the left and the right side, we can call this a differential drivetrain." < SUSPECT SENTANCE IMPROVE PLS
-For this stage the four drivetrain motors will be refered to as LeftLeader, LeftFollower, RightLeader, RightFollower.
-
-
-# Motor Controllers
-
-The core of frc programing is telling motors what to do by giving commands to their motor controllers.
-Vendors provide classes that can be used to both control and get sensor data from their motor controllers.
-While each individual type of motor controller has its own class, motor controllers from the same vendor are
-largely the same so this stage will only use the SparkMax for REV code and the TalonFX for CTRE code.
-
-When creating a motor controller object, the physical motor controller's CAN ID and the CAN Bus ID are given
-in the constructor so the code can comunicate with the proper controller. For this exercise the motor controllers will have the Ids:
-- LeftLeader: CAN Bus 0, CAN ID 0
-- LeftFollower: CAN Bus 0, CAN ID 1
-- RightLeader: CAN Bus 0, CAN ID 2
-- Right Follower: CAN Bus 0, CAN ID 3
-
-
-
- The spark max constructor takes the form of
- ```java
- SparkMax(int busId, int deviceId, MotorType type)
- ```
- Since the Spark Max can control both brushed and brushless motors it's neccesary to specify the type as
- MotorType.Brushless for motors like a NEO and MotorType.brushed for motors like a CIM. This results in
- the motor construction looking like this.
-
- ```java stage1/rev/solution/src/main/java/first/robot/Robot.java#DriveMotors
- ```
-
-
- ```java stage1/ctre/solution/src/main/java/first/robot/Robot.java#DriveMotors
- ```
- For the CTRE code the CAN ID of the leader motors are stored as a variable since they will be used latter on.
- This helps prevent errors from occuring by ensuring that there is a single source of truth for the corrrect CAN ID.
-
-
-
-Motor Controllers have many settings that can be changed to ensure the motors are driven correctly < BAD
-Vendors provide software like REV Client and Pheonix Tuner X to run and configure their devices from a computer;
-however, it is recomended to configure devices through code to ensure that all motor controllers are properly configured.
-This is especially useful when a motor controler needs to be swaped since the new motor controller may have configurations
-that need to be removed and the proper configurations need to be added. Under time pressure it can be easy to forget all
-of the configurations that need to be added and their proper values.
-
-For this section only the motor controller's invert setting will be configured. This setting controls what direction
-the motor spins when the motor control is given a command with a positive sign.
-
-Since there are 2 motors on each side of the drivetrain, its important to ensure that the each of the motors on a side
-move in sync with eachother. This can be accomplished by telling one of the motor controllers to follow the other. This
-tells the Follower to listen to the commands given to the Leader and is why we gave one motor the name Leader and the other Follower.
-
-
-
- ```java stage1/rev/solution/src/main/java/first/robot/Robot.java#MotorConfig
- ```
-
-
- ```java stage1/ctre/solution/src/main/java/first/robot/Robot.java#MotorConfig
- ```
-
-
\ No newline at end of file
From cd29d7a4af82e91eb9460c73617bf63a83f510ed Mon Sep 17 00:00:00 2001
From: Spaceman 11 <135277197+Spaceman113138@users.noreply.github.com>
Date: Thu, 30 Jul 2026 10:47:36 -0500
Subject: [PATCH 09/25] reorg part 3
---
.../stage1/stage1a/kitbot-drivetrain | 74 +++++++++++++++++++
1 file changed, 74 insertions(+)
create mode 100644 src/content/docs/learning-course/stage1/stage1a/kitbot-drivetrain
diff --git a/src/content/docs/learning-course/stage1/stage1a/kitbot-drivetrain b/src/content/docs/learning-course/stage1/stage1a/kitbot-drivetrain
new file mode 100644
index 00000000..41fa515c
--- /dev/null
+++ b/src/content/docs/learning-course/stage1/stage1a/kitbot-drivetrain
@@ -0,0 +1,74 @@
+---
+title: Kitbot Drivetrain
+description: Programing the kitbot drivetrain
+---
+
+import { Tabs, TabItem } from '@astrojs/starlight/components';
+
+# Drivetrain
+
+The kitbot uses a 4 motor tank drive meaning the left and right sides are driven independently by 2 motors each. This allows
+the robot to move similar to a tank by driving the left and right sides at different speeds. "Becasue the motion of the robot is dependent
+on the diference in the velocity of the left and the right side, we can call this a differential drivetrain." < SUSPECT SENTANCE IMPROVE PLS
+For this stage the four drivetrain motors will be refered to as LeftLeader, LeftFollower, RightLeader, RightFollower.
+
+
+# Motor Controllers
+
+The core of frc programing is telling motors what to do by giving commands to their motor controllers.
+Vendors provide classes that can be used to both control and get sensor data from their motor controllers.
+While each individual type of motor controller has its own class, motor controllers from the same vendor are
+largely the same so this stage will only use the SparkMax for REV code and the TalonFX for CTRE code.
+
+When creating a motor controller object, the physical motor controller's CAN ID and the CAN Bus ID are given
+in the constructor so the code can comunicate with the proper controller. For this exercise the motor controllers will have the Ids:
+- LeftLeader: CAN Bus 0, CAN ID 0
+- LeftFollower: CAN Bus 0, CAN ID 1
+- RightLeader: CAN Bus 0, CAN ID 2
+- Right Follower: CAN Bus 0, CAN ID 3
+
+
+
+ The spark max constructor takes the form of
+ ```java
+ SparkMax(int busId, int deviceId, MotorType type)
+ ```
+ Since the Spark Max can control both brushed and brushless motors it's neccesary to specify the type as
+ MotorType.Brushless for motors like a NEO and MotorType.brushed for motors like a CIM. This results in
+ the motor construction looking like this.
+
+ ```java stage1/rev/solution/src/main/java/first/robot/Robot.java#DriveMotors
+ ```
+
+
+ ```java stage1/ctre/solution/src/main/java/first/robot/Robot.java#DriveMotors
+ ```
+ For the CTRE code the CAN ID of the leader motors are stored as a variable since they will be used latter on.
+ This helps prevent errors from occuring by ensuring that there is a single source of truth for the corrrect CAN ID.
+
+
+
+Motor Controllers have many settings that can be changed to ensure the motors are driven correctly < BAD
+Vendors provide software like REV Client and Pheonix Tuner X to run and configure their devices from a computer;
+however, it is recomended to configure devices through code to ensure that all motor controllers are properly configured.
+This is especially useful when a motor controler needs to be swaped since the new motor controller may have configurations
+that need to be removed and the proper configurations need to be added. Under time pressure it can be easy to forget all
+of the configurations that need to be added and their proper values.
+
+For this section only the motor controller's invert setting will be configured. This setting controls what direction
+the motor spins when the motor control is given a command with a positive sign.
+
+Since there are 2 motors on each side of the drivetrain, its important to ensure that the each of the motors on a side
+move in sync with eachother. This can be accomplished by telling one of the motor controllers to follow the other. This
+tells the Follower to listen to the commands given to the Leader and is why we gave one motor the name Leader and the other Follower.
+
+
+
+ ```java stage1/rev/solution/src/main/java/first/robot/Robot.java#MotorConfig
+ ```
+
+
+ ```java stage1/ctre/solution/src/main/java/first/robot/Robot.java#MotorConfig
+ ```
+
+
\ No newline at end of file
From 13caf1472a8250d726b2f6925054f49668f9d027 Mon Sep 17 00:00:00 2001
From: Spaceman 11 <135277197+Spaceman113138@users.noreply.github.com>
Date: Thu, 30 Jul 2026 12:29:37 -0500
Subject: [PATCH 10/25] improve writing
---
.../ctre/src/main/java/first/robot/Robot.java | 19 ++-
.../rev/src/main/java/first/robot/Robot.java | 20 ++-
src/config/sidebarConfig.ts | 4 +
.../stage1/stage1a/kitbot-drivetrain | 74 ----------
.../stage1/stage1a/kitbot-drivetrain.mdx | 136 ++++++++++++++++++
.../stage1/stage1a/stage-overview.mdx | 2 +-
6 files changed, 171 insertions(+), 84 deletions(-)
delete mode 100644 src/content/docs/learning-course/stage1/stage1a/kitbot-drivetrain
create mode 100644 src/content/docs/learning-course/stage1/stage1a/kitbot-drivetrain.mdx
diff --git a/examples/stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java b/examples/stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java
index 72aa7100..a3002cac 100644
--- a/examples/stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java
+++ b/examples/stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java
@@ -27,15 +27,17 @@
*/
public class Robot extends OpModeRobot {
- // [DriveMotors]
+ // [DriveMotorsLeft]
private final int leftLeaderID = 0;
public TalonFX leftLeader = new TalonFX(leftLeaderID, CANBus.systemcore(0));
private TalonFX leftFollower = new TalonFX(1, CANBus.systemcore(0));
+ // [/DriveMotorsLeft]
+ // [DriveMotorsRight]
private final int rightLeaderID = 2;
public TalonFX rightLeader = new TalonFX(rightLeaderID, CANBus.systemcore(0));
private TalonFX rightFollower = new TalonFX(3, CANBus.systemcore(0));
- // [/DriveMotors]
+ // [/DriveMotorsRight]
public TalonFX intakeLauncher = new TalonFX(4, CANBus.systemcore(0));
public TalonFX feeder = new TalonFX(5, CANBus.systemcore(0));
@@ -55,16 +57,25 @@ public class Robot extends OpModeRobot {
* initialization code.
*/
public Robot() {
- // [MotorConfig]
+ // [MotorConfigCreationLeft]
var leftConfig = new TalonFXConfiguration();
+ // [/MotorConfigCreationLeft]
+ // [MotorConfigSetLeft]
leftConfig.MotorOutput.withInverted(InvertedValue.Clockwise_Positive);
+ // [/MotorConfigSetLeft]
+ // [MotorConfigLeft]
leftLeader.getConfigurator().apply(leftConfig);
+ leftFollower.getConfigurator().apply(leftConfig);
+
+ leftFollower.setControl(new Follower(leftLeaderID, MotorAlignmentValue.Aligned));
+ // [/MotorConfigLeft]
+ // [MotorConfig]
var rightConfig = new TalonFXConfiguration();
rightConfig.MotorOutput.withInverted(InvertedValue.CounterClockwise_Positive);
rightLeader.getConfigurator().apply(rightConfig);
+ rightFollower.getConfigurator().apply(leftConfig);
- leftFollower.setControl(new Follower(leftLeaderID, MotorAlignmentValue.Aligned));
rightFollower.setControl(new Follower(rightLeaderID, MotorAlignmentValue.Aligned));
// [/MotorConfig]
}
diff --git a/examples/stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java b/examples/stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java
index a0e0069c..96514e2e 100644
--- a/examples/stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java
+++ b/examples/stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java
@@ -19,12 +19,14 @@
public class Robot extends OpModeRobot {
- // [DriveMotors]
+ // [DriveMotorsLeft]
private SparkMax leftLeader = new SparkMax(0, 0, MotorType.kBrushless);
private SparkMax leftFollower = new SparkMax(0, 1, MotorType.kBrushless);
+ // [/DriveMotorsLeft]
+ // [DriveMotorsRight]
private SparkMax rightLeader = new SparkMax(0, 2, MotorType.kBrushless);
private SparkMax rightFollower = new SparkMax(0, 3, MotorType.kBrushless);
- // [/DriveMotors]
+ // [/DriveMotorsRight]
private OnboardIMU imu = new OnboardIMU(MountOrientation.FLAT);
@@ -40,16 +42,24 @@ public class Robot extends OpModeRobot {
new DifferentialDrive(leftLeader::setThrottle, rightLeader::setThrottle);
public Robot() {
- // [MotorConfig]
- var leftConfig = new SparkMaxConfig().inverted(true);
+ // [MotorConfigCreationLeft]
+ var leftConfig = new SparkMaxConfig();
+ // [/MotorConfigCreationLeft]
+ // [MotorConfigSetLeft]
+ leftConfig.inverted(true);
+ // [/MotorConfigSetLeft]
+ // [MotorConfigLeft]
leftLeader.configure(
leftConfig, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters);
leftFollower.configure(
leftConfig.follow(leftLeader),
ResetMode.kResetSafeParameters,
PersistMode.kPersistParameters);
+ // [/MotorConfigLeft]
- var rightConfig = new SparkMaxConfig().inverted(false);
+ // [MotorConfig]
+ var rightConfig = new SparkMaxConfig();
+ rightConfig.inverted(false);
rightLeader.configure(
rightConfig, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters);
rightFollower.configure(
diff --git a/src/config/sidebarConfig.ts b/src/config/sidebarConfig.ts
index bc56f1ed..e46dc166 100644
--- a/src/config/sidebarConfig.ts
+++ b/src/config/sidebarConfig.ts
@@ -110,6 +110,10 @@ export const sidebarSections: Record = {
label: 'Stage 1A Introduction',
slug: 'learning-course/stage1/stage1a/stage-overview',
},
+ {
+ label: 'Kitbot Drivetrain',
+ slug:'learning-course/stage1/stage1a/kitbot-drivetrain'
+ },
// {
// label: 'TBD',
// slug: 'stage-1a-commands/the-command-body',
diff --git a/src/content/docs/learning-course/stage1/stage1a/kitbot-drivetrain b/src/content/docs/learning-course/stage1/stage1a/kitbot-drivetrain
deleted file mode 100644
index 41fa515c..00000000
--- a/src/content/docs/learning-course/stage1/stage1a/kitbot-drivetrain
+++ /dev/null
@@ -1,74 +0,0 @@
----
-title: Kitbot Drivetrain
-description: Programing the kitbot drivetrain
----
-
-import { Tabs, TabItem } from '@astrojs/starlight/components';
-
-# Drivetrain
-
-The kitbot uses a 4 motor tank drive meaning the left and right sides are driven independently by 2 motors each. This allows
-the robot to move similar to a tank by driving the left and right sides at different speeds. "Becasue the motion of the robot is dependent
-on the diference in the velocity of the left and the right side, we can call this a differential drivetrain." < SUSPECT SENTANCE IMPROVE PLS
-For this stage the four drivetrain motors will be refered to as LeftLeader, LeftFollower, RightLeader, RightFollower.
-
-
-# Motor Controllers
-
-The core of frc programing is telling motors what to do by giving commands to their motor controllers.
-Vendors provide classes that can be used to both control and get sensor data from their motor controllers.
-While each individual type of motor controller has its own class, motor controllers from the same vendor are
-largely the same so this stage will only use the SparkMax for REV code and the TalonFX for CTRE code.
-
-When creating a motor controller object, the physical motor controller's CAN ID and the CAN Bus ID are given
-in the constructor so the code can comunicate with the proper controller. For this exercise the motor controllers will have the Ids:
-- LeftLeader: CAN Bus 0, CAN ID 0
-- LeftFollower: CAN Bus 0, CAN ID 1
-- RightLeader: CAN Bus 0, CAN ID 2
-- Right Follower: CAN Bus 0, CAN ID 3
-
-
-
- The spark max constructor takes the form of
- ```java
- SparkMax(int busId, int deviceId, MotorType type)
- ```
- Since the Spark Max can control both brushed and brushless motors it's neccesary to specify the type as
- MotorType.Brushless for motors like a NEO and MotorType.brushed for motors like a CIM. This results in
- the motor construction looking like this.
-
- ```java stage1/rev/solution/src/main/java/first/robot/Robot.java#DriveMotors
- ```
-
-
- ```java stage1/ctre/solution/src/main/java/first/robot/Robot.java#DriveMotors
- ```
- For the CTRE code the CAN ID of the leader motors are stored as a variable since they will be used latter on.
- This helps prevent errors from occuring by ensuring that there is a single source of truth for the corrrect CAN ID.
-
-
-
-Motor Controllers have many settings that can be changed to ensure the motors are driven correctly < BAD
-Vendors provide software like REV Client and Pheonix Tuner X to run and configure their devices from a computer;
-however, it is recomended to configure devices through code to ensure that all motor controllers are properly configured.
-This is especially useful when a motor controler needs to be swaped since the new motor controller may have configurations
-that need to be removed and the proper configurations need to be added. Under time pressure it can be easy to forget all
-of the configurations that need to be added and their proper values.
-
-For this section only the motor controller's invert setting will be configured. This setting controls what direction
-the motor spins when the motor control is given a command with a positive sign.
-
-Since there are 2 motors on each side of the drivetrain, its important to ensure that the each of the motors on a side
-move in sync with eachother. This can be accomplished by telling one of the motor controllers to follow the other. This
-tells the Follower to listen to the commands given to the Leader and is why we gave one motor the name Leader and the other Follower.
-
-
-
- ```java stage1/rev/solution/src/main/java/first/robot/Robot.java#MotorConfig
- ```
-
-
- ```java stage1/ctre/solution/src/main/java/first/robot/Robot.java#MotorConfig
- ```
-
-
\ No newline at end of file
diff --git a/src/content/docs/learning-course/stage1/stage1a/kitbot-drivetrain.mdx b/src/content/docs/learning-course/stage1/stage1a/kitbot-drivetrain.mdx
new file mode 100644
index 00000000..fd3d3cf7
--- /dev/null
+++ b/src/content/docs/learning-course/stage1/stage1a/kitbot-drivetrain.mdx
@@ -0,0 +1,136 @@
+---
+title: Kitbot Drivetrain
+description: Programing the kitbot drivetrain
+prev: stage-overview
+next: false
+---
+
+import { Tabs, TabItem } from '@astrojs/starlight/components';
+
+# Drivetrain
+
+The kitbot uses a 4 motor tank drive meaning the left and right sides are driven independently by 2 motors each. This allows
+the robot to move similar to a tank by driving the left and right sides at different speeds.
+For this stage the four drivetrain motors will be refered to as `leftLeader`, `leftFollower`, `rightLeader`, `rightFollower`.
+
+# Motor Controllers
+The core of frc programing is controlling motors. This can be done by giving commands to their motor controllers.
+Vendors provide classes that can be used to both control and get sensor data from their motor controllers.
+While each individual type of motor controller has its own class, motor controllers from the same vendor are
+mostly interacted with in the same way so this stage will only use the `SparkMax` for REV code and the `TalonFX` for CTRE code.
+
+When creating a motor controller object, the physical motor controller's CAN ID and the CAN Bus ID are given
+in the constructor so the code can comunicate with the proper controller. For this exercise the motor controllers will have the Ids:
+- `leftLeader`: CAN Bus 0, CAN ID 0
+- `leftFollower`: CAN Bus 0, CAN ID 1
+- `rightLeader`: CAN Bus 0, CAN ID 2
+- `rightFollower`: CAN Bus 0, CAN ID 3
+
+This is how the motor controller objects for the left motors will look.
+
+
+
+ ```java stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java#DriveMotorsLeft
+ ```
+ For the CTRE code the CAN ID of the leader motors are stored as a variable since they will be used latter on to tell the follower what motor controller to follow.
+ This helps prevent errors from occuring by ensuring that there is a single source of truth for the corrrect CAN ID.
+
+
+ ```java stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java#DriveMotorsLeft
+ ```
+ Since the Spark Max can control both brushed and brushless motors it's neccesary to specify the type as `MotorType.kBrushless` for motors like a NEO and `MotorType.kBrushed` for motors like a CIM.
+
+
+
+Now try creating the right motor controllers on your own.
+
+ Solution
+
+
+ ```java stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java#DriveMotorsRight
+ ```
+
+
+ ```java stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java#DriveMotorsRight
+ ```
+
+
+
+
+# Configuration
+Motor Controllers have many settings that can be changed.
+Vendors provide software like REV Hardware Client and Pheonix Tuner X to run and configure their devices from a computer;
+however, it is recomended to configure devices through code to ensure that all motor controllers are properly configured.
+This is especially useful because it can be easy to forget all of the configurations that need to be added and their proper values.
+
+For this section only the motor controller's invert setting will be configured. This setting controls what direction
+the motor spins when the motor control is given a command with a positive speed.
+
+Since there are 2 motors on each side of the drivetrain, its important to ensure that the each of the motors on a side
+move in sync with eachother. This can be accomplished by telling one of the motor controllers to follow the other. This
+tells the Follower to listen to the commands given to the Leader and is why one of the motors is named Leader and the other Follower.
+
+Motor Controllers are configured by first creating a motor controller configuration object.
+This object stores the configuration so it can be changed and shared across different Motor Controllers.
+
+
+
+ ```java stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java#MotorConfigCreationLeft
+ ```
+
+
+ ```java stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java#MotorConfigCreationLeft
+ ```
+
+
+
+Next, settings can be changed from their default by calling various functions on the configuration object with their new values.
+For the left motors, the invert setting will be true for REV code and Clockwise_Positive for CTRE code.
+For the right motors the value will be the opposite.
+
+
+
+ ```java stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java#MotorConfigSetLeft
+ ```
+
+
+ ```java stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java#MotorConfigSetLeft
+ ```
+
+
+
+Finally, the configuration object gets given to the motor controller object.
+It's important to remember that settings only get changed when the configuration gets given to the motor controller.
+
+
+
+ For CTRE Motor Controllers, becoming a follower is a `ControlRequest` instead of a configuration.
+
+ ```java stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java#MotorConfigLeft
+ ```
+
+
+ For REV Motor Controllers, becoming a follower is a configuration so the follower setting gets changed before being applied to the follower motor using the leader motor as the function parameter.
+ This must happen after the configuration is applied to the Leader so the motor controller doesn't want to follow itself.
+ `ResetMode.kResetSafeParameters` gets to tell the motor controller to reset all unchanged configurations to their default value.
+ This prevents old configurations from being left on the controller.
+ `PersistMode.kPersistParameters` is used so the configuration gets saved on the motor control so it persists even after power is removed.
+ ```java stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java#MotorConfigLeft
+ ```
+
+
+
+Now try configuring the right motor controllers on your own. Remember that some of the configurations may be different.
+
+ Solution
+
+
+ ```java stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java#MotorConfig
+ ```
+
+
+ ```java stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java#MotorConfig
+ ```
+
+
+
\ No newline at end of file
diff --git a/src/content/docs/learning-course/stage1/stage1a/stage-overview.mdx b/src/content/docs/learning-course/stage1/stage1a/stage-overview.mdx
index 80c5a487..5c41d044 100644
--- a/src/content/docs/learning-course/stage1/stage1a/stage-overview.mdx
+++ b/src/content/docs/learning-course/stage1/stage1a/stage-overview.mdx
@@ -2,7 +2,7 @@
title: Stage 1A Overview
description: An overview of Stage 1A
prev: ../stage-overview
-next: false
+next: kitbot-drivetrain
---
import YouTube from '../../../../../components/YouTube.astro';
From 416682c4c0a72f8f42d7f2cdd6cf20462a58f8e0 Mon Sep 17 00:00:00 2001
From: Spaceman 11 <135277197+Spaceman113138@users.noreply.github.com>
Date: Thu, 30 Jul 2026 14:59:21 -0500
Subject: [PATCH 11/25] apply suggestions
---
.../stage1/stage1a/kitbot-drivetrain.mdx | 26 +++++++++----------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/content/docs/learning-course/stage1/stage1a/kitbot-drivetrain.mdx b/src/content/docs/learning-course/stage1/stage1a/kitbot-drivetrain.mdx
index fd3d3cf7..57352071 100644
--- a/src/content/docs/learning-course/stage1/stage1a/kitbot-drivetrain.mdx
+++ b/src/content/docs/learning-course/stage1/stage1a/kitbot-drivetrain.mdx
@@ -11,16 +11,16 @@ import { Tabs, TabItem } from '@astrojs/starlight/components';
The kitbot uses a 4 motor tank drive meaning the left and right sides are driven independently by 2 motors each. This allows
the robot to move similar to a tank by driving the left and right sides at different speeds.
-For this stage the four drivetrain motors will be refered to as `leftLeader`, `leftFollower`, `rightLeader`, `rightFollower`.
+For this stage, the four drivetrain motors will be referred to as `leftLeader`, `leftFollower`, `rightLeader`, `rightFollower`.
# Motor Controllers
The core of frc programing is controlling motors. This can be done by giving commands to their motor controllers.
-Vendors provide classes that can be used to both control and get sensor data from their motor controllers.
+Vendors, such as REV or CTRE, provide classes that can be used to both control and get sensor data from their motor controllers.
While each individual type of motor controller has its own class, motor controllers from the same vendor are
mostly interacted with in the same way so this stage will only use the `SparkMax` for REV code and the `TalonFX` for CTRE code.
When creating a motor controller object, the physical motor controller's CAN ID and the CAN Bus ID are given
-in the constructor so the code can comunicate with the proper controller. For this exercise the motor controllers will have the Ids:
+in the constructor so the code can communicate with the proper controller. For this exercise the motor controllers will have the IDs:
- `leftLeader`: CAN Bus 0, CAN ID 0
- `leftFollower`: CAN Bus 0, CAN ID 1
- `rightLeader`: CAN Bus 0, CAN ID 2
@@ -32,13 +32,15 @@ This is how the motor controller objects for the left motors will look.
```java stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java#DriveMotorsLeft
```
- For the CTRE code the CAN ID of the leader motors are stored as a variable since they will be used latter on to tell the follower what motor controller to follow.
+For the CTRE code, the CAN ID of the leader motors are stored as a variable since they will be used later on to tell the follower what motor controller to follow.
This helps prevent errors from occuring by ensuring that there is a single source of truth for the corrrect CAN ID.
```java stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java#DriveMotorsLeft
```
- Since the Spark Max can control both brushed and brushless motors it's neccesary to specify the type as `MotorType.kBrushless` for motors like a NEO and `MotorType.kBrushed` for motors like a CIM.
+ Since the Spark Max can control both brushed and brushless motors it's necessary to specify the type as `MotorType.kBrushless` for motors like a NEO and `MotorType.kBrushed` for motors like a CIM.
+
+When writing code for a real robot, make sure your motor type is set correctly! Setting a NEO to `MotorType.kBrushed` may cause unintended or unwanted effects.
@@ -56,19 +58,17 @@ Now try creating the right motor controllers on your own.
-
-# Configuration
+Motor Controllers have many settings that can be changed such as IDs, motor types, and limits.
+Vendors provide software, such as REV's REV Hardware Client 2 and CTRE's Phoenix Tuner X, to run and configure their devices from a computer.
Motor Controllers have many settings that can be changed.
-Vendors provide software like REV Hardware Client and Pheonix Tuner X to run and configure their devices from a computer;
-however, it is recomended to configure devices through code to ensure that all motor controllers are properly configured.
+Vendors provide software, such as REV's REV Hardware Client 2 and CTRE's Phoenix Tuner X, to run and configure their devices from a computer.
+However, it is recommended to configure devices through code to ensure that all motor controllers are properly configured.
This is especially useful because it can be easy to forget all of the configurations that need to be added and their proper values.
For this section only the motor controller's invert setting will be configured. This setting controls what direction
-the motor spins when the motor control is given a command with a positive speed.
-
Since there are 2 motors on each side of the drivetrain, its important to ensure that the each of the motors on a side
move in sync with eachother. This can be accomplished by telling one of the motor controllers to follow the other. This
-tells the Follower to listen to the commands given to the Leader and is why one of the motors is named Leader and the other Follower.
+This is why one motor is named Leader and the other is Follower. The code tells the Follower to listen to the commands given to the Leader.
Motor Controllers are configured by first creating a motor controller configuration object.
This object stores the configuration so it can be changed and shared across different Motor Controllers.
@@ -85,7 +85,7 @@ This object stores the configuration so it can be changed and shared across diff
Next, settings can be changed from their default by calling various functions on the configuration object with their new values.
-For the left motors, the invert setting will be true for REV code and Clockwise_Positive for CTRE code.
+For the left motors, the invert setting will be `true` for REV code and `Clockwise_Positive` for CTRE code.
For the right motors the value will be the opposite.
From c424bb3926bc00e634bd78bab8221484c99262c0 Mon Sep 17 00:00:00 2001
From: Spaceman 11 <135277197+Spaceman113138@users.noreply.github.com>
Date: Thu, 30 Jul 2026 15:37:46 -0500
Subject: [PATCH 12/25] formating
---
src/config/sidebarConfig.ts | 2 +-
.../stage1/stage1a/kitbot-drivetrain.mdx | 96 +++++++++++++------
2 files changed, 69 insertions(+), 29 deletions(-)
diff --git a/src/config/sidebarConfig.ts b/src/config/sidebarConfig.ts
index e46dc166..d4bf8b5b 100644
--- a/src/config/sidebarConfig.ts
+++ b/src/config/sidebarConfig.ts
@@ -112,7 +112,7 @@ export const sidebarSections: Record = {
},
{
label: 'Kitbot Drivetrain',
- slug:'learning-course/stage1/stage1a/kitbot-drivetrain'
+ slug: 'learning-course/stage1/stage1a/kitbot-drivetrain',
},
// {
// label: 'TBD',
diff --git a/src/content/docs/learning-course/stage1/stage1a/kitbot-drivetrain.mdx b/src/content/docs/learning-course/stage1/stage1a/kitbot-drivetrain.mdx
index 57352071..c6520a8d 100644
--- a/src/content/docs/learning-course/stage1/stage1a/kitbot-drivetrain.mdx
+++ b/src/content/docs/learning-course/stage1/stage1a/kitbot-drivetrain.mdx
@@ -1,6 +1,6 @@
---
title: Kitbot Drivetrain
-description: Programing the kitbot drivetrain
+description: Programming the kitbot drivetrain
prev: stage-overview
next: false
---
@@ -9,18 +9,23 @@ import { Tabs, TabItem } from '@astrojs/starlight/components';
# Drivetrain
-The kitbot uses a 4 motor tank drive meaning the left and right sides are driven independently by 2 motors each. This allows
+The kitbot uses a 4 motor tank drive meaning the left and right sides are driven independently by 2 motors each.
+This allows
the robot to move similar to a tank by driving the left and right sides at different speeds.
For this stage, the four drivetrain motors will be referred to as `leftLeader`, `leftFollower`, `rightLeader`, `rightFollower`.
# Motor Controllers
-The core of frc programing is controlling motors. This can be done by giving commands to their motor controllers.
+
+The core of frc programming is controlling motors.
+This can be done by giving commands to their motor controllers.
Vendors, such as REV or CTRE, provide classes that can be used to both control and get sensor data from their motor controllers.
While each individual type of motor controller has its own class, motor controllers from the same vendor are
mostly interacted with in the same way so this stage will only use the `SparkMax` for REV code and the `TalonFX` for CTRE code.
When creating a motor controller object, the physical motor controller's CAN ID and the CAN Bus ID are given
-in the constructor so the code can communicate with the proper controller. For this exercise the motor controllers will have the IDs:
+in the constructor so the code can communicate with the proper controller.
+For this exercise the motor controllers will have the IDs:
+
- `leftLeader`: CAN Bus 0, CAN ID 0
- `leftFollower`: CAN Bus 0, CAN ID 1
- `rightLeader`: CAN Bus 0, CAN ID 2
@@ -33,55 +38,74 @@ This is how the motor controller objects for the left motors will look.
```java stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java#DriveMotorsLeft
```
For the CTRE code, the CAN ID of the leader motors are stored as a variable since they will be used later on to tell the follower what motor controller to follow.
- This helps prevent errors from occuring by ensuring that there is a single source of truth for the corrrect CAN ID.
+ This helps prevent errors from occurring by ensuring that there is a single source of truth for the correct CAN ID.
```java stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java#DriveMotorsLeft
```
Since the Spark Max can control both brushed and brushless motors it's necessary to specify the type as `MotorType.kBrushless` for motors like a NEO and `MotorType.kBrushed` for motors like a CIM.
-When writing code for a real robot, make sure your motor type is set correctly! Setting a NEO to `MotorType.kBrushed` may cause unintended or unwanted effects.
-
+When writing code for a real robot, make sure your motor type is set correctly! Setting a NEO to `MotorType.kBrushed` may cause unintended or unwanted effects.
+
+
+
Now try creating the right motor controllers on your own.
+
Solution
-
+
+
```java stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java#DriveMotorsRight
```
+
-
+
+
```java stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java#DriveMotorsRight
```
+
+
-Motor Controllers have many settings that can be changed such as IDs, motor types, and limits.
-Vendors provide software, such as REV's REV Hardware Client 2 and CTRE's Phoenix Tuner X, to run and configure their devices from a computer.
-Motor Controllers have many settings that can be changed.
-Vendors provide software, such as REV's REV Hardware Client 2 and CTRE's Phoenix Tuner X, to run and configure their devices from a computer.
-However, it is recommended to configure devices through code to ensure that all motor controllers are properly configured.
-This is especially useful because it can be easy to forget all of the configurations that need to be added and their proper values.
-
-For this section only the motor controller's invert setting will be configured. This setting controls what direction
-Since there are 2 motors on each side of the drivetrain, its important to ensure that the each of the motors on a side
-move in sync with eachother. This can be accomplished by telling one of the motor controllers to follow the other. This
-This is why one motor is named Leader and the other is Follower. The code tells the Follower to listen to the commands given to the Leader.
+Motor Controllers have many settings that can be changed such as IDs, motor
+types, and limits. Vendors provide software, such as REV's REV Hardware Client 2
+and CTRE's Phoenix Tuner X, to run and configure their devices from a computer.
+Motor Controllers have many settings that can be changed. Vendors provide
+software, such as REV's REV Hardware Client 2 and CTRE's Phoenix Tuner X, to run
+and configure their devices from a computer. However, it is recommended to
+configure devices through code to ensure that all motor controllers are properly
+configured. This is especially useful because it can be easy to forget all of
+the configurations that need to be added and their proper values.
+
+For this section only the motor controller's invert setting will be configured.
+This setting controls what direction
+Since there are 2 motors on each side of the drivetrain, its important to ensure that the each of the motors on a side
+move in sync with eachother.
+This can be accomplished by telling one of the motor controllers to follow the other.
+This is why one motor is named Leader and the other is Follower.
+The code tells the Follower to listen to the commands given to the Leader.
Motor Controllers are configured by first creating a motor controller configuration object.
This object stores the configuration so it can be changed and shared across different Motor Controllers.
-
+
+
```java stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java#MotorConfigCreationLeft
```
+
-
+
+
```java stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java#MotorConfigCreationLeft
```
+
+
Next, settings can be changed from their default by calling various functions on the configuration object with their new values.
@@ -89,14 +113,19 @@ For the left motors, the invert setting will be `true` for REV code and `Clockwi
For the right motors the value will be the opposite.
-
+
+
```java stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java#MotorConfigSetLeft
```
+
-
+
+
```java stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java#MotorConfigSetLeft
```
+
+
Finally, the configuration object gets given to the motor controller object.
@@ -108,6 +137,7 @@ It's important to remember that settings only get changed when the configuration
```java stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java#MotorConfigLeft
```
+
For REV Motor Controllers, becoming a follower is a configuration so the follower setting gets changed before being applied to the follower motor using the leader motor as the function parameter.
@@ -115,22 +145,32 @@ It's important to remember that settings only get changed when the configuration
`ResetMode.kResetSafeParameters` gets to tell the motor controller to reset all unchanged configurations to their default value.
This prevents old configurations from being left on the controller.
`PersistMode.kPersistParameters` is used so the configuration gets saved on the motor control so it persists even after power is removed.
+
```java stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java#MotorConfigLeft
```
+
+
-Now try configuring the right motor controllers on your own. Remember that some of the configurations may be different.
+Now try configuring the right motor controllers on your own.
+Remember that some of the configurations may be different.
+
Solution
-
+
+
```java stage1/stage1a/solutions/ctre/src/main/java/first/robot/Robot.java#MotorConfig
```
+
-
+
+
```java stage1/stage1a/solutions/rev/src/main/java/first/robot/Robot.java#MotorConfig
```
+
-
\ No newline at end of file
+
+
From cd6cd01be06d3802d130533381fdc59e90d8acc8 Mon Sep 17 00:00:00 2001
From: Spaceman 11 <135277197+Spaceman113138@users.noreply.github.com>
Date: Thu, 30 Jul 2026 20:30:40 -0500
Subject: [PATCH 13/25] Clear up some stuff
---
.../stage1/stage1a/kitbotDrivetrain.webp | Bin 0 -> 29556 bytes
.../stage1/stage1a/kitbot-drivetrain.mdx | 29 ++++++++++++------
2 files changed, 20 insertions(+), 9 deletions(-)
create mode 100644 public/learning-course/stage1/stage1a/kitbotDrivetrain.webp
diff --git a/public/learning-course/stage1/stage1a/kitbotDrivetrain.webp b/public/learning-course/stage1/stage1a/kitbotDrivetrain.webp
new file mode 100644
index 0000000000000000000000000000000000000000..951a28af951cb960e5e7f7709028bc8e8f696325
GIT binary patch
literal 29556
zcmZs?Q?O`VvaLI9+qSW$ZLVqCwr$(CZQHhO+s65;>fXI?owyO>VLbJW(KEC4FI)7X
zAR#Jh