Dynamic thresholds setting for relay

50 views (last 30 days)
sergio pernici
sergio pernici on 10 Nov 2015
Commented: yilin li on 26 Jan 2018
I need to have two different sets of the Up and Down thresholds for a relay. To solve the problem I use 2 relay blocks in parallel with different thresholds and I select the one I want with a switch according to a Boolean variable. A dynamic version of the relays would simplify the hardware. Is it already implemented anywhere?

Answers (2)

Sebastian Castro
Sebastian Castro on 11 Nov 2015
I don't think there's a built-in one, but you can make your own as shown below.
"on" and "off" are your outputs when on and off. Also, you need to set the initial condition of that "Memory" block to either "on" or "off" for it to work.
- Sebastian
  1 Comment
yilin li
yilin li on 26 Jan 2018
This model works well! Thank you !!

Sign in to comment.

Leigh Boyd
Leigh Boyd on 1 Nov 2017
We solved this "Simulink has no dynamic relay" problem using an SR flip flop and two relational operators. if the input is greater than threshold one, we set the flip flop If it is less than threshold two, we reset it.
This way you can dynamically set the thresholds and thereby create a "dynamic relay" with explicit defined thresholds. The output will be boolean true and false. If you need other outputs, you can connect to a switch and take alternate values (like 1.0 and 0.0 for example)
The beauty of this solution is that you can also use switches to choose between various thresholds without needing to duplicate the relay logic itself, and the thresholds can be set independently (and continuously if desired)


Find more on Nonlinear Dynamics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!