The Set Speed command is used to set the motor controller’s target ERPM. The motor controller’s current operating mode will be set to SPEED mode. The command timeout counter is reset when this command is received.
Command Parameters
Parameter | Units | Description |
---|---|---|
Speed | ERPM | Target motor speed, in ERPM. This value is the desired motor shaft speed in RPM multiplied by half the number of motor poles. For example, to command a three-pole motor to 5000 RPM, you command an ERPM value of 7500 ERPM. |
[reveal1 title=”Web App”]
- Switch to
Operate
tab - From the
Control Mode
selection box, selectSpeed Control
- Under
Speed Control
, specify a minimum and maximum commandable ERPM - a. Drag the slider to change the commanded speed
OR
b. Type a speed value into the manual entry box and clickSet Speed
[/reveal1]
[reveal1 title=”Serial Interface”]
This command follows the standard VESC serial packet format.
Command Structure
Byte | Datatype | Value | Scaler | Description |
---|---|---|---|---|
0 | uint8 | 0x02 | Packet start byte | |
1 | uint8 | 0x05 | Packet length | |
2 | uint8 | 0x08 | Packet ID [COMM_SET_RPM] | |
3 | int32 | 1 | Target ERPM | |
7 | uint16 | CRC16 of data section | ||
9 | uint8 | 0x03 | Stop byte |
Command Examples
The following table shows an example command to set the target RPM to 3000 ERPM.
Start Byte | Length | PID | ERPM | CRC16 | End Byte | |
---|---|---|---|---|---|---|
Hex | 0x02 | 0x05 | 0x08 | 0x00000BB8 | 0xF804 | 0x03 |
Integer | 2 | 5 | 8 | 3000 | 63492 | 3 |
The following table shows an example command to set the target RPM to -3000 ERPM.
Start Byte | Length | PID | ERPM | CRC16 | End Byte | |
---|---|---|---|---|---|---|
Hex | 0x02 | 0x05 | 0x08 | 0x FFFFF448 | 0x9024 | 0x03 |
Integer | 2 | 5 | 8 | -3000 | 36900 | 3 |
Command Response
There is no response for this command.
[/reveal1]
[reveal1 title=”CAN Bus Interface”]
This command follows the standard VESC CAN command frame format.
Packet Identifier: | 0x03 |
Data Length Code: | 4 |
Contents: | [int32] Target ERPM |
Command Response
There is no response for this command.
[/reveal1]