Skip to content
Week 10 · Lesson 1 50 min

Robot Integration

Turn a drivetrain and separate mechanisms into one robot by mounting them securely, balancing the weight, wiring them cleanly and organizing the code into subsystems.

In this lesson you will

  • Plan and mount mechanisms on the chassis with full clearance
  • Explain how weight distribution and center of gravity affect driving
  • Route and label wiring for added motors, servos and sensors
  • Organize mechanism code into a reusable subsystem class

Lesson

By now your team has a drivetrain that drives and at least one mechanism that works on the bench. Integration is the job of turning those pieces into one robot. It sounds simple, but most problems show up at the joins: an arm that hits a wheel, a wire that gets pinched, a robot that tips over when the lift goes up, or two pieces of code that both try to control the same motor. Plan integration carefully and you avoid days of rework.

DrivetrainFrameControl HubBatteryMechanismSensors↑ Front
Top view of a robot with its subsystems. Decide where each mechanism, the hub and the battery will sit before you bolt anything on.

Mounting mechanisms on the chassis

  1. 1
    Plan the layout
    Sketch a top and side view, or place the parts in your CAD assembly. Mark where every mechanism, the Control Hub, the battery and the power switch will go.
  2. 2
    Check clearances
    With the robot powered off, move each mechanism through its full range of motion by hand. Nothing should touch wheels, wires or other mechanisms at any point.
  3. 3
    Mount to strong points
    Bolt mechanisms to the frame channels, not to thin plates. Use at least two fasteners per mount so the part cannot pivot, and use lock nuts or nylon-insert nuts on anything that vibrates.
  4. 4
    Keep access open
    You must be able to swap the battery, reach the power switch and plug a cable into the hub without taking the robot apart. At an event you may have only minutes between matches.

Weight distribution

Every robot has a center of gravity: the point where its weight balances. Keep heavy parts, like the battery and motors, low and near the middle. A tall lift or a long arm raises the center of gravity when extended, so the robot can tip when it brakes or turns quickly. Uneven weight also causes problems you might blame on code: if one side is much heavier, the light-side wheels slip and your Autonomous drifts.

  • Check that all wheels touch the tiles evenly; a rocking robot loses traction.
  • Extend the arm or lift fully and drive slowly, then stop sharply. If the robot lifts a wheel, lower or move weight.
  • Mount the battery low and secure it so it cannot slide during a collision.
  • Weigh or feel each side by lifting the robot by one end, then the other, to spot obvious imbalance.

Wiring for added mechanisms

Driver HubGamepadsControl HubCPU · IMU · I/OBattery 12 VSwitchWi-FiMotorsServosSensors
Every new motor, servo or sensor connects to a port on the Control Hub (or Expansion Hub), which is powered by the battery through the main switch.
  • Route wires along the frame and secure them with zip ties every few inches.
  • Leave a loose service loop where a wire crosses a moving joint, so the joint can move without pulling the wire.
  • Keep wires away from gears, belts, wheels and pinch points.
  • Label both ends of every cable with its port and name, for example arm on motor port 2.
  • Make sure the name in the robot configuration matches the name in your code exactly.

Combining code subsystems

When each mechanism lives in its own class, your TeleOp and your Autonomous can share the same tested code. The class sets up its hardware once and gives you simple methods like goTo(UP). If you later change a motor direction or a preset position, you fix it in one place instead of in every OpMode.

JAVA
1import com.qualcomm.robotcore.hardware.DcMotor;
2import com.qualcomm.robotcore.hardware.HardwareMap;
3
4public class Arm {
5    public static final int DOWN = 0;
6    public static final int UP = 800; // measure this on your own robot
7
8    private final DcMotor motor;
9
10    public Arm(HardwareMap hardwareMap) {
11        motor = hardwareMap.get(DcMotor.class, "arm");
12        motor.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);
13        motor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
14        motor.setTargetPosition(DOWN);
15        motor.setMode(DcMotor.RunMode.RUN_TO_POSITION);
16    }
17
18    public void goTo(int ticks) {
19        motor.setTargetPosition(ticks);
20        motor.setPower(0.5);
21    }
22
23    public int getPosition() {
24        return motor.getCurrentPosition();
25    }
26}
A simple arm subsystem that any OpMode can use.

Key terms

Integration
Combining separately built mechanisms, wiring and code into one robot that works as a whole.
Center of gravity
The point where the robot's weight balances; keeping it low and central makes the robot harder to tip.
Service loop
A small amount of extra, loosely secured wire left at a moving joint so movement does not pull on the connection.
Subsystem
A self-contained part of the robot, such as an arm or intake, with its own hardware and its own code class.
Range of motion
The full path a mechanism travels from one end of its movement to the other.

Practical exercise

Integrate one mechanism end to end

  1. 1Sketch where your mechanism, hub, battery and switch sit on the chassis, and check the range of motion by hand with power off.
  2. 2Mount the mechanism to the frame with at least two fasteners and lock nuts.
  3. 3Route and zip-tie the wires with a service loop at any moving joint, and label both ends.
  4. 4Add the device to the robot configuration and write a subsystem class for it like the Arm example.
  5. 5Do the tip test: extend the mechanism fully, drive slowly, stop sharply, and note whether a wheel lifts.
Deliverable: Photos of the mounted, wired mechanism, the subsystem class file, and a short note on the tip test result and any weight changes you made.

Knowledge check

Answer every question, then check your answers.

  1. Q1Why should heavy parts like the battery be mounted low and near the middle of the robot?
  2. Q2What is a service loop?
  3. Q3Your TeleOp and Autonomous both use the arm. What is the main benefit of an Arm subsystem class?
  4. Q4What should you do before adding or moving wires on the robot?

Further resources

Mark lesson complete