9 releases (4 major breaking)
4.0.0 | Mar 13, 2024 |
---|---|
3.0.1 | Feb 1, 2024 |
3.0.0 | Sep 15, 2023 |
2.0.0 | Aug 28, 2023 |
0.1.1 | Feb 3, 2023 |
#9 in #gmt
57 downloads per month
Used in 4 crates
755KB
10K
SLoC
gmt_dos-clients_mount
A client for the GMT mount control system.
There are a few mount controller and driver models to choose from.
The model selection is set with the MOUNT_MODEL
environment variable.
Possible values for MOUNT_MODEL
are:
MOUNT_FDR_1kHz
: FDR version of the controller and driver sampled at 1kHzMOUNT_PDR_8kHz
: PDR version of the controller and driver sampled at 8kHzMOUNT_FDR_1kHz-az17Hz
: PDR version of the controller and driver sampled at 8kHz with a notch filter at 17Hz in the controller
lib.rs
:
GMT mount control model
A gmt_dos-actors client for the GMT mount control system.
Example
Commanding the elevation axis of the mount to a 1arcsec offset.
// Dependencies:
// * tokio
// * gmt_dos_actors
// * gmt_dos_clients
// * gmt_dos_clients_io
// * gmt_dos_clients_arrow
// * gmt_dos_clients_fem
// * gmt-fem
// * gmt_dos_clients_mount
// * gmt-lom
// * skyangle
// Environment variables:
// * FEM_REPO
// * LOM
use gmt_dos_actors::actorscript;
use gmt_dos_clients::{Signal, Signals};
use gmt_dos_clients_fem::{fem_io::actors_outputs::*, DiscreteModalSolver, ExponentialMatrix};
use gmt_dos_clients_io::{
gmt_m1::M1RigidBodyMotions,
gmt_m2::M2RigidBodyMotions,
mount::{MountEncoders, MountSetPoint, MountTorques},
};
use gmt_dos_clients_mount::Mount;
use gmt_fem::FEM;
use gmt_lom::{OpticalMetrics, LOM};
use skyangle::Conversion;
use serde::{Deserialize, Serialize};
use gmt_mount_ctrl_controller::MountController;
use gmt_mount_ctrl_driver::MountDriver;
let sim_sampling_frequency = 1000; // Hz
let sim_duration = 20_usize; // second
let n_step = sim_sampling_frequency * sim_duration;
// FEM MODEL
let state_space = {
let fem = FEM::from_env()?;
println!("{fem}");
DiscreteModalSolver::<ExponentialMatrix>::from_fem(fem)
.sampling(sim_sampling_frequency as f64)
.proportional_damping(2. / 100.)
.including_mount()
.outs::<OSSM1Lcl>()
.outs::<MCM2Lcl6D>()
.use_static_gain_compensation()
.build()?
};
println!("{state_space}");
// SET POINT
let setpoint = Signals::new(3, n_step).channel(1, Signal::Constant(1f64.from_arcsec()));
// MOUNT CONTROL
let mount = Mount::new();
actorscript! {
#[model(state = completed)]
1: setpoint[MountSetPoint]
-> mount[MountTorques]
-> state_space[MountEncoders]!
-> mount
1: state_space[M1RigidBodyMotions]$
1: state_space[M2RigidBodyMotions]$
}
// Linear optical sensitivities to derive segment tip and tilt
let lom = LOM::builder()
.rigid_body_motions_record(
(*logging_1.lock().await).record()?,
Some("M1RigidBodyMotions"),
Some("M2RigidBodyMotions"),
)?
.build()?;
let segment_tiptilt = lom.segment_tiptilt();
let stt = segment_tiptilt.items().last().unwrap();
println!("Segment TT: {:.3?}mas", stt.to_mas());
Dependencies
~66MB
~1M SLoC