# Measuring accuracy and counting frequency?

The machines at my workshop have meter counters with hall effect sensor switches, which convert shaft rotation to electronic pulses. The switching signal is send to their PLCs' high speed counter input. The PLCs are located at the other side of the workshop, around 300m away.

Recently, discussions arose within my team about the measuring accuracy of the system. Surely there are many factors that could affect the accuracy. One of the them being discussed concerns whether that long signal wire, traveling through the cable bridge, would introduce interference which affect counting accuracy.

Also some believe that higher frequency gives better accuracy. (By increasing frequency I mean adding more sensing points to the encoding disk on shaft, currently 1 pulse/rotation)

One thing worth noting is that the "accuracy" here is not about resolution, but the final accumulated sum - the total amount of material through the machine. Every machine run takes typically 3 >2 hours resulting in about 2 billion 184,000 pulses at current frequency. (i.e. ~1,200RPM)

I am not really an electrical guy, but my logic tells me increasing the frequency give better resolution, but not necessarily accuracy to the total sum. Maybe on the contrary it loses more pulses (but each pulse represents less rotation too). And about the noise/interference thing, I really have no idea. However I do believe moving the disk to the driven shaft, instead of the motor shaft, will increase accuracy (but which will decreases counting frequency notably)

Provided that we don't re-run the cables, will increasing / decreasing the frequency make the result better / worse ?

Update 1:
As pointed out by @jonk and @Russell McMahon, the numbers are unlikely, I did some serious calculations and updated the figures.

The PLC is Mistubishi PLC, the counter's max response frequency is 100kHz.

The question actually is not about how to improve, but what has been done that actually improved things. Because many changes were done in one project, we are debating about what contributed least/most to determine how to move forwards. I find the information confusing, so I'd rather rely on physics.

Basically what has been done is:

• moving the encoding disk to the driven shaft, to eliminate belt slips.
• meanwhile increasing sensing points from 1 to 4. (pulley reduction = 2:1)
• use an additional PLC + HMI 10m away from the hall effect sensor.

The accuracy we're discussing is reported as a 1%-5% difference variation of a direct variable (wt).

Unfortunate limitation :

• there is no oscilloscope to compare the signal from 10m to from 300m away.
• the accuracy is based on indirect monitoring of the mach output weight, the pulses/meter is just a factor in the weight formula.

Again, I find the information unreliable, so I'd rather look for clues in physics... Will electrical science support a 1~5% stability improvement through the above changes ?

Update 2:
Some more details to add. The proximity sensor is an Omron E2E 24VDC E2B-M12KS04-WP-C1 sensor. The signal is dumb on/off pulses, not digitally encoded.

The Mistubishi PLC's X000 high speed (100kHz) counter input has a default 5us input filter delay (I think that's the hysteresis time, though the FX doc never mentioned it as hysteresis).

The encoding disk is not really a disk, but a pole or 4 poles in the revised version, close to the size of the cylindrical sensor head. So the ON cycle is very short compared to the OFF cycle at each rotation.

Update 3:
The PLC is FX3U-64MR AC powered model. The proximity switch is tied to X0 input point, not extension module. The code directly read/reset C235 which is counter for X000, with no self-baked counting logic in PLC code.

According to hardware manual jy997d16801k.pdf Sect. 3.4.1:

For input point X000 to X005:
Input form = Sink/source
Input signal voltage = 24V DC +10%, -10%
Input impedance = 3.9kohm
Input signal current = 6mA/24V DC
ON input sensitivity current = 3.5 mA or more
OFF input sensitivity current = 1.5 mA or less


There is more info in the User's Manual [Hardware Edition] sect. 10.2 JY997D16501. I can't find a public download link, so I uploaded it to a site I found. However the site removes files every couple of hours. Just in case, here's some screenshots:

• Look, 3 hrs divided by a billion is about $11\:\mu\text{s}$. I don't think that reducing that time will be of much help in terms of getting more accurate results. That's already fast enough for a single machine, I imagine. But have you checked out the errors? Is there really a problem? You don't say. Has anyone provided a fixed amount to process and then looked to see if the counting pulses were accurate? You need to test if there is a problem in the first place, it seems to me. But maybe I'm lacking some knowledge you haven't yet disclosed.
– jonk
Commented May 8, 2019 at 6:39
• Hi @jonk thanks for the comment. You are right, I revised the data. No the weight is reported to be more accurate now. They used a different approach from osoloscope to study this problem directly they call it 6σ methodologies... well, I just wonder by physics if any of these factors is possible to improve reliability by 1%~5%
– Ben
Commented May 8, 2019 at 16:38
• The OMRON E2E sensors are inductive , not Hall, and there is a vast range of versions. Pages 7 & 8 in the datas sheet show you the many output characteristics which may be expected. Knowing which of the E2E's it is will probably help. | page 9 shows the NC and NO equivalent circuits. The output is always an open collector transistor so response depends on the load - which we do not know. Can you provide the actual model used , and do you have a data sheet link for the PLC input module used. Commented May 11, 2019 at 12:52
• Hi Russell, I have updated the post with required info.
– Ben
Commented May 11, 2019 at 15:44

Using Hall sensors, the accuracy of the sensor should be essentially 100%.
If you have a voltage swing of a few volts (say 0V/5V at the source) then you would be able to achieve essentially error free operation over 300 metres using cable IF the receiving equipment is able to properly deal with the pulse shape at the receiver.

If the received pulses have rounded "edges" (as they probably will) then noise added to the signal may cause an 'edge' to be seen as multiple transitions at the receiver if the receiver has not been designed to be noise tolerant. Probably the most effective means of dealing with typical noise is to use receivers with "hysteresis" / Schmitt triggered inputs. A Schmitt trigger 'declares' a low to high transition at a ceratin voltage level but declares a high to low transition at a lower voltage level. eg in a 0V/5V system, low to high may occur at 3.5 V, and high to low at 1.5V. This means that a noise signal would need to perturb the signal level by 2V in order to cause an extra count.
Most industrial receivers using voltage signalling already have this capability inbuilt. A look at the specifications of your equipment will give a guide to the noise tolerance they have, and a look at the line with an oscilloscope will show the tyoical noise levels experienced.

As Jonk says, 1 billion counts in 3 hours sound extremely high.
1E9 / 3hrs / 3600 s ~= 90,000 rps or 5.5 million rpm. Seems unlikely :-).

At a shaft speed of say 6000 rpm, in 3 hours revolutions = 6000 x 60 x 3 = or about 1 million pulses. Time between pulses ~= 60/6000 = 10 ms (100 Hz).
This is "almost DC" and a hall sensor with say a 1 ms high time, 0/5V output and twisted pair or coax connection and a receiver with typical levels of hysteresis would be liable to function well.

• Hi Russell, Sorry I got the informaiton wrong.I corrected it. Thanks for pointing it out. The PLC input point and register are all for high frequency input. It should be well within range. oscilloscope is not available, thus I can not say. I wonder how much error would it most likely to introduce due to singal out of shape ? What the latter two chages I mentioned above ? :-)
– Ben
Commented May 8, 2019 at 16:44
• "Accuracy" of result deep-ends on how the available sensor data is used. You report or ask for comments on3 things which are NOT equal: a "1% to 5% "stability improvement" / Direct variable improvement / Reliability.improvement. You need to better explain what you have observed. NOTE: This is NOT meant to be a rude comment - just an identification of a need for greater precision in what you are conveying. | If it is "observation of a direct variable", then the available improvement depends on the period over which the variable is sampled to derive data for calculation and/or how data is used.. Commented May 9, 2019 at 13:15
• eg if you are counting pulses in a given period then at 200 RPM you get 200 RPM/60s = 3.5 pulses per second with one pulse per rev and 14 pps with 4 pulses per rev. If you sum pulses over 30 seconds you can get either 3.5 x 30 = 105 pulses or 420 pulses with 1 or 4 pulses per rev. The first has a maximum accuracy of about 1% and the other of about 0.25%. If you sum over 10 seconds those accuracies triple. || BUT if you measure pulse to pulse spacings then at 200 RPM 1 ppr = 60/200 = 300 ms between pulses and 4 ppr = 75 ms between pulses. .... Commented May 9, 2019 at 13:22
• ... Depending on how your system works the lower ppr system MAY be superior. || We need a much better understanding of the system to have real insight into what is happening. We may provide well-informed guesses but eg you say what the receiver is but we have no details on the pulse encoding, whether hysteresis is employed in the receiver, what the voltage signalling levels are if analog, or if current loop is used, or if perhaps it is digital coded at source or ... . || We are pleased to try and help but can only do so much with the available information. Commented May 9, 2019 at 13:26
• Hi Russel, I updated it with more details. It feels like the improvement in metering is not in the right direction. Btw, is NC output sesnor more resilient to noise than NO output ones ?
– Ben
Commented May 11, 2019 at 10:00

If you suspect the accuracy, then you may have another bigger problem than you think you have.

Were you familiar with the old analogue television, before digital broadcasts replaced them, or analogue AM/FM radio, rather than DAB or internet sound?

Analogue systems degrade gradually, a bit of hiss on the audio, a bit of snow or ghosting on the picture. As the communication channel degrades, it gets progressively worse, but you can still make out the programme. There's a large margin between noticing some degradation, and the signal being unusable. They are said to fail soft.

Digital systems fail hard. They work perfectly as the channel degrades, continue to work perfectly, then collapse in a heap, with only a tiny margin between 100% working and totally useless.

If you are sending digital pulses across your workshop, then you have a digital system. If you have any evidence or well-founded suspicion that there might be issues with dropping pulses, or extra pulses, then you are already on the knife-edge of total failure. Changing the frequency is not going to help. Changing the frequency is akin to rearranging the deck-chairs on the Titanic. You need to miss the iceberg.

You need to address the noise margins, noise susceptibility, signal levels, that level of design. If you're using single-ended, directly connected comms, then you may well have a signal integrity problem. But it's better to solve it by going differential, or opto-isolated, rather than messing around with the frequency. While going differential may require re-running cables, opto-isolating only requires intermediate boxes.

Or you may not have a problem at all, in which case, don't mess about about fine tuning the frequency.

• I've seen that DAB example used so many times to illustrate that, but it's in fact wrong - the MPEG codec is relatively robust against a few bit errors, and there's a lot of interleaving going on to ensure that these errors are individual bit errors even after FEC failed to correct them all. So, that's a digital system that gradually degrades! Commented May 8, 2019 at 8:51
• @MarcusMüller Well you come and listen to my DAB radio then when it's next to my camera charger. A small movement, a small change in interference strength, is the difference between perfection and total failure. While DAB may be relatively robust for a digital system, it's OFDM after all which hammers multipath, ideal for its use for mobile reception, the general drift of digital having a harder failure mode still applies. As far as the OP's situation is concerned, I'm still confident I've told him where to look correctly, even if my argument was pedantically weak. Commented May 8, 2019 at 9:14
• yeah, I mean, it's a good answer :) Commented May 8, 2019 at 12:24