Cookie CodersFTC Team 39092

TeleOp // Student lesson

Tele-Learn-MecanumDrive
Mecanum Drive

Code Lab / Tele-Learn-MecanumDrive

Trace Tele-Learn-MecanumDrive from signed joystick inputs to four normalized motor commands. This lesson uses Start.blk, not a sensor-guarded replacement; it has no wall or vision stop. Read and calculate first. Any physical trial requires a separate supervisor review, secure support, and Driver Station STOP access.

The opening comment mentions left-motor reversal, but the actual setup reverses both left motors AND back-right. BRAKE is zero-power behavior, not a position lock. The enabled source flag is not approval to run this mounting-specific sample.

Before running: Ask your supervisor first. Keep Driver Station STOP ready.

Mission control

Read, predict, compare, explain.

9source-linked steps
6scored quiz checks
Start with a question

How can three requests, each no larger than 1, combine to demand more than one wheel can accept?

  • Joystick coordinates
  • Mecanum mixing
  • Normalization
  • Telemetry

Read · predict · explain

Build the idea, one block at a time

Read these steps before exploring the full program. The numbered blue comments in the diagram link back to the matching step.

Start with a question

How can three requests, each no larger than 1, combine to demand more than one wheel can accept?

By the end, you can…

  • Translate joystick signs into forward, strafe, and turn requests.
  • Calculate a common normalization denominator without amplifying small inputs.
  • Predict all four mecanum powers and the effect of the held slow-mode bumper.
  • Distinguish commanded power, telemetry, physical speed, and stopping behavior.

01Read all four directions, not just the comment

Actual Blocks for this section
Blocks for Read all four directions, not just the comment
Blocks to noticeHover, focus or tap a block to see what it does.
  • Sets which way positive power spins each motor. Front-left, back-left, and back-right are REVERSE; front-right is FORWARD. Verify this on the real robot.
  • Makes each motor resist turning when its power is zero rather than coasting. It does not lock a position or guarantee no coast.
  • Sets each motor to run directly from the power value without encoder-based speed control.
  • Sets all four drive motors to zero power in setup, so no movement is requested before the driver presses START.

The actual Blocks set front-left, back-left, and back-right REVERSE; front-right is FORWARD. Mirrored mounting motivates direction correction, but these settings need physical verification for this robot. All four use BRAKE and RUN_WITHOUT_ENCODER, then receive zero. BRAKE resists motion at zero; it does not actively hold an encoder position or guarantee no coast.

For example: Copying only 'reverse the left motors' misses the back-right setting. Equal positive commands are intended to produce shared forward motion only with the matching mounting and wiring.

Think first

Does RUN_WITHOUT_ENCODER make +0.25 an exact wheel speed?

Show Answer

No. It is a power request; battery, load, friction, and mounting affect actual movement.

02Separate initialization from active driving

Actual Blocks for this section
Blocks for Separate initialization from active driving
Blocks to noticeHover, focus or tap a block to see what it does.
  • Shows the message READY - basic mecanum drive on the Driver Station during INIT. It is only information, not a safety system.
  • Pauses the program until the driver presses START on the Driver Station. Setup and the zero-power commands run before this point.
  • Repeats the joystick reading and wheel mixing blocks again and again until the driver presses STOP.

Setup and zero commands occur before waitForStart. That block waits for Driver Station START; joystick mixing lives inside the later active loop. The READY display is information, not permission from a safety system. This sample does not have a repeated sensor-preview INIT loop.

For example: A nonzero joystick during waitForStart is not yet processed by the drive loop, but START can immediately make that held request active.

Think first

Is it safe to leave a joystick held just because INIT requested zero?

Show Answer

No. Release controls before START; the active loop will read current stick positions.

03Give each joystick axis a signed job

Actual Blocks for this section
Blocks for Give each joystick axis a signed job
Blocks to noticeHover, focus or tap a block to see what it does.
  • Reads the left stick's up/down position as a number from -1 to +1. Pushing the stick up gives a negative number.
  • Flips the sign of a number. Here it makes pushing the left stick forward give a positive forward value.
  • Reads the left stick's side-to-side position from -1 to +1 and uses it unchanged as strafe, the sideways request.
  • Reads the right stick's side-to-side position from -1 to +1 and uses it unchanged as turn, the rotation request.
  • Sets the speed scale to 1 (full) at the start of every loop, before the bumper check can lower it.

forward = -LeftStickY, strafe = LeftStickX, and turn = RightStickX. A pushed-up left stick reports negative Y, so negation makes forward positive. Positive strafe requests right; negative requests left. The loop resets speed to 1 each time before checking the bumper.

For example: LeftStickY = -0.60, LeftStickX = -0.20, RightStickX = +0.10 become forward +0.60, strafe -0.20, turn +0.10.

Think first

What forward value comes from pulling LeftStickY to +0.40?

Show Answer

forward = -0.40, a backward request.

04Scale while the bumper is held

Actual Blocks for this section
Blocks for Scale while the bumper is held
Blocks to noticeHover, focus or tap a block to see what it does.
  • Runs the blocks inside only while the left bumper is held down. It is a held control, not a toggle.
  • Lowers the speed scale to 0.35 (35 percent) for this loop. It scales the power command, not measured speed.
  • Multiplies every wheel's power by speed, so all wheels shrink by the same amount and the driving direction is kept.

Holding LEFT BUMPER changes speed from 1 to 0.35 for this loop. Every wheel gets the same final multiplier, preserving the normalized command ratios. This is a held control, not a toggle, and it applies to turns as well as translation. A 35% command scale is not a guarantee of 35% measured speed.

For example: A normalized wheel request of -0.80 becomes -0.28 while the bumper is held, then -0.80 after release if the sticks have not changed.

Think first

Does releasing the bumper keep slow mode latched?

Show Answer

No. The next loop resets speed to 1 unless the bumper is held again.

05Measure combined demand without sign cancellation

Actual Blocks for this section
Blocks for Measure combined demand without sign cancellation
Blocks to noticeHover, focus or tap a block to see what it does.
  • Takes the size of the forward request, ignoring its plus or minus sign so it cannot cancel the other requests.
  • Takes the size of the strafe request, ignoring its plus or minus sign so it cannot cancel the other requests.
  • Takes the size of the turn request, ignoring its plus or minus sign so it cannot cancel the other requests.
  • Adds the three sizes together to estimate the largest combined demand any one wheel could receive.
  • Stores that sum as denominator, which later divides all four wheel values so they can stay within -1 to +1.

The source adds |forward| + |strafe| + |turn|. Absolute values count each demand's magnitude; opposite signs must not cancel in this bound. A wheel numerator is a sum of signed requests, so this magnitude sum bounds every wheel's possible absolute demand.

For example: forward = 0.60, strafe = -0.60, turn = 0.20 give denominator 1.40, not the signed sum 0.20.

Think first

For forward = 1, strafe = 1, turn = 0, what demand must the denominator account for?

Show Answer

2: the front-left and back-right numerators can reach +2 before division.

06Never divide small requests by a small bound

Actual Blocks for this section
Blocks for Never divide small requests by a small bound
Blocks to noticeHover, focus or tap a block to see what it does.
  • True when the combined demand is under 1, which happens with small stick movements or neutral sticks.
  • Replaces a small denominator with 1, so small requests are not made bigger and neutral sticks never divide by zero.
  • Divides each wheel's forward, strafe, and turn sum by the shared denominator, which shrinks big combined demands equally for all wheels.

Replace any denominator below 1 with 1. This prevents division by zero at neutral sticks and prevents a small request from being amplified. Larger combined demands use their original sum so all wheels shrink together rather than being clipped independently.

For example: With forward 0.20 and other inputs zero, the raw sum is 0.20 but the final denominator is 1; each wheel stays at 0.20 before speed scaling.

Think first

What denominator is used when all three inputs are zero?

Show Answer

1, yielding zero wheel powers without dividing by zero.

07Mix the signs for each wheel

Actual Blocks for this section
Blocks for Mix the signs for each wheel
Blocks to noticeHover, focus or tap a block to see what it does.
  • Sets front-left power to speed * (forward + strafe + turn) / denominator. Positive strafe and positive turn both add here.
  • Sets front-right power to speed * (forward - strafe - turn) / denominator. Positive strafe and positive turn both subtract here.
  • Sets back-left power to speed * (forward - strafe + turn) / denominator. Strafe subtracts and turn adds.
  • Sets back-right power to speed * (forward + strafe - turn) / denominator. Strafe adds and turn subtracts.

Each numerator is divided by the same denominator and multiplied by speed. Positive strafe adds to front-left/back-right and subtracts from front-right/back-left; positive turn adds on the left and subtracts on the right. Roller placement plus verified motor directions turns these patterns into chassis motion. No sensor guard modifies these powers.

For example: forward = 1, strafe = 1, turn = 0, speed = 1 give FL 1, FR 0, BL 0, BR 1 after dividing by 2. With slow mode, FL and BR become 0.35.

Think first

For pure positive strafe 0.50 with no bumper, what are FL, FR, BL, BR?

Show Answer

+0.50, -0.50, -0.50, +0.50, in that order.

08Compare inputs with the final command

Actual Blocks for this section
Blocks for Compare inputs with the final command
Blocks to noticeHover, focus or tap a block to see what it does.
  • Adds labeled rows to the Driver Station display, such as forward, strafe, turn, and speed. It only shows data and does not control the robot.
  • Reads each drive motor's current Power setting, the value the program last requested. It is not measured speed or distance.
  • Adds rows showing whether the A, B, X, Y, D-pad, bumper, Start, and Back buttons are pressed. They do not change the driving.
  • Sends the rows added this loop to the Driver Station screen. It adds no obstacle protection.

Telemetry reports forward, strafe, turn, speed scale, and each motor's Power property, plus raw button states. Motor Power here is the requested value, not measured RPM or a distance. update sends the display; it does not add obstacle protection. Displayed Start/Back/A/B/X/Y buttons have no drive-stop branch in this sample.

For example: Joystick forward can read 1 while FL motor power reads 0.35 because the bumper changed the final scale.

Think first

If telemetry says FL power 0.35, does it prove that wheel is rotating?

Show Answer

No. It proves a command value, not physical motion; a stall or wiring problem can still exist.

09Clear every motor on exit

Actual Blocks for this section
Blocks for Clear every motor on exit
Blocks to noticeHover, focus or tap a block to see what it does.
  • The loop test. When the driver presses STOP it becomes false, the loop ends, and the exit blocks after it run.
  • After the loop ends, sets all four motors to zero power so no earlier request stays active. It does not guarantee an instant stop.

When the active loop ends, the final chain explicitly requests zero from all four motors. Driver Station STOP ends the OpMode; a displayed gamepad button is not a substitute. Zero command and BRAKE cannot guarantee instantaneous physical stopping, and a software exit chain is not an independent hardware emergency stop.

For example: An earlier diagonal request left FL and BR powered. Exit must clear those outputs as well as FR and BL.

Think first

Would zeroing only the front motors completely clear the previous drive request?

Show Answer

No. Back-left and back-right also need zero.

Try it without a robot

Make the math make sense

Use a notebook or talk through your answer with a partner. You do not need a robot to predict what these blocks will do.

forward = -LeftStickY; strafe = LeftStickX; turn = RightStickX
Preserve the signed requests; only the controller's forward/back Y is negated.
D = max(1, |forward| + |strafe| + |turn|)
Use one bound for all wheels; do not amplify small requests.
FL = s*(f+x+r)/D; FR = s*(f-x-r)/D; BL = s*(f-x+r)/D; BR = s*(f+x-r)/D
Here f is forward, x is strafe, r is turn, and s is 1 or held-bumper 0.35. These are power commands, not distances.

1. Trace a mixed command

On paper use LeftStickY -0.60, LeftStickX -0.20, RightStickX +0.10. Calculate forward, strafe, turn, D, and FL/FR/BL/BR at speed 1 and 0.35. Which signs change when the bumper is pressed?

2. Compare common normalization with clipping

Use forward 1, strafe 0.50, turn 0.50. Calculate the four raw numerators and normalized powers. Compare with independently clipping each raw numerator to [-1,1]. Explain why the ratios differ.

3. Separate request from evidence

Make columns for INIT, START with neutral sticks, pure right strafe, bumper-held strafe, and STOP. Write requested powers and the observations you would need to verify movement. Explain why telemetry alone cannot certify a safe robot.

Full-program context

Explore the full Blocks program

One source program, in one column. Calls connect any named helper routines; they are not separate programs. Click a numbered blue comment to return to its explanation.

Full commented Blocks program
100%

Ask your supervisor before importing or running these Blocks. Viewing the program does not control the robot.

Section in context

Full Blocks program

The highlighted Blocks belong to this section. You can select another blue comment.

Check your understanding

Your turn

Choose an answer, then check your thinking. You can change an answer and try again.

Your answers stay on this page and reset when you reload. No cookies, account, or saved answers.

0 / 6 correct · 0 / 6 answered

0
0
Question 1LeftStickY is -0.70 and the other stick axes are zero. What forward command is calculated?

Question 2forward = 0.20, strafe = 0, turn = 0. Which denominator and normal-mode wheel power are used?

Question 3forward = 1, strafe = 1, turn = 0, with LEFT BUMPER held. What are FL, FR, BL, BR?

Question 4Which direction detail is in the actual Start Blocks but omitted by a left-motors-only summary?

Question 5The bumper is released while unchanged sticks request motion. What happens next loop?

Question 6Does Start.blk automatically stop a right strafe at a wall 12 inches away?

Reset clears every choice, explanation, and score.

Adult supervision · setup · safety

Supervisor notes

For supervisors: 60-minute teaching plan & robot setup

Before the robot is used

Safety: This is a read-and-calculate lesson first. Enabled metadata does not authorize operation. For a separately approved demonstration, support the robot with all wheels clear, exclude hands and loose items, use an operator and a supervisor at Driver Station STOP, and stop promptly for unexpected direction or a stall. There is no wall guard. BRAKE does not eliminate coast; isolate power before touching the drivetrain.

Required hardware & dependencies

  • Four mecanum drive motors named front_left_drive, front_right_drive, back_left_drive, and back_right_drive; verify each configured name against its physical cable and wheel.
  • FTC Robot Controller, Driver Station, secure battery, and a notebook. Motor direction settings are specific to the source and mounting, not universal wiring instructions.
  • Paired gamepad with verified left-stick axes, right-stick X, and LeftBumper. Stable wheels-clear support for any separately approved demonstration.

Source identity remains Start.blk. It uses native FTC Blocks and the four exact drive-device names; no helper ZIP is supplied or implied. Review motor mounting, directions, controller mapping, and an approved wheels-clear test plan before any operation. This migration does not deploy or change a robot.

Robot setup checklist

  1. Review Start.blk in the FTC Blocks editor without treating import as deployment. Resolve the four native motor devices; no separate MyBlocks helper is claimed.
  2. Compare each actual direction: FL REVERSE, BL REVERSE, FR FORWARD, BR REVERSE. Check mecanum roller orientation and physical cable labels before authorizing a bench test.
  3. Confirm RUN_WITHOUT_ENCODER, BRAKE, zero setup powers, neutral controls, and STOP access. Do not expect wall sensors or gamepad face buttons to stop this sample.

60-minute teaching sequence

  1. 0-10 min

    Predict signs from joystick positions and compare the setup comment with all four Blocks.

    Look for: Students notice the back-right reversal and distinguish BRAKE from a position hold.

  2. 10-25 min

    Compute denominators for neutral, small, diagonal, and mixed inputs.

    Look for: Absolute magnitudes do not cancel; small inputs use D = 1.

  3. 25-40 min

    Trace wheel signs and repeat one calculation with the held bumper.

    Look for: All four powers share the same denominator and scale.

  4. 40-60 min

    Compare a paper telemetry table with the quiz and discuss a separately approved bench observation.

    Look for: Requested power is not measured motion, and STOP clears all four outputs.

Observation notebook

Notebook: inputs, calculated commands, and separate physical evidence
Conditionf / strafe / turnD / speedFL / FR / BL / BREvidence or question
Small forward0.20 / 0 / 01 / 10.20 / 0.20 / 0.20 / 0.20Power request, not RPM
Diagonal, bumper1 / 1 / 02 / 0.350.35 / 0 / 0 / 0.35Why do two wheels receive zero?
ExitNot usedNot used0 / 0 / 0 / 0Record coast only in an approved demonstration

Use paper traces unless a supervisor has separately approved hardware activity. Label motor Power readings as commands and physical movement as observations.

Troubleshooting · stop before investigating

A wheel appears to oppose the other wheels.
STOP; review the exact four direction settings, motor mapping, and roller orientation. Do not compensate with an invented mix before checking hardware.
Tiny stick movement predicts full power.
Inspect the denominator < 1 branch; D must become 1 rather than the small magnitude sum.
A wall does not change the command.
That matches this source: no wall sensor is read. Do not enable a separate study and assume it guards Start.
Power telemetry is nonzero but the wheel does not move.
STOP and isolate power before inspecting wiring or a stall. A power property is not an encoder or motion measurement.

Exit ticket & assessment

  1. Calculate pure positive strafe at 0.50.
  2. Explain why D cannot be 0.20 for a 0.20 forward request.
  3. Name the absent safety feature and the correct control for ending the OpMode.

Assessment: Require correct signs, a common denominator, held-bumper behavior, and a command-versus-motion explanation. Safety understanding includes no wall guard and all-four zero cleanup; correct arithmetic alone is not a pass.

Extension challenge: On paper compare common normalization and independent clipping for one mixed input. Propose a hardware-verification checklist without editing or deploying robot code.

Teacher key · discuss after students predict

Mixed-input practice

f = 0.60, strafe = -0.20, turn = 0.10; D = 1. Powers are 0.50, 0.70, 0.90, 0.30. At 0.35 they are 0.175, 0.245, 0.315, 0.105; signs do not change.

Normalization versus clipping

For 1,0.50,0.50, raw powers are 2,0,1,1. D = 2 gives 1,0,0.50,0.50. Independent clipping gives 1,0,1,1 and changes the ratios.

Safety and source fidelity

Back-right REVERSE is an actual setting. RUN_WITHOUT_ENCODER is direct power control; BRAKE is not a hold guarantee. Start contains no sensor guard.