E-Bike Conversion – Software

e-bike_conversion(pic21)

It’s been a while since I wrote the posts about my electric bicycle conversion project. The bicycle runs fine so far and I finally finished rewriting the software that configures its controller.

I will not make a long post for this so you won’t get bored. Basically I took the original software which also included all required source files and made it look better, fixed many bugs, improved its operation and added a small help file. Now you don’t need administrative rights under windows 8 and 10 to be able to see the available COM ports. The interface looks more tidy and well aligned and also uses better English. Numerous bugs were fixed, regarding error messages and error checking, communication, parameter limits and so on. I found this program as an open source (including all source files) I am providing it the same way.

Be advised! Doing any changes to your controller might lead to damage. I won’t be held responsible for any kind of damage you might induce to your controller, motor, gears, bicycle or yourself. Do what you like at your own risk! Cycle safe and take care of others on the road!

You can download the program HERE. The file keeps getting reported for violation, so it might get blocked again. I just reuploaded it again. I have no idea who and why is doing this. It can’t be shared on WordPress directly, so I might have to look for new sharing service again.

Latest version uploaded on 16.05.2017 with a few updates. Assist level labels now say Assist, not Assit 😀 The current limit is not active when bike is not connected. This allows you to work with your saved profiles even if you haven’t connected your bike.

Compatibility with BBS##B drives has been confirmed by many users now. Luckily for all, Bafang hasn’t changed the communication protocol.

297 thoughts on “E-Bike Conversion – Software

  1. Hi, I get an error messaeg “file handle is not a comm handle” when I try to connect. Have you any thoughts on this? Thank you and regards. James

    1. I haven’t seen this error. There seems to be something wrong with the COM port.

    2. Thank you. There was indeed something wrong with the COM port..user error! Thank you for your software. Configured my BBS01-b today and she’s running like a dream. Amps to 18, Speed Limit in basic to 100%, Keep Current to 80%. Perfect:)

  2. Hi Stafan,
    Thanks for sharing your work on the Bafang programming interface. I have enjoyed using it and fine tuning my bbshd.
    I have an issue with my twist throttle. There is more initial dead band than I would like. I can not set the min throttle voltage below 11. Is that limit in your interface, or in the firmware? I would like to try lower to reduce the initial dead band, but don’t know how. Thanks.

    1. This limit was in firmware and I believe it means 1.1V coming out of the magnetic sensor inside the throttle control.

  3. Thank you Stefan for your work and sharing with those who are frustrated with other sources. Biktrix Canada provided a version of the Bafang Config tool which gave me nothing but grief. Yours worked first time. The only complaint I still have is with my Bafang DPC18 display only being able to accommodate PAS levels of 1-5 and not a full 1-9.

    1. You are welcome. I had that display for a while, but I only used it with 5 levels. 9 seems too much. Most common models use only 3 levels and even this is enough most of the time.

    1. If you see the COM port in software, then the issue is on the cable. It’s possible RX and TX wires are swapped. It’s not the first time I have heard of this.

  4. I was afraid I had ruined something unknown in my DIY ebike. I’m unsure what fixed it, but I adjusted the tire size, turned off the throttle in your software and it woke up! Thank you for whatever happened!

  5. Hello,
    any chance of getting it to run on Linux (on playonlinux, the wine for newbies)?
    USB cable not even recognized. Just com-ports shown

    1. I have never tried it on Linux, so I don’t know if it will work. I don’t use Linux, so I can’t help. I have been asked before and I am pretty sure someone did build it for Linux as well.

    2. I was able to install Delphi 10.3 and compile and run BafangConfigTool.exe on a Windows 7 Virtual Machine running on Oracle Virtual Box on a Debian 10 host. But have not tried Wine.

  6. I’m working with a Eunorau 48V25A Sinewave controller and software version 16.05.2017. everything works fine except that it will not accept “the minimum battery voltage setting”. the manufacturer recommends 41.5 V, I have selected all the V levels in the dropped down window, but I can’t write to the controller. I get the message “minimum battery voltage out of range, reset voltage”. Has this problem been encounter before?

    1. I think this is returned by the controller. Depending on how many cells in series the controller was designed for, there is minimum voltage set in firmware, so you can’t go lower than that even if your battery can handle it.

    2. You wrote: I think this is returned by the controller. Depending on how many cells in series the controller was designed for, there is minimum voltage set in firmware, so you can’t go lower than that even if your battery can handle it.
      Rey: I’m not interested in changing this voltage. I just want to know what it is so there will not be rejection by the controller or anything else. It would not allow me to write any other changes to any other variable.
      Thanks

    3. If you read what is already set in the controller before changing anything and leave that voltage the same, then you should be able to write your settings. When you connect to the controller the nominal voltage is returned. You can see it on the right of the software. Based on that limits for low battery voltage are defined. You can try to enter numbers in the field and find the limits. You can also find them in the source code included with the software.

  7. Hi Mr. Penoff, first of all I want to thank you for everything you do and all the advice you help others. I have a question: I have a bafang 750w mid, and it confuses me that the program shows me that my controller has a max current: 24A. Everywhere I’ve looked with the same configurations shows 25A Is this normal or … ? Thank you in advance!

    1. That is strange, but the limit comes from firmware. The software reads the limit and then sets the maximum allowed value for current limit field that you can choose.

    2. Thank you, so does this mean; do i need to change the firmware, can i set the controller value to max. current 18A?

    3. No problem to set to a lower current limit. For a higher one you will need modified firmware and I haven’t heard about such thing yet. Even the original one is not easy to find.

    1. If it is not in the list it is also not in firmware, so you just can’t. Pick the closest value as an alternative.

    2. If It isn’t in the firmware, Who makes the firmware? The manufacturer of the motor? I think that measure is very common.

  8. Hi there,

    I appreciate the work to support the ebike community (or any open-source software creation). I’m trying to download to program my new bbshd but the link says ‘The hosting period has now expired, only paid users can download it’. Does anyone have a link to a mirror or can drop it on a free file hosting site for access? Thanks again.

    1. I will check and try to fix it. Not sure where to put it anymore. Either the time is limited or it is paid or it doesn’t allow executable files.

    2. Fixed. Apparently the file had an expiration date. Don’t worry! My intention was never to ask for money, so if the sharing service asks for money, don’t pay and let me know.

    3. Thanks! I’d much rather pay you for your work then the sharing site.

    4. I never did place a PayPal button on my website, but I might do it at some point. Hosting costs money and I make zero profit from the website and spend time answering questions.

  9. @Stan Purdum
    To be more precise you need to find the right driver for the usb-serial converter chip on your Interface. Name ist printed on the little bug. Often you find the drivers not only on the manufacturers homepage…

  10. Can you tell me where to get the drivers for the USB programming cable to work in a com port on my laptop? I’ve not been able to find them.
    Stan

    1. Driver depends on the converter you bought. Check with the supplier.

    2. I am sorry, but I have no idea what cable you have. Contact the seller!

    1. I have just downloaded it using the link from the post and it worked fine for me, so I cannot tell what the problem is on your side. It might be some short issue with the file hosting service I have used. Try again! It might work for you too now.

  11. Were do I buy a USB cable that works with the BAFANG Motor and Controller..?

    1. There are many online and actual stores where you can buy a USB to Serial converter that will work fine. The only thing you need if it is not made specifficaly for this purpose is a connector to solder to it. Otherwise it should just work. Personally, I use FTDI converters (genuine, not cheap knock-offs) and never had an issue. I am sure you can find something that works on sites like AliExpress, eBay, Amazon… I can point you to one that I can guarantee working though.

  12. Hi Stefan,
    many thanks for your highly valuable configuration tool with the enlightening infos. I’ve used it with my BBS01b, and it even works with my new M400 (obviously without torque settings). Since the original display for my M400 died, i’ve connected the 500C from my other bike, and programmed the controller for 5 levels. While your info for the actually used levels fit for the BBS01 (0,1,3,5,7,9), it doesn’t on the M400, where 0,2,4,6,8,9 are used. That brings me to the conclusion, that the used levels are set by the controller, not by the display. The 36V controller is named SW06 V3.0.
    Best regards
    Jan

  13. Hi Stephan, I just went to download the software and there is the following message displayed:
    File created: 10/3/2020, 10:35:05 AM | File Size: 1.6 MB
    This file has been reported as a violation and is under review, download with caution.

    Did you upload a new version on October 3, 2020? If not, maybe someone has substituted the file for something else…

    1. I switched from dropbox to another sharing service some time ago, but haven’t updated the file since then. I will check it tonight. Thanks for letting me know! I hope someone didn’t hack the server and added virus to the zip file.

    2. There is nothing wrong with the file. It seems someone reported it to the sharing website for some unknown reason, but the site didn’t bother to cantact me, so I don’t know what was the reason. This means the file might disappear if they decide so and I am pretty sure they won’t even notify me of that.

    1. It is Delphi 7. Delphi is using Pascal. It can be built with new version of Delphi also.

  14. I found the answer to my question about how the 9 levels of assist in the app apply to a display with 5 levels, DP-C18.
    Assist levels 1, 3, 5, 7 and 9 apply to levels 1 – 5 on the display. Levels 2, 4, 6 and 8 are ignored.

    1. Also level zero works on this display, so 6 usable power levels.

Your comment:

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.