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

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

Respuesta aceptada

Atsushi Ueno
Atsushi Ueno el 12 de Oct. de 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');

Más respuestas (1)

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

Iniciar sesión para comentar.

Categorías

Más información sobre Simulink en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!