Introduction¶
In DeepSeek Harness (DSH), discussions of classical control often stop at text or scattered formulas: Bode plots, Nyquist contours, and root locus branches require opening separate MATLAB/Python or manual calculations for verification, which can easily become disconnected from the conversation context. Below is an introduction to the community plugin control-plot-lab-github (repository name dsh-control-plot-lab, maintainer Mhk0416): it draws Bode plots, Nyquist plots, and root locus based on continuous-time rational transfer functions G(s) on the browser side, and provides step-by-step calculation explanations corresponding to the graphics on the right side of the panel. The plugin is published via GitHub and does not depend on npm; once installed, plotting and step-by-step deduction run locally.
What is This¶
One-sentence positioning: A “Three Charts + Steps” workspace for continuous-time, lumped-parameter rational transfer functions, injected into the conversation interface as a DSH Web/Desktop client plugin.
- Name:
dsh-control-plot-lab(package.jsonversion1.0.0, MIT) - Install Source: GitHub — Mhk0416/control-plot-lab-github
- Community Directory: SkillHub Plugin Page
- Runtime Requirements: DeepSeek Harness
>=0.2.1(seeengines.dshinpackage.json)
Core Features¶
What Each of the Three Charts Does¶
Bode: Magnitude (dB) and Phase (°) share a logarithmic frequency axis; corner frequency, cutoff frequency ωc, gain crossover frequency ωg, phase margin PM, and gain margin GM can be marked; asymptotes and grid can be toggled. When pure delay is included, it uses the exact e^(-jωτ). The right-side steps cover conversion to polynomial, substitution of s=jω, poles/zeros, system type and low-frequency slope, corner frequencies, PM/GM, delay margin, closed-loop stability, etc.
Nyquist: Plots the main curve for ω: 0→∞ and its mirror; marks the -1 point, start/end points, and real axis intersections; uses a semi-circular detour for poles in the right-half plane and draws an infinite arc; calculates the number of open-loop right-half plane poles P, the clockwise encirclement count N, and Z=P+N. When pure delay is included, the curve remains exact, but the encirclement count is no longer finite; the interface switches to delay margin and second-order Padé approximation for stability. When the numerator and denominator are of the same order, the infinite arc maps to the ratio of the leading coefficients.
Root Locus: Standard form 1 + K·G(s)=0; if the symbol K appears in the equation, it is automatically organized into A(s)+K·B(s)=0, supporting K in the numerator or denominator. The chart marks poles, zeros, branch arrows, asymptotes, break-in/break-out points, and imaginary axis intersections, and provides real axis segments, asymptote centroid/angle, departure angle, and the stable K range. When pure delay is included, the root locus uses a second-order Padé approximation and is marked in the chart; Bode/Nyquist still use exact delay.
Input and Interaction¶
The Laplace variable is fixed as s, and the variable gain parameter is K. Common syntaxes are supported, for example:
10/(s*(s+1)*(s+2))
(s+2)/(s^2+2*s+5)
s/(s+1)^3
3/[(K*s+3)*(s+1)]
e^(-0.5s)/(s+1)
exp(-0.3*s)/(s^2+2*s+2)
The multiplication sign can be omitted; supports + - * / ^, parentheses, and square brackets. Pure delay must be written as e^(-τs) or exp(-τs) and can only be a multiplicative factor. K is allowed only to the first power. The current version supports transfer functions up to 12th order (excluding the extra 2 orders added by the delay Padé).
Each chart provides zoom +, −, and ⟲ in the top right corner: zoom with mouse wheel or buttons, pan after zooming, and ⟲ to reset.
Engineering Structure (for Self-Check)¶
The Host in the repository is index.js, the pre-built client is client.js; the core numerical calculations are in src/engine.js, and the React panel and SVG are in src/ui.js. GitHub installation does not automatically execute build.mjs, so the released package relies on the committed client.js.
Installation and Enablement¶
Installation requires access to GitHub; once installed, the plugin runs locally, and plotting and viewing steps are possible even when offline.
# Web profile
dsh plugin --profile web add github:Mhk0416/control-plot-lab-github
# The profile for DSH Desktop is usually called desktop
dsh plugin --profile desktop add github:Mhk0416/control-plot-lab-github
Refresh the page once after installation; you can also install directly from the GitHub entry in the plugin marketplace.
If you have previously used a local development version @local/control-plot-lab, you must first remove or disable it in the plugin management before installing the GitHub version—the two share the same bundle ID and cannot be enabled simultaneously.
How to Open:
- The “Control Plot” curve icon in the toolbar to the left of the chat input box;
- The blue floating button “Control Plot” in the upper right corner of the page (can be dragged, position is remembered).
Clicking opens a full-screen panel; Esc or clicking the mask closes it.
Typical Usage¶
- Complete the above installation in DSH and refresh.
- Open the “Control Plot” panel from the toolbar or the floating button.
- Input
G(s)following the syntax supported in the README (keepKin the equation when a root locus is needed). - Switch between Bode / Nyquist / Root Locus, and compare the right-side steps with the annotations on the chart (
ωc,PM/GM, encirclement count or stableKrange, etc.). - For high-order systems, if a reduction prompt appears, try keeping the numerator and denominator order within 12th order.
The maintainer provides a regression test entry in the repository to verify numerical logic:
node test/engine.test.cjs
Suitable Scenarios and Notes¶
Suitable: Quickly verifying transfer functions from undergraduate/graduate classical control homework or interview questions alongside DSH conversations; scenarios where you need to see both the graph and the derivation chain without switching to a heavy CAE environment.
Known Limitations (refer to README):
- Only continuous-time, lumped-parameter, rational transfer functions; does not support discrete systems or direct state-space input.
- Pure delay is only a multiplicative factor; the root locus side uses Padé approximation.
- When pure delay is included, the Nyquist encirclement count interpretation switches to delay margin / Padé stability judgment.
- Maximum order is 12.
Security and License: The plugin executes client logic locally within the current DSH process; it is recommended to read the repository source code and the MIT license before installation to confirm it aligns with your environment policy. The SkillHub community directory is an independent site with no official affiliation to DeepSeek or Magic Layer (the company behind DeepSeek); what is described here is a community-contributed plugin, not a built-in application.
Conclusion¶
control-plot-lab-github brings Bode plots, Nyquist plots, root locus, and accompanying calculation steps into the DSH interface, reducing the switching between “discussing control theory” and “plotting for verification”. For installation commands and input details, please refer to the repository README.
- Directory Page: https://www.skillhub.cn/plugins/Mhk0416/control-plot-lab-github
- GitHub: https://github.com/Mhk0416/control-plot-lab-github