Skip to content

Add PID tuning evidence and arbitrary-input plant identification - #172

Open
jamestjsp wants to merge 3 commits into
mainfrom
codex/pid-tuner-numerics
Open

jamestjsp wants to merge 3 commits into
mainfrom
codex/pid-tuner-numerics

Conversation

@jamestjsp

Copy link
Copy Markdown
Owner

Summary

Process Lab's PID workspace needs controller families and formulas, direct frequency-response tuning, and plant estimation from arbitrary input/output records. Add these numerical APIs while preserving the existing Pidtune behavior.

  • Independent integration and derivative formulas, ideal versus filtered derivative families, bounded tuning with tracking/rejection focus, and fixed or optimized two-degree-of-freedom weights.
  • Direct FRD designs with explicit measured-band limitations and achieved crossover/margin evidence.
  • Physical process-model fitting with exact held-input fractional delays, plus state-space order proposals with separate training and held-out validation.
  • Bounded work, cancellation, typed diagnostics, and independent analytic regressions.

Validation and limits

go test ./... and go vet ./... pass. Tests cover formula realizations, independent target/margin equations, direct FRD agreement, noise-free and noisy identification, initialization, bounds and cancellation.

These are native numerical methods with explicit evidence, not bit-identical proprietary MATLAB algorithms. Finite-band FRD and exact-delay margins do not certify global stability. Process Lab consumes immutable revision d7d37f683e40 through a module pseudo-version.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-16T00:03:57.549847Z d7d37f6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d7d37f683e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pid_tuning.go
// Ideal derivative controllers may be improper on their own while their
// closed-loop characteristic is well-defined. Test the characteristic directly.
func pidTuningIdealStable(plant *System, c *PID2) bool {
transfer, err := plant.TransferFunction(nil)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve hidden modes in ideal-derivative stability checks

When tuning an ideal PD/PID (Kd != 0 and Tf == 0), this path checks a transfer-function characteristic instead of the full state-space interconnection. TransferFunction eliminates uncontrollable or unobservable modes, so a nonminimal plant containing a hidden unstable mode can be accepted and reported with Stability == "closed-loop-poles", even though the corresponding feedback interconnection retains that unstable state. Check the original plant's internal modes or preserve the full closed-loop dynamics before certifying stability.

Useful? React with 👍 / 👎.

Comment thread process_identification.go
Comment on lines +579 to +580
if power > 0 {
result.ResidualLagOne = cross / power

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Normalize the lag-one residual metric correctly

When residual energy changes over the validation interval, dividing the lag product only by the current-sample power does not produce a valid lag-one correlation or regression coefficient. For example, residuals beginning [10, 1, 0.1] yield a value near 10, despite a correlation being bounded by 1. Normalize by both lagged powers (and consistently center the sequences) so ResidualLagOne remains an interpretable diagnostic.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant