AbstractControlProcesses.AbstractProcess
— TypeAbstractProcess
Base abstract type for all lab processes. This should not be inherited from directly, see PhysicalProcess
, SimulatedProcess
AbstractControlProcesses.PhysicalProcess
— TypePhysicalProcess <: AbstractProcess
Pysical processes should inherit from this abstract type.
AbstractControlProcesses.SimulatedProcess
— TypeSimulatedProcess <: AbstractProcess
Simulated processes should inherit from this abstract type.
AbstractControlProcesses.bias
— Methodb = bias(P::AbstractProcess)
Return an input bias for the process. This could be, i.e., the constant input u₀ around which a nonlinear system is linearized, or whatever other bias might exist on the input. length(b) = num_inputs(P)
AbstractControlProcesses.control
— Methodcontrol(P::AbstractProcess, u)
Send a control signal u
to the process where u
should have dimension num_inputs(P)
.
AbstractControlProcesses.initialize
— Methodinitialize(P::AbstractProcess)
This function is called before any control or measurement operations are performed. During a call to initialize
, one might set up external communications etc. After control is done, the function finalize
is called.
AbstractControlProcesses.inputrange
— Methodrange = inputrange(P::AbstractProcess)
Return the range of inputs (control signals) of the process. range
is a vector of tuples, length(range) = num_inputs(P), eltype(range) = Tuple(Real, Real)
AbstractControlProcesses.isasstable
— Methodisasstable(P::AbstractProcess)
Return true/false indicating whether or not the process is asymptotically stable
AbstractControlProcesses.isstable
— Methodisstable(P::AbstractProcess)
Return true/false indicating whether or not the process is stable
AbstractControlProcesses.measure
— Methody = measure(P::AbstractProcess)
Return a measurement from the process, y
has length num_outputs(P)
.
AbstractControlProcesses.num_inputs
— Methodnu = num_inputs(P::AbstractProcess)
Return the number of inputs (control signals) of the process.
AbstractControlProcesses.num_outputs
— Methodny = num_outputs(P::AbstractProcess)
Return the number of outputs (measurement signals) of the process.
AbstractControlProcesses.outputrange
— Methodrange = outputrange(P::AbstractProcess)
Return the range of outputs (measurement signals) of the process. range
is a vector of tuples, length(range) = num_outputs(P), eltype(range) = Tuple(Real, Real)
AbstractControlProcesses.periodic_wait
— Methodlast_time = periodic_wait(P::AbstractProcess, last_time, dt)
Should continue execution at start of next period, i.e. when dt
seconds has passed since last_time
.
For a PhysicalProcess
this has a default implementation which sleeps until last_time + dt
using Libc.systemsleep
. Though this is more precise than using the standard sleep
in Julia, it also blocks the entire Julia thread it is running on which could affect execution in some cases.
For a SimulatedProcess
it can either be running in realtime in a background process, in which case it should be implemented similarly to the physical process, or it runs at full simulation speed, in which case the environment should simulate a step corresponding to dt
time when periodic_wait
is called.
A good way to initialize last_time
to the correct value is to call last_time = periodic_wait(P, 0.0, 0.0)
.
AbstractControlProcesses.sampletime
— Methodh = sampletime(P::AbstractProcess)
Return the sample time of the process in seconds.
Base.finalize
— Methodfinalize(P::AbstractProcess)
This function is called after any control or measurement operations are performed. During a call to finalize
, one might finalize external communications etc. Before control is done, the function initialize
is called.
Base.show
— Methodshow(io::IO, p::AbstractProcess)
To make the types show a bit nicer by default and not include all the struct information.