Code Monkey home page Code Monkey logo

pid-simulator's Introduction

PID Simulator

A simple PID controller simulator.

The PID comput code in the pid_compute.jl.

Usage

  1. Start Julia REPL.
  2. Change the working dircetory to this folder:
julia> cd("PATH_TO_THIS_FOLDER")
  1. Check the current working directory:
julia> pwd()
"CURRENT_WORKING_DIR"

Demo

Run pid_demo.jl:

julia> include("pid_demo.jl")
--- PID Simulator Demo ---
1st config:
kp: 0.400000, ki: 0.900000, Kd: 0.500000, max: 55.000000, min: -55.000000
2nd config:
kp: 1.500000, ki: 0.200000, Kd: 0.500000, max: 55.000000, min: -55.000000
Done!

Plot

Include pid_plot.jl first:

julia> include("pid_plot.jl")

Run plot() function with specified kp=1.5, ki=0.2 and kd=0.3:

julia> plot(1.5, 0.2, 0.3)

Run plot() function with specified kp, ki, kd and max=25, min=-25:

julia> plot(1.5, 0.2, 0.3, 25, -25)

Run plot() function with specified kp, ki, kd, max, min and system_model:

julia> plot(1.5, 0.2, 0.3, 25, -25, system_model=(i,b)->i+b*0.7+5)

Environment

  • Julia v1.6.6 LTS 64-bit
    • Plots

pid-simulator's People

Watchers

 avatar

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.