Reverse Engineering the Nidec 24H055M020 Encoder Sensors
by NewsonsElectronics in Circuits > Arduino
70 Views, 0 Favorites, 0 Comments
Reverse Engineering the Nidec 24H055M020 Encoder Sensors
Encoder sensors are vital for creating a closed-loop system where a motor can provide feedback on how many rotations it has completed. This information is very useful for projects that require wheels or belts to move a precise distance.
Unfortunately, when I bought this Japanese Nidec 24H055M020 BLDC motor, there was no documentation available online explaining how to get these sensors working. However, after some reverse engineering and debugging, I was able to get the encoder to output the FG (frequency generator) signal.
Link to the full video explanation
Supplies
For this instructable you will need the motor and an Arduino Uno board to control the motor.
Nidec 24H055M020 BLDC motor→ Amazon.ca , Amazon.com , Taobao
Arduino UNO→ Amazon.ca , Amazon.com
Solder & Soldering Iron → Amazon.ca, Amazon.com
Multimeter leads → Amazon.ca, Amazon.com
Motor Pinout and Notes
Here is the pinout of the motor. It should be noted that the original pinout diagram contained some incorrect labels.
The motor operates from 1 kHz to 16 kHz, and its speed is controlled via PFM, not PWM. The Enable pin deactivates standby mode and is normally tied to 12 V. The Brake pin is activated when connected to GND. The Direction pin determines rotation: connected to VCC, the motor spins CCW; connected to GND, it spins CW.
The issue was the 4 Feedback pins from the encoder no one knew what they did so I had to do some testing.
Encoder Feedback Pins
Pins 5, 6, 7, and 8 are connected to the motor’s encoder. Pin 8 is GND, but measuring pins 5, 6, and 7 shows about 3.6 V on each. These signals are quite noisy, and no one online seemed to know how to decode them.
After opening the motor, I noticed the BD63000 chip. This chip retrieves data from the encoder and uses it to control the three MOSFETs, allowing the motor to spin properly. The reason the three encoder sensor wires each read 3.6 V is that they are connected to VREG within this IC. The three unknown feedback wires are HU, HV, and HW—Hall effect sensor wires.
At slow speeds, these encoder wires can be used to determine the motor’s RPM by programming an averaging algorithm and checking when the analog read from an Arduino Uno crosses a set threshold.
Example code:
Downloads
The Issue
The issue is that HU, HV, and HW require external circuitry to amplify the signal and filter out noise. Luckily, the BD63000 chip handles all of this internally and outputs a clean FG (frequency generator) signal. By modifying the motor, we can solder a wire to the FG pin to extract this signal.
Adding FG Wire
By probing the PCB, I found that the FG pin is connected to two small resistors. We can solder a wire from this point and connect it to the 5th motor pin to extract the signal.
Clean FG Signal
Now that we have access to the FG pin, it produces a clean square wave. We can connect this to pin 2 on the Arduino and use a falling-edge interrupt to track how many cycles the motor rotor completes:
from testing the FG signal, it can be determined that 1000 Hz corresponds to 150 RPM, and each increase of 1 kHz results in an additional 150 RPM. The motor can operate in a range from 250 Hz to 20,000 Hz.
The motor is now working with all of it's function including the Encoder Sensor Feedback using the FG signal!
Arduino Code Used for Testing