Skip to main content

TN0001 CAN FD MIT Mode and Force Control Tuning Guide

ItemDescription
Document No.TN0001 (Rev. 2.1 · 2026-11-21)
Applicable ProductsJuxie Intelligent Next-Generation Joint Modules (baselined on R58 V3 and next-gen force-control / standard architectures)
Recommended ProtocolCAN FD Fast-Control Protocol (recommended 0x210 multi-axis synchronous frame, 1 Mbps arbitration / 5 Mbps data BRS)
Commissioning BaselineStart real-hardware commissioning from factory-shipped parameters; numerical values in this guide illustrate physical dimensions, bit-packing conversions, and tuning directions

MIT Impedance Control allows the master controller to command five joint-side physical setpoints simultaneously in every control cycle—desired position, desired velocity, position Stiffness, velocity Damping, and Feedforward Torque—while the drive synthesizes desired joint output torque in real time inside its high-speed internal loop. It is widely deployed in bipedal/quadruped robots, collaborative manipulators, compliant assembly, and human-robot interaction.

This guide walks step-by-step through "Understanding the Impedance Control Law → Distinguishing Hardware Paths With/Without Torque Sensors → Running CAN FD Multi-Axis/Single-Axis Fast Control → Fine-Tuning the Torque Loop (P+D) & Friction Compensation → 6-Step Hardware Commissioning". If your system relies on a traditional CANopen master stack, jump to Section 7 at the end of this guide.

First Power-On Safety Notice

MIT mode directly controls joint output torque. At zero gains (Kp = 0, Kd = 0, τ_ff = 0), the joint will neither hold its current position nor automatically counteract gravity. Before enabling for the first time, ensure links are clear of hard mechanical stops, gravity-loaded links are safely supported, and an emergency stop plus power-supply current limit are ready.

1. Principles of MIT Impedance Control​

1.1 Five-Tuple Joint-Side Control Law​

In MIT mode, the drive bypasses traditional cascaded "Position Loop → Velocity Loop" integrators and directly synthesizes desired torque inside an internal 4 kHz (250 μs) real-time path using the joint-side spring-damper law, dispatching the result to the 40 kHz field-oriented current loop (FOC):

τ_ref = Kp × (q_des − q) + Kd × (dq_des − dq) + τ_ff

All five command quantities are defined at the reducer output shaft (joint side), so host algorithms never need to manually scale by gear reduction ratios (such as R58 V3's 101 ratio) or motor torque constants:

ParameterPhysical MeaningJoint-Side UnitCore Control Role
q_desDesired joint positionradVirtual spring equilibrium point; deviation from actual angle q produces restoring torque
dq_desDesired joint velocityrad/sVirtual damper reference velocity; set 0 for posture holding, or position time-derivative for trajectories
KpPosition Stiffness coefficientN·m/radCompliance "softness/hardness" resisting position error (independent of standard position loop 0x2536)
KdVelocity Damping coefficientN·m·s/radSuppresses velocity error and oscillation (independent of standard velocity loop 0x2534)
τ_ffFeedforward TorqueN·mSummed directly into target torque for gravity or inverse-dynamics compensation
MIT impedance control law: target position, target velocity, stiffness Kp, damping Kd, and feedforward torque form virtual spring, virtual damper, and feedforward terms in the 4 kHz drive loop, summed and clamped into τ_ref.Physical IntuitionTarget q_desMeas. qVirtual Spring + Damper4 kHz (250 μs) Impedance SynthesisSpring: Kp × (q_des − q)Pos. error → restoring torqueDamper: Kd × (dq_des − dq)Vel. error → viscous dampingFeedforward: τ_ffGravity / dynamics model comp.ΣTarget τ_refSafety-clampedSensor Torque CLKt Current Path
Fig. 1 · Inside the drive, spring, damping, and feedforward terms are summed at 4 kHz to produce joint torque command τ_ref

1.2 Four Common Operating Combinations​

By combining Kp, Kd, and τ_ff, a single frame channel seamlessly switches task compliance profiles:

Parameter CombinationTypical ScenarioExpected Physical Behavior
Kp = 0, Kd = 0, τ_ff = 0Post-enable safety self-checkSynthesized target torque is 0; used to verify state transitions and feedback polarity
Kp = 0, Kd > 0, dq_des = 0Pure damping compliant teachingSmooth viscous resistance in both push directions; stops smoothly without springback when released
Kp > 0, Kd > 0, dq_des = 0Compliant posture holdingExternal displacement produces elastic restoring torque; smoothly returns to target when released
Kp > 0, Kd > 0 + dq_des, τ_ffDynamic trajectory trackingSetting dq_des to position derivative paired with dynamics feedforward eliminates tracking lag
  • Never Apply Stiffness Without Damping: Never command large Kp while Kd = 0; lack of energy dissipation easily triggers sustained mechanical oscillation.
  • Built-In Multi-Layer Protection: Before reaching the FOC current loop, synthesized τ_ref automatically passes through soft-travel-limit derating, peak torque clamping, thermal derating, and hard peak phase-current limiting.

2. Modules With Torque Sensor vs. Without Torque Sensor​

Represented by the R58 V3 next-generation control architecture, Juxie Intelligent Joint Modules expose an identical MIT frame interface to the master while internally routing commands to the appropriate execution chain depending on whether an output-side joint Torque Sensor is installed.

Top: unified CAN FD 8B unpacking and 4 kHz MIT torque synthesis for both variants. Middle: Path A for torque-sensor joints using inner sensor torque loop (0x2548 P+D) and friction compensation (0x2549). Bottom: Path B for sensorless joints using calibrated Kt conversion and motor friction compensation (0x2549).CAN FD 8B MIT Payload0x210 Multi / 0x110+ID SingleScale Unpack (0x2542~46)Joint rad · rad/s · N·m4 kHz MIT Torque Ref τ_refKp·Δq + Kd·Δdq + τ_ffPath A · With Joint Torque Sensor (R58 V3)Inner Sensor Torque LoopTorque P (2548:01) + D (2548:06)Torque-Loop Friction0x2549 Ratio (0~100%)40 kHz FOC → Sensor FB0x300 16B FB / SDO 0x6077Measured joint torque τ_sensor real-time feedbackPath B · Sensorless Variant (Standard)Calibrated Joint Kt MapIq_base = τ_ref / Kt_joint_calMotion Friction Comp.0x2549 Ratio (Zero-vel gate)40 kHz FOC → Harmonic Out0x300 12B Estimated Torque
Fig. 2 · Identical upper-level MIT commands across both hardware variants; firmware routes to sensor torque loop or calibrated Kt path

2.1 Comparison of the Two Hardware Configurations​

Before commissioning, confirm which hardware configuration your module uses, as low-level execution, tunable parameters, and feedback frame lengths differ as follows:

DimensionModels With Joint Torque SensorStandard Models Without Torque Sensor
Low-Level Torque ExecutionEnters 4 kHz Torque Sensor closed loop, comparing measured joint torque in real time to compensate transmission nonlinearitiesConverts target torque directly to base current Iq_base via factory-calibrated equivalent torque constant
Inner-Loop Tunable ParametersSupports tuning Torque Loop P / D (0x2548) and Friction Compensation (0x2549)No inner torque loop (0x2548 unused); supports tuning Friction Compensation (0x2549)
Fast-Control Feedback Length0x300 + ID is 16 bytes (Byte10..11 returns measured joint torque)0x300 + ID is 12 bytes (Byte4..5 returns current-estimated torque in MIT mode)
Zero-Torque CalibrationSupports 0x2531 = 2 sensor zero-torque calibration and standalone torque closed-loop modeRequires standard Set Mechanical Zero (0x2531 = 1) only

2.2 Zero-Torque Check & Calibration on Sensor-Equipped Models (0x2531)​

Any Torque Sensor zero offset adds directly to the closed-loop target, causing slight unidirectional drift under zero command or asymmetric push/pull backdrive feel. Upon initial mounting or fixture changes, verify the sensor zero point while unloaded, free of external contact, and servo-disabled:

  1. Read Measured Joint Torque 0x6077:00 (INT16, resolution 0.05 N·m/LSB, e.g., raw 20 = 1.00 N·m):
    Tx (0x601, DLC=8): 40 77 60 00 00 00 00 00
    Rx (0x581, DLC=8): 4B 77 60 00 00 00 00 00 // Near 0 when unloaded indicates healthy zero offset
  2. Execute Zero-Torque Calibration If Needed (example for Dev_ID = 1; distinguish carefully from Set Mechanical Zero):
Calibration CommandSDO Request Frame (0x601)Description
Sensor Zero-Torque Calibration23 31 25 00 02 00 00 00Zeroes out joint Torque Sensor offset and saves to Flash (must be servo-disabled and unloaded)
Set Mechanical Zero (Position)23 31 25 00 01 00 00 00Sets current joint angle as position 0 only; does not alter Torque Sensor offset
Never Automate Zero-Torque Calibration on Every Power-Up

0x2531 = 2 is a mechanical installation/maintenance procedure. If executed automatically at boot while a robot limb bears gravity or rests against an obstacle, that external load will be recorded as zero torque, causing unintended torque output upon enabling.

Next-generation Joint Modules default to CAN FD mode (standard 11-bit ID, 1 Mbps arbitration / 5 Mbps data phase with Bit Rate Switch BRS enabled). Install one 120 Ω termination resistor at each physical end of the bus (~60 Ω measured between CAN_H and CAN_L unpowered).

For Joint Modules running CAN FD fast-control firmware (0x100A software version formatted as Vx.00.zz), we strongly recommend using the 0x210 multi-axis synchronous fast-control frame:

  • Drive 6 Axes Synchronously in One Frame: A single 64-byte (DLC = 15) broadcast frame dispatches MIT commands to up to 6 joints simultaneously, eliminating per-axis polling skew and bus arbitration overhead (a 12-DoF biped or quadruped requires alternating just two 0x210 frames).
  • Stateless Instant Control: Each axis sub-frame embeds servo enable, Brake Release, and fault reset bits, eliminating multi-step CiA 402 state-machine handshakes.
  • Immediate High-Speed Feedback: Upon unpacking its assigned slot, each target joint immediately replies with a 0x300 + Dev_ID real-time status frame.
  • Clean Separation of Config and Real-Time Traffic: Low-frequency tasks—reading full-scale ranges at boot or tuning Torque Loop P+D and Friction Compensation online—use standard SDO (0x600 + Dev_ID ⇄ 0x580 + Dev_ID).
CAN FD fast-control topology: the master broadcasts a single 0x210 (64B, DLC=15) frame to command up to 6 joints simultaneously with enable, brake release, and MIT 5-tuple (or 0x110+ID 12B for single-axis); each joint immediately replies with 0x300+ID feedback; low-rate config uses SDO 0x600+ID.Real-Time Robot MasterCAN FD · 1M / 5M BRSPreferred: 0x210 Multi64B sync for 1~6 joints(Single-axis: 0x110+ID 12B)Rx 0x300 + ID FeedbackPos · Vel · Torque/Iq · TempLow-Rate: SDO 0x600+ID1~5 ms cycle (Enable + Brake)Immediate 16B / 12B feedbackRead scales / Tune P+D & friction / SaveCAN FD Joint ActuatorsJoint Dev_ID = 1 (Slot 1)Unpack Byte 0..8 → Tx 0x301Joint Dev_ID = 2 (Slot 2)Unpack Byte 9..17 → Tx 0x302… Sync up to 6 joints / frame>6 axes: alternate two 0x210 groups
Fig. 3 · A single 64B 0x210 frame synchronously drives up to 6 joints and triggers immediate feedback, minimizing bus arbitration overhead

3.2 Step 1: Verify MIT Full-Scale Range Parameters (0x2542 ~ 0x2546)​

To pack five floating-point setpoints into a compact 8-byte payload, master packing and drive unpacking must share identical full-scale range constants, stored in Object Dictionary 0x2542 through 0x2546:

Object IndexParameterUnit & Factory DefaultAllowed Ceiling8B Payload Mapped Physical Span
0x2542:00P_MAX0.01 rad/LSB, default 314 (3.14 rad)1000 (10.00 rad)16 bit maps [-P_MAX, +P_MAX]
0x2543:00V_MAX0.01 rad/s/LSB, default 314 (3.14 rad/s)1000 (10.00 rad/s)12 bit maps [-V_MAX, +V_MAX]
0x2544:00KP_MAX1 N·m/rad/LSB, default 2500500012 bit maps [0, KP_MAX]
0x2545:00KD_MAX1 N·m·s/rad/LSB, default 50050012 bit maps [0, KD_MAX]
0x2546:00T_MAX1 N·m/LSB, default 30050012 bit maps [-T_MAX, +T_MAX]
  • Auto-Sync Scales on Power-Up: Have your master read 0x2542 ~ 0x2546 once via SDO during initialization (e.g., read P_MAX: 40 42 25 00 00 00 00 00) to populate your packing struct automatically and prevent scale mismatches.
  • Tighten Ranges to Boost Resolution: For example, R58 V3 has a peak torque around 43 N·m; if your application feedforward never exceeds 50 N·m, setting 0x2546 to 50 while disabled and saving to Flash improves feedforward quantization resolution by 6×.

3.3 Step 2: Core 8B Bit-Packing & Fast-Control Frame Layouts​

In both multi-axis and single-axis fast-control frames, each joint's command consists of a 1-byte fast-control word + 8-byte Big-Endian bit-packed MIT payload (forming a 9-byte axis sub-frame).

Top: big-endian bitfield packing of the 8-byte MIT payload (q_des 16-bit; dq_des, Kp, Kd, tau_ff 12-bit each). Bottom: byte layout of the 0x210 multi-axis 64B frame and 0x110+ID single-axis 12B frame.1. Core 8-Byte (64-bit) MIT 5-Tuple Payload — Big-Endian Packed Nibble EncodingByte 0Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7q_des (16 bit)Byte0 [15:8] | Byte1 [7:0]±P_MAX (0x2542)dq_des (12 bit)B2 + B3[7:4]±V_MAX (0x2543)Kp (12 bit)B3[3:0] + B40..KP_MAX (0x2544)Kd (12 bit)B5 + B6[7:4]0..KD_MAX (0x2545)τ_ff (12 bit)B6[3:0] + B7±T_MAX (0x2546)▲ Byte 3 shared nibble▲ Byte 6 shared nibble2. CAN FD Fast-Control Frame Encapsulation (Multi-Axis 0x210 & Single-Axis 0x110+ID)Multi-Axis (Rec.)0x210 · 64B (DLC=15)Byte 0..53: 6 Slots × 9B SubframesEach slot = 1B Ctrl (0xCC) + 8B MIT payload54..5500 00Byte 56..61Slot 1~6 IDs62..6300 00Single-Axis Fast0x110+ID · 12B (DLC=9)Byte 0: Ctrl ByteEn+Brake = 0xCCByte 1..8: 8-Byte MIT 5-Tuple PayloadByte 9..11: 00 00 00Pad to 12B frame
Fig. 4 · Each 9B single-axis subframe (1B Ctrl + 8B MIT payload) packs into the 64B 0x210 multi-axis frame or pads with 3 zeros as a 12B 0x110+ID frame

Inside the 8-byte MIT payload, fields are concatenated Big-Endian across nibble boundaries (p, v, kp, kd, t are linearly quantized unsigned integers):

Byte0 = (p >> 8) & 0xFF
Byte1 = p & 0xFF
Byte2 = (v >> 4) & 0xFF
Byte3 = ((v & 0x0F) << 4) | ((kp >> 8) & 0x0F)
Byte4 = kp & 0xFF
Byte5 = (kd >> 4) & 0xFF
Byte6 = ((kd & 0x0F) << 4) | ((t >> 8) & 0x0F)
Byte7 = t & 0xFF
Never Send an All-00 8-Byte MIT Payload

In bipolar unsigned quantization, raw code 0 maps to negative full scale (-P_MAX / -V_MAX / -T_MAX), whereas physical zero corresponds to mid-scale codes 0x8000 and 0x800. To guard against uninitialized zero buffers causing violent jumps, firmware rejects and drops any 8-byte payload consisting of all 00 bytes. The valid 8-byte encoding for zero position, zero velocity, zero gains, and zero feedforward is 80 00 80 00 00 00 08 00.

1. Fast-Control Word Encoding (Sub-Frame Byte 0)​

The first byte of every 9-byte sub-frame directly controls servo enablement, brake state, fault reset, and mode:

Bit FieldNameValue Definition
Bit 7Servo Enable1 = Request servo enable; 0 = Request controlled disable
Bit 6Brake Control1 = Brake Release; 0 = Engage mechanical brake
Bit 5Fault Reset0 → 1 rising edge clears latched faults whose physical cause is resolved
Bit 4 .. 1Fast-Control ModeFixed at 0x06 for MIT Impedance Control (0x07 for standalone Torque Sensor closed-loop)
Bit 0ReservedFixed at 0

Quick-reference byte values: 0xCC = MIT Enable + Brake Release; 0x0C = MIT Controlled Disable; 0x2C → 0x0C = Trigger fault clear while disabled.

2. Primary Frame: CAN FD Multi-Axis Synchronous Frame 0x210 (64 Bytes, DLC = 15)​

Transmit standard ID 0x210 (CAN FD + BRS enabled) at a fixed 1 ms ~ 5 ms cycle with 64 bytes, packing up to 6 joint slots per frame:

Byte RangeField DefinitionPacking Rule
Byte 0 .. 8Slot 1 Sub-Frame (9B)Byte 0 control word (e.g., 0xCC) + Byte 1..8 MIT 8B payload
Byte 9 .. 17Slot 2 Sub-Frame (9B)Control word + MIT 8B payload for 2nd target joint
Byte 18 .. 26Slot 3 Sub-Frame (9B)Control word + MIT 8B payload for 3rd target joint
Byte 27 .. 35Slot 4 Sub-Frame (9B)Control word + MIT 8B payload for 4th target joint
Byte 36 .. 44Slot 5 Sub-Frame (9B)Control word + MIT 8B payload for 5th target joint
Byte 45 .. 53Slot 6 Sub-Frame (9B)Control word + MIT 8B payload for 6th target joint
Byte 54 .. 55Reserved (2B)Fixed at 00 00
Byte 56 .. 61Slot Target ID MapTarget Dev_ID (1~127) for Slots 1 ~ 6 respectively; set unused slots to 00
Byte 62 .. 63Reserved (2B)Fixed at 00 00

For example, to synchronize only nodes 1 and 2, populate Slot 1 (Byte 0..8) and Slot 2 (Byte 9..17), set Byte 56..61 to 01 02 00 00 00 00, and zero-fill all remaining unused bytes.

3. Bench Debug Frame: CAN FD Single-Axis Frame 0x110 + Dev_ID (12 Bytes, DLC = 9)​

For single-joint bench testing, you can alternatively send 12 bytes (the smallest standard CAN FD payload size above 8 bytes, DLC = 9) to ID = 0x110 + Dev_ID:

Byte RangeField DefinitionPacking Rule
Byte 0Fast-Control Word (1B)Same as above: 0xCC for MIT Enable + Brake Release, 0x0C for Disable
Byte 1 .. 8MIT Payload (8B)8-byte Big-Endian 5-tuple packed payload
Byte 9 .. 11Length Padding (3B)Must pad with 00 00 00 to satisfy the 12-byte CAN FD DLC boundary

3.4 Interactive Frame Calculator / Hex Decoder & C99 Reference Code​

Verify your full-scale constants (0x2542 ~ 0x2546) in Step 1 of the widget below, then enter single-axis setpoints in Step 2: the widget outputs both the 0x210 multi-axis slot bytes (9B sub-frame + 1B ID slot) and the 0x110 + ID single-axis 12B frame. You can also switch to Paste HEX & Decode to inspect captured bus frames:

CAN FD MIT Frame Calculator & Packet Inspector

Step 1Verify Protocol Full-Scale Ranges (must match drive SDO 0x2542 ~ 0x2546)
Step 2Enter Single-Axis Control Parameters (step-by-step packing demo)
Ctrl Byte0 = 0xCC (Mode 0x06)
Quantized raw integers: p_raw=0x8000 (32768) · v_raw=0x800 (2048) · kp_raw=0x0C5 (197) · kd_raw=0x021 (33) · t_raw=0x800 (2048)
Multi-Axis Sync Frame 0x210 (64B, DLC=15) — Slot #1 Active Subframe
Active 9B Subframe → Write to Byte 0 .. 81B Ctrl + 8B Payload
CC 80 00 80 00 C5 02 18 00
Target Node ID → Write to Byte 56
01 (Dev_ID = 1)
00..15:CC80008000C502180000000000000000
16..31:00000000000000000000000000000000
32..47:00000000000000000000000000000000
48..63:00000000000000000100000000000000
Tip: For multi-axis control, place each joint’s 9B subframe into its slot (Byte 0..53) and write each target Dev_ID into Byte 56..61.
Single-Axis Fast Frame 0x111 (12B, DLC=9 · 9B subframe + 3 zero-pad bytes)
CC 80 00 80 00 C5 02 18 00 00 00 00
Click to Expand: Standard C99 Packing & Dual-Axis Synchronous Sine-Tracking Example (8B Payload / 0x210 Multi-Axis 64B / 0x110 Single-Axis 12B)
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>

typedef struct {
float p_max_rad; /* Matches 0x2542 * 0.01f, default 3.14f */
float v_max_rad_s; /* Matches 0x2543 * 0.01f, default 3.14f */
float kp_max_nm_per_rad; /* Matches 0x2544, default 2500.0f */
float kd_max_nm_s_rad; /* Matches 0x2545, default 500.0f */
float t_max_nm; /* Matches 0x2546, default 300.0f */
} MitScaleConfig_t;

typedef struct {
uint8_t dev_id; /* Target node ID 1~127; 0 skips this slot */
bool enable; /* true: servo enable, false: disable */
bool release_brake; /* true: Brake Release */
bool clear_fault; /* false -> true rising edge triggers fault reset */
float q_des_rad;
float dq_des_rad_s;
float kp_nm_per_rad;
float kd_nm_s_per_rad;
float tau_ff_nm;
} MitAxisCmd_t;

static uint16_t mit_float_to_uint(float x, float x_min, float x_max, uint8_t bits)
{
const float span = x_max - x_min;
if (!(span > 0.0f) || bits == 0U || bits > 16U) {
return 0U;
}
if (x < x_min) { x = x_min; }
if (x > x_max) { x = x_max; }

const uint32_t raw_max = (1UL << bits) - 1UL;
const uint32_t raw = (uint32_t)lroundf(((x - x_min) * (float)raw_max) / span);
return (uint16_t)((raw > raw_max) ? raw_max : raw);
}

static uint8_t mit_build_ctrl_byte(bool enable, bool release_brake, bool clear_fault)
{
uint8_t ctrl = (uint8_t)(0x06U << 1U); /* MIT fast-control mode code is fixed at 0x06 */
if (enable) { ctrl |= (1U << 7U); }
if (release_brake) { ctrl |= (1U << 6U); }
if (clear_fault) { ctrl |= (1U << 5U); }
return ctrl;
}

/* Pack core 8-byte MIT payload */
void mit_pack_payload8(const MitAxisCmd_t *cmd, const MitScaleConfig_t *scale, uint8_t out8[8])
{
const uint16_t p = mit_float_to_uint(cmd->q_des_rad, -scale->p_max_rad, scale->p_max_rad, 16U);
const uint16_t v = mit_float_to_uint(cmd->dq_des_rad_s, -scale->v_max_rad_s, scale->v_max_rad_s, 12U);
const uint16_t kp = mit_float_to_uint(cmd->kp_nm_per_rad, 0.0f, scale->kp_max_nm_per_rad, 12U);
const uint16_t kd = mit_float_to_uint(cmd->kd_nm_s_per_rad, 0.0f, scale->kd_max_nm_s_rad, 12U);
const uint16_t t = mit_float_to_uint(cmd->tau_ff_nm, -scale->t_max_nm, scale->t_max_nm, 12U);

out8[0] = (uint8_t)(p >> 8U);
out8[1] = (uint8_t)(p & 0xFFU);
out8[2] = (uint8_t)(v >> 4U);
out8[3] = (uint8_t)(((v & 0x0FU) << 4U) | ((kp >> 8U) & 0x0FU));
out8[4] = (uint8_t)(kp & 0xFFU);
out8[5] = (uint8_t)(kd >> 4U);
out8[6] = (uint8_t)(((kd & 0x0FU) << 4U) | ((t >> 8U) & 0x0FU));
out8[7] = (uint8_t)(t & 0xFFU);
}

/* Recommended: Pack 0x210 multi-axis synchronous 64-byte frame (CAN FD DLC = 15, up to 6 joints) */
void mit_pack_canfd_multi64(const MitAxisCmd_t slots[6],
const MitScaleConfig_t *scale,
uint8_t out64[64])
{
memset(out64, 0, 64U);
for (uint8_t i = 0U; i < 6U; i++) {
if (slots[i].dev_id == 0U || slots[i].dev_id > 127U) {
continue;
}
uint8_t *sub = &out64[i * 9U];
sub[0] = mit_build_ctrl_byte(slots[i].enable, slots[i].release_brake, slots[i].clear_fault);
mit_pack_payload8(&slots[i], scale, &sub[1]);
out64[56U + i] = slots[i].dev_id; /* Byte 56..61 stores target node IDs for Slots 1..6 */
}
}

/* Single-axis helper: Pack 0x110 + dev_id single-axis 12-byte frame (CAN FD DLC = 9) */
void mit_pack_canfd_single12(const MitAxisCmd_t *cmd,
const MitScaleConfig_t *scale,
uint8_t out12[12])
{
out12[0] = mit_build_ctrl_byte(cmd->enable, cmd->release_brake, cmd->clear_fault);
mit_pack_payload8(cmd, scale, &out12[1]);
out12[9] = 0x00U;
out12[10] = 0x00U;
out12[11] = 0x00U;
}

/* 1 kHz cyclic call example: Drive ID=1 and ID=2 synchronously along a sine wave via one 0x210 frame */
void mit_sync_two_axes_step_1khz(const float q_init_rad[2], float dt_s, const MitScaleConfig_t *scale)
{
static float t_sec = 0.0f;
MitAxisCmd_t slots[6] = {0};
uint8_t frame64[64];

const float amp_rad = 0.25f;
const float omega = 6.2831853f * 0.40f; /* 0.4 Hz */
t_sec += dt_s;

for (uint8_t i = 0U; i < 2U; i++) {
const float phase = omega * t_sec;
slots[i].dev_id = (uint8_t)(i + 1U);
slots[i].enable = true;
slots[i].release_brake = true;
/* Key dynamic trajectory rule: dq_des must equal the time derivative of q_des(t) */
slots[i].q_des_rad = q_init_rad[i] + amp_rad * sinf(phase);
slots[i].dq_des_rad_s = amp_rad * omega * cosf(phase);
slots[i].kp_nm_per_rad = 120.0f; /* On real hardware, ramp up from low stiffness in small steps */
slots[i].kd_nm_s_per_rad = 4.0f; /* Validate pure damping at Kp=0 first on real hardware */
slots[i].tau_ff_nm = 0.0f;
}

mit_pack_canfd_multi64(slots, scale, frame64);
/* Transmit via low-level CAN FD driver: Standard ID = 0x210, FD + BRS enabled, 64 bytes */
canfd_send_std_brs(0x210U, frame64, 64U);
}

3.5 High-Speed Fast-Control Feedback Frame (0x300 + Dev_ID)​

Upon receiving a matching fast-control command (or a 0x080 SYNC frame), the Joint Module immediately replies with a 0x300 + Dev_ID status frame (all multi-byte fields in this frame are Big-Endian):

Byte OffsetModels With Torque Sensor (16 Bytes, DLC=10)Models Without Torque Sensor (12 Bytes, DLC=9)
Byte 0 .. 1Joint output position INT16 (-32768..32767 maps -π..+π rad)Same (q_rad = raw × π / 32768)
Byte 2 .. 3Motor shaft speed INT16 (1 rpm/LSB; divide by gear ratio for joint speed)Same
Byte 4 .. 5Actual Iq current INT16 (1 mA/LSB standard; 10 mA/LSB on peak > 32.7 A models)Returns current-estimated joint torque in MIT mode
Byte 6 .. 7Active fault code UINT16 (0x0000 = normal)Same
Byte 8 .. 9Motor winding temperature INT16 (0.1 °C/LSB, e.g., 0x0118 = 28.0 °C)Same
Byte 10 .. 11Measured Torque Sensor joint torque INT16 (0.05 N·m/LSB)Byte 10: Mode (0x06); Byte 11: Status bits (upper 4 bits)
Byte 12 .. 14Reserved extension bytes (00 00 00)—
Byte 15Upper 4 status bits (b7 Enable / b6 Brake Release / b5 Fault / b4 Reached), lower 4 mode bits (0x06)—

Low-Frequency SDO Status Cross-Check (Note: SDO payloads are Little-Endian): 0x6064:00 Joint position (65536 LSB/rev) · 0x606C:00 Motor shaft speed (1 rpm/LSB) · 0x6077:00 Measured joint torque (0.05 N·m/LSB) · 0x6078:00 Actual Iq current · 0x603F:00 Fault code (see FC0001 V2.0 Error Codes & SDO Reading).

4. Torque Loop Tuning Guide (P + D, Torque-Sensor Models)​

On next-generation modules equipped with a joint Torque Sensor (such as the R58 V3 force-control variant), an independent 4 kHz Torque Sensor closed-loop controller runs inside the drive. Properly coordinating outer MIT impedance gains with inner Torque Loop P + D achieves both effortless backdrivability and harmonic-drive flexspline vibration suppression.

4.1 Inner vs. Outer Loop Roles & Coupling Relationship​

Left: nested hierarchy of outer MIT impedance loop (Kp/Kd) and inner sensor torque loop (0x2548:01 P, 0x2548:06 D). Right: torque step response comparison showing well-matched convergence, low-D ringing, and excessive P/D noise spikes.Outer vs. Inner Loop RolesOuter Loop: MIT Impedance (Kp / Kd)Sets task stiffness & motion damping(Updated every cycle via fast frame)Inner Loop: Sensor Torque (P + D)P (0x2548:01): torque tracking bandwidthD (0x2548:06): harmonic flexspline dampingCoupling: Effective Damping ∝ (P − 1) × DDamping = 0 at P = 1; re-check D after PTorque Step Response Comparisonτ_ref0Matched P+D (e.g. P≈2.4, D≈16): clean convergenceLow D: flexspline ringing (increase 0x2548:06)Excessive P/D: Iq noise spikes & audible whine
Fig. 5 · Outer MIT gains govern task compliance, while inner torque-loop P+D determine torque tracking bandwidth and resonance damping

Strictly distinguish inner Torque Loop parameters (0x2548) from outer MIT impedance parameters (Kp / Kd):

ParameterObject & ResolutionValid RangeCore Responsibility
Torque Loop P0x2548:01 (UINT16, 0.001/LSB)1000 ~ 20000 (1.000 ~ 20.000)Amplifies sensor torque tracking error, effectively scaling down reflected rotor inertia for lighter backdriving
Torque Loop D0x2548:06 (UINT32, 0.001 N·m·s/rad/LSB)0 ~ 10000000 (0 ~ 10000 N·m·s/rad)Injects active damping from relative torsion velocity between motor and output dual encoders to suppress flexspline resonance
MIT Kp / KdSent cyclically in fast-control frames0 ~ KP_MAX / 0 ~ KD_MAXDefines task-space macroscopic virtual spring Stiffness and motion viscous Damping
Critical Coupling Rule: Always Re-Check D After Changing P

Effective inner-loop active damping current gain scales proportionally with (Torque Loop P − 1) × Torque Loop D:

  1. When Torque Loop P = 1.000 (0x2548:01 = 1000), both torque-error amplification and inner Torque Loop D output drop to zero simultaneously.
  2. Changing Torque Loop P scales effective inner damping strength proportionally—always re-evaluate 0x2548:06 after modifying 0x2548:01.

4.2 Real-Time Online Tuning Procedure & SDO Examples​

Both 0x2548:01 and 0x2548:06 support online SDO writes while servo-enabled with immediate effect:

  1. Set Up Tuning State: Place the joint in MIT zero-gain state (Kp = 0, Kd = 0, τ_ff = 0) while monitoring measured torque and actual Iq waveforms.
  2. Tune Torque Loop P First: Starting from factory baseline (e.g., R58 V3 typical baseline P = 2.400, D = 16.000 N·m·s/rad), adjust 0x2548:01 in steps of 0.2 ~ 0.3 (raw 200 ~ 300). Roll back immediately if sensor noise amplification, high-frequency hand buzz, or audible whine occurs.
  3. Match Torque Loop D Next: Hold P constant, fine-tune 0x2548:06 in small steps while gently flicking and releasing the link until low-frequency elastic ringing decays rapidly without introducing high-frequency spikes on Iq.

Example SDO frames for Dev_ID = 1 reading/writing R58 V3 reference values P = 2.400 (2400 = 0x0960) and D = 16.000 (16000 = 0x00003E80):

OperationCAN IDData (HEX, Little-Endian)Frame Notes
Read Torque Loop P0x60140 48 25 01 00 00 00 00Replies 4B 48 25 01 60 09 00 00 (2400 = 2.400)
Write Torque Loop P = 2.40x6012B 48 25 01 60 09 00 002-byte write (2Bh), UINT16 Little-Endian 60 09
Read Torque Loop D0x60140 48 25 06 00 00 00 00Replies 43 48 25 06 80 3E 00 00 (16000 = 16.0)
Write Torque Loop D = 16.00x60123 48 25 06 80 3E 00 004-byte write (23h), UINT32 Little-Endian 80 3E 00 00
Advanced Option: Mechanical Resonance Notch Filter (0x2547:01 ~ 04)

When slender links or high-inertia end-effectors excite a fixed-frequency mechanical resonance, configure the 2nd-order Notch Filter while disabled and save to Flash:

  • 0x2547:01 (INT32): Notch Filter enable (0 = Disabled, 1 = Enabled).
  • 0x2547:02 (INT32): Center frequency (0.01 Hz/LSB, e.g., 1800 = 18.00 Hz).
  • 0x2547:03 (INT32): Quality factor Q (0.01/LSB, default 400 = 4.00).
  • 0x2547:04 (INT32): Attenuation depth (1%/LSB, range 0 ~ 100).

5. Friction Compensation Tuning & Flash Persistence (0x2549)​

5.1 Global Friction Compensation Ratio Mechanism​

Harmonic reducers exhibit static breakaway stiction and Coulomb friction steps during startup and low-speed reversals. Firmware provides unified online compensation scaling via 0x2549:00 (INT32, 1%/LSB, 0 ~ 100 for 0% ~ 100%):

Left: low-speed drag resistance curves under 0%, recommended 30%~60%, and excessive 0x2549 friction compensation ratios. Right: automatic friction compensation derating near phase current limit I_max to prioritize base control current.0x2549 Friction Ratio vs. Low-Speed DragDrag Torque ↑Vel. dq →0% Off: noticeable stiction step30%~60% Rec.: smooth & low dragToo high: coasting / creepR58 V3 ref: 30%; write 0 for smooth ramp-downCurrent Headroom Auto-DeratingPhase Limit I_max (e.g. 12.5 A)Fric. IqBase IqLight LoadClippedBase IqHeavy LoadBase IqComp = 0Full LimitControl torque prioritized; never exceeds I_max
Fig. 6 · Moderate friction compensation (typically 30%~60%) smooths low-speed backdrivability and automatically yields under heavy load
  1. Unified Across Both Hardware Paths: Scales inner torque-loop Friction Compensation on Torque-Sensor models, and scales the calibrated motor motion friction model on sensorless models (automatically freezing at rest to prevent zero-speed chatter), smoothing out low-stiffness MIT zero-crossing deadzones.
  2. Smooth Slew-to-Zero on Writing 0: Setting 0x2549:00 = 0 online ramps compensation current smoothly down to zero without torque steps.
  3. Automatic Heavy-Load Headroom Yielding: Friction Compensation utilizes only remaining current headroom below the peak phase-current ceiling; as base control current approaches the limit, compensation automatically yields to 0, never starving primary control torque.

5.2 Online Tuning Steps & SDO Frames​

0x2549:00 supports online SDO writes while servo-enabled with immediate effect:

  • Tuning Criterion: Starting from factory default (e.g., R58 V3 default 30%) or 0%, increment in 10% steps while gently pushing the link back and forth. Aim for smooth breakaway without stiction steps, while coming to an immediate natural rest upon release without coasting or unloaded creep (typical sweet spot: 25% ~ 60%).
  • Scope Reminder: Friction Compensation offsets internal transmission drag only—it cannot replace external link gravity Feedforward Torque τ_ff or 0x2531 = 2 Torque Sensor zero calibration.
Operation (Dev_ID = 1 Example)CAN IDData (HEX)Description
Read Friction Compensation ratio0x60140 49 25 00 00 00 00 00Reply 1E 00 00 00 indicates 30%
Write 40% compensation online0x60123 49 25 00 28 00 00 00Writes decimal 40 (0x28), takes effect immediately
Temporarily disable compensation (0%)0x60123 49 25 00 00 00 00 00Smoothly ramps compensation current to zero

5.3 Saving Parameters to Flash After Stopping (0x1010 / 0x2539)​

Online adjustments to 0x2548 and 0x2549, as well as staged changes to 0x2542 ~ 0x2546, must be saved to Flash to persist across power cycles:

  1. Disable and Stop the Motor First (send fast-control word 0x0C and confirm power stage is off).
  2. Send Save SDO Command (choose either method, shown for Dev_ID = 1):
    • Standard CiA 301 save signature (0x1010:01 = "save"): 23 10 10 01 73 61 76 65
    • Vendor quick-save (0x2539:00 = 1): 23 39 25 00 01 00 00 00
  3. Wait Quietly Before Power-Off: After receiving SDO response 60 ... on 0x581, keep power applied for ~500 ms without cutting power immediately. To restore factory defaults, write "load" to 0x1011:03 while disabled (23 11 10 03 6C 6F 61 64).

6. Six-Step Safe Hardware Commissioning Procedure​

When commissioning MIT mode on a test bench or robot for the first time, unlock control degrees of freedom strictly in the following six steps:

6-step MIT commissioning roadmap: Row 1: Step 1 Scales & Zero → Step 2 Zero-Gain Enable → Step 3 Pure Kd Check; Row 2: Step 4 Inner Loop & Friction → Step 5 Compliant Hold → Step 6 Motion & Feedforward.STEP 1Scales & ZeroRead 0x2542~2546 scales via SDOCheck & zero torque while disabledSTEP 2Zero-Gain EnableAlign q_des to measured angle qEnable safely with Kp=0, Kd=0STEP 3Pure Kd CheckKeep Kp=0 and target dq_des=0Step up Kd to feel viscous dampingSTEP 4Inner Loop & Fric.Tune 0x2548 torque-loop P & DAdjust 0x2549 friction comp. ratioSTEP 5Compliant HoldLatch constant target angle q_holdKeep Kd and ramp up stiffness KpSTEP 6Motion & τ_ffMatch dq_des to time derivative dqVerify sign, then blend in τ_ff
Fig. 7 · Follow Step 1 → Step 6 strictly on hardware: verify zero-gain and pure damping before engaging stiffness Kp and feedforward τ_ff
StepActionPass Criterion
Step 1 · Verify Scales & ZeroesRead 0x2542~0x2546 while disabled to sync master scales; check angle, fault code, and 0x6077 torque zeroStable feedback, fault code 0; run 0x2531 = 2 first if unloaded sensor offset is excessive
Step 2 · Zero-Gain Aligned EnableSet q_des = q_now, dq_des = Kp = Kd = τ_ff = 0; cyclically transmit 0x210 / 0x110+IDBrake Release (~100 ms), feedback mode reports 0x06 enabled, joint remains completely still
Step 3 · Pure Damping Push TestHold Kp = 0, dq_des = 0, τ_ff = 0; increment Kd in small steps starting from 0.5 N·m·s/radUniform viscous drag in both directions; settles smoothly without springback when released
Step 4 · Inner Loop & Friction TuneFine-tune 0x2548 (P+D) on sensor models and 0x2549 friction ratio on both model typesSmooth breakaway, rapid decay after light taps, no coasting on release, clean Iq without whine
Step 5 · Latched Compliant HoldLatch current angle once into constant q_hold, set q_des = q_hold, keep Kd, and increment KpSmooth restoring torque when pushed away, returning cleanly without overshoot
Step 6 · Dynamic Trajectory & FFEvolve q_des(t) smoothly with dq_des(t) = d(q_des)/dt; ramp in polarity-verified τ_ffLag-free tracking with ample current and thermal headroom
Common Pitfall: Never Overwrite q_des Every Cycle During Posture Holding

Initialize q_des from measured position only before enabling in Step 2. Once in Step 5 Compliant Hold, q_des must stay latched at fixed constant q_hold (or be updated independently by your trajectory planner). Executing q_des = q_meas inside your cyclic loop forces position error q_des - q to 0 permanently—producing zero stiffness force regardless of how large Kp is!

7. Extension: Full CANopen Mode Integration (0x500 + Dev_ID)​

If your Joint Module runs full CANopen firmware (0x100A software version formatted as Vx.10.zz) or your upper controller reuses standard CiA 402 state machine management, transmit MIT payloads via the dedicated 8-byte direct channel 0x500 + Dev_ID (note: Vx.00.zz fast-control firmware disables 0x500 + Dev_ID; both firmware families share identical SDO configuration and tuning dictionaries).

7.1 Operation Mode Code Comparison​

Mode numbers between standard CANopen Object Dictionary (0x6060 / 0x6061) and CAN FD fast-control frames map as follows:

Operation ModeCAN FD Fast-Control Mode (Byte0 / 0x300)Full CANopen Mode (0x6060 Write / 0x6061 Read)
MIT Impedance Control Mode0x0611 (0x0B)
Joint Torque Sensor Closed-Loop Mode0x07 (sensor models only)12 (0x0C) (sensor models only)

7.2 Full CANopen Enable & Cyclic Control Sequence​

Because 0x500 + Dev_ID carries only the raw 8-byte MIT payload (no controlword byte, built-in direct firmware channel requiring no 0x1603 PDO remapping), complete the standard CiA 402 handshake first and then refresh 0x500 + Dev_ID every 1 ms ~ 10 ms (an internal 50 ms command freshness timeout applies; example shown for Dev_ID = 1):

SeqCAN IDDLCData (HEX)Action & Status Verification
10x000201 01NMT Start Node 1 into Operational
20x60182F 60 60 00 0B 00 00 00Write 0x6060 = 11 (0x0B) to select MIT Impedance Control
30x60182B 40 60 00 06 00 00 000x6040 = 0x0006 (verify (0x6041 & 0x006F) == 0x0021)
40x60182B 40 60 00 07 00 00 000x6040 = 0x0007 (verify (0x6041 & 0x006F) == 0x0023)
50x501880 00 80 00 00 00 08 00Pre-send zero-gain 8B frame aligned to current angle (use pure 8B mode in Section 3.4 widget)
60x60182B 40 60 00 0F 00 00 000x6040 = 0x000F (verify (0x6041 & 0x006F) == 0x0027 and 0x6061 == 11)
70x5018(Cyclically updated 8B MIT payload)Refresh 8B payload every 1 ~ 10 ms; write 0x6040 = 0x0006 to stop

For general TPDO feedback mapping and bit-rate configuration under full CANopen, refer to PR0002 Joint Module CAN FD / CANopen Protocol Quick Guide and TN0002 CANopen Communication Extended Features.

8. Frequently Asked Questions (FAQ)​

Q1: Why does the joint neither respond nor reply on 0x300 + ID when sending fast-control frames?​

  1. Check Frame Byte Length & FD/BRS Flags: 0x210 must be 64 bytes (DLC = 15), 0x110 + ID must pad 3 trailing zero bytes to 12 bytes (DLC = 9), and both CAN FD and BRS must be enabled.
  2. Check the 0x210 Target ID Map: When sending 0x210, verify Byte 56..61 contains the target Dev_ID for each populated slot (if left 00, every joint ignores the frame).
  3. Check Firmware Variant & Non-Zero Payload: Read 0x100A via SDO to confirm fast-control firmware Vx.00.zz, verify the 8B MIT payload is not all 0x00, and read 0x603F to rule out active faults such as undervoltage or limit alarms.
  1. Unaligned Initial Angle Before Enabling: If the joint rests at 0.8 rad and the master enables with q_des = 0 and non-zero Kp, an immediate step torque occurs. Always initialize q_des from measured position and enable with Kp = 0.
  2. Mismatched Full-Scale Constants: Verify P_MAX ~ T_MAX in your master code match SDO readbacks from 0x2542 ~ 0x2546 exactly.

Q3: Why is manual backdriving heavy, buzzing slightly, or slowly creeping after release?​

  1. Asymmetric Push/Pull Resistance: On Torque-Sensor models, inspect 0x6077 unloaded while disabled; if non-zero offset exists, execute 0x2531 = 2 zero-torque calibration.
  2. Sticky Breakaway Feel: Increase 0x2549:00 Friction Compensation ratio in 10% increments.
  3. High-Frequency Buzz or Post-Release Coasting: For high-frequency buzz or whine, step down outer MIT Kd or inner 0x2548 Torque Loop P / D; if the link keeps coasting after a light push, 0x2549:00 is over-compensated—reduce it by 10% ~ 15%.