This package contains an (programming- as well as connection-) interface to serve
This package contains an (programming- as well as connection-) interface to serve
as a base for the implementation of lab-process software. The first exampel of
as a base for the implementation of lab-process software. The first example of
an implementaiton of this interface is for the ball-and-beam process, which is
an implementaiton of this interface is for the ball-and-beam process, which is
used in Lab1 FRTN35: frequency response analysis of the beam. The lab is implemented
used in Lab1 FRTN35: frequency response analysis of the beam. The lab is implemented
in [BallAndBeam.jl](https://gitlab.control.lth.se/processes/BallAndBeam.jl), a
in [BallAndBeam.jl](https://gitlab.control.lth.se/processes/BallAndBeam.jl), a
...
@@ -12,7 +12,7 @@ line of code :)
...
@@ -12,7 +12,7 @@ line of code :)
## Installation
## Installation
1. Start julia
1. Start julia
2. Install LabProcesses.jl using command Pkg.clone("https://gitlab.control.lth.se/processes/LabProcesses.jl.git") Lots of packages will now be installed, this will take some time.
2. Install LabProcesses.jl using command `Pkg.clone("https://gitlab.control.lth.se/processes/LabProcesses.jl.git")` Lots of packages will now be installed, this will take some time.
## How to implement a new process
## How to implement a new process
1. Locate the file [interface.jl](https://gitlab.control.lth.se/processes/LabProcesses.jl/blob/master/src/interface.jl)
1. Locate the file [interface.jl](https://gitlab.control.lth.se/processes/LabProcesses.jl/blob/master/src/interface.jl)
...
@@ -51,8 +51,9 @@ end
...
@@ -51,8 +51,9 @@ end
Often one finds the need to implement a stateful controller, i.e., a function
Often one finds the need to implement a stateful controller, i.e., a function
that has a memory or state. To this end, the function [`sysfilter`](@ref) is
that has a memory or state. To this end, the function [`sysfilter`](@ref) is
provided. This function is used to implement control loops where a signal is filtered through a
provided. This function is used to implement control loops where a signal is
dynamical system, i.e., `U(z) = C(z)E(z)`. Usage is demonstrated below
filtered through a dynamical system, i.e., `U(z) = C(z)E(z)`.
Usage is demonstrated below
```julia
```julia
stateC=init_sysfilter(C)
stateC=init_sysfilter(C)
function control(i)
function control(i)
...
@@ -60,5 +61,5 @@ function control(i)
...
@@ -60,5 +61,5 @@ function control(i)
u=sysfilter!(stateC,C,e)
u=sysfilter!(stateC,C,e)
end
end
```
```
`C` must here be represented by a [`StateSpace`](@ref) type from [`ControlSystems.jl`](https://github.com/JuliaControl/ControlSystems.jl).
`C` must here be represented by a [`StateSpace`](http://juliacontrol.github.io/ControlSystems.jl/latest/lib/constructors/#ControlSystems.ss) type from [`ControlSystems.jl`](https://github.com/JuliaControl/ControlSystems.jl).
`TransferFunction` types can easily be converted to a `StateSpace` by `Gss = ss(Gtf)`.
`TransferFunction` types can easily be converted to a `StateSpace` by `Gss = ss(Gtf)`.