diff --git a/src/interface_implementations/furuta.jl b/src/interface_implementations/furuta.jl index 0b89333498d1e28be7eac0b9ffe351503f22a206..54664028174a7efbeea83fa8ec6d387b3b113b25 100644 --- a/src/interface_implementations/furuta.jl +++ b/src/interface_implementations/furuta.jl @@ -18,6 +18,12 @@ export Furuta, FurutaSimulator, AbstractFuruta struct Furuta <: PhysicalProcess h::Float64 bias::Float64 + phi::Float64 + phi_dot::Float64 + theta::Float64 + theta_dot::Float64 + theta_precise::Float64 + theta_dot_precise::Float64 stream::LabStream measure_phi::AnalogInput10V measure_phi_dot::AnalogInput10V @@ -30,6 +36,12 @@ end function Furuta(; h::Float64 = 0.01, bias::Float64 = 0., + phi::Float64 = 0.0, + phi_dot::Float64 = 0.0, + theta::Float64 = 0.0, + theta_dot::Float64 = 0.0, + theta_precise::Float64 = 0.0, + theta_dot_precise::Float64 = 0.0, stream::LabStream = ComediStream(), measure_phi::AnalogInput10V = AnalogInput10V(4), measure_phi_dot::AnalogInput10V = AnalogInput10V(5), @@ -38,7 +50,7 @@ function Furuta(; 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_phi,measure_phi_dot,measure_theta,measure_theta_dot,measure_theta_precise,measure_theta_dot_precise,control) + p = Furuta(Float64(h),Float64(bias),Float64(phi),Float64(phi_dot),Float64(theta),Float64(theta_dot),Float64(theta_precise),Float64(theta_dot_precise),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 @@ -72,12 +84,12 @@ control(p::AbstractFuruta, u::Number) = send(p.control,u) control(p::FurutaSimulator, u::Number) = p.s(u) -measure_phi(p::Furuta) = read(p.measure_phi)*2.56 -measure_phi_dot(p::Furuta) = (read(p.measure_phi_dot) + 0.0708)*2.0 -measure_theta(p::Furuta) = (read(p.measure_theta) + 5.1763)*0.3091 -measure_theta_dot(p::Furuta) = (read(p.measure_theta_dot) - 0.022)*3.76 -measure_theta_precise(p::Furuta) = (read(p.measure_theta_precise) + 0.7792)*0.058 -measure_theta_dot_precise(p::Furuta) = read(p.measure_theta_dot_precise)*0.68 +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