Introduction: High performance integrated servo solution
The MGv2 series brushless servo motor launched by Shanghai Lingkang Technology (LK-TECH), combined with the DG80 series driver, is designed specifically for high-precision, high response, and high torque applications. This series of motors adopts a 32-bit high-performance MCU combined with optimized FOC (Field Oriented Control) technology, as well as a low internal resistance MOSFET flat structure, achieving compact electromechanical integration design. The motor and driver are highly integrated, supporting absolute value encoders and built-in dual closed-loop control, significantly improving the accuracy of torque, position, and speed feedback.
The MGv2 series covers multiple sub series such as MS, MF, MG, MH, etc., suitable for scenarios such as gimbal, pod, turntable, power inspection robot, robotic arm, LiDAR, quadruped robot, exoskeleton, etc. This article is based on the official manual V2.33, providing engineers with a systematic technical guide for selection comparison, hardware connection, software debugging, parameter configuration, encoder alignment, and common troubleshooting.
Comparison of Product Series Selection
Series Input Voltage Current Range Speed Range Drive Type Encoder Accuracy Communication Typical Scenarios
MS 7.4-24V 0-4A 0-1000 rpm SVPWM 12/18 bit RS-485/CAN gimbal, pod
MF 12-36V 0-9A 0-3000 rpm FOC 14/18 bit RS-485/CAN turntable, power inspection
MG 24-48V 0-14A 0-2000 rpm FOC 18 bit RS-485/CAN robotic arm, LiDAR
MH 12-24V 0-4A 0-3000 rpm FOC 18 bit RS-485/CAN quadruped robot, exoskeleton
Selection criteria: Choose based on load inertia, maximum speed, and supply voltage. The MG series has the highest torque (14 A) and is suitable for heavy-duty joints; The MF series has a high rotational speed (3000 rpm), suitable for quick positioning; MS series low voltage, low speed, suitable for portable gimbal; MH series medium voltage and speed, suitable for exoskeletons. Note that all series support three control modes: speed, position, and torque.
Driver parameters and interfaces
3.1 DG80 Driver Core Specifications
Parameter values
Input voltage DC 12-60 V (DG80R/C7)
Rated/peak current 10 A/20 A (peak duration 10 seconds)
Control loop torque 32 kHz, speed 8 kHz, position 8 kHz
PWM frequency 32 kHz
Torque ring width 0.4-2.8 kHz (depending on motor and load)
Encoder 18 bit absolute value
Communication RS-485 or CAN
3.2 Interface Definition
The driver provides the following key interfaces:
A/H, B/L: RS-485 A+/B - or CAN-H/L
V+, V ---: Positive and negative poles of the power supply
T. R: UART send/receive (for serial port debugging)
G: Signal Ground
Important: The 120 Ω terminal resistor needs to be connected to both ends of the bus (controlled by dip switch S-4). For long-distance or multi node networks, terminal resistors must be enabled to avoid signal reflection.
Hardware connection and debugging environment setup
4.1 Power Connection
Connect the driver to the power supply using XT30 cable. Be sure to confirm that the positive and negative poles are correct, and select the appropriate voltage range and output power (it is recommended that the power supply capacity be no less than 1.5 times the peak power of the motor). The MG series has a maximum voltage of 48V, please note that overvoltage may cause damage to the driver.
4.2 USB-UUART Connection
Connect the PC to the driver through a USB-UUART conversion module (such as CP2102). CP210x virtual serial port driver needs to be installed (official Baidu Netdisk link provided). After successful connection, confirm the COM port number in the device manager.
4.3 Upper computer software
LingKong Motor Tool V2.33 "is an official debugging tool that does not require installation and can be run by double clicking. Supports WIN7 and above systems. The interface includes:
Connection settings (COM port, baud rate ID)
Basic settings (ID, bus type, direction, braking resistance)
Protection settings (undervoltage, overvoltage, motor temperature, etc.)
Limiting settings (maximum speed, acceleration, torque current)
PID settings (position loop, speed loop, current loop)
Motor/encoder alignment
Test interface (torque, speed, multi turn position, single turn position control)

Communication configuration and ID allocation
5.1 ID Setting Method
The ID of MGv2 driver can be set in two ways:
DIP switch (ID=0): Binary selection of 1-8 from DIP switches SW1-SW3. Corresponding relationship:
1#:OFF OFF OFF
2#:OFF OFF ON
3#:OFF ON OFF
4#:OFF ON ON
5#:ON OFF OFF
6#:ON OFF ON
7#:ON ON OFF
8#:ON ON ON
Software settings (ID=1-32): Set the ID to a non-zero value on the "Basic Settings" page, save and restart the power to take effect. At this time, the fourth position (S-4) of the dip switch is specifically used to control the 120 Ω terminal resistor (ON indicates connection).
Engineering experience: It is recommended to use software IDs (1-32) for multi axis systems to avoid limiting the number of dip switches; Ensure that each axis ID is unique. After changing the ID, it must be powered on again.
5.2 Bus type and baud rate
RS-485: Supports 9600 bps to 2 Mbps. The factory default is 115200 bps.
CAN: Supports 125 kbps, 250 kbps, 500 kbps, and 1 Mbps. The factory default is 1 Mbps.
Broadcast mode: Can control 4 motors (ID 1-4) simultaneously, with baud rate set to 1M or 2M (RS-485) or 500K/1M (CAN), and only supports torque control mode. This mode is suitable for scenarios where multiple motors output synchronously but do not require independent position feedback.
5.3 Rotation direction
Reversible motor rotation direction (Normal: counterclockwise is positive; Reverse: clockwise is positive. After modification, it is necessary to save and restart, and then perform the "Align" operation to recalibrate.
Encoder alignment (core steps)
The MGv2 series uses an 18 bit absolute value encoder, and the motor and encoder must be aligned before use, otherwise the motor cannot operate normally.
6.1 Alignment Preparation
Ensure that the number of motor poles is set correctly (usually default values apply).
The motor is best unloaded (if the load is heavy, the alignment voltage can be appropriately increased).
Click the "Align" button, and the motor will automatically calibrate by swinging in both directions.
6.2 Alignment result judgment
After alignment is completed, the 'Motor/Encoder Align Ratio' is automatically calculated. The value should be close to 1000, the closer it is to 1000, the better the calibration effect. If the deviation is too large, it is necessary to check:
Is the number of motor poles incorrect
Excessive mechanical resistance of the motor (bearing jamming, load not detached)
Poor contact of encoder wiring
Common faults: The motor shakes violently or cannot rotate during the alignment process. Firstly, reduce the alignment voltage, and then manually rotate the motor to feel the resistance. If it still cannot be completed, check if the UVW phase sequence of the motor is reversed.
6.3 Motor Zero Position Setting
After alignment is completed, the current position can be set as the starting zero position of the motor using the "Set" button. For systems with reducers, it is also necessary to set the reduction ratio and reducer zero position in the "Reducer/Encoder Setting" (dual encoder mode).
Protection mechanism and troubleshooting
7.1 Configurable Protection
Protection item status description
Motor temperature protection can be enabled to read the internal temperature sensor of the motor. If it exceeds the limit, an error will be reported and it will stop
Under voltage protection can activate an alarm when the bus voltage is below the threshold
Overvoltage protection can activate an alarm when the bus voltage exceeds the threshold
Input loss protection can enable communication signal loss alarm after exceeding the set time
Overcurrent, short circuit, and stalling have not yet been opened at the hardware level due to limited current. Software protection is pending firmware upgrade
Suggestion for handling: In battery powered applications, it is necessary to enable undervoltage protection to prevent battery damage caused by over discharge. If undervoltage is frequently triggered, it is necessary to check whether the power cord diameter is too thin or the battery internal resistance is too high.
7.2 Indicator light status
Green constantly on: connection is normal, motor is enabled (Motor ON).
Green slow flashing (2 seconds/time): Motor not enabled (Motor OFF).
Green flash (0.3 seconds/time): The motor is in an error state (fault).
When an error occurs, clear it through the "Clear Error" button; If it is an unrecoverable error (such as overvoltage), the power supply needs to be restarted.
7.3 Common Error Codes (Read by Status)
The software provides a "Read State 1/2/3" button, which can read in real-time:
UVP: Undervoltage
OVP: Overvoltage
MTP: Motor Temperature Protection
LIP: Input loss (communication timeout)
Troubleshooting example: The motor suddenly stops and the indicator light flashes rapidly. Clicking on "Read State1" displays "UVP". If the input voltage of the driver is lower than the minimum operating voltage (for example, if the 24V system drops to 18V), check the power supply or replace it with a larger capacity battery.

PID Debugging Guide
The MGv2 driver adopts a three loop control: current loop (torque loop), speed loop, and position loop. The PI parameters (Kp, Ki) of each loop can be independently adjusted through software.
8.1 Debugging sequence
Current loop (default parameters generally apply, unless the motor is replaced or the load inertia is extremely high). Kp affects the torque response speed, while Ki eliminates steady-state errors. If the motor produces high-frequency whistling, Kp should be reduced.
Speed loop: First set smaller Kp and Ki, gradually increase Kp until there is no oscillation in the speed response, and then increase Ki to reduce static error.
Position loop: Based on the adjusted speed loop, adjust the position loop Kp (usually only controlled by P, with Ki set to 0). Increasing Kp can improve the positioning stiffness, but excessive Kp can easily cause overshoot or oscillation.
8.2 Save Parameters
Using the 'SET' button only writes to RAM (lost during power failure), it is necessary to use 'Write to ROM' and restart the power to permanently save.
Experience value: For general gimbal loads, the speed loop Kp can be set to 500-1500, and Ki can be set to 100-300; Set the position ring Kp at 200-800. Specific adjustments need to be made based on the actual mechanical system.
Detailed explanation of control mode (test interface)
On the "Test" page, users can send real-time instructions to verify the motor response.
Mode description range reducer influence
Torque control setting torque current (± 2000), clockwise is positive. 2000~2000 has no impact
Speed control set speed (± 24000 dps). -24000~24000 dps No impact
Multi turn position control 1 sets the absolute angle (± 359999.99 °), and the motor moves at maximum speed. -359999.99~359999.99 ° Actual angle=Set value/i
Multi circle position control 2 is the same as above, but it can limit the movement speed. Same angle, adjustable speed as above
Single turn position control 1 is set to rotate clockwise relative to the zero position from 0 to 359.99 °, with the option to rotate in the opposite direction. 0-359.99 ° actual angle=set value/i
Single circle position control 2 is the same as above, which can limit the speed. – –
Incremental position control 1 increases the fixed angle (supports positive and negative) with each click. ± 359999.99 ° increments divided by reduction ratio
Incremental position control 2 can limit speed. – –
Note: All multi turn/incremental position values must be divided by the reduction ratio (i) to obtain the actual motor movement angle. In applications with reducers (such as MG80-16-i6), it is important to pay attention to parameter settings.
Firmware upgrade operation
Hardware/software information can be read through the 'Product' page. Upgrade steps:
Click on 'Open File' and select the firmware file (. bin) that matches the motor model.
Click 'Download' and wait for the writing to complete.
After the upgrade is completed, the motor will automatically recalibrate (alignment needs to be performed again).
Warning: Power off is strictly prohibited during the upgrade process, otherwise the drive may become bricked. The mismatch between firmware and motor model may cause the motor to malfunction, so it is necessary to verify.
Quick Reference Table for Common Malfunctions and Solutions
Possible causes and solutions for the fault phenomenon
Unable to connect to software COM port selection error, baud rate mismatch, driver not installed, check device manager; Ensure the baud rate is 115200 (default); Reinstall CP210x driver
The motor does not rotate, and the LED flash triggering protection (under voltage, over voltage, temperature, communication loss) reads the status and handles it according to the error type; Clear errors or restart
During alignment, the motor experiences severe shaking, excessive load, incorrect number of pole pairs, mechanical jamming, and no-load alignment; Check the pole pair setting; Reduce alignment voltage
Unstable speed control, improper PID parameters, re adjust the speed loop, reduce Kp or increase integration time
Position control overshoot position ring Kp is too large, reduce position ring Kp, or increase speed limit
Communication interference leads to packet loss due to lack of terminal resistance, and unused shielded twisted pair cables are connected to 120 Ω resistors at both ends of the bus; Use twisted pair shielded wires, with the shielding layer grounded at one end
Broadcast mode cannot synchronize ID not set to 1-4, baud rate does not match confirm axis ID 1-4, baud rate 1M/2M (RS-485) or 500K/1M (CAN)
