Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
processes
LabProcesses.jl
Commits
60e18a66
Commit
60e18a66
authored
Aug 21, 2017
by
Fredrik Bagge Carlson
Browse files
Add support for bias in control signal b&b
parent
b1bbe807
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/interface_implementations/ballandbeam.jl
View file @
60e18a66
...
...
@@ -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
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment