Configuration
Speed and Acceleration Limits
Set speed and acceleration limits for the 7 joints.
from realhand import A7
with A7(side="left", interface_name="can0") as arm:
arm.enable()
# Set the speed limit of all joints to 1.0 rad/s
arm.set_velocities([1.0] * 7)
# Set acceleration limits individually
arm.set_accelerations([10.0, 9.0, 8.0, 7.0, 6.0, 5.0, 4.0])
| Method | Parameter | Range | Description |
|---|---|---|---|
set_velocities(velocities) | Velocity limits for 7 joints (rad/s) | [0.0, 50.0] | Default 0.5 |
set_accelerations(accelerations) | Acceleration limits for 7 joints (rad/s²) | [1.0, 50.0] | Default 10.0; sets acceleration and deceleration together |
Exception: ValidationError (exactly 7 values are required, and all values must be within range)
PID Parameter Settings
Set PID parameters for the 7 joints.
from realhand import A7
with A7(side="left", interface_name="can0") as arm:
arm.set_position_kps([100.0] * 7)
arm.set_velocity_kps([0.5] * 7)
arm.set_velocity_kis([0.01] * 7)
| Method | Parameter | Description |
|---|---|---|
set_position_kps(kps) | Position Kp values for 7 joints | Proportional gain of the position loop |
set_velocity_kps(kps) | Velocity Kp values for 7 joints | Proportional gain of the velocity loop |
set_velocity_kis(kis) | Velocity Ki values for 7 joints | Integral gain of the velocity loop |
Parameter Quick Reference
| Parameter type | Default | Range |
|---|---|---|
| Speed limit | 0.5 rad/s | [0.0, 50.0] rad/s |
| Acceleration limit | 10.0 rad/s² | [1.0, 50.0] rad/s² |
move_l max linear speed | 0.05 m/s | (0, 0.4] m/s |
move_l max angular speed | 0.3 rad/s | (0, 3.0] rad/s |
move_l linear acceleration | 0.1 m/s² | (0, 1.0] m/s² |
move_l angular acceleration | 0.1 rad/s² | (0, 1.0] rad/s² |
Example
Move After Setting PID, Speed, and Acceleration Limits
from realhand import A7
with A7(side="left", interface_name="can0") as arm:
arm.set_position_kps([80.0] * 7)
arm.set_velocity_kps([0.4] * 7)
arm.set_velocity_kis([0.008] * 7)
arm.enable()
arm.set_velocities([1.0] * 7)
arm.set_accelerations([10.0] * 7)
arm.home(blocking=True)
arm.move_j([0.0, 0.0, 0.0, 1.57, 0.0, 0.0, 0.0], blocking=True)
Parameter Persistence
Call save_params() to write the current PID, speed, acceleration, and related parameters to motor flash so they remain effective after power loss.
from realhand import A7
with A7(side="left", interface_name="can0") as arm:
arm.set_position_kps([80.0] * 7)
arm.set_velocity_kps([0.4] * 7)
arm.save_params() # Save to flash
Note: Each write takes about 1 ms. Avoid calling this in real-time control loops.