WestlakeLEARN
FTC · Java

FIRST Tech Challenge

FTC · Java

  • P Control Basics
  • PD Control and Damping
  • Integral Control and When Not to Use It
  • PIDF and Feedforward
  • Dashboard Tuning Workflow

P Control Basics

The first useful feedback controller.

Module 9: PID and Feedforward ControlControl

In this lesson, you will:

  1. 01Define error.
  2. 02Scale output by error.
  3. 03Clamp safely.

Concept narrative

Proportional control converts current error into output. It is the simplest way to make a mechanism move toward a target using feedback.

This lesson should be read as a robotics lesson first and a programming lesson second. The code matters because it lets the team create repeatable behavior under match pressure. Students should slow down long enough to name the inputs, outputs, assumptions, and safety limits before they touch the robot.

Robot mental model

The robot is repeatedly asking how far away it is and pushing in proportion to that distance. Large error produces larger output; small error produces smaller output.

A good mental model gives the team a shared language. When a driver, builder, and programmer can point to the same behavior and use the same words, debugging gets calmer and code review becomes useful instead of personal.

Implementation walkthrough

Read position, calculate error, multiply by kP, clamp, command motor, and print all values. Tune slowly with small target changes.

Keep the implementation staged. First create the smallest version that compiles. Then add telemetry that proves it is running. Then connect one hardware device or one decision. Finally, repeat the test from a cold init so the team knows it was not a lucky hot reload.

PController.javaJava

double error = targetTicks - lift.getCurrentPosition();
double output = kP * error;
output = Math.max(-1.0, Math.min(1.0, output));
lift.setPower(output);

Common mistakes and debugging

If the mechanism runs away, check encoder sign. If it oscillates, kP may be too high or the mechanism may need damping. If it never moves, output may be too small to overcome friction.

Use the five-value debugging habit: input, state, target, measurement, output. If one of those values is missing, add it before rewriting logic. The goal is to make the robot tell the truth about what it thinks is happening.

Practice

Tune a proportional-only lift on blocks and graph target, position, error, and output.

Checkpoint

  • Error sign is correct.
  • Output is clamped.
  • Telemetry shows target/position/error/output.

Reflection check

Check your understanding before moving on.

What is the most important habit in P Control Basics?

0 of 1 answered

References

Game Manual 0FTC community reference for programming, controls, and robot design.FTC DashboardLive telemetry, graphs, config variables, and camera streaming.

Finished reading?

Mark this lesson complete — “PD Control and Damping” is up next.

Build a Vision-Selected AutonomousPD Control and Damping