Set Speed

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

ParameterUnitsDescription
SpeedERPMTarget 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”]

  1. Switch to Operate tab
  2. From the Control Mode selection box, select Speed Control
  3. Under Speed Control, specify a minimum and maximum commandable ERPM
  4. a. Drag the slider to change the commanded speed
    OR
    b. Type a speed value into the manual entry box and click Set Speed

[/reveal1]

[reveal1 title=”Serial Interface”]

This command follows the standard VESC serial packet format.

Command Structure

ByteDatatypeValueScalerDescription
0uint80x02Packet start byte
1uint80x05Packet length
2uint80x08Packet ID [COMM_SET_RPM]
3int321Target ERPM
7uint16CRC16 of data section
9uint80x03Stop byte

Command Examples

The following table shows an example command to set the target RPM to 3000 ERPM.

Start ByteLengthPIDERPMCRC16End Byte
Hex0x020x050x080x00000BB80xF8040x03
Integer2583000634923

The following table shows an example command to set the target RPM to -3000 ERPM.

Start ByteLengthPIDERPMCRC16End Byte
Hex0x020x050x080xFFFFF4480x90240x03
Integer258-3000369003

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]