Sensor Measurement Fundamentals Series
Position and Frequency Measurements
Key Takeaways Encoder basics Counter fundamentals How to take a position measurement How to take a digital frequency measurement NI s solution for position and frequency measurements 3
Measurement Components Physical Measurement Sensor Connectivity Signal Conditioning & Acquisition Computer 4
Position Measurements Cut-to-Length Factory Automation Pick and Place 5
Measurement Components Physical Measurement Sensor Connectivity Signal Conditioning & Acquisition Computer 6
What is an Encoder? Linear or Rotary Optical Mechanical Capacitive Magnetic Inductive 7
Types of Encoders Incremental Encoder Absolute 8
How Does a Quadrature Encoder Work? Shaft and disk rotate Code track either passes or blocks light to sensor Light sensor creates two pulse trains Light Sensor Light Source Shaft Code Track Channel A Rotating Disk 9 Channel B
Measurement Components Physical Measurement Sensor Connectivity Signal Conditioning & Acquisition Computer 10
How to Take Encoder Measurements Basic component required is called a counter Two basic functions 1. Count based on the comparison of input signals 2. Generate pulses based on inputs and register values Gate Out Up/Down Source Count Register 11
How Do Counters Work? Gate controls when the counter counts Source is the signal that is counted Register holds the running count Output generates pulses and signals when the counter rolls over Gate Source Count 0 0 1 2 2 2 3 4 12
Counter Signals Counters accept and generate TTL signals +5.0 V high Maximum Rise/Fall Time = 50 ns +2.0 V +0.8 V 0 V indeterminate low Minimum Pulse Width = 10 ns 13
Quadrature Encoder Connections Pin Number Function 1 Ground 2 Index 3 A channel 4 +5V DC power 5 B channel 14
X1 Encoding If A leads, counter increments on rising edge of A If B leads, counter decrements on falling edge of A 15
X2 Encoding Same rules as X1 decoding If A leads, counter increments If B leads, counter decrements Actions occur on rising and falling edge of A 16
X4 Decoding Same rules as X1 decoding If A leads, counter increments If B leads, counter decrements Actions occur on rising and falling edge of A and B 17
Encoder Measurement Formulas For Rotational Position: Amount of Rotation = where: x = encoding type Edge Count xn 360 N = number of pulses generated by encoder per shaft revolution For Linear Position: Amount of Displacement = Edge Count xn 1 PPI where: PPI = pulse per inch (a parameter specific to each encoder) 18
Testing Automated Medical Imaging Tables The Challenge Developing a cost-effective solution for the production test of automated tables used to position patients in medical imaging machines. The Solution Used encoders and limit switches to test stopping distance and smooth movement of motors. 19
Encoder Measurement Demonstration 20
What is Frequency? Rate of recurrence of a cyclic or periodic event Analog Waveforms with Frequency Increasing from Top to Bottom Frequency of a Digital Waveform 21
How to Take Low Frequency Measurements Measure the period of unknown signal and take the inverse Known Timebase f k Unknown Signal f x Interval Measured 1 2 N f x = f k N Where: f x is the signal being measured f k is the known timebase N is the number of pulses/ticks Signal being measured Internal Timebase Gate Source CTR 0 22
Quantization Error Inherent uncertainty in digitizing an analog value as a result of the finite resolution of the conversion process Example Gate period is exactly four source cycles Measurement could be off by +/- 1 source cycles GAT ESOURCE Miss both edges 0 1 2 3 3 Miss one, catch 0 1 2 3 4 one Catch both edges 1 2 3 4 5 23
How to Take High Frequency Measurements Count the number of pulses of the unknown signal during a known period. Generated Pulse Unknown Signal f x Width of Pulse (T) 1 2 N f x = N T Where: f x is the signal being measured T is the period of generated pulse train N is the number of pulses/ticks 24
Range of Frequencies Measure time of known number of cycles f x Pulse Known Timebase 1 2 N Interval to Measure f x = N f k N TB Where: f x is the signal being measured N is the number of pulses of unknown signal used to generate pulse train f k is the internal timebase frequency N TB is the number of counter 1 source edges 25
Choosing a Method for Frequency Measurement Method Number of Counters Used Measures Low Frequencies Accurately Measures High Frequencies Accurately Measurement Error Inverse Period 1 Good Poor f x f k f x Number of Pulses in Known Time Time of Known Number of Cycles 2 Poor Good f k f x 2 Good Good f x N f k f x Where: f x is the signal being measured f k is the known timebase 26
Acquiring the Measurement PXI Counter Modules PXI-6220 PXIe-6341 CompactDAQ Counter Modules NI 9401 NI 9402 NI 9411 CompactRIO Counter Modules NI 9401 NI 9402 NI 9411 Platform Advantages Best-in-Class Synchronization Widely Adopted Industry Standard Platform Advantages Waveform Streaming Measurements Rapid Software Customization Platform Advantages Deterministic Single Point Measurements Custom Timing and Triggering 27
/data-acquisition 28