Commit 60e18a66 authored by Fredrik Bagge Carlson's avatar Fredrik Bagge Carlson
Browse files

Add support for bias in control signal b&b

parent b1bbe807
......@@ -4,8 +4,9 @@ export BallAndBeam, BallAndBeamSimulator, BallAndBeamType
struct BallAndBeam <: PhysicalProcess
h::Float64
bias::Float64
end
BallAndBeam() = BallAndBeam(0.01)
BallAndBeam() = BallAndBeam(0.01, 0.0)
struct BallAndBeamSimulator <: SimulatedProcess
h::Float64
......@@ -22,7 +23,7 @@ isasstable(p::BallAndBeamType) = false
sampletime(p::BallAndBeamType) = p.h
control(p::BallAndBeam, u) = ccall((:comedi_write, comedipath),Int32,
(Int32,Int32,Int32,Int32),0,1,1,num2io(u[1]))
(Int32,Int32,Int32,Int32),0,1,1,num2io(u[1]+p.bias))
measure(p::BallAndBeam) = io2num(ccall((:comedi_read,comedipath), Int32,
(Int32,Int32,Int32), 0,0,0))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment