필터 지우기
필터 지우기

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

조회 수: 5 (최근 30일)
洸太
洸太 2023년 10월 12일
댓글: Dyuman Joshi 2023년 10월 13일
リレー回路のシミュレーションで、困っています。
リレーが動作電圧を超えたら動作するようにif文を用いてプログラムをかいてみたのですが、リレーの特性上1度動作電圧を超えると電圧が0になるまで動作する性質があり、どのようなプログラムを書けばいいのか分からずにいます。
分かる方教えていただけますと幸いです。

채택된 답변

Atsushi Ueno
Atsushi Ueno 2023년 10월 12일
ヒステリシス動作を 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');

추가 답변 (1개)

Atsushi Ueno
Atsushi Ueno 2023년 10월 12일
Simulinkならこうです。色を付けた自作のロジックと Relay ブロックを並べました。双方の出力は一致します。
  댓글 수: 2
洸太
洸太 2023년 10월 13일
ありがとうございます。
参考になりました。
Dyuman Joshi
Dyuman Joshi 2023년 10월 13일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 プログラムによるモデル編集에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!