Relay logic simulation

Hi all,

We've been asked to design a number of control / protection schemes lately which are increasing in complexity. Can anyone point us towards a simple software tool to model the relay logic we can use to sense-check the design (after a manual check of course) and highlight any faux pas before things get built? Really just to look at checking relays in series/parallel etc are doing the right thing, not a full-on circuit emulation, i.e., with these inputs changing to this state, we get these outputs live with that happening after the programmed delay and so on.

In an ideal world it would be able to read a design straight out of our CAD (ACE), but I suspect that's too much to ask!

Ta,

Jam

Parents
  • Multi-sim or a free equivalent should do simple relay logic. 

    Heck I reckon even tinkercad could do that to be honest. 

    If you're looking for something you can demo hardware wise easily, grab an arduino and some switches, and you could code all that, their coding side is really simple.

  • If you're looking for something you can demo hardware wise easily, grab an arduino and some switches, and you could code all that, their coding side is really simple.

    The problem is that (unless you do something clever) you're likely to code it in series. So each relay is a simple IF statement, but what you mustn't do is simply have them all happening one after another, because as soon as you get relays in parallel and branching off in all directions and rejoining the sequence of events becomes critical, and hard to predict - and is exactly what you want to find out. You effectively need parallel processing. So you could use several arduinos, or you could use several relays...which takes you back to where you started! There probably is a way of doing it, by putting each relay branch in a subroutine, and possible nesting them, but personally I'd then be getting concerned that my software would have more bugs in than the design I was trying to emulate Smile

    But yes absolutely it ought to be possible to use the free simulators that are around, provided they include simulating the delays.

  • It's just a nested set of IF, Else IF statements. 

    And it's easy to debug, you just issue Serial.print statements before you connect any hardware, that's how I typically build these. 

  • except it isn't quite - nested ifs do not correctly chatter like relays that disconnect their own suppies. There is a reason for time domain analysis ... and why it re-solves all  node voltages at every step.
    Mike

  • But the sequence of those statements has to be correct, which begs the question of how do you know what that sequence needs to be. Of course you can emulate a relay circuit in software, but to do so you need to analyse the relay circuit so that you know how it will behave for any given combination of inputs in any sequence (remembering not just that inputs could occur simultaneously or at fractionally different times, but also that you need to consider the delays introduced by each relay, and therefore the length of each relay logic path). Once you've analysed it you can implement it - but then you don't need to simulate it any more because you've already analysed it, which is what the simulator is needed for in the first place.

    The reason I get involved with this is that I occasionally have to do Independent Safety Assessment of rail signalling designs which are exactly that: software implementations of standard (and well proven) relay circuits. So I have to ask the question of how the designers know that their software exactly implements the relay logic for all possible input combinations including timings. It's not rocket science, but also not always obvious. Hence I can totally see the value of a simulation tool - I (and the software designers) could have done with one a few times!

    Cheers,

    Andy

Reply
  • But the sequence of those statements has to be correct, which begs the question of how do you know what that sequence needs to be. Of course you can emulate a relay circuit in software, but to do so you need to analyse the relay circuit so that you know how it will behave for any given combination of inputs in any sequence (remembering not just that inputs could occur simultaneously or at fractionally different times, but also that you need to consider the delays introduced by each relay, and therefore the length of each relay logic path). Once you've analysed it you can implement it - but then you don't need to simulate it any more because you've already analysed it, which is what the simulator is needed for in the first place.

    The reason I get involved with this is that I occasionally have to do Independent Safety Assessment of rail signalling designs which are exactly that: software implementations of standard (and well proven) relay circuits. So I have to ask the question of how the designers know that their software exactly implements the relay logic for all possible input combinations including timings. It's not rocket science, but also not always obvious. Hence I can totally see the value of a simulation tool - I (and the software designers) could have done with one a few times!

    Cheers,

    Andy

Children
No Data