> For the complete documentation index, see [llms.txt](https://docs.seattlesolvers.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.seattlesolvers.com/features/controllers/squidf.md).

# SquIDF

package com.seattlesolvers.solverslib.controller

A `SquIDF` controller is a variation of the `PIDF` controller that square roots the positional error term. Effectively, it extends the `PIDF` class, and overrides the `calculateOutput` method. This modification changes how the controller responds to errors of different magnitudes.

#### Key Differences from PIDF

| Aspect                    | PIDF                        | SquIDF               |
| ------------------------- | --------------------------- | -------------------- |
| **Proportional Response** | Linear with error           | Square root of error |
| **Large Errors**          | Stronger correction         | Moderate correction  |
| **Small Errors**          | Generally weaker correction | Stronger correction  |
| **Response Curve**        | Straight line               | Curved (sub-linear)  |

`SquIDF` helps reduces overshoot (since the square root dampens aggressive corrections when initial error is high), and generally gives a smoother approach. However, like a PID/PIDF, tuning is critical. The controller is only as good as you can tune it.

#### Usage Example

```java
// Create SquIDF controller with same gains as PIDF
SquIDFController squidfController = new SquIDFController(
    1.0,  // kP
    0.1,  // kI
    0.05, // kD
    0.2   // kF
);

// Use just like a PIDF controller
squidfController.setSetPoint(targetPosition);
double output = squidfController.calculate(currentPosition);
```

#### Tuning Notes

* **kP values** will typically need to be **higher** than in PIDF since √(e) < e for errors > 1
* Start with your PIDF gains and increase kP gradually
* The I, D, and F terms work pretty much identically to PIDF


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.seattlesolvers.com/features/controllers/squidf.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
