Skip to main content

Advanced Motion Control Algorithms

Overview

This document covers advanced motion control algorithms available in LemLib and other robotics frameworks. While our current robot uses Boomerang control, understanding these alternatives helps with future development and optimization.

Ramsete Controller

What is Ramsete?

Ramsete (Robust Adaptive Model Predictive Control) is a path-following algorithm originally developed for FRC robotics. It's designed to follow pre-planned trajectories with high accuracy and robustness.

Key Features

  • Trajectory following: Follows time-parameterized paths
  • Velocity control: Controls both linear and angular velocity
  • Error correction: Automatically corrects for path deviations
  • Predictive: Looks ahead to anticipate required corrections

When to Use Ramsete

  • Complex autonomous routines with multiple waypoints
  • High-precision path following requirements
  • Time-critical movements where timing matters
  • Repeatable paths that can be pre-planned

Ramsete vs. Boomerang

FeatureRamseteBoomerang
Path PlanningPre-computed trajectoriesDynamic point-to-point
PrecisionVery highHigh
FlexibilityLow (fixed paths)High (dynamic targets)
Setup ComplexityHighLow
Real-time AdaptationLimitedExcellent

Pure Pursuit Controller

Algorithm Overview

Pure Pursuit is a path-following algorithm that:

  1. Looks ahead along a pre-defined path
  2. Calculates curvature needed to reach the lookahead point
  3. Commands steering to follow the calculated arc

Implementation Concept

// Pseudo-code for Pure Pursuit
double lookaheadDistance = 12.0; // inches
Point lookaheadPoint = findLookaheadPoint(path, currentPosition, lookaheadDistance);
double curvature = calculateCurvature(currentPosition, currentHeading, lookaheadPoint);
commandVelocity(targetSpeed, curvature);

Advantages

  • Smooth paths: Natural, flowing movements
  • Predictable: Well-understood behavior
  • Tunable: Lookahead distance affects aggressiveness
  • Robust: Handles path deviations well

Disadvantages

  • Requires path planning: Need pre-computed waypoints
  • Corner cutting: May cut inside curves
  • Setup complexity: More initial configuration

Model Predictive Control (MPC)

Concept

MPC is an advanced control strategy that:

  • Predicts future behavior over a time horizon
  • Optimizes control inputs to minimize cost function
  • Handles constraints on velocity, acceleration, etc.
  • Recalculates continuously as conditions change

Applications in Robotics

  • Obstacle avoidance: Dynamic path replanning
  • Multi-objective optimization: Balance speed vs. accuracy
  • Constraint handling: Respect physical limitations
  • Disturbance rejection: Adapt to unexpected conditions

Implementation Challenges

  • Computational complexity: Requires significant processing power
  • Tuning difficulty: Many parameters to optimize
  • Real-time constraints: Must solve optimization quickly

Adaptive Control Methods

Self-Tuning Controllers

Concept: Controllers that automatically adjust their parameters based on performance

Benefits:

  • Adapt to changing conditions (battery voltage, field wear)
  • Reduce manual tuning requirements
  • Maintain performance over time

Implementation Ideas:

// Pseudo-code for adaptive PID
if (settlingTime > targetTime) {
kP *= 1.1; // Increase aggressiveness
} else if (overshoot > threshold) {
kP *= 0.9; // Reduce aggressiveness
}

Machine Learning Integration

Reinforcement Learning: Train controllers through trial and error Neural Networks: Learn complex control mappings Online Learning: Adapt during competition

Sensor Fusion Techniques

Kalman Filtering

Purpose: Combine multiple sensor readings for better accuracy

Applications:

  • Merge odometry with vision data
  • Filter noisy sensor readings
  • Predict robot state between measurements

Basic Concept:

  1. Predict next state based on motion model
  2. Update prediction with sensor measurements
  3. Weight predictions vs. measurements based on uncertainty

Extended Kalman Filter (EKF)

Use case: Non-linear systems (most real robots) Advantage: Handles complex motion models Disadvantage: More computational complexity

Path Planning Algorithms

A* (A-Star) Algorithm

Purpose: Find optimal path through obstacle field

Process:

  1. Discretize field into grid cells
  2. Mark obstacles as impassable
  3. Search for path using heuristic cost function
  4. Return optimal route from start to goal

Rapidly-Exploring Random Trees (RRT)

Purpose: Path planning in complex environments

Advantages:

  • Handles complex obstacle shapes
  • Probabilistically complete
  • Good for real-time replanning

Process:

  1. Randomly sample points in free space
  2. Grow tree toward sampled points
  3. Connect to goal when possible
  4. Extract path from tree structure

Implementation Considerations

Computational Requirements

AlgorithmCPU UsageMemoryReal-time Feasible
BoomerangLowLowYes
Pure PursuitLow-MediumMediumYes
RamseteMediumMediumYes
MPCHighHighChallenging
RRTHighMediumFor replanning only

VEX V5 Brain Limitations

  • Processor: ARM Cortex-A9 @ 667 MHz
  • Memory: 128 MB RAM
  • Real-time constraints: 20ms typical control loop
  • Recommendation: Stick to simpler algorithms for competition

Future Algorithm Selection

For Current Season (2025-26)

Recommended: Continue with Boomerang + PID

  • Proven reliability
  • Team familiarity
  • Sufficient for game requirements
  • Low risk of competition failures

For Future Development

Next steps:

  1. Implement Pure Pursuit for smoother multi-waypoint paths
  2. Add basic sensor fusion for improved odometry
  3. Experiment with adaptive PID for consistent performance
  4. Consider vision integration for dynamic target tracking

Advanced Features (Long-term)

  • Real-time path replanning for dynamic games
  • Machine learning for strategy optimization
  • Multi-robot coordination for alliance play
  • Predictive control for faster cycle times

Research and Learning Resources

Essential Papers

  • Ramsete: "Control of Wheeled Mobile Robots: An Experimental Overview" (De Luca et al.)
  • Pure Pursuit: "Implementation of the Pure Pursuit Path Tracking Algorithm" (Coulter, 1992)
  • MPC: "Model Predictive Control: Theory and Practice" (Rawlings & Mayne)

Online Resources

  • Controls Engineering in FRC: WPILib documentation
  • Path Planning: LaValle's "Planning Algorithms" (free online)
  • LemLib Documentation: Official API and examples
  • Team 254 Technical Binder: Advanced FRC control strategies

Simulation Tools

  • PROS Simulator: Test algorithms safely
  • Gazebo: 3D robot simulation
  • MATLAB/Simulink: Control system design
  • Python: Rapid prototyping and visualization

Implementation Roadmap

Phase 1: Current Season (Immediate)

  • Boomerang controller implementation
  • Basic PID tuning
  • Odometry accuracy validation
  • Autonomous routine development

Phase 2: Off-season Development

  • Pure Pursuit implementation
  • Advanced PID features (feedforward, etc.)
  • Sensor fusion basics
  • Path planning tools

Phase 3: Advanced Features

  • Real-time path replanning
  • Vision-guided navigation
  • Machine learning integration
  • Multi-robot coordination

Last updated: 2025-08-25