calculator | ||
images | ||
_config.yml | ||
LICENSE | ||
README.md |
Quick SHFW Configuration Walkthrough
SHFW is a custom firmware available for flashing via the Scooterhacking Utility app. Configuring it might be challenging for new users. This guide aims to provide a quick and easy way to apply the important basics. The understanding aspect of all this can be overwhelming, but it will come as a side effect of your own testing and thinking as we can't do that for you.
Installation
To install SHFW, follow these steps:
-
Download the flashing app from https://utility.cfw.sh/.
-
Supported Scooter Models:
-
Ninebot G30: You can flash this firmware if the DRV version is at 1.7.0 or below. If your DRV is above 1.7.0 and not higher than 1.7.3, you need to select "Attempt Downgrade". For DRV versions above 1.7.3, you'll need an ST-link. Refer to https://joeybabcock.me/wiki/STLink_Ninebot_Max_ESC for more information.
-
Xiaomi Scooters: If the BLE version is at or above 1.5.0, you'll need an ST-link for the dashboard. There are online guides available for this process.
-
Ninebot EsX and Ex Series: You can flash this firmware if the DRV version is below 2.7.0. Else you will need to use a st-link. There are online guides available for this process.
-
Ninebot F-Series: You can flash this firmware if the DRV version is below 5.7.0. Else you will need to use a st-link. There are online guides available for this process.
-
Ninebot D-Series: There is an experimental support for D-Series using the F-Series firmware. It's not known at which DRV version you will need a St-link. The guides should be identical to the F-Series.
-
-
Flash Procedure:
- Ensure you have the correct scooter model.
- Open the utility app, connect to the scooter.
- Press "Load Custom" and select SHFW.
- For G30, it's recommended to select the 187 DRV base.
- If you have the new G30 motor then select the new motor option under the system config tab as well.
Note: The number in the firmware name indicates the base DRV.
Usage
Please be aware that the information provided below is intended for practical use, but it should be used with caution. Remember, field weakening, because of its nature, will not be efficient.
Ninebot G30
To achieve the top speed for Ninebot G30, follow these configurations:
-
Set sport DPC curve to 30A with a flat curve (0.0 linear).
- Configure the other modes as desired, preferably lower than sport for logical reasons.
- Set the brake to 40A with a flat curve.
- Set speed limit to off / 0.
-
Go to the field weakening tab and:
- Enable field weakening for sport mode.
- Configure as follows: 20 km/h, 0A, 1500.
- If it isn't reaching the performance you expected then consider settings initial amps to 5 instead.
-
Default tire size for G30 models are 10", but set 9.3" to get the dash speed to match GPS speed.
Xiaomi Pro 2, 3
For Xiaomi Pro 2 and mi3, use the following configurations:
-
Sport mode, DPC, 27A, flat curve (0.0 linear).
-
Go to the field weakening tab and:
- Enable field weakening for sport mode.
- Configure as follows: 20 km/h, 0A, 1300.
Xiaomi Essential, Lite, 1S
For Xiaomi Essential Lite, use these configurations:
-
Sport mode, DPC, 16A, flat curve (0.0 linear).
-
Go to the field weakening tab and:
- Enable field weakening for sport mode.
- Configure as follows: 13 km/h, 0A, 1000.
The rest of the configurations are up to you. Feel free to explore and set up profiles according to your preferences. Your imagination is the limit.
Field Weakening Calculations and Logic
What is Field Weakening?
Field weakening is a technique commonly used with 3-phase electric motors to achieve higher speeds in electric vehicles like scooters. It allows the motor to operate beyond its rated voltage and rpm, which can result in increased top speed. However, implementing field weakening comes with trade-offs, including increased battery usage, higher motor temperatures, and potential additional expenses.
Field Weakening Flux Calculation
The calculation for field weakening flux is as follows:
field weakening flux = initial + ("current speed" - "field weakening start speed") * (variable / 1000)
initial
: The initial value of the field weakening flux."current speed"
: The current speed of the scooter."field weakening start speed"
: The speed at which field weakening should start.variable
: A parameter that influences the rate of flux increase.
Here's a graph of the flux current applied at various speeds comparing the following 2 setups:
- 7A initial current, 24km/h start speed, 1500mA/km/h variable current
- 0A initial current, 24km/h start speed, 1500mA/km/h variable current
Recommended Field Weakening Settings
As per my experience and testing, it's recommended to keep the initial value at 0 and adjust the other parameters to achieve around 30-35A of requested flux. This range is believed to provide the best riding experience while balancing performance and safety. The calculations and principles discussed in this section have been applied to configure the examples for the scooter models listed in this guide. These settings can vary depending on the specific scooter model and user preferences.
Custom batteries and BMS emulation
After installing a custom battery in specific scooter models, you might notice that the display no longer shows the battery charge percentage. This occurs because the scooter's original Battery Management System (BMS) uses a communication cable to provide this information, among other functions. As a workaround, BMS emulation can be employed. This method calculates the battery's charge level based purely on the system's voltage, a viable approach due to the linear relationship between voltage and charge state.
For configuration, access the Utility app and navigate to the 'Config' tab. Here, you will find the BMS emulation option towards the bottom. In this section, enter the details of your battery, including the number of series groups and the total capacity. It's crucial to ensure the minimum and maximum cell group voltages are set correctly, ideally matching or being more conservative than those specified by your BMS. The voltage range for a Li-Ion cell typically spans from 3 to 4.2V, but your BMS may have specific cutoff limits for charging and discharging. Adjust these settings according to your BMS's limits or opt for the default if uncertain.
Note, BMS emulation is necessary only if you've completely replaced the original battery. If you've added an additional pack in series with matching or higher capacity, or if you have another battery in parallel, BMS emulation is not required. In cases of parallel battery configurations, the primary adjustment needed is to disable the charging mode, which can be found in the system settings. This guide aims to facilitate a seamless transition to custom battery usage, ensuring optimal performance and compatibility.
Given:
V_min
= Minimum voltage of the battery pack when fully discharged.V_max
= Maximum voltage of the battery pack when fully charged.V_current
= Current voltage of the battery pack.
The formula to calculate the battery percentage (Battery_%
) is:
Battery_% = ((V_current - V_min) / (V_max - V_min)) * 100
Where:
Battery_%
is the state of charge of the battery pack as a percentage.V_min
is the total voltage of the pack when all cells are at their minimum voltage.V_max
is the total voltage of the pack when all cells are at their maximum voltage.V_current
is the current total voltage of the battery pack.
Upcoming Features
To clarify, none of these features mentioned below are in any way guaranteed to be kept in the final release or guaranteed to be kept working the way described below.
-
Adjustable PWM Frequency for Motor: Set the motor frequency from 4kHz to 24kHz for reduced acoustic noise and improved motor performance, with a note on potential efficiency changes and increased switching losses.
-
Brake Boost
- Brake boost is designed to significantly enhance e-brake performance, delivering powerful and responsive braking capabilities. However, it's essential to exercise caution when utilizing this feature. Excessive use of brake boost can lead to wheel lock-up, which, in turn, can have a detrimental impact on overall braking distance and stability. This situation is particularly concerning for riders who need to maintain control during emergency braking scenarios. Furthermore, front-wheel-drive (FWD) scooter users, such as Xiaomi riders, should be especially mindful when applying brake boost. Incorrect usage of this setting can potentially result in the scooter's back wheel lifting, leading to a front flip if not managed properly. Striking a balance between increased braking power and maintaining safe and controlled braking performance is paramount.
-
Acceleration Boost
- Acceleration boost provides additional torque in low RPM scenarios, significantly enhancing the scooter's overall performance and acceleration. This feature delivers an exhilarating and responsive riding experience. Users are encouraged to experiment with this setting to determine the level of acceleration that best aligns with their preferences. However, it's crucial to exercise caution, particularly in situations where traction and control are critical.
-
Further Customization
-
Field Weakening
- Flux Til Start: This setting provides a static amount of flux up until the field weakening activation speed. It can offer additional acceleration speed at the expense of slight vibration and increased battery usage.
- The option to dynamically trade flux current to torque current has also been added. Mostly meant for those that want flux for acceleration purposes instead of maxing out top speed.
-
Phase Limits
- Phase limits are customizable for torque and flux. The default settings are 65A for torque and 30A for flux.
-
ADC modding info (G30)
Special thanks to Lothean for providing valuable information on the R_adc logic.
Note1: Make sure to adjust R_adc, as it plays a significant role in ADC modding. Note2: You can also measure your battery voltage and then increase the divider voltage until the system voltage reading matches your previous meassuring. Note3: You only need to touch this setting once you changed the resistors on the esc.
Contributors
- lekrsu - Main contributor and architect.
- Paul - Added valuable insights and documentation.
- BXLR - Instrumental in development, making everything possible. Kudos!
- Edex - Provided critical support and logic validation.
- Lex - Supplied essential images and visuals.
- PureComedi - Ensured top-notch grammar and structural integrity.
A big thank you to everyone who has contributed to making this project a success!
License
This project is licensed under the MIT License.
Please review the LICENSE file for detailed terms and conditions.
Note: The MIT License is applied to this project. While it allows for wide use and modification, it comes with no warranties or guarantees. The project contributors and maintainers are not responsible for any issues, damages, or liabilities that may arise from the use of this software.
Author Information
This guide has been written by lekrsu, who can be reached on Discord with the tag lekrsu
and on Telegram with the username lekrsu
. You're welcome to send a pull request if you feel like the information needs correction.