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
6013f772
Commit
6013f772
authored
Aug 26, 2019
by
Julian Salt
Browse files
Update furuta.jl
parent
cd872dd8
Pipeline
#735
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/interface_implementations/furuta.jl
View file @
6013f772
...
...
@@ -19,17 +19,27 @@ struct Furuta <: PhysicalProcess
h
::
Float64
bias
::
Float64
stream
::
LabStream
measure
::
AnalogInput10V
measure_phi
::
AnalogInput10V
measure_phi_dot
::
AnalogInput10V
measure_theta
::
AnalogInput10V
measure_theta_dot
::
AnalogInput10V
measure_theta_precise
::
AnalogInput10V
measure_theta_dot_precise
::
AnalogInput10V
control
::
AnalogOutput10V
end
function
Furuta
(;
h
::
Float64
=
0.01
,
bias
::
Float64
=
0.
,
stream
::
LabStream
=
ComediStream
(),
measure
::
AnalogInput10V
=
AnalogInput10V
(
4
),
measure_phi
::
AnalogInput10V
=
AnalogInput10V
(
4
),
measure_phi_dot
::
AnalogInput10V
=
AnalogInput10V
(
5
),
measure_theta
::
AnalogInput10V
=
AnalogInput10V
(
6
),
measure_theta_dot
::
AnalogInput10V
=
AnalogInput10V
(
7
),
measure_theta_precise
::
AnalogInput10V
=
AnalogInput10V
(
2
),
measure_theta_dot_precise
::
AnalogInput10V
=
AnalogInput10V
(
3
),
control
::
AnalogOutput10V
=
AnalogOutput10V
(
0
))
p
=
Furuta
(
Float64
(
h
),
Float64
(
bias
),
stream
,
measure
,
control
)
init_devices!
(
p
.
stream
,
p
.
measure
,
p
.
control
)
p
=
Furuta
(
Float64
(
h
),
Float64
(
bias
),
stream
,
measure
_phi
,
measure_phi_dot
,
measure_theta
,
measure_theta_dot
,
measure_theta_precise
,
measure_theta_dot_precise
,
control
)
init_devices!
(
p
.
stream
,
p
.
measure
_phi
,
p
.
measure_phi_dot
,
p
.
measure_theta
,
p
.
measure_theta_dot
,
p
.
measure_theta_precise
,
p
.
measure_theta_dot_precise
,
p
.
control
)
p
end
...
...
@@ -45,9 +55,9 @@ end
const
AbstractFuruta
=
Union
{
Furuta
,
FurutaSimulator
}
num_outputs
(
p
::
AbstractFuruta
)
=
1
num_inputs
(
p
::
AbstractFuruta
)
=
1
num_inputs
(
p
::
AbstractFuruta
)
=
6
outputrange
(
p
::
AbstractFuruta
)
=
[(
-
10
,
10
)]
inputrange
(
p
::
AbstractFuruta
)
=
[
(
-
10
,
10
)]
inputrange
(
p
::
AbstractFuruta
)
=
[(
-
10
,
10
),(
-
10
,
10
),(
-
10
,
10
),(
-
10
,
10
),(
-
10
,
10
),
(
-
10
,
10
)]
isstable
(
p
::
AbstractFuruta
)
=
false
isasstable
(
p
::
AbstractFuruta
)
=
false
sampletime
(
p
::
AbstractFuruta
)
=
p
.
h
...
...
@@ -62,7 +72,13 @@ control(p::AbstractFuruta, u::Number) = send(p.control,u)
control
(
p
::
FurutaSimulator
,
u
::
Number
)
=
p
.
s
(
u
)
measure
(
p
::
Furuta
)
=
read
(
p
.
measure
)
measure_phi
(
p
::
Furuta
)
=
read
(
p
.
measure_phi
)
measure_phi_dot
(
p
::
Furuta
)
=
read
(
p
.
measure_phi_dot
)
measure_theta
(
p
::
Furuta
)
=
read
(
p
.
measure_theta
)
measure_theta_dot
(
p
::
Furuta
)
=
read
(
p
.
measure_theta_dot
)
measure_theta_precise
(
p
::
Furuta
)
=
read
(
p
.
measure_theta_precise
)
measure_theta_dot_precise
(
p
::
Furuta
)
=
read
(
p
.
measure_theta_dot_precise
)
measure
(
p
::
FurutaSimulator
)
=
p
.
s
.
sys
.
C
*
p
.
s
.
state
initialize
(
p
::
Furuta
)
=
nothing
...
...
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