I am trying to come up with a light sensor which better suits my needs, it comes on early as light rises, and goes off early as light falls. However, this post is not really interested in that particular end goal.
Now at first sight it seemed like I needed some combinator logic which expressed hysteresis https://en.wikipedia.org/wiki/Hysteresis.
An idealised hysteresis loop as commonly desired in digital electronics would be a Schmidt trigger https://en.wikipedia.org/wiki/Hysteresi ... c_circuits , https://en.wikipedia.org/wiki/Schmitt_trigger.
Note that in order to move from '-M' > '+M' you need to cross the higher input threshold of '+T', and to move back from '+M' > '-M' you then need to cross the lower threshold of '-T'. - this is actually the reverse of what I needed.
I need: that in order to move from '-M' > '+M' you only need to cross the lower input threshold of '-T', and to move back from '+M' > '-M' you then only need to cross the higher threshold of '+T'. This seems to be a far more uncommon shape for a hysteresis loop both in engineering applications and in the natural physical world. However, one example of where it is expressed is in the behaviour of rubber bands as they extend and shrink as you load and unload them. The name of this shape of loop is apparently (/) Elastic hysteresis. https://en.wikipedia.org/wiki/Hysteresi ... hysteresis.
I came up with some combinatoric logic which achieves this: can anyone simplify or reduce this? (I'm sure someone can)There is a blue print of my combinator logic below. It has input 'A' (scalar), and output 'H' (boolean 0/1). You can use the slider on the constant combinator for A. In reality it has four thresholds A<=9, A>=10, A<=40000, A>=40001.
When A<=9 the logic is latched into a rising mode (R=1). Now when A rises to A>=10 the H = 1 this produces may pass through and the circuit latches 'H=1'.
When A<=40001 the logic is reset into a falling mode (R=0). Now when A falls to A<=40000 the L = 1 this produces may pass through and the circuit is reset 'H=0'.
Note that when the logic is in rising mode (R=1) A<=40000 is ignored and cannot (yet) reset the latch, and that when the logic is in falling mode (R=0) the A>=10 cannot (yet) set the latch.
(I have a sneaking suspicion that my logic is cheating somehow but I can't quite put my finger on in. Maybe it's just that I'm thinking in 'Real' numbers while working in 'Rational/Integer' numbers?)
Code: Select all
For example for a regular Shmitt Trigger type (not elastic) hysteresis loop see Xnight's circuit here: viewtopic.php?t=28899&start=50#p189322
My approach is a rather 'digital' (easier, naive) electronic's type approach , where as XKnight's is almost a 'linear' (far more difficult/clever ) electronics type approach.
Have fun if this type of problem is your thing! Many thanks!