A simple PID controller simulator.
The PID comput code in the pid_compute.jl
.
- Start Julia REPL.
- Change the working dircetory to this folder:
julia> cd("PATH_TO_THIS_FOLDER")
- Check the current working directory:
julia> pwd()
"CURRENT_WORKING_DIR"
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!
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)
- Julia
v1.6.6
LTS 64-bit- Plots