VESC - Flipsky 75100 V2 with Bafang Display and T15/T17 BB-Torque Sensor

Hi, How would I program this to work with my MakerX G300, where I could switch power modes using the display? Would there be a setting in the VESC tool where I can change how much power is on those mode levels? Would I need to connect it to my battery or could I use the 5v off my controller to power the display? Would it work with mid-drive motors that run 8kw and 430 phase amps?
 
How would I program this to work with my MakerX G300
You would have to port the LunaCycle files to MakerX hwconfig, like I've done it for the Flipsky.
You can look at the commit history of my fork, how to do it.
I already asked the VESC community at Discord, to get help for making the Bafang display support available for all hardware, but there was no resonance :(

Lunacycle has set the levels linear, but of course, you can define individual values for each level. But this can't be done by the VESC tool, as it is hardcoded.

The power you can get is not depending on the display or the torquesensor, but on the controller hardware.

The display needs full battery voltage to work

regards
stancecoke
 
Last edited:
First of all I wanted to thank Stancecoke for all the work and help you give for all of us. I tried to make your latest project with Vesc 75100 and used Erider T17, and SW102 from aliexpress. I uploaded hex to vesc 75100 (it has software 6.05, and I used vesc tool also version 6.05), everything was successful, I connected it to my SW102, unfortunately I have error 30, I know it's a communication error and I checked everything (connections, diagram, I swapped tx with rx because I thought maybe there was a mistake there) I wonder where the problem is, whether this project works only on SW102 from lunacycle, or do I need to flash SW102 and upload another hex file because it is on the original bafanga firmware.
 
Have you managed to get it working?
Unfortunately, it has not been possible to start it yet, I wonder if it's a problem with the controller because I have a Flipsky vesc 75100, or maybe it should be makerbase75100, according to the diagram, everything is OK, I also set the vesc tool as it should be, but I have error30 ( apart from sw102 I tried on dz40 there is the same error) I swapped tx and rx It didn't help either, I checked the cables with a multimeter to see if there was a connection and there was. I don't know where I'm making a mistake, but I'll keep looking.
 
I don't know where I'm making a mistake, but I'll keep looking.
If you have a USB-UART converter, please listen to the tx data stream of the display (1200 BAUD) with your laptop first.
If the messages are valid, we can do further steps.

The tx stream (in hex representation) should look like this:
Code:
11 0A
11 11
16 1A F0 20
11 08
16 0B 00 21
11 0A
11 11
16 1A F0
11 20
11 08
16 1F 03 1B 53
11 0A

where the 0x11 is a request to the controller and the 0x16 is an information to the controller.
11 11 --> get battery soc
11 0A --> get amps
11 20 --> get speed
.....

16 1A F0 --> light off (not implemented in Luna code)
16 0B 00 21 --> PAS level 0
16 1F 03 1B 53 --> wheel diameter (not implemented in Luna code)
....

https://github.com/stancecoke/VESC_...bfde/hwconf/flipsky/luna_display_serial.c#L38

The library in the "Forumscontroller" project has more parameters implemented than the Luna Cycle, but in decimal representation:
https://github.com/jenkie/Arduino-P...r/Arduino_Pedelec_Controller/display_bafang.h


regards
stancecoke
 
Last edited:
I can provide the .bin file also, if that helps. It is generated anyway during compiling.
But I had no problem with flashing the .hex file with the 6.06 BETA VESC tool.

regards
stancecoke
Hello stanecoke. Will your firmware work with Innotrace X1 controller for Bafang m620 UART? Innotrace is based on VESC.

My Innotrace X1 controller STM32 chip is dead and I need firmware for that chip but unfortunately Innotrace is out of business and the controller developer does not respond.

I detached the chip and ordered a couple new chips to replace the bad one.

1738978471313.png

1738978536105.png

The Innotrace X1 controller uses 6 pins UART toque sensor+pedal assist sensor from the Bafang M620 motor.


Unfortunately I did not save the .bin file from the chip before it died and now I need .bin file for this chip for this controller.

The board has 6 pads Tag-Connect interface for ST-Link programming dongle to flash .bin file on the STM32 chip. I ordered a couple new STM32 chips to replace the bad one but I need the firmware will work with this controller

1738978879592.png
 
Last edited:
Thank you for the link! I did not see it and I did non have even Discord account. I will take a look and maybe even can contribute. Just need to figure out how this Discord thing works and what it is for.

I had quite a few troubles with my Innotrace X1 controller and I posted about those here (the motor shaft destroyed the rotary encoder)


I repaired it but the problem went back a few months later. I repaired it again and installed it in the new Bafang m620 UART motor. I worked OK for one ride and next day I turned it ON the and display showed error 30 (no communication with controller)

I opened the motor case and found the FET driver was damaged. I also found some grease splashed from the new motor on the board so maybe this is what caused the damage.

1739001343449.png

I replaced the FET driver but the motor display still indicated Error 30. I noticed the 3.3V voltage regulator (AP2202K-3.3TRG1) on the board got really hot. I checked the board and found a shortage between 3.3V rail and the ground. I detached the 3.3V regulator and some capacitors in the 3.3V circuit thinking those are bad but the shortage was still present and the capacitors I unsoldered were good.

1739001396238.png

Then I unsoldered the STM32 MCU chip and the shortage on the board is gone. I checked the STM32 chip and it turned out the STM32 chip 3.3V pins and ground are shortened.
 
Last edited:
The Flipsky 75100 is available at a very reasonable price and in a pedelec-compatible housing. However, the VESC is hardly suitable for e-bikes due to the lack of display and torque sensor support. This has challenged my tinkering instinct ;)
Luna Cycle has already implemented the Bafang protocol for its BBSHD controller, so I “only” had to port it to the Flipsky hardware.
For the torque sensor I put the PAS signal on the servo input and the torque signal on ADC2.
The VESC tool still works for setting up the motor, but the app setting must not be done with the VESC tool at the moment, as it does not (yet) know the new functions.
Currently it only runs on the test bench, the torque sensor signals are emulated by a blackpill board.
Next I have to install the controller in my tinker bike and do a real test ride :cool:
Commits · stancecoke/VESC_BLDC

Flipsky%20wiring.PNG

A little teaser on Youtube:

regards
stancecoke
You use 4 wires from the torque sensor while the sensor has 6 wires. Other two wires have no functions or it is not necessary to use those to make it works?

I found Bafang ULTRA (M620) UART motor torque/cadence sensor wiring but I am not sure if it correlates with the sensor you illustrated



1739171488879.png

1739171553976.png

I also found pins marking for Bafang m620 original controller for torque/cadence sensor

1739171696851.png

1739172652468.png

5V and GND is obviously 5 volts (orange wire) and ground (black wire). But how the rest correlates with your torque sensor wiring (ZL1 (PAS, white wire), ZL2 (PAS phase shifted, purple wire), W (Torque, brown wire), DS (Speed/Direction, green wire)) ?

I feel like ZL1 (PAS, white wire) of Bafang m620 UART is Speed Signal Output1 (yellow) on you diagram (as I understand this is PAS signal). ZL2 (PAS phase shifted, purple wire) of Bafang m620 UART is Speed Signal Output2 (green) on you diagram (as I understand this is duplicated PAS signal just for reliability and safety and it is not necessary to use this duplicated signal since you can rely only on one PAS signal). W (Torque, brown wire) of Bafang m620 UART is Torque Signal Output (white) on your diagram (as I understand this is analogue signal (like throttle potentiometer) around 1V at zero pressure on the pedals and a little more at maximum pressure on the pedals). DS (Speed/Direction, green wire) of Bafang m620 UART is No Connect (blue) on your diagram (as I understand this is direction of the pedals rotation signal, Bafang controller uses this signal to immediately cancel assist when you pedaling backwards, which is not necessary feature so you do not use it).
 
Last edited:
But how the rest correlates with your torque sensor wiring
The Bafang sensor uses more wires than the ERider sensor. I've analyzed both in detail.
Both, ERider and Bafang provide a quadrature PAS signal for direction detection of the pedal movement. I don't use the second PAS signal, as there is no torque if you pedal backwards. So the output power calculated from torque*cadence*factor stays zero with no torque anyway.
The sixth wire of the Bafang sensor carries a somehow processed signal, but I couldn't investigate, what is done there internally.

Furthermore, a direction/speed signal is output. At crank standstill 0V at backward pedaling 4V and at forward pedaling an analog signal, which is not proportional to the cadence according to the first rough measurement :confused:. Why there is this signal is a mystery to me, the information is already contained in the other signals....
regards
stancecoke
 
I have finished figuring out how Bafang m620 UART torque/PAS sensor is connected to STM32 MCU chip on Innotrace X1 VESC based controller. Does it make sense?

1740001760671.png


1740002078901.png

1740002094635.png

1740010343014.png
 
Last edited:
Does it make sense?
Hm, for a middrive it might make sense, as you need no cadence information, because the motor rpm is always in a constant ratio to the cadence. So the cadence is canceled out of the formula for calculating the motor power proportional to the riders effort. For a hub motor you would need the PAS-signals for getting the cadence to calculate the riders effort, as the ratio from cadence to motor rpm is not constant due to the gearshift.
 
Hello!
I am a newbie in VESC and I have several questions:
Will this firmware work for Single Ubox 100V 100A?
Will it work with the 750C Bluetooth screen, or are there other, more interesting options.
And is it possible to use the motor temperature sensor input as an external speed sensor input?
 
Hello!
I am a newbie in VESC and I have several questions:
Will this firmware work for Single Ubox 100V 100A?
Will it work with the 750C Bluetooth screen, or are there other, more interesting options.
And is it possible to use the motor temperature sensor input as an external speed sensor input?
No and if it does you'll get weird readings because spintend used different hardware. Also you'll probably want phase filtering. You should recompile the firmware with the correct HW settings from here; I get mine next week and will be able to tell you more by than.
 
The Flipsky 75100 is available at a very reasonable price and in a pedelec-compatible housing. However, the VESC is hardly suitable for e-bikes due to the lack of display and torque sensor support. This has challenged my tinkering instinct ;)
Luna Cycle has already implemented the Bafang protocol for its BBSHD controller, so I “only” had to port it to the Flipsky hardware.
For the torque sensor I put the PAS signal on the servo input and the torque signal on ADC2.
The VESC tool still works for setting up the motor, but the app setting must not be done with the VESC tool at the moment, as it does not (yet) know the new functions.
Currently it only runs on the test bench, the torque sensor signals are emulated by a blackpill board.
Next I have to install the controller in my tinker bike and do a real test ride :cool:
Commits · stancecoke/VESC_BLDC

regards
stancecoke
Tried this today - compiles just fine (couple of warnings in the luna code) and seems to work although the t17 torque sensor behaviour could use some tweaking. Working on porting the KT display code from the ebics source to this one now since I miss my temperature reading on bafang displays.
Yet I'm wondering what's the best option in the long run. Vedder told on multiple occasions that he has no intention on adding support fo a never ending amount of peripheral, which kind of makes sense, so he implemented scripting though I will probably never understand why he chose lisp instead of a far more common language like python.
Anyway, what do you think Stancecoke ? Should we translate this into a script or do you plan on keeping your fork synced with the main vesc branch for the next 10 years ?
 
Last edited:
Should we translate this into a script
I'm not familiar with lisp scripting and I'm not planning to learn it ;)
I prefer Lishui controllers, they are of much better quality than this Flipsky stuff. I only had the tinkering ambition to get the torque sensor and the display on the VESC working. An implementation in the VESC tool to make the sensor and display selectable as an option for any dumb user, did not generate any response in the VESC community, I have already made several attempts on Discord.
Using lisp script will remain a solution for freaks.

If someone would develop the ESC firmware and the VESC Tool, to work generally on all hardware, then B. Vedder won't reject a pull request, I guess.
 
Last edited:
I'm not familiar with lisp scripting and I'm not planning to learn it ;)
I prefer Lishui controllers, they are of much better quality than this Flipsky stuff. I only had the tinkering ambition to get the torque sensor and the display on the VESC working. An implementation in the VESC tool to make the sensor and display selectable as an option for any dumb user, did not generate any response in the VESC community, I have already made several attempts on Discord.
Using lisp script will remain a solution for freaks.

If someone would develop the ESC firmware and the VESC Tool, to work generally on all hardware, then B. Vedder won't reject a pull request, I guess.
Seems a bit harsh. The embedded lisp terminal offers a very nice way to tinker around without rising to crash the whole thing, and without the hassle of a complete dev environment. I think it has a lot of potential, though as said, I don't follow the choice of lisp.

Any open source bldc driver project with some resonance will inevitably meet the "bloating" challenge, since there are just too many hardware configuration possibilities. Even your elegant ebics code, which is still my favourite btw, can become tricky to navigate, once it comes to configuring the correct options. With that in mind, the idea of a firmware concentrating on running the actual motor next to a *simple* script emulator that can run virtually any peripheral seems like a viable way to move forward.

A for a "generic" VESC firmware + software, feel free to do so; vesc stuff is published under gpl 3.0 license which means anyone can further develop it provided it stays under that license. I don't think it will be that easy because the whole VESC project is based on some very specific hardware.
 
feel free to do so
For the ESC firmware it would be quite easy, as the functions are implemented already, you only would have to move the source files to a common folder, not to the hardware definition. But the VESC Tool source code is just a mess for me. I won't waste my time, even trying to setup the IDE for it...
 
Last edited:
No and if it does you'll get weird readings because spintend used different hardware. Also you'll probably want phase filtering. You should recompile the firmware with the correct HW settings from here; I get mine next week and will be able to tell you more by than.
I tried to change the firmware for myself, but errors appeared during compilation. Apparently, I didn't understand something somewhere)
I think I'll try to use the servo output for the speed sensor, it's not used anyway.
I didn't even bother with connecting an external display, I'd like to figure out the sensor first.
 
hello; i dont have the torque-sensor; so i was wondering if it would be possible to use the pas sensor inside the bbshd instaed, so there is some form of paddle assist?

thanks in advance
 
Back
Top