Skip to content

jleny/ControlSystems.jl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ControlSystems.jl

Build Status Coverage Status

A control systems design toolbox for Julia.

Installation

To install, in the Julia REPL:

Pkg.add("ControlSystems")

Note that this package requires Julia 0.4.

Documentation

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

A documentation website under developement is available at http://juliacontrol.github.io/ControlSystems.jl/latest/.

Some of the available commands are:

Constructing systems

ss, tf, zpk, ss2tf

Analysis

pole, tzero, norm, ctrb, obsv, gangoffour, margin, markovparam, damp, dampreport, zpkdata, dcgain, covar, gram, sigma, sisomargin

Synthesis

care, dare, dlyap, lqr, dlqr, place, pid, leadlink, laglink, leadlinkat, rstd, rstc, dab

Time and Frequency response

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

Plotting

lsimplot, stepplot, impulseplot, bodeplot, nyquistplot, sigmaplot, marginplot, gangoffourplot, pidplots, 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
stepplot(CLs);
# Add legend. This is specific to the PyPlot back-end, see documentation for more info.
PyPlot.legend(["Kp = 1", "Kp = 5", "Kp = 15"]);

StepResponse

About

A Controls Toolbox for Julia

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Julia 100.0%