Coder Social home page Coder Social logo

agerlach / controlsystems.jl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from juliacontrol/controlsystems.jl

0.0 0.0 0.0 13.04 MB

A Control Systems Toolbox for Julia

Home Page: https://juliacontrol.github.io/ControlSystems.jl/latest/

License: Other

Julia 100.00%

controlsystems.jl's Introduction

ControlSystems.jl

Build Status Documentation Status

PkgEval codecov

Star on GitHub

A control systems design toolbox for Julia.

Installation

To install, in the Julia REPL:

using Pkg; Pkg.add("ControlSystems")

News

2022-07 v1.0

  • Breaking: Frequency-responses have changed data layout to ny×nu×nω from the previous nω×ny×nu. This is for performance reasons and to be consistent with time responses. This affects downstream functions bode and nyquist as well.
  • Breaking: baltrunc and balreal now return the diagonal of the Gramian as the second argument rather than the full matrix.
  • Breaking: The pid constructor no longer takes parameters as keyword arguments. pid has also gotten some new features, the new signature is pid(P, I, D=0; form = :standard, Ts=nothing, Tf=nothing, state_space=false). This change affects downstream functions like placePI, loopshapingPI, pidplots.
  • Breaking: The semantics of broadcasted multiplication between two systems was previously inconsistent between StateSpace and TransferFunction. The new behavior is documented under Multiplying systems in the documentation.

Documentation

All functions have docstrings, which can be viewed from the REPL, using for example ?tf .

A documentation website is available at http://juliacontrol.github.io/ControlSystems.jl/latest/ and an introductory video is available here.

Some of the available commands are:

Constructing systems

ss, tf, zpk, delay

Analysis

poles, tzeros, norm, hinfnorm, linfnorm, ctrb, obsv, gangoffour, margin, markovparam, damp, dampreport, zpkdata, dcgain, covar, gram, sigma, sisomargin

Synthesis

are, lyap, lqr, place, leadlink, laglink, leadlinkat, rstd, rstc, dab, balreal, baltrunc

PID design

pid, stabregionPID, loopshapingPI, pidplots, placePI

Time and Frequency response

step, impulse, lsim, freqresp, evalfr, bode, nyquist

Plotting

bodeplot, nyquistplot, sigmaplot, plot(lsim(...)), plot(step(...)), plot(impulse(...)), marginplot, gangoffourplot, pzmap, nicholsplot, pidplots, rlocus, leadlinkcurve

Other

minreal, sminreal, c2d

Usage

This toolbox works similar to that of other major computer-aided control systems design (CACSD) toolboxes. Systems can be created in either a transfer function or a state space representation. These systems can then be combined into larger architectures, simulated in both time and frequency domain, and analyzed for stability/performance properties.

Example

Here we create a simple position controller for an electric motor with an inertial load.

using ControlSystems

# Motor parameters
J = 2.0
b = 0.04
K = 1.0
R = 0.08
L = 1e-4

# Create the model transfer function
s = tf("s")
P = K/(s*((J*s + b)*(L*s + R) + K^2))
# This generates the system
# TransferFunction:
#                1.0
# ---------------------------------
# 0.0002s^3 + 0.160004s^2 + 1.0032s
#
#Continuous-time transfer function model

# Create an array of closed loop systems for different values of Kp
CLs = TransferFunction[kp*P/(1 + kp*P) for kp = [1, 5, 15]];

# Plot the step response of the controllers
# Any keyword arguments supported in Plots.jl can be supplied
using Plots
plot(step.(CLs, 5), label=["Kp = 1" "Kp = 5" "Kp = 15"])

StepResponse

Additional examples

See the examples folder and ControlExamples.jl and several examples in the documentation.

controlsystems.jl's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.