owhite
100 W
- Joined
- Aug 3, 2020
- Messages
- 290
-------------------------------------------------------------------------
This post has been locked by request of the owner. -Moderation
-------------------------------------------------------------------------
CAUTION -- I DO NOT RECOMMEND USE OF THIS CONTROLLER.
What follows is a discussion of attempting to use an open source board that has not worked for a number of people. I've spoken to the mods who request we leave the thread here for instructional purposes but again, dont use this board.
-owhite
INTRODUCTION
This write up is an overview of building an open source electronic speed controller (ESC) that was originally posted here: BESC - beefed up VESC motor controller for high power ebikes
The designer of big(?) ESC (BESC) goes by user name galp. Galp is incredibly prolific based on his posts at his blog:
e.pavlin.si
and he made at least two versions of the BESC:
and has some comments on that page about making a third version.
the specs for the BESC-G2 are:
and he provided a write up of the G2 here:
The BESC is a variant of the Vedder ESC which originally was an open source ESC project which has been partially commercialized. Galp publicized development of the G2 over here on the VESC project site:
vesc-project.com
VESCs can be found in abundance on amazon, search under that name. The cool thing about VESCs is comes with a very nice interface
vesc-project.com
and if you have a functional VESC, there are some nice instructional videos on using the VESC-tool.
So, the following is a description of my experience of getting a BESC-G2 into my hands for testing. This is not a step by step tutorial, and the skill levels required are you at a minimum have to know about electronics, using Kicad printed circuit board (PCBs) software, ordering PCBs, and PCB assembly.
100v, 400A. I'm gonna assume you know what youre doing.
Galp stores his PCB files here:
github.com
PRINTED CIRCUIT BOARD ASSEMBLY BY EMAIL
I downloaded his files, loaded them into kicad, and checked all the parts to make sure that I could create a list from mouser.com, the electronics supplier. Kicad has a bunch of menu functions that help you with reviewing the parts list. My favorite is Tools-->edit symbol fields in Eeschema. Start with this list and painstakingly make sure that all of the parts are still available. Note this part: USBLC6-2SC6 was wrong. The correct one was USBLC6-2P6. Another problem which was his original 8MHz crystal was not obtainable, but I was able to use: ECS-80-18-30B-AGN-TR which fit on the footprint of his design exactly. If you want to try making your own board be prepared for the fact that parts always go out of date, and you either have to find a part that fits in the same footprint as before,
NOTE: as mentioned by Galp's build post (BESC-G2 – BESC) be sure to remove U7 and bridge the lines between pins.
At any rate, the size of some of the parts on the G2 are less than 1mm, and you may be more brave than I but assembly involve simply way too many parts. Instead I used a Printed Circuit Board Assembly (PCBA) service. Kicad makes lists of all the parts, and it creates a "centroid" file, which tells the factory how place all the parts in their correct location. Check out the export menu in pcbnew. Again this is not a tutorial so I wont go through all the steps but I loaded the comma separated values into excel to massage all the lists into the correct format. I then ordered the PCBA at PCBway.com. Approximate cost was $190 for PCB and the parts to make the complete board. (Note: this only reflects the cost of SMD parts, not the through-hole parts like the MOSFETs). I ordered 4 boards total, and it took about 4 weeks.
The boards arrived and look beautiful. Have a look at PCBway's videos on PCBA, they are kind of mind-blowing in terms of how complicated it is to put these boards together. The final product is amazing and I simply dont understand how they can make money from the process. Anyway. The first thing to test was power supply on the board. This involved soldering in the DC-to-DC converter (P/N R-78E5.0-0.5) as well as some of the 0.1 inch headers and applying a bench power supply to the power rails of the board. The 12 volt, 5 volt, and 3.2 volt systems on the board checked out. Then it came time to flash the firmware on the board. If you havent done this before search on "STM32 st-link programming" and you'll find about 2,000 tutorials. This part is nerve-wracking because at this point it is very hard to tell if you board is actually going to live.
FLASHING THE BESC FOR THE FIRST TIME
I also found a tutorial on simply making the LEDs flash with this STM32 MCU:
wiki.st.com
and I got that to work which was a big relief. That meant the components supporting the STM32F405RGT were working. Look I know I didnt design or assemble the thing but seeing it work for the first time was exhilarating just the same.
Ideally, it would be good to compile the firmware from scratch. There are some instructions as galp's code repository GitHub - galpavlin/BESC-G2: BESC second generation, BUT that did not end up working for me. The code that I flashed just didnt run. Galp left a copy of his firmware as a binary, and flashing that required installation of the st-flash utility on my mac to run. I connected the st-link2 hardware device to the G2, and used this on the command line:
to load galp's binary. When I plugged in the USB connector, this resulted in these two ports appearing in my /dev directory:
/dev/cu.usbmodem3041
/dev/tty.usbmodem3041
That was also landmark because it shows the board is now connecting with the computer.
Next installment will be a discussion of using the VESC-tool for programming, as well as the wiring etc needed to connect the board to the motor.
This post has been locked by request of the owner. -Moderation
-------------------------------------------------------------------------
CAUTION -- I DO NOT RECOMMEND USE OF THIS CONTROLLER.
What follows is a discussion of attempting to use an open source board that has not worked for a number of people. I've spoken to the mods who request we leave the thread here for instructional purposes but again, dont use this board.
-owhite

INTRODUCTION
This write up is an overview of building an open source electronic speed controller (ESC) that was originally posted here: BESC - beefed up VESC motor controller for high power ebikes
The designer of big(?) ESC (BESC) goes by user name galp. Galp is incredibly prolific based on his posts at his blog:
Mare & Gal Electronics
and he made at least two versions of the BESC:
and has some comments on that page about making a third version.
the specs for the BESC-G2 are:
- 24S lipo/100V max supply voltage
- 400A max phase current
- 24x IRF135B203 135V MOSFETs
and he provided a write up of the G2 here:
The BESC is a variant of the Vedder ESC which originally was an open source ESC project which has been partially commercialized. Galp publicized development of the G2 over here on the VESC project site:
BESC G2 100V 400A | VESC Project
VESCs can be found in abundance on amazon, search under that name. The cool thing about VESCs is comes with a very nice interface
VESC Project
and if you have a functional VESC, there are some nice instructional videos on using the VESC-tool.
So, the following is a description of my experience of getting a BESC-G2 into my hands for testing. This is not a step by step tutorial, and the skill levels required are you at a minimum have to know about electronics, using Kicad printed circuit board (PCBs) software, ordering PCBs, and PCB assembly.
100v, 400A. I'm gonna assume you know what youre doing.
Galp stores his PCB files here:
GitHub - galpavlin/BESC-G2: BESC second generation
BESC second generation. Contribute to galpavlin/BESC-G2 development by creating an account on GitHub.
PRINTED CIRCUIT BOARD ASSEMBLY BY EMAIL
I downloaded his files, loaded them into kicad, and checked all the parts to make sure that I could create a list from mouser.com, the electronics supplier. Kicad has a bunch of menu functions that help you with reviewing the parts list. My favorite is Tools-->edit symbol fields in Eeschema. Start with this list and painstakingly make sure that all of the parts are still available. Note this part: USBLC6-2SC6 was wrong. The correct one was USBLC6-2P6. Another problem which was his original 8MHz crystal was not obtainable, but I was able to use: ECS-80-18-30B-AGN-TR which fit on the footprint of his design exactly. If you want to try making your own board be prepared for the fact that parts always go out of date, and you either have to find a part that fits in the same footprint as before,
NOTE: as mentioned by Galp's build post (BESC-G2 – BESC) be sure to remove U7 and bridge the lines between pins.
At any rate, the size of some of the parts on the G2 are less than 1mm, and you may be more brave than I but assembly involve simply way too many parts. Instead I used a Printed Circuit Board Assembly (PCBA) service. Kicad makes lists of all the parts, and it creates a "centroid" file, which tells the factory how place all the parts in their correct location. Check out the export menu in pcbnew. Again this is not a tutorial so I wont go through all the steps but I loaded the comma separated values into excel to massage all the lists into the correct format. I then ordered the PCBA at PCBway.com. Approximate cost was $190 for PCB and the parts to make the complete board. (Note: this only reflects the cost of SMD parts, not the through-hole parts like the MOSFETs). I ordered 4 boards total, and it took about 4 weeks.
The boards arrived and look beautiful. Have a look at PCBway's videos on PCBA, they are kind of mind-blowing in terms of how complicated it is to put these boards together. The final product is amazing and I simply dont understand how they can make money from the process. Anyway. The first thing to test was power supply on the board. This involved soldering in the DC-to-DC converter (P/N R-78E5.0-0.5) as well as some of the 0.1 inch headers and applying a bench power supply to the power rails of the board. The 12 volt, 5 volt, and 3.2 volt systems on the board checked out. Then it came time to flash the firmware on the board. If you havent done this before search on "STM32 st-link programming" and you'll find about 2,000 tutorials. This part is nerve-wracking because at this point it is very hard to tell if you board is actually going to live.
FLASHING THE BESC FOR THE FIRST TIME
I also found a tutorial on simply making the LEDs flash with this STM32 MCU:
STM32StepByStep:Step2 Blink LED - stm32mcu

and I got that to work which was a big relief. That meant the components supporting the STM32F405RGT were working. Look I know I didnt design or assemble the thing but seeing it work for the first time was exhilarating just the same.
Ideally, it would be good to compile the firmware from scratch. There are some instructions as galp's code repository GitHub - galpavlin/BESC-G2: BESC second generation, BUT that did not end up working for me. The code that I flashed just didnt run. Galp left a copy of his firmware as a binary, and flashing that required installation of the st-flash utility on my mac to run. I connected the st-link2 hardware device to the G2, and used this on the command line:
Code:
$ st-flash write ../Downloads/besc-g2.bin 0x8000000
/dev/cu.usbmodem3041
/dev/tty.usbmodem3041
That was also landmark because it shows the board is now connecting with the computer.
Next installment will be a discussion of using the VESC-tool for programming, as well as the wiring etc needed to connect the board to the motor.
Last edited by a moderator: