AI

The **LMS-4WG-R** is an industrial-grade **Linear Magnetic Scale** (or Magnetic Encoder Sensor) primarily used in CNC machinery, metalworking, and automation for precise position measurement. It is designed to work in conjunction with a magnetic tape (usually 5mm pole pitch).
---
## 1. Technical Specifications
The following table outlines the key electronic and physical characteristics of the LMS-4WG-R sensor:
| Parameter | Specification |
| :--- | :--- |
| **Supply Voltage** | 5V DC or 10-30V DC (Model dependent) |
| **Output Signal** | TTL / RS422 (Differential) |
| **Resolution** | 5μm (Standard), options for 1μm or 10μm |
| **Pole Pitch** | 5mm + 5mm |
| **Max Speed** | Up to 25 m/s |
| **Protection Class** | IP67 (Waterproof and Oil-resistant) |
| **Connector Type** | DB9 or Open-wire |
---
## 2. Wiring Configuration
The device typically uses a shielded cable to prevent electromagnetic interference (EMI). The standard pinout for a DB9 connector is as follows:
| Pin Number | Color | Signal | Description |
| :--- | :--- | :--- | :--- |
| 1 | Red | **VCC** | Power Supply (+) |
| 2 | Black | **0V** | Power Supply (-) |
| 3 | Brown | **A** | Phase A Signal |
| 4 | Orange | **A-** | Inverted Phase A |
| 5 | White | **B** | Phase B Signal |
| 6 | Yellow | **B-** | Inverted Phase B |
| 7 | Green | **Z** | Reference (Index) Signal |
| 8 | Blue | **Z-** | Inverted Index Signal |
| 9 | Shield | **FG** | Frame Ground |
---
## 3. Core Electronic Features
### A. Signal Processing (RS422 / TTL)
The LMS-4WG-R utilizes a differential line driver. By sending both a signal (e.g., A) and its complement (A-), the system can cancel out electrical noise that occurs over long cable distances, making it highly reliable in factory environments.
### B. Magnetoresistive Sensor Technology
Inside the sensor head, there is a magnetoresistive (MR) bridge. As the sensor moves over the magnetic tape (which has alternating North and South poles every 5mm), the MR bridge detects changes in the magnetic field and converts them into sine/cosine waves, which are then interpolated into digital square waves.
### C. Reference (Index) Signal
The "Z" signal (or Reference Mark) provides a precise zero-point or "Home" position. This allows the machine to calibrate its absolute position after a power cycle.
---
## 4. Implementation Example
If you are connecting this to a microcontroller (like an Arduino) or a PLC, you must ensure the voltage levels match.
```cpp
// Example: Basic Pulse Counting for LMS-4WG-R (TTL 5V)
const int pinA = 2; // Connect to A
const int pinB = 3; // Connect to B
volatile long position = 0;
void setup() {
pinMode(pinA, INPUT);
pinMode(pinB, INPUT);
attachInterrupt(digitalPinToInterrupt(pinA), updateEncoder, RISING);
}
void updateEncoder() {
if (digitalRead(pinB) == LOW) {
position++;
} else {
position--;
}
}
```
---
- ⤷
What is the maximum gap distance allowed between the LMS-4WG-R sensor and the magnetic tape?
- ⤷ Can the LMS-4WG-R be used with a 2mm pole pitch tape instead of 5mm?
- ⤷ What are the common causes of signal loss in magnetic encoders in industrial settings?