Filter löschen
Filter löschen

リレー回路のシミュレーションについて

3 Ansichten (letzte 30 Tage)
洸太
洸太 am 12 Okt. 2023
Kommentiert: Dyuman Joshi am 13 Okt. 2023
リレー回路のシミュレーションで、困っています。
リレーが動作電圧を超えたら動作するようにif文を用いてプログラムをかいてみたのですが、リレーの特性上1度動作電圧を超えると電圧が0になるまで動作する性質があり、どのようなプログラムを書けばいいのか分からずにいます。
分かる方教えていただけますと幸いです。

Akzeptierte Antwort

Atsushi Ueno
Atsushi Ueno am 12 Okt. 2023
ヒステリシス動作を if 文で表すと例えば下記の様になります。
tm = 0:0.01:3; % 時刻[s](適当に周波数1[Hz]で3秒間)
vt = sin(2 * pi * tm); % 電圧[V](最大電圧を1[V]と仮定)
rl = zeros(size(tm)); % リレーのON/OFF状態[-]
for k = 2:length(tm)
if vt(k) >= 0.8 % 動作電圧(最大電圧の80[%])以上ならリレーをONにする
rl(k) = 1;
elseif vt(k) <= 0 % 復帰電圧(最大電圧の0[%])以下ならリレーをOFFにする
rl(k) = 0;
else % 上記の間ならリレーの状態を保持する
rl(k) = rl(k-1);
end
end
plot(tm,vt,tm,rl,'LineWidth',3);
legend('電圧','リレーON/OFF','Location','southeast');

Weitere Antworten (1)

Atsushi Ueno
Atsushi Ueno am 12 Okt. 2023
Simulinkならこうです。色を付けた自作のロジックと Relay ブロックを並べました。双方の出力は一致します。
  2 Kommentare
洸太
洸太 am 13 Okt. 2023
ありがとうございます。
参考になりました。
Dyuman Joshi
Dyuman Joshi am 13 Okt. 2023
Hello @洸太 , if this answer solved your problem, please consider accepting the answer.
Accepting the answer indicates that your problem has been solved (which can be helpful to other people in future) and it awards the volunteer with reputation points for helping you.
You can accept only 1 answer for a question, but you can vote for as many answers as you want. Voting an answer also provides reputation points.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu プログラムによるモデル編集 finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!