Tutorial 03: Mode Switch and Command Sending
Prerequisites
- Completed Tutorial 02: Enable and Status
- Motor enabled and providing feedback
Control Modes Overview
The SDK supports four unified control modes:| Mode | Description | Key Parameters |
|---|---|---|
MIT | Full impedance control | pos, vel, kp, kd, tau |
POS_VEL | Position with velocity limit | pos, vlim |
VEL | Pure velocity control | vel |
FORCE_POS | Compliant position control | pos, vlim, ratio |
Mode Selection Guide
Mode Switching
Basic Mode Switch
Mode Switch with Error Handling
MIT Mode
MIT mode provides full impedance control with five parameters:Parameters
| Parameter | Unit | Description | Typical Range |
|---|---|---|---|
pos | rad | Target position | -PMAX to +PMAX |
vel | rad/s | Target velocity | -VMAX to +VMAX |
kp | Nm/rad | Position stiffness | 0.1 - 100 |
kd | Nm·s/rad | Velocity damping | 0.01 - 10 |
tau | Nm | Feedforward torque | -TMAX to +TMAX |
Basic MIT Control
Position Sweep with MIT
Torque Control with MIT
Position-Velocity Mode
Simple position control with velocity limit.Parameters
| Parameter | Unit | Description |
|---|---|---|
pos | rad | Target position |
vlim | rad/s | Maximum velocity |
Basic Usage
Point-to-Point Motion
Velocity Mode
Pure velocity control for continuous rotation.Parameters
| Parameter | Unit | Description |
|---|---|---|
vel | rad/s | Target velocity |
Basic Usage
Velocity Ramp
Force Position Mode
Compliant position control with force ratio.Parameters
| Parameter | Unit | Description |
|---|---|---|
pos | rad | Target position |
vlim | rad/s | Velocity limit |
ratio | - | Force ratio (0.0-1.0) |
Gripper Example
Control Loop Patterns
Fixed-Rate Control Loop
State-Based Control
Vendor Mode Support
Check vendor support before using modes:Complete Example
Next Steps
- Tutorial 04: Multi-Motor Control - Control multiple motors
- Mode API - Mode enum reference
- Motor API - Command methods
- Vendor Capability Matrix - Vendor feature support