Overview
Work Package 1 focuses on understanding and simulating the Mecanum robot’s motion using MATLAB. Before building physical hardware, it’s essential to model the robot mathematically to:- Understand how wheel velocities translate to robot motion
- Predict robot behavior for different control inputs
- Validate designs before committing to hardware
- Develop control algorithms in a safe, virtual environment
Duration: Suggested 4 weeks (can overlap with WP2)
Prerequisites: MATLAB basics, linear algebra, trigonometry
Learning Objectives
By the end of WP1, you will be able to:- ✅ Derive forward and inverse kinematics for Mecanum wheel robots
- ✅ Implement kinematics equations in MATLAB
- ✅ Simulate robot trajectories (linear, rotational, combined)
- ✅ Visualize robot motion and wheel velocities
- ✅ Analyze how robot parameters affect performance
Deliverables
D1.1: Kinematics of the Mecanum Robot
Suggested Time: 1 week What to deliver:- Mathematical derivation of kinematics equations
- MATLAB functions for forward and inverse kinematics
- Validation tests showing correctness
- Documentation explaining your approach
- Equations correctly relate wheel velocities to robot velocity
- MATLAB code produces expected results for test cases
- Clear explanation of coordinate frames and assumptions
D1.2: Trajectory Planning and Visualization
Suggested Time: 3 weeks What to deliver:- MATLAB simulation of robot following trajectories:
- Square path (1m × 1m) with constant orientation
- Circular path (1m diameter) with constant orientation
- Circular path with robot facing inward
- Custom trajectories (your choice - be creative!)
- Visualization showing:
- Robot position and orientation over time
- Individual wheel velocities
- Path tracking error
- Analysis of how wheel size and robot dimensions affect motion
- Robot successfully follows planned trajectories in simulation
- Smooth wheel velocity commands (no discontinuities)
- Professional plots with labels, legends, and titles
- Analysis shows understanding of parameter effects
Why Simulation Matters
Design Validation
Design Validation
Simulation lets you test different robot dimensions (wheel size, wheelbase, track width) before building hardware. You can optimize for speed, maneuverability, or payload capacity.
Control Algorithm Development
Control Algorithm Development
Develop and test control algorithms (PID, trajectory following) in MATLAB before implementing on ESP32. Debugging in MATLAB is much faster than on hardware.
Understanding Mecanum Kinematics
Understanding Mecanum Kinematics
Mecanum wheels create unique motion coupling. Simulation helps visualize how each wheel contributes to overall robot motion, building intuition.
Error Analysis
Error Analysis
Simulate effects of wheel slippage, encoder errors, or manufacturing tolerances. Understand limitations before real-world testing.
Mecanum Wheel Basics
How Mecanum Wheels Work
A Mecanum wheel consists of rollers mounted at 45° to the wheel axis. When multiple Mecanum wheels work together, they enable:- Forward/Backward: All wheels rotate in same direction
- Strafing (Sideways): Diagonal wheel pairs rotate in opposite directions
- Rotation: Left and right wheels rotate in opposite directions
- Diagonal Motion: Combination of the above
Coordinate Frames
Understanding coordinate frames is crucial for kinematics: Robot Frame (Body-Fixed):- Origin: Center of robot
- X-axis: Forward direction
- Y-axis: Left direction (perpendicular to X)
- Z-axis: Upward (right-hand rule)
- Fixed reference frame
- Robot moves through this frame
- Used for trajectory planning
- Each wheel has its own frame
- Rotation axis and roller contact direction
Robot Configuration
For this project, we use a 4-wheel Mecanum configuration:L: Wheelbase (front-rear distance)W: Track width (left-right distance)r: Wheel radiusα: Roller angle (typically 45°)
Tools and Resources
Required Software
- MATLAB R2020a or later (university license)
- Toolboxes: None strictly required, but helpful:
- Robotics System Toolbox (optional)
- Symbolic Math Toolbox (optional for derivations)
MATLAB Skills Needed
Programming Basics
- Functions and scripts
- Loops and conditionals
- Arrays and matrices
- Plotting (plot, subplot, xlabel, ylabel)
Mathematical Operations
- Matrix multiplication
- Trigonometric functions (sin, cos, atan2)
- Numerical integration (ode45 or simple Euler)
- Linear algebra (matrix inverse, transpose)
Learning Resources
If you need to brush up on MATLAB:- MathWorks MATLAB Onramp (free 2-hour course)
- University MATLAB tutorials (check your course portal)
- MATLAB Documentation (excellent built-in help)
Project Structure
Organize your MATLAB code in a clear folder structure:Getting Started Steps
1
Review Kinematics Theory
Read the Kinematics page to understand the mathematical foundation
2
Set Up MATLAB Project
Create folder structure and parameter file with your robot dimensions
3
Implement Forward Kinematics
Write function to convert wheel velocities to robot velocity
4
Implement Inverse Kinematics
Write function to convert desired robot velocity to wheel velocities
5
Test and Validate
Verify kinematics with simple test cases (forward only, strafe only, etc.)
6
Plan Trajectories
Generate time-series of desired robot positions for different paths
7
Simulate Motion
Integrate robot motion over time using kinematics and trajectory commands
8
Visualize and Analyze
Create plots showing robot path, wheel velocities, and tracking performance
Common Approaches
Approach 1: Velocity-Level Kinematics (Recommended)
Model robot as velocity-controlled system:- Input: Desired robot velocities (Vₓ, Vᵧ, ω)
- Kinematics: Calculate required wheel velocities
- Integration: Update robot pose numerically
Approach 2: Position-Level Control
Plan exact trajectory, then compute velocities:- Input: Desired position vs time
- Differentiation: Calculate velocity from position
- Kinematics: Convert to wheel velocities
Approach 3: Hybrid
Combine both approaches for realistic simulation:- High-level: Position trajectory planning
- Low-level: Velocity control with feedback
Tips for Success
Start Simple
Start Simple
Begin with stationary robot, then forward motion, then add complexity. Don’t try to simulate everything at once!
Validate Each Step
Validate Each Step
Test kinematics with hand-calculated examples. If forward motion gives wrong velocity, fix before adding rotation.
Use Meaningful Variables
Use Meaningful Variables
Name variables clearly:
wheel_radius not r, robot_pose not x. Your future self will thank you.Plot Everything
Plot Everything
Visualize intermediate results. Plot wheel velocities, robot velocity, trajectory error. Helps debugging and understanding.
Comment Your Code
Comment Your Code
What to Include in Report
For your project proposal and final report, include:-
Kinematics Derivation:
- Coordinate frame definitions
- Roller geometry and force analysis
- Matrix equations for forward and inverse kinematics
- Assumptions and limitations
-
MATLAB Implementation:
- Code structure overview (don’t paste all code, just key functions)
- Parameter values used (wheel size, robot dimensions)
- Validation test results
-
Simulation Results:
- Trajectory plots (position vs time, 2D path)
- Wheel velocity profiles
- Analysis of results (does it match expectations?)
- Effects of parameter changes
-
Figures:
- Professional quality plots with labels
- Multiple trajectories in one figure for comparison
- All figures numbered and referenced in text
Next Steps
Ready to dive in? Continue with the technical pages:Kinematics Derivation
Learn the math behind Mecanum motion
Trajectory Planning
Plan and simulate robot paths in MATLAB
Hardware Reference
Check motor specs for realistic parameters
Project Proposal
Include WP1 results in your proposal
% velocity in m/s).