# Wheel Speed PID Calculator AI Agent Connect

> Wheel Speed PID Calculator MCP handles the heavy math for differential-drive robotics. Your AI client uses this to calculate motor commands via PID and feedforward logic, translate wheel speeds into 2D body movement, and monitor controller health through real-time diagnostics.

## Overview
- **Category:** mathematics
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_UdBrTtkKd80bste54ysYGXSAs1VRBCvDaYgpcWfT/ai-agent-connect
- **Tags:** pid, differential-drive, kinematics, robotics, control-theory

## Description

If you are building or tuning differential-drive robots, you know that managing motor commands is a headache. This MCP takes that math off your plate. Instead of manually calculating error terms or worrying about anti-windup logic, you let your AI agent handle the control loop. You can feed it target speeds and current sensor data, and it will output the exact motor commands needed to hit those targets. It handles the PID terms, feedforward, and friction compensation in one go. Beyond motor control, it bridges the gap between wheel-level physics and robot-level movement. You can convert individual wheel speeds into linear and angular velocities to see how the robot will actually move in 2D space. It also keeps an eye on your system, providing diagnostics to let you know if your controller is hitting saturation limits or if your physical robot dimensions are logically sound. It is a dedicated math engine for mobile robotics control.

## Tools

### calculate_wheel_pid
This tool calculates specific motor commands for a single wheel. It uses PID, feedforward, and anti-windup logic to determine the necessary output.

### convert_to_body_twist
This tool translates individual wheel speeds into the robot's 2D movement. It outputs linear and angular velocity based on your robot's physical dimensions.

### get_controller_diagnostics
This tool provides a health check for your controller. It reports on saturation states and other critical status metrics.

### validate_kinematic_params
This tool checks your robot's physical dimensions. It ensures the provided kinematic parameters are logically consistent for a differential-drive setup.

## Prompt Examples

**Prompt:** 
```
Calculate the motor command for a wheel with target speed 1.0, measured speed 0.9, kp 0.5, ki 0.1, kd 0.05, ff 0.2, friction 0.05, sample time 0.01, integral sum 0.009, max 10.0, min -10.0, and no windup.
```

**Response:** 
```
The calculated saturated output is 0.75.
```

**Prompt:** 
```
What is the body twist if the left wheel speed is 0.5 and the right wheel speed is 0.5, with a wheel radius of 0.05 and axle track of 0.2?
```

**Response:** 
```
The linear velocity is 0.05 and the angular velocity is 0.0.
```

**Prompt:** 
```
Check the diagnostics for a controller with pTerm 0.4, iTerm 0.1, dTerm 0.0, saturatedOutput 10.0, maxOutput 10.0, and minOutput -10.0.
```

**Response:** 
```
The controller is currently saturated.
```

## Capabilities

### Motor Command Calculation
Your agent uses PID and feedforward logic to generate precise wheel outputs.

### Kinematic Translation
Your agent converts wheel-level data into 2D linear and angular velocities.

### System Health Monitoring
Your agent checks for controller saturation and status via diagnostics.

### Parameter Validation
Your agent verifies that your robot's physical dimensions are mathematically valid.

## Use Cases

### PID Tuning
Use your agent to calculate motor commands with specific Kp, Ki, and Kd values to test different control responses.

### Motion Planning
Convert desired robot paths into specific wheel speeds using kinematic conversion.

### System Debugging
Run diagnostics to see if your motor outputs are hitting their limits or saturating.

### Robot Configuration
Verify that your wheel radius and axle track measurements are logically sound for your drive model.

## Benefits

- Reduces manual math errors in PID and feedforward calculations.
- Provides instant conversion from wheel speeds to 2D movement vectors.
- Identifies controller saturation and system health issues immediately.
- Validates physical robot parameters before deployment.

## How It Works

Connecting this MCP to your AI client gives your agent immediate access to a robotics math engine.

1. Connect your AI client to Vinkius.
2. Your agent gains access to PID and kinematic tools.
3. You provide target speeds or physical dimensions via text.
4. Your agent executes the math and returns motor commands or velocities.

## Frequently Asked Questions

**What kind of robots does this MCP support?**
This MCP is specifically designed for differential-drive robots.

**Can I use this with any AI client?**
Yes, it works with any MCP-compatible client like Claude, Cursor, or Windsurf.

**Does it handle anti-windup logic?**
Yes, the calculate_wheel_pid tool includes anti-windup logic in its calculations.

**How do I know if my controller is saturated?**
You can use the get_controller_diagnostics tool to check the saturation state of your controller.

**Can it calculate 3D movement?**
No, this MCP focuses on 2D movement by converting wheel speeds into linear and angular velocity.

**How do I calculate the motor command for a specific wheel?**
Use the `calculate_wheel_pid` tool. You will need to provide the target speed, measured speed, PID gains (kp, ki, kd), feedforward term, friction compensation, and actuator limits.

**Can I convert wheel speeds to robot movement?**
Yes, the `convert_to_body_twist` tool converts individual wheel speeds into the robot's linear and angular velocity based on the wheel radius and axle track.

**How can I check if my controller is saturated?**
You can use `get_controller_diagnostics` to check the `isSaturated` status and overall control health.
