Limiting speed and cruise control in VESC: Max ERPM, profiles, and cruise control settings
In VESC, the maximum speed is not set in km/h, but in electric revolutions per minute (RPM), using the `Max ERPM` parameter. The speed controller, on the other hand, is an optional button on the ADC input that maintains the speed as long as it is active. These two functions are often confused: the first sets a maximum limit, while the second maintains a specific speed. This guide explains both, with the exact names used in VESC Tool and their limitations.
The essentials
- The speed limit is adjusted in the Motor Settings, General tab, under the RPM section: Max ERPM and Max ERPM Reverse.
- ERPM Limit Start makes the limit transition gradual rather than abrupt.
- Beyond the set speed limit, the controller cuts off power to the motor; it does not apply the brakes. When going downhill, the vehicle can exceed the set speed.
- The cruise control feature requires a wired button connected to the controller and only functions in current mode.
- On public roads, an electric scooter is limited to a speed of 25 km/h.
Why ERPM (revolutions per minute) and not km/h (kilometers per hour)?
The controller only knows about its motor. It measures the electrical rotational speed, referred to as ERPM (electrical revolutions per minute): this is the mechanical speed of the motor multiplied by its number of pole pairs. A 30-pole motor (15 pairs) rotating at 1,000 revolutions per minute, for example, would have an ERPM of 15,000.
To convert ERPM (revolutions per minute) to motor speed, you need three pieces of information: the number of motor poles, the gear ratio (if any), and the wheel diameter. The VESC Tool requests these values in the Motor Settings, Additional Info section, on the Setup tab: Motor Poles, Gear Ratio, and Wheel Diameter. On a direct-drive scooter (motor-wheel), the gear ratio is 1. With these correct values, the mobile application can display and adjust the speed in km/h.
The calculation is straightforward: speed in km/h = ERPM ÷ number of pole pairs ÷ gear ratio × wheel circumference in meters × 60 ÷ 1000. Measure the actual diameter of the inflated tire, not the marked diameter: the difference will be noticeable in the calculated speed.
Adjust the speed limit
In the Motor Settings section, under the General tab, in the RPM area:
- Max ERPM: The maximum electrical revolutions per minute in forward gear.
- Max ERPM Reverse: The same applies in reverse (negative value).
- ERPM Limit Start: A fraction of the limit (between 0 and 1) from which the current begins to decrease. The lower this fraction, the more gradually the limit is reached.
The public firmware applies the limit as follows: Under the "ERPM Limit Start" setting, the maximum motor current is available; between this setting and "Max ERPM", it gradually decreases; at "Max ERPM", the acceleration current drops to zero. The motor no longer provides power, but it does not brake.
What the limit does not do
Since the controller cuts power without braking, even a slight downhill slope can cause the vehicle to exceed the set speed. The speed limit prevents the motor from propelling the vehicle faster; it doesn't actively hold it back. Only the rider, using the brakes, controls the speed when going downhill.
If the machine has two controllers, each has its own motor configuration: the limit must be set on both. See our guide on dual-motor VESC systems using CAN.
Mobile app profiles
The VESC Tool on your phone offers a Profiles tab. A profile groups together a Speed Limit (for forward and reverse, displayed in km/h based on the information in the Setup tab), a Motor Current Scale in percentage for acceleration and braking, and an optional power limit (Enable Power Limit). The Read current configuration button retrieves the current values.
Profiles are useful for switching from a road setting to a closed-track setting without having to adjust the entire configuration. They rely on the same parameters: Max ERPM, current scales, and power limits.
The speed controller (cruise control)
The regulator is an option within the ADC (Analog-to-Digital Converter) application, which reads a trigger or throttle. In App Settings, ADC, on the General tab, the field for button inputs (Button Inputs in firmware 6.0x, renamed Input Config in subsequent development versions) contains the Enable Cruise Control checkbox, and Invert CC Button to invert the polarity of the button.
According to the VESC Tool help documentation, the operation is as follows:
- The button connects to the TX pin of the communication port when only the ADC application is active (the RX pin is used for the reverse button)
- When both the ADC and UART applications are active simultaneously, the servo input (PPM) functions as a button
- The controller maintains the motor's speed as long as the button is active, even when the throttle is released, and when a current control mode is being used.
To maintain speed, the controller switches to speed regulation using the gains from the Motor Settings section, specifically the PID Controllers (Speed PID Kp, Speed PID Ki, Speed PID Kd). The Allow Braking option on this page allows the regulator to brake in order to maintain speed, for example, when going downhill. With poorly adjusted gains, the speed will oscillate; check this first with the front wheel raised, then on a clear course.
Attention: The button is read as a state, not as a momentary press. A button that remains active by mistake, or a poorly wired input, will maintain the speed. Always test the behavior when releasing the button before riding.
| Need | VESC Tool settings | Where? |
|---|---|---|
| Limit the speed | Maximum ERPM, ERPM Limit Start | Motor Settings, General, RPM |
| Display in km/h | Motor Poles, Gear Ratio, Wheel Diameter | Motor Settings, Additional Information, Setup |
| Quickly change settings | Speed Limit, Motor Current Scale | Mobile application, Profiles |
| Maintain a constant speed | Enable Cruise Control | App Settings, ADC, General |
| Adjusting speed stability | Speed PID: Kp, Ki, Kd. Allow braking | Motor Settings, PID Controllers |
And what about the law?
On public roads, the maximum allowed speed for an electric scooter (motorized PMD) is 25 km/h, as reminded by service-public.fr. A speed limit set in the VESC Tool can be modified by anyone who connects to the controller; it does not make a powerful machine compliant. Settings beyond this limit are reserved for private tracks and terrains: see our guide on unlocked scooters, the law, and the track, and our section E'trott racing for riding fast in a suitable environment.
Workshop tip
Before relying on the calculated speed, verify it with a GPS. An approximate wheel diameter or an incorrect number of poles will throw off the calculation. Also, adjust the speed limit on each controller of a dual-motor machine. If you prefer us to handle this, our workshop offers this service on an hourly basis (https://rage-mechanics.com/en/our-products/1529-labor-30-minutes.html).
Frequently Asked Questions
Why does my electric scooter exceed the set speed limit when going downhill?
Because the Max ERPM setting reduces the current used for acceleration but doesn't affect braking. The slope of the road takes care of the rest. This is the normal behavior of the firmware.
How do you convert kilometers per hour (km/h) to electric revolutions per minute (ERPM)?
To calculate the motor's RPM, divide the wheel speed in meters per minute by the wheel's circumference to get the wheel rotations per minute. Then, multiply that result by the gear ratio and the number of motor pole pairs. The mobile app will perform this calculation for you if the "Setup" tab is properly filled in.
Does the speed controller work without a button?
No, the ADC triggers it via a button input. Without a wired button, it remains inactive even if the "Enable Cruise Control" box is checked.
Does the controller remain active when I brake?
It remains active only if the throttle is released and the active button is pressed. On your machine, with the wheel raised, verify that the brake properly reasserts control and that releasing the button cuts off the motor control.
Does setting a speed limit of 25 km/h in the VESC Tool make my scooter legal?
Not necessarily. The speed limit is just one of the regulations that apply to electric personal mobility devices (EDPMs), and a software setting that can be modified does not constitute approval. Please refer to service-public.fr for more information.