DM-J4340P-2EC geared motor (Cross roller bearing)
This website is licensed under the Apache License 2.0. No license is granted for this documentation or the original documentation.
| Date | Version | Changes |
|---|---|---|
| 2023.11.16 | V1.0 | First version created |
Disclaimer
Thank you for purchasing ™DAMIAO ™DM-J4340P-2EC geared motor (hereinafter referred to as "the motor"). Before using this product, please carefully read and follow this document and all safety guidelines provided by DAMIAO Technology. Failure to do so may cause harm to you and those around you, or damage to this product or other surrounding items.
By using this product, you acknowledge that you have carefully read this document, understand, acknowledge, and accept all the terms and contents of this document and all related documents concerning this product.
You promise to use this product only for legitimate purposes. You promise to assume full responsibility for the use of this product and any consequences that may arise. DAMIAO Technology shall not be liable for any damage, injury, or any legal liability caused directly or indirectly by the use of this product.
DAMIAO is a trademark of Shenzhen DAMIAO Technology Co., Ltd. Product names, brands, etc. Appearing in this document are trademarks of their respective companies. This product and manual are copyrighted by Shenzhen DAMIAO Technology Co. Ltd. Reproduction or reprinting without permission will be prohibited. The final interpretation right of this document and all related documents concerning this product belongs to Shenzhen DAMIAO Technology Co., Ltd.
Updates may be made without notice.
Warnings
- Please strictly operate in specified environment and keep the motor under maximum rated temperature. Otherwise, permanent and irreversible damage may occur.
- Prevent entering foreign objects into the rotor, as this will cause abnormal rotor operation.
- Before use, please check that all components are intact. If any parts are missing, aged, or damaged, please stop using the motor.
- Ensure correct wiring and the motor is installed correctly and securely.
- Do not touch the rotor during use to avoid any accidents. The motor will generate heat when outputting high torque, please take precautions to avoid burns.
- Please do not disassemble the motor. This will affect the motor's control accuracy and cause abnormal motor operation.
Features
- Dual encoder equipped, single-turn absolute position output provide no loss of absolute position during power outages
- Integrated motor and driver design, compact structure, and high integration
- Visualized debugging and firmware upgrades supported by Damiao debugging tools
- Readable motor speed, position, torque, and temperature information via CAN bus
- Dual temperature protection
- Supports trapezoidal acceleration and deceleration in position mode
Packing list
- Motor(built in driver) x1
- Power(with CAN communication terminals) connection cable: XT30(2+2)-F plug single end connection cable (100mm) ×1
- Serial port signal cable for debugging: GH1.25 connector - 3pin(Different side, 300mm) ×1
Interface and wiring specifications
| Connector name-Number | Interface mark | Description |
|---|---|---|
| Power connector-1 (with CAN connector) | ![]() |
|
| Power connector-2 (with CAN connector) | ||
| Debugging serial port-3 | ![]() | Connect to a PC by using the GH1.25 connector cable (-3 pin) and a USB to CAN debugging tool (or a USB to serial module). Use Damiao Technology debugging assistant to set motor parameters and upgrade firmware. |
Motor dimension and installation
Refer the motor mounting hole dimensions and locations to install the motor into the corresponding equipment.
States of indicator lamp
| Normal states | Static green | ERR bit is 1,Enable mode, working normally |
| Static red | ERR bit is 0, Disable mode | |
| Abnormal states | Blink red | This indicates a fault, and the corresponding fault type is as shown:
You can check the feedback frame and figure out which fault has occurred via Damiao Technology debugging assistant interface. |
Operating modes
MIT mode
The MIT mode is designed for compatible with the original MIT mode, allowing for seamless switching for flexibly setting the control range (P_MAX, V_MAX, T_MAX).
The driver converts the received CAN data into control variables, calculates the torque value, and uses it as the current setpoint for the current loop. The current loop then adjusts according to its regulation rules to ultimately achieve the given torque current. Its control block diagram is as follows:
Based on the MIT (Mutual Aspect Ratio) model, various control modes can be derived. For example, when kp=0 and kd is not 0, a given v_des will achieve uniform rotation. When kp=0 and kd=0, a given t_ff will achieve a given torque output.
Note: When controlling the position, kd cannot be set to 0. Otherwise it will cause the motor vibrate or go out of control.
Position speed mode
The position cascade mode employs a three-loop series control method. The position loop acts as the outermost loop, and its output serves the reference for the speed loop. The output of the speed loop serves the reference for the inner current loop, controlling the actual current output. The control block diagram is shown below:
p_des is the target position to be controlled, and v_des is the maximum absolute velocity value during the motion process.
Using the control parameters recommended by the debugging assistant during the position cascade mode, it can achieve good control accuracy and a relatively smooth control, but the response time is relatively long. In addition to v_des, configurable parameters include acceleration/deceleration settings. These parameters can compensate unexpected oscillations during control.
Note: p_des and v_des are in units of rad and rad/s respectively, and type float. The damping factor must be set to non-zero positive value. Please refer to the notes for speed mode.
Speed mode
The speed mode allows the motor to turn continuously setting target speed. The control block diagram is shown below:
Note: The unit of v_des is rad/s, and type of the data is float. If you need to use the debugging assistant to automatically calculate parameters, you need to set the damping factor to a non-zero positive value. Typically, the value is between 2.0 and 10.0. Too small damping factor will cause oscillation and large overshoot, while too large damping factor will cause a long rise time. The recommended setting is 4.0.
Force position hybrid control mode
The force position hybrid control mode dynamically controls the output torque based on the position-speed mode control. Its control block diagram is as follows:
A current command saturation stage was added after the output command of the speed loop to limit the current loop's input to a given range.
Use
The control uses the CAN standard frame format with a fixed baud rate of 1 Mbps. It is divided into receive frames and feedback frames. Receive frames contain the received control data, used to command and control the motor. feedback frames contain the motor's status data sent to the upper-level controller. Depending on the selected motor mode, the receive frame format and frame IDs are different, but the feedback frame is the same across all modes.
Feedback frame
The feedback frame ID is set by the debugging assistant (Master ID), with a default value 0. It mainly provides motor's position, speed, and torque information, and its frame format is defined as follows:
| Feedback message | D[0] | D[1] | D[2] | D[3] | D[4] | D[5] | D[6] | D[7] |
|---|---|---|---|---|---|---|---|---|
| MST_ID | ID|ERR<<4 | POS[15:8] | POS[7:0] | VEL[11:4] | VEL[3:0]|T[11:8] | T[7:0] | T_MOS | T_Rotor |
ID represents controller's ID, It is come from CAN_ID's lower 8 bit.
-
ERR
It shows fault,The corresponding fault type is as shown:
- 0------Disable
- 1------Enable
- 8------Over voltage
- 9------Under voltage
- A------Over current
- B------MOSFET Overheat
- C------Coil Overheat
- D------Communication lost
- E------Overloaded
-
POS: Motor position
-
VEL: Motor speed
-
T: Motor output torque
-
T_MOS: Average temperature of MOSFETS mounted on the driver (unit: degree)
-
T_Rotor: Average temperature of Motor's coil(unit: degree)
Position, velocity, and torque are converted from floating-point data into signed fixed-point data using a linear mapping method. Position using 16 bit data and velocity and torque using 12 bit data.
Control frame in MIT mode
| Control message | D[0] | D[1] | D[2] | D[3] | D[4] | D[5] | D[6] | D[7] |
|---|---|---|---|---|---|---|---|---|
| ID | p_des[15:8] | p_des[7:0] | v_des[11:4] | v_des[3:0]|Kp[11:8] | Kp[7:0] | Kd[11:4] | Kd[3:0]|t_ff[11:8] | t_ff[7:0] |
The frame ID is as same as the CAN_ID set by debugging assistant.
- p_des:Desired position
- v_des:Desired speed
- Kp:Proportional control ratio for position control
- Kd:Derivative control ration for speed control
- t_ff:Feed forward torque value
Each parameter conforms to the mapping method in the previous section. The numbers of p_des, v_des, and t_ff can be set by the debugging assistant.
The range of Kp is [0, 500], and the range of Kd is [0, 5].
Assignment: CAN number is only one level, with 8 characters, MIT's restraint command format: Position, Velocity, Kp, Kd, Torque. Among them: Position 2 characters 16 bits, Velocity 12 bits, Kp 12 bits, Kd 12 bits
Control frame of Position speed mode
| Control message | D[0] | D[1] | D[2] | D[3] | D[4] | D[5] | D[6] | D[7] |
|---|---|---|---|---|---|---|---|---|
| 0x100+ID | p_des | v_des | ||||||
The frame ID is the set CAN ID value plus an offset of 0x100.
- p_des:Target position, floating-point type LSB first,MSB last (little endian).
- v_des:Target speed, floating-point type LSB first,MSB last (little endian).
The CAN ID for the command here is 0x100+ID. The target speed is the highest speed of trapezoidal acceleration, which is the speed value of the constant speed segment.
Speed mode control frame
| Control message | D[0] | D[1] | D[2] | D[3] |
|---|---|---|---|---|
| 0x200+ID | v_des | |||
The frame ID is the set CAN ID value plus an offset of 0x200.
- v_des:Target speed, floating-point type LSB first,MSB last (little endian).
The CAN ID for the command here is 0x200+ID.
Control frame of force position hybrid control mode
Control message is as follows:
| Control message | D[0] | D[1] | D[2] | D[3] | D[4] | D[5] | D[6] | D[7] |
|---|---|---|---|---|---|---|---|---|
| 0x300+ID | p_des | v_des | i_des | |||||
- p_des
- Target position given in rad, floating-point,LSB first, MSB last.
- v_des
- Speed limit value in rad/s, magnified by 100, Type is unsigned 16 bit, LSB first, MSB last, range is 0-10000, Exceeding 10000 will be limited to 10000, so the corresponding actual speed limit is 0~100rad/s.
- i_des *Torque current limit value, magnified 10000. Type is unsigned 16 bit, LSB first, MSB last. The range is 0-10000, exceeding 10000 will be limited to 10000. the corresponding actual current limit per-unit is 0-1.0 current per-unit value: actual current value divided by maximum current value, DM-J4340P-2EC maximum current 10.26A.
Read parameters
| Message ID | Property | D[0] | D[1] | D[2] | D[3] |
|---|---|---|---|---|---|
| 0x7FF | STD | CANID_L | CANID_H | 0x33 | RID |
RID: Register addresses. see Appendix <Register List and Range>.
Reading succeeded, the data in the register will be returned with the following frame format:
| Message ID | Property | D[0] | D[1] | D[2] | D[3] | D[4] | D[5] | D[6] | D[7] |
|---|---|---|---|---|---|---|---|---|---|
| MST_ID | STD | CANID_L | CANID_H | 0x33 | RID | Data | |||
The data is either floating-point data or unsigned integer, occupying 32 bits (4 bytes in total), with the LSB D4 and the MSB being D7, and so on.
Write parameters
| Message ID | Property | D[0] | D[1] | D[2] | D[3] | D[4] | D[5] | D[6] | D[7] |
|---|---|---|---|---|---|---|---|---|---|
| 0x7FF | STD | CANID_L | CANID_H | 0x55 | RID | Data | |||
As shown above, the RID will be returned after a successful write, and the frame format is the same as that sent.
| Message ID | Property | D[0] | D[1] | D[2] | D[3] | D[4] | D[5] | D[6] | D[7] |
|---|---|---|---|---|---|---|---|---|---|
| MST_ID | STD | CANID_L | CANID_H | 0x55 | RID | Data | |||
Data written to the register takes effect immediately, cannot be stored so will be lost after power off. Store parameters command needs to write all the modified parameters into the chip.
Save parameters
| Message ID | Property | D[0] | D[1] | D[2] | D[3] |
|---|---|---|---|---|---|
| 0x7FF | STD | CANID_L | CANID_H | 0xAA | 0x01 |
Upon successful writing, this message will sent:
| Message ID | Property | D[0] | D[1] | D[2] | D[3] |
|---|---|---|---|---|---|
| MST_ID | STD | CANID_L | CANID_H | 0xAA | 0x01 |
Note:
- Stored parameter is only applied inDisable mode.
- All parameters will be retained at once when storing parameters.
- This operation writes the parameters into the on-chip flash memory. Each operation takes 30ms maximum. please keep sufficient time of powered.
- The flash memory has approximately 10,000 write/erase cycles. please do not send "store parameters" commands frequently.
Mode switching
It supports switching between multiple modes. The currently supported control modes are as follows:
| Number | Mode |
|---|---|
| 1 | MIT |
| 2 | Pos speed |
| 3 | Speed |
| 4 | Force position hybrid control |
The mode can be changed by modifying the value of the mode register (0x0A). When switching modes, the motor first clears the command value. This includes position, speed, and torque feedforward and KP,KD values in MIT mode.
When switching from one mode to the position control mode, it is recommended to read the precise position first (the value of register 0x50) to prevent shock. And try to switch when the motor is at zero speed.
After the mode is changed, it will not be stored in flash memory and will be lost when power is off. After powered again, the control mode will be set to the mode last stored in flash memory.
Change the baud rate of CAN communication
The CAN communication baud rate can be modified by writing specific data to the baud rate register (address 0x23). Specific baud rate modification is supported. The currently supported baud rates are as follows:
| Number | Baud rate |
|---|---|
| 0 | 125K |
| 1 | 200K |
| 2 | 250K |
| 3 | 500K |
| 4 | 1M |
| 5 | 2M |
| 6 | 2.5M |
| 7 | 3.2M |
| 8 | 4M |
| 9 | 5M |
After successfully modifying the baud rate, the driver initially feeds back data at the original baud rate. And then communicates at the new baud rate. When powered-up, the motor first checks the stored baud rate. If it's greater than 5Mbps, it automatically defaults to 1Mbps. For baud rates greater than 1Mbps (excluding 1Mbps), it automatically switches to CAN FD function. If the baud rate is less than or equal to 1Mbps, it automatically switches to CAN 2.0B. Motors configured as CAN FD can still receive CAN 2.0B data frames, but they send feedback frames using CAN FD. Therefore, the upper-level controller will not receive feedback data, and the driver will continuously report errors. If a controller using CAN 2.0B has an incorrect ID setting, the baud rate can still be changed back using the baud rate modification command.
Using Damiao Debugging Assistant
Using the Damiao Technology USB to CAN debugging tool, connect the computer and the motor, and use the Damiao Technology assistant to set the motor parameters and upgrade the firmware.
The motor debugging serial port is connected to the PC via the GH1.25 connector cable -3pin. The CAN communication terminal in the motor power interface is connected to the USB to CAN debugging tool via the XT30 (2+2)-F connector cable. The motor parameters are set and firmware is upgraded using the Damiao Technology debugging assistant.
After connecting the motor's serial port, CAN port, and power interface, open the Damiao Technology Debugging Assistant on the computer, select the corresponding serial port device, and open the serial port. Then, supply power to the motor. the serial port will print information, with "Control Mode" indicating the current drive mode.
Characteristic parameters
Please use the motor appropriately according to the following parameters.
| Type | Characteristic parameters | DM-J4340P-2EC(24V) | DM-J4340P-2EC(48V) |
|---|---|---|---|
| Motor parameters | Rated voltage | 24V | 48V |
| Rated current | 2.5A | 2.5A | |
| Peak current | 8A | 8A | |
| Rated torque | 9NM | 9NM | |
| Peak torque | 27NM | 27NM | |
| Rated speed | 36rpm | 36rpm | |
| Maximum speed under no-load | 52rpm | 100rpm | |
| Motor characteristic value | Reduction ratio | 40:1 | 40:1 |
| Number of pole pairs | 14 | 14 | |
| Phase inductance | 360μH | 360μH | |
| Phase resistance | 880mΩ | 880mΩ | |
| Structure and weight | Outer diameter | 57mm | 57mm |
| Height | 56.5mm | 56.5mm | |
| Motor weight | 375g Approx | 375g Approx | |
| Encoders | Encoder resolution | 14 bit | 14 bit |
| Number of encoders | 2 | 2 | |
| Encoder type | Magnetic(single lap) | Magnetic(single lap) | |
| Communication | Control interface | CAN@1Mbps | |
| Parameter adjust interface | UART@921600bps | ||
| Control and protection | Control mode | MIT mode | |
| Speed mode | |||
| Position mode | |||
| Force position hybrid control mode | |||
| Protection | Driver overheat protection: The protection temperature is 120℃. If the temperature exceeds this limit, the motor will exit "Enable mode". | ||
Motor overheat protection. It should be set according to requirements of usage however recommended not to exceed 100℃. Over-temperature protection will cause the motor to exit "Enable mode". | |||
Motor overvoltage protection should be set according to usage requirements, but it is recommended not to exceed 32V. Overvoltage will exit "Enable mode". | Motor overvoltage protection should be set according to usage requirements, but it is recommended not to exceed 52V. Overvoltage will exit "Enable mode". | ||
Communication loss protection: If no CAN command is received within a set period, the system will automatically exit "Enable mode". | |||
Motor overcurrent protection: It should be set according to usage requirements, but it is recommended not to exceed 9.8A. Overcurrent will exit "Enable mode". | |||
Motor undervoltage protection: If the power supply voltage is lower than the set value, the "Enable mode" will be exited. It is recommended that the power supply voltage not be lower than 15V. | Motor undervoltage protection: If the power supply voltage is lower than the set value, the "Enable mode" will be exited. It is recommended that the power supply voltage not be lower than 15V. | ||
Appendix Register List and Range
| Address (HEX) | Address (DEC) | Variable | Description | R/W | Value range | Type |
|---|---|---|---|---|---|---|
| 0x00 | 0 | UV_Value | UV protection value | RW | (10.0,fmax] | float |
| 0x01 | 1 | KT_Value | Torque coefficient | RW | [0.0,fmax] | float |
| 0x02 | 2 | OT_Value | Over temperature value | RW | [80.0,200) | float |
| 0x03 | 3 | OC_Value | Over current value | RW | (0.0,1.0) | float |
| 0x04 | 4 | ACC | Acceleration ratio | RW | (0.0,fmax) | float |
| 0x05 | 5 | DEC | deceleration ratio | RW | [-fmax,0.0) | float |
| 0x06 | 6 | MAX_SPD | Maximum speed | RW | (0.0,fmax] | float |
| 0x07 | 7 | MST_ID | Feedback ID | RW | [0,0x7FF] | uint32 |
| 0x08 | 8 | ESC_ID | Receive ID | RW | [0,0x7FF] | uint32 |
| 0x09 | 9 | TIMEOUT | Timeout time | RW | [0,2^32-1] | uint32 |
| 0x0A | 10 | CTRL_MODE | Control mode | RW | [0,4] | uint32 |
| 0x0B | 11 | Damp | Motor damping factor | RO | / | float |
| 0x0C | 12 | Inertia | Motor rotational inertia | RO | / | float |
| 0x0D | 13 | hw_ver | Reserved | RO | / | uint32 |
| 0x0E | 14 | sw_ver | Software version | RO | / | uint32 |
| 0x0F | 15 | SN | Reserved | RO | / | uint32 |
| 0x10 | 16 | NPP | Motor pole pairs number | RO | / | uint32 |
| 0x11 | 17 | Rs | Motor phase resistance | RO | / | float |
| 0x12 | 18 | Ls | Motor phase inductance | RO | / | float |
| 0x13 | 19 | Flux | Motor flux linkage | RO | / | float |
| 0x14 | 20 | Gr | Gear reduction ratio | RO | / | float |
| 0x15 | 21 | PMAX | Location mapping range | RW | (0.0,fmax] | float |
| 0x16 | 22 | VMAX | Speed mapping range | RW | (0.0,fmax] | float |
| 0x17 | 23 | TMAX | Torque mapping range | RW | (0.0,fmax] | float |
| 0x18 | 24 | I_BW | Current loop control range | RW | [100.0,1.0e4] | float |
| 0x19 | 25 | KP_ASR | Speed loop Kp | RW | [0.0,fmax] | float |
| 0x1A | 26 | KI_ASR | Speed loop Ki | RW | [0.0,fmax] | float |
| 0x1B | 27 | KP_APR | Position loop Kp | RW | [0.0,fmax] | float |
| 0x1C | 28 | KI_APR | Position loop Ki | RW | [0.0,fmax] | float |
| 0x1D | 29 | OV_Value | Over voltage protection | RW | TBD | float |
| 0x1E | 30 | GREF | Gear torque efficiency | RW | (0.0,1.0] | float |
| 0x1F | 31 | Deta | Speed loop damping cofficient | RW | [1.0,30.0] | float |
| 0x20 | 32 | V_BW | Velocity loop damping coefficient | RW | (0.0,500.0) | float |
| 0x21 | 33 | IQ_c1 | Current loop enhancement factor | RW | [100.0,1.0e4] | float |
| 0x22 | 34 | VL_c1 | Velocity loop enhancement factor | RW | (0.0,1.0e4] | float |
| 0x23 | 35 | can_br | CAN baud rate code | RW | [0,4] | uint32 |
| 0x24 | 36 | sub_ver | Sub version number | RO | / | uint32 |
| 0x32 | 50 | u_off | U phase bias | RO | / | float |
| 0x33 | 51 | v_off | V phase bias | RO | / | float |
| 0x34 | 52 | k1 | Compensation value 1 | RO | / | float |
| 0x35 | 53 | k2 | Compensation value 2 | RO | / | float |
| 0x36 | 54 | m_off | Angle offset | RO | / | float |
| 0x37 | 55 | dir | Direction | RO | / | float |
| 0x50 | 80 | p_m | Motor current position | RO | / | float |
| 0x51 | 81 | xout | Output shaft current position | RO | / | float |
- RW:Read Write
- RO:Read Only

