What is Hysteresis Noise Filtering and How is it Used in Optical Encoders?
April 15, 2013
Here are a few definitions of the word “hysteresis” I found online:
Hysteresis – Non-uniqueness in the relationship between two variables as a parameter increases or decreases. Also called deadband, or that portion of a system’s response where a change in input does not produce a change in output.
A system with hysteresis can be summarized as a system that may be in any number of states, independent of the inputs to the system. To be exact, a system with hysteresis exhibits path-dependence, or “rate-independent memory”. By contrast, consider a deterministic system with classical dynamics but no Hysteresis. In that case, one can predict the output of the system at some instant in time, given only the input to the system at that instant. If the system has hysteresis, then this is not the case; one cannot predict the output without looking at the history of the input, i.e., the state of the system for a given input. In order to predict the output, one must look at the path that the output followed before it reached its current value.
Here is My Spin on Hysteresis:
The place where we can most relate to hysteresis is in our home. Furnaces and air conditioning systems use hysteresis to help buffer the set point at which they turn on and off. If you can imagine having a temperature set point of exactly 70 degrees, the moment the temperature dropped to 69.9 degrees the furnace would come on. If it rose to 70.1 degrees, the AC would come on. You can see how this could result in frequent cycling of the equipment in our home.
In order to reduce this, hysteresis is used to buffer the area around our set point. In HVAC equipment it is often called “temperature swing”. For example at my house I have a 3 degree swing set up in my programmable thermostat. This means that at a setpoint of 70 degrees, my furnace doesn’t come back on until it reaches 67 degrees. I could tighten this up to say a one degree swing, but it costs a bit more to heat that way.
For me, it is a careful balance between saving money and keeping my girlfriend from complaining about how cold it is.
How it Relates to Optical Encoders:
In optical encoders, hysteresis is used to buffer the analog signal coming from the sensor before a switching decision is made. This is particularly needed when rotary encoders are turning very slowly. As the decision point slowly approaches any variation in signal amplitude due to noise could cause the digital output to quickly switch on and off this would be seen as several quick pulses at the leading and trailing edges of the digital square waves often referred to as “chattering”.
Below is a picture of how too little hysteresis may affect encoder signals. Particularly in a system with electrical noise.
Below is a representation of the analog signal (shown in red) of an encoder as it crosses the decision point (blue line). The output is the black digital signal.
This is what we would expect, and get, in a perfect electrical world. In the real world we have to deal with issues such as electrical noise.
The image below shows how electrical noise introduced in a system can cause extra pulse or “chattering”. The noise is shown as a voltage anomaly on the red analog line causing multiple crossing points along the blue decision line, resulting in extraneous pulses at the edge of our digital signal.
In the next image we see how the addition of hysteresis affects the digital output signal. The cyan line represents the delay is decision point or “deadband” that is created by the addition of hysteresis. The digital signal switches high with the original red analog signal, but doesn’t switch off again until the cyan hysteresis line crosses the blue decision point.
The new hysteresis filtered digital output is shown in magenta with the original unfiltered digital output shown in black.
One would tend to think that the more Hysteresis you add, the better as it adds more noise immunity to the system. This is true, but the other side of adding Hysteresis is that it results in positional error.
Since we are essentially delaying the point at which the digital decision is made, we are delaying the point in rotation before the signal is switched on.
In the image above when comparing the black digital signal to the magenta one, we notice how the switch off point has been delayed in time. This is real system error that is the cost of hysteresis.
We can compare this to a HVAC system in that additional hysteresis around the temperature set point makes it easier for the system to withstand thermal “noise”, such as a quick temperature variation from opening a door, but ultimately keeps the system from tightly regulating to a temperature set point.
Encoder manufacturers always have to carefully balance the amount of hysteresis they add against the error introduced in the system from it.
The way that Quantum Devices fights this is through the use of their interlaced sensor, and use of differential signals to determine switching points. The interlaced sensor provides a large amplitude signal when compared to typical noise introduced into a system, so that minimum hysteresis is needed when making the switching decisions.
Hysteresis in Magnetism
Here are some links to some information on the origin of the word hysteresis and how it relates to magnetism.
Magnetic hysteresis in the iron core or “stack” of electric motors is what is responsible for a significant portion of heat build up.
The last link is particularly interesting as it talks about how hysteresis curves in magnetic materials may not be smooth.