# Servo Bandwidth Calculator AI Agent Connect

> Servo Bandwidth Calculator MCP gives your AI client the math required for advanced control theory. It handles the heavy lifting of calculating open-loop transfer functions, determining stability margins, and evaluating how time delays impact your system's performance.

## Overview
- **Category:** engineering
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_hiZYAcPbaG2hpmO6dckmFYClaY26H4OCZcnCPITj/ai-agent-connect
- **Tags:** servo, stability, frequency-response, control-theory, bandwidth

## Description

You can use this MCP to perform technical analysis on servo-control loops directly within your AI client. Instead of manually calculating complex frequency responses, you provide the component data and let your agent handle the math. It works by aggregating data from your plant, controller, sensor, and actuator to build a complete loop profile. Once the profile is built, you can immediately check for stability buffers like phase and gain margins. It is particularly useful for seeing how much phase margin you lose when you introduce time delays into the system. You can also determine the operational speed of your closed-loop system by calculating its bandwidth. This turns your agent into a specialized control engineering tool that can validate loop designs and identify stability risks in seconds.

## Tools

### analyze_delay_impact
This tool isolates how much time delays consume your system's phase margin.

### calculate_stability_margins
Use this to find the specific phase and gain margins that act as safety buffers for your system.

### estimate_bandwidth
This tool calculates the operational speed or bandwidth of your closed-loop system.

### get_loop_transfer_function
This tool aggregates individual component responses to build the total open-loop characteristics.

## Prompt Examples

**Prompt:** 
```
Calculate the stability margins for a loop with this plant data: {"freq": [1, 10, 100], "mag": [1, 0.5, 0.1], "phase": [0, -45, -90]} and this controller data: {"freq": [1, 10, 100], "mag": [10, 5, 1], "phase": [0, -10, -20]}
```

**Response:** 
```
The crossover frequency is 10 Hz, the phase margin is 45 degrees, and the gain margin is 12 dB.
```

**Prompt:** 
```
What is the bandwidth of the system if the loop transfer data shows a magnitude drop of 3dB at 50 Hz?
```

**Response:** 
```
The bandwidth is 50 Hz.
```

**Prompt:** 
```
How much phase margin is lost due to a 0.05 second delay in my control loop?
```

**Response:** 
```
The delay causes a phase loss of 14.3 degrees, leaving an effective phase margin of 30.7 degrees.
```

## Capabilities

### Loop Profile Construction
Your agent uses component data to build a full open-loop transfer function.

### Stability Margin Calculation
Your agent determines phase and gain margins to check system safety.

### Bandwidth Estimation
Your agent calculates the closed-loop operational speed.

### Delay Impact Analysis
The tool quantifies how time delays reduce your phase margin.

## Use Cases

### Stability Verification
Check if a new controller design provides enough phase margin to prevent oscillation.

### Delay Sensitivity Testing
Evaluate how much phase margin is lost when adding communication delays to a loop.

### Performance Benchmarking
Calculate the bandwidth of a closed-loop system to ensure it meets speed specs.

### Component Integration
Combine plant, actuator, and sensor responses to see the total open-loop effect.

## Benefits

- Automates the aggregation of plant, controller, and sensor data into a single transfer function.
- Provides immediate feedback on how time delays erode phase margins.
- Calculates specific gain and phase margins to ensure system stability.
- Determines closed-loop bandwidth to verify operational speed requirements.

## How It Works

Connect your AI client to Vinkius and start running control theory calculations immediately.

1. Connect your preferred MCP-compatible client to the Vinkius platform.
2. Provide your plant, controller, or sensor data to your AI agent.
3. Ask your agent to calculate margins, bandwidth, or delay impacts.
4. Review the mathematical results provided by the MCP tools.

## Frequently Asked Questions

**What can this MCP calculate?**
It calculates open-loop transfer functions, phase and gain margins, closed-loop bandwidth, and the impact of time delays on phase margin.

**Which AI clients can use this MCP?**
You can use this with any MCP-compatible client, including Claude, Cursor, Windsurf, and VS Code.

**Do I need to host the MCP myself?**
No, Vinkius hosts and manages the MCP for you. You connect your client and it is ready to use.

**Can I analyze the impact of a specific time delay?**
Yes, the analyze_delay_impact tool specifically isolates how much phase margin is consumed by a given time delay.

**How does it handle multiple components?**
The get_loop_transfer_function tool aggregates data from the plant, controller, sensor, and actuator to create a complete profile.

**How do I calculate the stability margins?**
First, use `get_loop_transfer_function` to generate the loop profile. Then, pass that output into `calculate_stability_margins` to retrieve the phase margin, gain margin, and crossover frequency.

**Can I analyze the effect of system latency?**
Yes. Use `analyze_delay_impact` with the loop transfer data and the specific delay in seconds to see how much phase margin is lost.

**What data is required for the analysis?**
You need frequency response data for the system components (plant, controller, sensor, actuator) and the time delay in seconds.
