GainSTM
GainSTMはFociSTMとは異なり, 任意のGainを扱える. ただし, 使用できるGainの個数は (拡張モードの場合) となる.
GainSTMの使用方法は以下のようになる.
これは, アレイの中心から直上の点を中心とした半径の円周上で焦点を回すサンプルである.
円周上を200点サンプリングし, 一周をで回るようにしている. (すなわち, サンプリング周波数はである.)
use autd3::prelude::*;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let autd = Controller::open([AUTD3::default()], Nop::new())?;
let center = autd.center() + Vector3::new(0., 0., 150.0 * mm);
let point_num = 200;
let radius = 30.0 * mm;
let _ =
GainSTM {
gains: (0..point_num)
.map(|i| {
let theta = 2.0 * PI * i as f32 / point_num as f32;
let p = radius * Vector3::new(theta.cos(), theta.sin(), 0.0);
Focus {
pos: center + p,
option: FocusOption::default(),
}
})
.collect::<Vec<_>>(),
config: 1.0 * Hz,
option: GainSTMOption {
mode: GainSTMMode::PhaseIntensityFull,
},
};
Ok(())
}
#include <ranges>
#include<autd3.hpp>
#include<autd3/link/nop.hpp>
using namespace std::ranges::views;
int main() {
using namespace autd3;
auto autd = Controller::open({AUTD3{
.pos = Point3::origin(),
.rot = Quaternion::Identity(),
}},
link::Nop{});
const Point3 center = autd.center() + Vector3(0, 0, 150);
constexpr auto points_num = 200;
constexpr auto radius = 30.0f;
GainSTM(iota(0) | take(points_num) | transform([&](auto i) {
const auto theta = 2.0f * pi * static_cast<float>(i) /
static_cast<float>(points_num);
return Focus(
center + radius * Vector3(std::cos(theta), std::sin(theta), 0),
FocusOption{});
}) | std::ranges::to<std::vector<Focus>>(),
1.0f * Hz, GainSTMOption{.mode = GainSTMMode::PhaseIntensityFull});
return 0; }
using AUTD3Sharp;
using AUTD3Sharp.Utils;
using AUTD3Sharp.Gain;
using AUTD3Sharp.Link;
using static AUTD3Sharp.Units;
using var autd = Controller.Open([new AUTD3(pos: Point3.Origin, rot: Quaternion.Identity)], new Nop());
var center = autd.Center() + new Vector3(0, 0, 150);
const int pointNum = 200;
const float radius = 30.0f;
new GainSTM(
gains: Enumerable.Range(0, pointNum).Select(i =>
{
var theta = 2.0f * MathF.PI * i / pointNum;
return new Focus(
pos: center + radius * new Vector3(MathF.Cos(theta), MathF.Sin(theta), 0),
option: new FocusOption()
);
}),
config: 1.0f * Hz,
option: new GainSTMOption
{
Mode = GainSTMMode.PhaseIntensityFull
}
);
import numpy as np
from pyautd3 import AUTD3, Controller, Focus, FocusOption, GainSTM, GainSTMMode, GainSTMOption, Hz
from pyautd3.link.nop import Nop
autd = Controller.open([AUTD3(pos=[0.0, 0.0, 0.0], rot=[1, 0, 0, 0])], Nop())
center = autd.center() + np.array([0.0, 0.0, 150.0])
point_num = 200
radius = 30.0
GainSTM(
gains=(
Focus(
pos=center + radius * np.array([np.cos(theta), np.sin(theta), 0]),
option=FocusOption(),
)
for theta in (2.0 * np.pi * i / point_num for i in range(point_num))
),
config=1.0 * Hz,
option=GainSTMOption(
mode=GainSTMMode.PhaseIntensityFull,
),
)
GainSTMMode
GainSTMは位相/振幅データをすべて送信するため, レイテンシが大きい1.
この問題に対処するため, GainSTMには位相のみを送信して送信にかかる時間を半分にするPhaseFullモードと, 位相を4bitに圧縮して送信時間を4分の1にするPhaseHalfモードが用意されている.
この2つのモードでは振幅は最大値が使用される.
デフォルトは振幅/位相データを送るPhaseIntensityFullモードである.
-
FociSTM<1>のおよそ75倍のレイテンシ ↩