
The circuit consists of two rotary encoders (Kalamoyi P3022-V1-CW360) connected to two STG adapters. Each encoder's VCC, OUT, and GND pins are connected to the corresponding STG adapter, facilitating signal transmission and power supply management.

The Differential Servo Encoder Converter (A, B) for PLC TTL/NPN is a versatile device designed to convert differential signals from a servo encoder into a format compatible with Programmable Logic Controllers (PLCs). It supports TTL or NPN output, ensuring reliable digital communication in industrial automation systems. This component is commonly used in motion control, robotics, and industrial machinery where precise position or speed feedback is required.

The circuit consists of two rotary encoders (Kalamoyi P3022-V1-CW360) connected to two STG adapters. Each encoder's VCC, OUT, and GND pins are connected to the corresponding STG adapter, facilitating signal transmission and power supply management.

This circuit appears to be a configurable encoder system with an RF transmission capability. The encoder's address pins (A0-A7) are connected to a DIP switch for setting the address, and its data output (DO) is connected to an RF transmitter, allowing the encoded signal to be wirelessly transmitted. The circuit is powered by a 9V battery, regulated to 5V by a 7805 voltage regulator, and includes a diode for polarity protection. Tactile switches are connected to the encoder's data inputs (D1-D3), and an LED with a current-limiting resistor indicates power or activity.

This circuit features a Raspberry Pi 4B as the central controller, interfaced with an Adafruit PCA9685 PWM Servo Breakout to manage multiple servomotors (two MG90S servomotors are connected). The PCA9685 receives power from a 2.1mm Barrel Jack with Terminal Block and communicates with the Raspberry Pi via I2C (using GPIO2/SDA and GPIO3/SCL). Additionally, a HW-040 Rotary Encoder is connected to the Raspberry Pi for user input, which could be used for tasks like controlling the position of the servomotors.

This circuit features an Arduino Mega 2560 and two Arduino Nano microcontrollers interfacing with two rotary encoders for input. The system is powered by an AC-DC PSU board converting 220V AC to 5V DC, and the microcontrollers communicate with each other via serial connections. The setup is designed for reading rotary encoder inputs and potentially processing or transmitting the data.
Below are the key technical details of the Differential Servo Encoder Converter:
| Parameter | Specification |
|---|---|
| Input Signal Type | Differential (A, B) |
| Output Signal Type | TTL or NPN |
| Input Voltage Range | 5V to 24V DC |
| Output Voltage Range | 5V to 24V DC (matches input voltage) |
| Maximum Output Current | 20mA per channel |
| Operating Temperature Range | -20°C to 70°C |
| Signal Frequency Range | Up to 200 kHz |
| Isolation | Optically isolated output |
| Dimensions | 50mm x 30mm x 15mm |
The pin configuration for the Differential Servo Encoder Converter is as follows:
| Pin | Label | Description |
|---|---|---|
| 1 | A+ | Differential encoder signal A+ |
| 2 | A- | Differential encoder signal A- |
| 3 | B+ | Differential encoder signal B+ |
| 4 | B- | Differential encoder signal B- |
| 5 | GND | Ground reference for input signals |
| Pin | Label | Description |
|---|---|---|
| 1 | A | TTL/NPN output signal A |
| 2 | B | TTL/NPN output signal B |
| 3 | GND | Ground reference for output signals |
| 4 | VCC | Power supply for output signals (5-24V) |
If you are using the Differential Servo Encoder Converter with an Arduino UNO for testing or prototyping, the following code demonstrates how to read the A and B signals:
// Define the input pins for the encoder signals
const int encoderPinA = 2; // Connect to output signal A from the converter
const int encoderPinB = 3; // Connect to output signal B from the converter
volatile int encoderPosition = 0; // Variable to store the encoder position
int lastEncoded = 0; // Variable to store the last encoder state
void setup() {
pinMode(encoderPinA, INPUT); // Set pin A as input
pinMode(encoderPinB, INPUT); // Set pin B as input
// Enable pull-up resistors for noise immunity
digitalWrite(encoderPinA, HIGH);
digitalWrite(encoderPinB, HIGH);
// Attach interrupts to the encoder pins
attachInterrupt(digitalPinToInterrupt(encoderPinA), updateEncoder, CHANGE);
attachInterrupt(digitalPinToInterrupt(encoderPinB), updateEncoder, CHANGE);
Serial.begin(9600); // Initialize serial communication for debugging
}
void loop() {
// Print the encoder position to the serial monitor
Serial.println(encoderPosition);
delay(100); // Delay for readability
}
void updateEncoder() {
// Read the current state of the encoder pins
int MSB = digitalRead(encoderPinA); // Most Significant Bit
int LSB = digitalRead(encoderPinB); // Least Significant Bit
int encoded = (MSB << 1) | LSB; // Combine the two bits into a single value
int sum = (lastEncoded << 2) | encoded; // Combine with the last state
// Determine the direction of rotation
if (sum == 0b1101 || sum == 0b0100 || sum == 0b0010 || sum == 0b1011) {
encoderPosition++;
} else if (sum == 0b1110 || sum == 0b0111 || sum == 0b0001 || sum == 0b1000) {
encoderPosition--;
}
lastEncoded = encoded; // Update the last state
}
No Output Signal:
PLC Not Detecting Signals:
Noisy or Unstable Signals:
Incorrect Position Feedback:
By following this documentation, users can effectively integrate the Differential Servo Encoder Converter into their systems for reliable and accurate signal conversion.