# Two-Degree-of-Freedom PID Calculator AI Agent Connect

> Two-Degree-of-Freedom PID Calculator is a high-precision calculation engine designed for advanced control laws. It uses a proportional setpoint weight to separate how your system follows a setpoint from how it handles external disturbances. This allows you to adjust tracking smoothness without ruining your regulation performance.

## Overview
- **Category:** engineering
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_qcXEcY1lWG9UckYAquJHXQ97oa4a2Fe0sozJ1jvL/ai-agent-connect
- **Tags:** pid, control-theory, 2dof, automation, mathematical-modeling

## Description

Standard PID controllers often force a trade-off: if you tune for fast setpoint tracking, you might end up with poor disturbance rejection, and vice versa. This MCP solves that problem by implementing 2DoF control laws. By using a proportional setpoint weight, you can tune the response to changes in the target independently from how the system reacts to noise or external hits. 

You can use your AI client to run step-by-step math, check if your gains are mathematically sound, or pull performance metrics from your control history. It's a specialized math engine that turns your agent into a control theory expert. Instead of manually calculating outputs or checking stability in a spreadsheet, you feed the parameters to your agent and get immediate, precise results.

## Tools

### validate_pid_parameters
This tool checks your PID gains and configuration. It ensures your settings are mathematically sound before you apply them.

### calculate_2dof_pid_output
This tool performs a single step of the 2DoF PID calculation. It handles the math for your current control loop iteration.

### get_control_statistics
This tool analyzes your history of calculated outputs. It provides specific performance metrics based on your data.

### get_tracking_efficiency
This tool evaluates how well your system follows setpoints compared to how it rejects disturbances.

## Prompt Examples

**Prompt:** 
```
Calculate the 2DoF PID output with setpoint 10, measured output 8, Kp 1.5, Ki 0.5, Kd 0.1, weight 0.5, filter 0.1, sample time 0.1, limits -10 to 10, previous error 0, previous integral 0, and previous derivative 0.
```

**Response:** 
```
The unsaturated output is 2.5 and the saturated output is 2.5.
```

**Prompt:** 
```
Validate these PID parameters: Kp 2.0, Ki 0.1, Kd 0.05, weight 0.8, min -5, max 5.
```

**Response:** 
```
The parameters are valid.
```

**Prompt:** 
```
Get statistics for an output history of [1.0, 1.2, 1.1] and error history of [0.1, 0.2, 0.1].
```

**Response:** 
```
The average output is 1.1 and the peak output is 1.2.
```

## Capabilities

### Setpoint Decoupling
Your agent uses proportional setpoint weighting to separate tracking from regulation.

### Parameter Validation
Your agent checks PID gains to ensure they meet mathematical requirements.

### Performance Analysis
Your agent calculates statistics and efficiency metrics from your control data.

### Step-by-Step Math
Your client performs individual PID calculation steps on demand.

## Use Cases

### Tuning Control Loops
Use the tool to find the right balance between smooth setpoint changes and fast disturbance rejection.

### System Stability Checks
Verify that your Kp, Ki, and Kd gains are mathematically sound before deployment.

### Performance Auditing
Analyze historical data to see how well your controller is actually performing.

### Mathematical Modeling
Run precise 2DoF calculations to simulate how a controller will behave in a specific environment.

## Benefits

- Decouples setpoint tracking from disturbance rejection via proportional weighting.
- Prevents mathematical errors through automated parameter validation.
- Provides instant performance metrics from output and error histories.
- Eliminates manual PID math by performing step-by-step calculations.

## How It Works

Connect your AI client to Vinkius to access the calculation engine instantly.

1. Connect your MCP-compatible client to Vinkius.
2. Provide your PID parameters or data history to your AI agent.
3. Your agent calls the specific tool needed for the calculation.
4. The MCP returns precise mathematical results to your agent.
5. Your agent presents the final output or analysis to you.

## Frequently Asked Questions

**What is a 2DoF PID controller?**
It is a controller that uses a proportional setpoint weight to decouple how a system follows a setpoint from how it rejects disturbances.

**How do I use this MCP with Claude or Cursor?**
You connect your client to the Vinkius platform, which hosts the MCP. Once connected, your AI client can immediately use the calculation tools.

**Can this MCP validate my PID gains?**
Yes, the validate_pid_parameters tool checks if your gains and configuration are mathematically sound.

**Does this replace a standard PID controller?**
This is a calculation engine that provides the math for 2DoF control laws, offering more flexibility than standard PID by separating tracking and regulation.

**Can I analyze my control performance?**
Yes, you can use get_control_statistics for performance metrics and get_tracking_efficiency to evaluate setpoint following.

**What is the benefit of a 2DoF PID controller?**
A 2DoF PID controller allows you to adjust how the controller responds to setpoint changes independently from how it responds to disturbances, preventing aggressive setpoint tracking from causing instability.

**How can I check if my PID gains are valid?**
You can use the `validate_pid_parameters` tool to ensure your gains and saturation limits are mathematically and physically sound before running calculations.

**Can I analyze the performance of my controller?**
Yes, you can use `get_control_statistics` to get average and peak metrics, or `get_tracking_efficiency` to evaluate how well the system follows setpoints versus rejecting disturbances.
