Controller Programming - Lishui
Open your controller case. Look for a 4-pin header labeled:
Some models use a 6-pin JST connector. If unlabeled, trace the pins back to the MCU. Pins PB13 (SWCLK) and PB14 (SWDIO) are common on STM32F103 chips.
Checklist before programming:
Lishui controller programming is a powerful skill that turns a generic, restricted electric scooter into a personalized performance machine. With a $10 ST-Link dongle, a bit of patience, and the guidance above, you can adjust speeds, currents, and throttle feel to your exact liking.
However, respect the hardware. The engineers at Lishui set limits for a reason: thermal dissipation, MOSFET safe operating area (SOA), and battery C-rating. Incremental changes (10–20% over stock) are usually safe. Doubling currents is a recipe for smoke.
If you are a beginner, start by backing up your firmware and simply adjusting the throttle curve or reducing the regenerative braking strength. As you gain experience, move on to speed derestriction and battery upgrades.
The world of PEV modding is exciting, but it begins with understanding the brain of your vehicle. Happy programming—and ride safely.
Resources: Join the "Lishui Controller Tuning" group on Telegram or Reddit’s r/ElectricScooters for firmware dumps and user-submitted parameter maps. Always verify any hex patch against your specific controller PCB revision.
Introduction
Lishui controllers are popular electronic speed controllers (ESCs) used in various applications, including robotics, automation, and industrial control systems. Programming a Lishui controller requires a basic understanding of programming concepts and the specific commands used by the controller. This guide provides a step-by-step introduction to Lishui controller programming.
Hardware Requirements
Software Requirements
Basic Programming Concepts
Programming Steps
Common Commands
Programming Examples
#include <SoftwareSerial.h>
SoftwareSerial serial(2, 3); // RX, TX
void setup()
serial.begin(115200);
void loop()
// Set speed to 50%
serial.print("\x55\xAA\x01\x00\x32");
serial.println();
delay(100);
// Get current speed
serial.print("\x55\xAA\x02");
serial.println();
delay(100);
import serial
ser = serial.Serial('COM3', 115200)
# Set speed to 75%
ser.write(b'\x55\xAA\x01\x00\x4B')
# Get current speed
ser.write(b'\x55\xAA\x02')
Troubleshooting
Conclusion
Here’s a sample review for Lishui controller programming (common in e-bikes, scooters, and industrial motors), based on typical user experiences:
Title: Solid performance for the price – but documentation could be better
Rating: ⭐⭐⭐⭐ (4/5)
I’ve been programming Lishui controllers for several months now, mostly for e-bike conversions. Here’s my honest take:
Pros:
Cons:
Verdict:
If you’re comfortable experimenting and searching online communities (Endless Sphere, Reddit), Lishui controllers are a great DIY option. For beginners, be prepared for a learning curve.
Tip: Always back up the stock firmware before changing anything – recovery mode isn’t clearly explained!
Would you like a shorter version or one focused on a specific use case (e.g., cargo bikes, scooters)?
"Unlocking the Secrets of Lishui Controller Programming: A Journey of Discovery"
As I embarked on the adventure of mastering Lishui controller programming, I couldn't help but feel a mix of excitement and trepidation. The world of industrial automation can be daunting, but with the right guidance, I was determined to unlock the full potential of these powerful controllers.
The Initial Hurdle
At first, the Lishui controller's programming interface seemed like a foreign language. The manuals and online resources were dense with technical jargon, making it challenging to decipher the correct syntax and commands. However, as I began to experiment and play with the code, the fog started to lift.
The Eureka Moment
The turning point came when I stumbled upon a cleverly crafted example project. This ingenious code snippet not only demonstrated the controller's capabilities but also provided a glimpse into the developer's thought process. It was like finding the Rosetta Stone – suddenly, the complexities of Lishui controller programming began to make sense.
The Learning Curve
As I continued to explore and program the Lishui controller, I encountered various obstacles, from troubleshooting errors to optimizing code efficiency. But with each hurdle, I gained valuable insights and developed strategies to overcome them. The process was both frustrating and exhilarating, like navigating a thrilling obstacle course.
The Payoff
The moment of triumph arrived when I successfully implemented a sophisticated control algorithm, harmoniously integrating multiple sensors and actuators. Witnessing the Lishui controller seamlessly execute the program, effortlessly managing the industrial process, was a truly satisfying experience.
The Verdict
Lishui controller programming is an engaging and rewarding pursuit, offering a chance to master the intricacies of industrial automation. While the initial learning curve may be steep, the sense of accomplishment and the possibilities for innovation make it well worth the effort. If you're willing to invest the time and perseverance, the Lishui controller will reveal its secrets, empowering you to create sophisticated solutions that transform industries.
Rating: 4.5/5
Recommendation: For those new to Lishui controller programming, I suggest starting with the example projects and online tutorials. Joining online forums and communities can also provide valuable support and insights from experienced developers.
By sharing my journey, I hope to inspire others to embark on this fascinating adventure and uncover the hidden potential of Lishui controller programming. Happy coding!
Lishui controllers are widely used in ebikes and can be programmed through two primary methods: standard parameter adjustment via the display and deeper firmware flashing using dedicated hardware. 1. Standard Parameter Adjustments (Display)
Most Lishui-based ebikes (like those using SW900 or KT-LCD displays) allow you to modify basic performance settings through a built-in menu. Common parameters include:
P01–P03: Screen brightness, units (km/h vs. mph), and battery voltage (24V, 36V, 48V, etc.).
P06–P08: Wheel diameter, motor magnet count, and the maximum speed limit. P13: Controller amperage setting to adjust power output. 2. Firmware Programming (Advanced)
For deeper customization (e.g., Field Oriented Control (FOC) tuning or current limits), you must flash the controller directly using a computer.
Official Tools: Lishui provides a "LSH Programmer" tool and specific .lsh encrypted firmware files. To use these, you typically need a Lishui-specific USB programming stick (FPS2) or a compatible USB-to-UART adapter connected to the display cable's RX/TX pins.
Open Source Alternatives: Projects like EBiCS_Firmware and the Flexible OpenSource Firmware allow you to bypass factory restrictions. These often require an ST-Link V2 programmer to connect directly to the controller’s internal STM32 pins.
Custom Settings: By unchecking "Keep Current Settings" in official Lishui tools, you can sometimes manually set new maximum current and low-voltage cutoff values. 3. Necessary Hardware Connection Point Display Buttons Handlebar Display Basic speed and PAS level limits. USB-to-UART Adapter Display Connector Parameter adjustment and .lsh firmware updates. ST-Link V2 Internal PCB Pins Complete open-source firmware replacement.
Safety Warning: Always use a fuse in your power supply when flashing firmware to prevent permanent damage to the controller or battery if a short circuit occurs.
Programming a Lishui e-bike controller allows you to unlock higher speeds, adjust current limits, and customize the riding feel through field-oriented control (FOC) or torque simulation
. While stock programming is often restricted by manufacturers, there are three primary ways to modify these controllers depending on your technical comfort level. 1. Official Manufacturer Tools (Basic Configuration) If you have a
firmware file provided by a tech team or found online, you can use official software to update parameters like max current and undervoltage limits. : Download the LSH_File_Update_Tools LS_Controller_Update.exe from the official Lishui Controller Download Page
: You typically need a Lishui-specific USB programmer (like the The "Secret" Menu
: In some versions of the programmer, clicking "Clear Info" multiple times reveals a "File Conversion" tab used to convert hex files to
: Connect the programmer to the controller's display connector (RX to TX, TX to RX). You may need to power the controller via the e-bike battery during the process if the USB port doesn't provide enough current. 2. Open Source Firmware (Advanced Customization) For users wanting total control, the EBiCS (E-Bike Controller System)
project provides a free FOC firmware for Lishui controllers that use the STM32F103 processor. Key Features
: Supports sinewave driving, throttle, torque-simulation, and torque sensors. Flashing Method : Requires an ST-Link V2
programmer. For newer controllers, you may need to open the housing and solder wires to the GND, +3.3V, SWDIO, and SWCLK pins. Source Code : Available on the EBiCS GitHub Repository 3. Display-Based Adjustments (Quick Settings)
If you aren't ready to flash new firmware, many Lishui controllers support "P-settings" through the LCD display (like the : Speed Limit (0–100 km/h).
: Current Limit (set to match your controller's amp rating).
: Some manufacturers lock these settings at the factory, in which case flashing (Option 1 or 2) is the only way to override them. Warning: Safety First lishui controller programming
Lishui controllers (LS), manufactured by the Nanjing Lishui Electronics Research Institute, are widely used in e-bikes for their smooth Field-Oriented Control (FOC) performance. Programming these units allows riders to fine-tune torque delivery, adjust current limits, and even install custom open-source firmware. Essential Programming Tools
To interface with a Lishui controller, you need specific hardware to bridge the gap between your computer and the controller’s display or programming port:
USB-to-Serial Adapter: A standard FT232RL-based adapter is the industry standard for stable communication.
Programming Cable: Depending on your controller model, you may need a Julet 5-pin or 4-pin waterproof connector cable that breaks out into RX, TX, GND, and VCC.
ST-Link V2 (Optional): Required for flashing deep firmware or unbricking controllers that do not have a bootloader accessible via the display port. The Official Programming Process
Official programming is typically done using the Lishui LSH_File_Update_Tools. This utility allows you to upload .lsh firmware files provided by manufacturers or tech teams.
Driver Setup: Install the appropriate USB serial drivers. If the software shows a COM port number, the connection is successful.
Connection: Connect the adapter to the controller's display port. Most modern controllers can be "self-powered" by the USB port, but older versions require the e-bike battery to be connected and switched on during the process.
Loading Firmware: Use the "Local File" button to load your .lsh file.
Adjusting Basic Settings: By unchecking the "Keep Current Settings" box, users can often manually adjust the maximum current and undervoltage cutoff limits before flashing.
Flashing: Press Program (F5) and wait for the "Write successful" confirmation. Third-Party & Open-Source Options
For advanced users, the official software can be restrictive. Several community-driven alternatives exist:
EggRider V2 Display: A popular aftermarket display that allows you to configure Lishui settings directly from a smartphone app via Bluetooth.
EBiCS Open Source Firmware: A community project on GitHub that provides free FOC firmware for Lishui controllers, offering features like regenerative braking and customized torque sensing.
XPD (Extended Parameter Designer): Older software used for some sine wave controllers to adjust ramp times and PAS (Pedal Assist) sensitivity. I have a Lishui Controller .lsh firmware file lets mod it
Programming a Lishui e-bike controller involves using proprietary or open-source software to modify motor performance, battery management, and rider assistance settings. The process typically requires a specialized USB programming device Bluetooth adapter to interface with the controller’s hardware. www.pedelecs.co.uk Core Programming Methods LSH File Downloader : The official tool from Lishui Electronics used to flash firmware files (with the extension). It includes a "secret" menu for File Conversion
(converting hex to .LSH) by clicking the "Clear Info" button multiple times. Bluetooth App Programming
: Some newer controllers or those equipped with a Bluetooth adapter can be configured via a smartphone app (iOS/Android), allowing users to adjust settings through a simplified interface. Open-Source Firmware (EBiCS) : For advanced users, projects like EBiCS_Firmware on GitHub
provide free Field Oriented Control (FOC) firmware that enables extensive customization, such as adding regenerative braking or torque sensor support. Key Programmable Features
Programming allows you to fine-tune the following parameters: Motor Performance
Current limits, speed limits, torque simulation, and startup acceleration. Battery Management
Voltage cutoff bases (e.g., 31.5V for 36V batteries) and under-voltage protection. Pedal Assist (PAS)
PAS type (left/right mounting), number of magnets, and assist pulse delay. Riding Strategy
Selection between "Normal" or "Current Simulation" modes to change how power is delivered. Hardware Requirements Program Downloader
Lishui controllers are typically "OEM-locked," meaning they are programmed at the factory for specific bike models and aren't as easily customizable as KT (Kunteng) controllers. However, you can modify them using specialized hardware, manufacturer tools, or community-developed open-source firmware. 🛠️ Programming Methods 1. Official Lishui Programming Tool
This is the standard "manufacturer" way to update firmware or change basic limits.
Hardware Needed: You require a specific Lishui USB Stick FPS2 and matching adapter cables.
Software: The Lishui Controller LSH Programmer allows you to upload .lsh firmware files and adjust max current or undervoltage limits.
Limitation: These tools are difficult for individual consumers to find and are mostly sold to retailers or manufacturers. 2. Open Source Firmware (OSF)
The CloneYCRS project on GitHub is the most popular way to "unlock" these controllers.
What it does: Replaces the factory software with Field Oriented Control (FOC) firmware that is fully customizable. Open your controller case
Features: Includes a user-friendly GUI to adjust throttle response, torque simulation, and sensor settings.
Hardware: You typically need an ST-Link V2 programmer to flash the firmware directly to the controller's internal chip. 3. Display-Based "Hidden" Menus
For minor adjustments like speed limits or wheel size, you can sometimes use the LCD display.
Access: On many models, holding the Up and Down arrows simultaneously enters the settings mode.
Parameters: Settings are often unlabelled (e.g., #1 to #20). For example, setting #18 often adjusts the speed reading/limit between 50% and 150%. ⚠️ Key Challenges
Potting Material: Many Lishui controllers are filled with a thick "glue" or wax-like potting to protect against water, which can make accessing the internal pins for a programmer nearly impossible.
Hardware Variants: Different models use different processors (like the STM32 series). You must verify your specific chip before trying to flash custom firmware to avoid "bricking" the unit.
Baud Rate: If using a PC tool, the default baud rate is typically 38400. If you'd like to proceed, let me know: Your controller model number (e.g., LSW1207)
What specific change you want to make (e.g., increase speed, change PAS levels)
If you are comfortable with soldering or using an ST-Link device
I can then provide a more specific step-by-step guide for your setup.
Deuin/CloneYCRS: Free FOC firmware for Lishui E-Bike-Controllers
Lishui Controller Programming: A Comprehensive Guide
Lishui controllers are a popular choice among CNC machinists and manufacturers due to their high-performance capabilities, reliability, and ease of use. Programming a Lishui controller can seem daunting, especially for those new to CNC machining. However, with a thorough understanding of the controller's features and capabilities, you can unlock its full potential and optimize your machining processes. In this article, we will provide a comprehensive guide on Lishui controller programming, covering the basics, advanced techniques, and best practices.
Understanding Lishui Controllers
Before diving into programming, it's essential to understand the Lishui controller's architecture and features. Lishui controllers are designed to work with CNC machines, providing precise control over the machine's movements, spindle speed, and other functions. The controller consists of a main board, a control panel, and various I/O modules.
The Lishui controller's main board contains the CPU, memory, and various interfaces for connecting peripherals. The control panel provides a user-friendly interface for operators to input commands, monitor machine status, and adjust settings. I/O modules enable the controller to interact with external devices, such as sensors, motors, and other machines.
Basic Programming Concepts
Lishui controller programming involves creating a set of instructions that the controller can execute to perform specific tasks. The programming language used is typically a variation of G-code, which is a standard language for CNC machines.
Here are some basic programming concepts to get you started:
Programming Techniques
Here are some programming techniques to help you get the most out of your Lishui controller:
Advanced Programming Topics
Here are some advanced programming topics to help you take your Lishui controller programming to the next level:
Best Practices
Here are some best practices to keep in mind when programming a Lishui controller:
Common Challenges and Solutions
Here are some common challenges and solutions to help you overcome common issues:
Conclusion
Lishui controller programming is a complex and nuanced topic that requires a thorough understanding of CNC machining, G-code, and M-code. By mastering the basics, advanced techniques, and best practices outlined in this article, you can unlock the full potential of your Lishui controller and optimize your machining processes. Whether you're a seasoned machinist or just starting out, with practice and patience, you can become proficient in Lishui controller programming and take your machining operations to the next level.
Lishui controllers are among the most popular and widely used electric bicycle controllers in the DIY and aftermarket community. Known for their reliability and the accessibility of their programmable versions, they offer a deep level of customization for ebike enthusiasts. Some models use a 6-pin JST connector
Below is a comprehensive guide to Lishui controller programming, covering hardware identification, software tools, parameter configuration, and advanced tuning.